merge with MySQL 5.5.27

manually checked every change, reverted incorrect or stupid changes.
This commit is contained in:
Sergei Golubchik 2012-08-09 17:22:00 +02:00
commit d11829654c
122 changed files with 2869 additions and 1727 deletions

View file

@ -1097,7 +1097,6 @@ CPackSourceConfig.cmake
Docs/INFO_BIN Docs/INFO_BIN
Docs/INFO_SRC Docs/INFO_SRC
tags tags
sql/.empty
Testing Testing
info_macros.cmake info_macros.cmake
VERSION.dep VERSION.dep

View file

@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5 MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=25 MYSQL_VERSION_PATCH=27
MYSQL_VERSION_EXTRA= MYSQL_VERSION_EXTRA=

View file

@ -1,5 +1,6 @@
/* /*
Copyright (c) 2000, 2011, Oracle and/or its affiliates. Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -843,6 +844,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
DBUG_ENTER("process_event"); DBUG_ENTER("process_event");
print_event_info->short_form= short_form; print_event_info->short_form= short_form;
Exit_status retval= OK_CONTINUE; Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
/* /*
Format events are not concerned by --offset and such, we always need to Format events are not concerned by --offset and such, we always need to
@ -922,6 +924,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print_skip_replication_statement(print_event_info, ev); print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
} }
if (head->error == -1)
goto err;
break; break;
} }
@ -954,8 +958,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{ {
print_skip_replication_statement(print_event_info, ev); print_skip_replication_statement(print_event_info, ev);
ce->print(result_file, print_event_info, TRUE); ce->print(result_file, print_event_info, TRUE);
if (head->error == -1)
goto err;
} }
// If this binlog is not 3.23 ; why this test?? // If this binlog is not 3.23 ; why this test??
if (glob_description_event->binlog_version >= 3) if (glob_description_event->binlog_version >= 3)
{ {
@ -977,6 +982,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
output of Append_block_log_event::print is only a comment. output of Append_block_log_event::print is only a comment.
*/ */
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
if ((retval= load_processor.process((Append_block_log_event*) ev)) != if ((retval= load_processor.process((Append_block_log_event*) ev)) !=
OK_CONTINUE) OK_CONTINUE)
goto end; goto end;
@ -985,6 +992,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case EXEC_LOAD_EVENT: case EXEC_LOAD_EVENT:
{ {
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
Execute_load_log_event *exv= (Execute_load_log_event*)ev; Execute_load_log_event *exv= (Execute_load_log_event*)ev;
Create_file_log_event *ce= load_processor.grab_event(exv->file_id); Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
/* /*
@ -1002,6 +1011,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
ce->print(result_file, print_event_info, TRUE); ce->print(result_file, print_event_info, TRUE);
my_free((void*)ce->fname); my_free((void*)ce->fname);
delete ce; delete ce;
if (head->error == -1)
goto err;
} }
else else
warning("Ignoring Execute_load_log_event as there is no " warning("Ignoring Execute_load_log_event as there is no "
@ -1014,6 +1025,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print_event_info->common_header_len= print_event_info->common_header_len=
glob_description_event->common_header_len; glob_description_event->common_header_len;
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
if (!remote_opt) if (!remote_opt)
{ {
ev->free_temp_buf(); // free memory allocated in dump_local_log_entries ev->free_temp_buf(); // free memory allocated in dump_local_log_entries
@ -1043,6 +1056,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
break; break;
case BEGIN_LOAD_QUERY_EVENT: case BEGIN_LOAD_QUERY_EVENT:
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) != if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) !=
OK_CONTINUE) OK_CONTINUE)
goto end; goto end;
@ -1060,6 +1075,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
convert_path_to_forward_slashes(fname); convert_path_to_forward_slashes(fname);
print_skip_replication_statement(print_event_info, ev); print_skip_replication_statement(print_event_info, ev);
exlq->print(result_file, print_event_info, fname); exlq->print(result_file, print_event_info, fname);
if (head->error == -1)
{
if (fname)
my_free(fname);
goto err;
}
} }
else else
warning("Ignoring Execute_load_query since there is no " warning("Ignoring Execute_load_query since there is no "
@ -1190,6 +1211,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
default: default:
print_skip_replication_statement(print_event_info, ev); print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
} }
} }
@ -1353,7 +1376,7 @@ static struct my_option my_options[] =
"Stop reading the binlog at position N. Applies to the last binlog " "Stop reading the binlog at position N. Applies to the last binlog "
"passed on the command line.", "passed on the command line.",
&stop_position, &stop_position, 0, GET_ULL, &stop_position, &stop_position, 0, GET_ULL,
REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE, REQUIRED_ARG, (longlong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0}, (ulonglong)(~(my_off_t)0), 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \ {"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \ requested binlog but rather continue printing until the end of the last \
@ -2322,7 +2345,13 @@ err:
end: end:
if (fd >= 0) if (fd >= 0)
my_close(fd, MYF(MY_WME)); my_close(fd, MYF(MY_WME));
end_io_cache(file); /*
Since the end_io_cache() writes to the
file errors may happen.
*/
if (end_io_cache(file))
retval= ERROR_STOP;
return retval; return retval;
} }

View file

@ -2610,6 +2610,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
if (strcmp(field->name, "View") == 0) if (strcmp(field->name, "View") == 0)
{ {
char *scv_buff= NULL; char *scv_buff= NULL;
my_ulonglong n_cols;
verbose_msg("-- It's a view, create dummy table for view\n"); verbose_msg("-- It's a view, create dummy table for view\n");
@ -2624,8 +2625,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
the same name in order to satisfy views that depend on this view. the same name in order to satisfy views that depend on this view.
The table will be removed when the actual view is created. The table will be removed when the actual view is created.
The properties of each column, aside from the data type, are not The properties of each column, are not preserved in this temporary
preserved in this temporary table, because they are not necessary. table, because they are not necessary.
This will not be necessary once we can determine dependencies This will not be necessary once we can determine dependencies
between views and can simply dump them in the appropriate order. between views and can simply dump them in the appropriate order.
@ -2652,8 +2653,23 @@ static uint get_table_structure(char *table, char *db, char *table_type,
else else
my_free(scv_buff); my_free(scv_buff);
if (mysql_num_rows(result)) n_cols= mysql_num_rows(result);
if (0 != n_cols)
{ {
/*
The actual formula is based on the column names and how the .FRM
files are stored and is too volatile to be repeated here.
Thus we simply warn the user if the columns exceed a limit we
know works most of the time.
*/
if (n_cols >= 1000)
fprintf(stderr,
"-- Warning: Creating a stand-in table for view %s may"
" fail when replaying the dump file produced because "
"of the number of columns exceeding 1000. Exercise "
"caution when replaying the produced dump file.\n",
table);
if (opt_drop) if (opt_drop)
{ {
/* /*
@ -2680,14 +2696,19 @@ static uint get_table_structure(char *table, char *db, char *table_type,
row= mysql_fetch_row(result); row= mysql_fetch_row(result);
fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0), /*
row[1]); The actual column type doesn't matter anyway, since the table will
be dropped at run time.
We do tinyint to avoid hitting the row size limit.
*/
fprintf(sql_file, " %s tinyint NOT NULL",
quote_name(row[0], name_buff, 0));
while((row= mysql_fetch_row(result))) while((row= mysql_fetch_row(result)))
{ {
/* col name, col type */ /* col name, col type */
fprintf(sql_file, ",\n %s %s", fprintf(sql_file, ",\n %s tinyint NOT NULL",
quote_name(row[0], name_buff, 0), row[1]); quote_name(row[0], name_buff, 0));
} }
/* /*

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. /* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2009-2012 Monty Program Ab. Copyright (c) 2009, 2012, Monty Program Ab.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -5148,7 +5148,7 @@ typedef struct
static st_error global_error_names[] = static st_error global_error_names[] =
{ {
{ "<No error>", -1, "" }, { "<No error>", -1U, "" },
#include <mysqld_ername.h> #include <mysqld_ername.h>
{ 0, 0, 0 } { 0, 0, 0 }
}; };
@ -7710,6 +7710,8 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
*/ */
if ((counter==0) && do_read_query_result(cn)) if ((counter==0) && do_read_query_result(cn))
{ {
/* we've failed to collect the result set */
cn->pending= TRUE;
handle_error(command, mysql_errno(mysql), mysql_error(mysql), handle_error(command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), ds); mysql_sqlstate(mysql), ds);
goto end; goto end;

View file

@ -758,6 +758,10 @@ void CertDecoder::GetName(NameType nt)
while (source_.get_index() < length) { while (source_.get_index() < length) {
GetSet(); GetSet();
if (source_.GetError().What() == SET_E) {
source_.SetError(NO_ERROR_E); // extensions may only have sequence
source_.prev();
}
GetSequence(); GetSequence();
byte b = source_.next(); byte b = source_.next();

View file

@ -1,5 +1,5 @@
/* /*
Copyright (c) 2002, 2011, Oracle and/or its affiliates. Copyright (c) 2002, 2012, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -79,7 +79,7 @@ struct my_option
enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
longlong def_value; /**< Default value */ longlong def_value; /**< Default value */
longlong min_value; /**< Min allowed value (for numbers) */ longlong min_value; /**< Min allowed value (for numbers) */
longlong max_value; /**< Max allowed value (for numbers) */ ulonglong max_value; /**< Max allowed value (for numbers) */
longlong sub_size; /**< Unused */ longlong sub_size; /**< Unused */
long block_size; /**< Value should be a mult. of this (for numbers) */ long block_size; /**< Value should be a mult. of this (for numbers) */
void *app_type; /**< To be used by an application */ void *app_type; /**< To be used by an application */

View file

@ -1,7 +1,7 @@
#ifndef SQL_COMMON_INCLUDED #ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED #define SQL_COMMON_INCLUDED
/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. /* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
Copyright (c) 2010, 2011, Monty Program Ab Copyright (c) 2010, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -80,8 +80,9 @@ typedef struct st_mysql_methods
0, arg, length, 1, stmt) 0, arg, length, 1, stmt)
extern CHARSET_INFO *default_client_charset_info; extern CHARSET_INFO *default_client_charset_info;
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,
my_bool default_value, uint server_capabilities); uint fields, my_bool default_value,
uint server_capabilities);
void free_rows(MYSQL_DATA *cur); void free_rows(MYSQL_DATA *cur);
void free_old_query(MYSQL *mysql); void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql); void end_server(MYSQL *mysql);

View file

@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates /* Copyright (c) 2000, 2012, Oracle and/or its affiliates
Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -811,7 +812,7 @@ MYSQL_FIELD *cli_list_fields(MYSQL *mysql)
return NULL; return NULL;
mysql->field_count= (uint) query->rows; mysql->field_count= (uint) query->rows;
return unpack_fields(query,&mysql->field_alloc, return unpack_fields(mysql, query,&mysql->field_alloc,
mysql->field_count, 1, mysql->server_capabilities); mysql->field_count, 1, mysql->server_capabilities);
} }
@ -871,7 +872,7 @@ mysql_list_processes(MYSQL *mysql)
if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0, if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0,
protocol_41(mysql) ? 7 : 5))) protocol_41(mysql) ? 7 : 5)))
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, if (!(mysql->fields=unpack_fields(mysql, fields,&mysql->field_alloc,field_count,0,
mysql->server_capabilities))) mysql->server_capabilities)))
DBUG_RETURN(0); DBUG_RETURN(0);
mysql->status=MYSQL_STATUS_GET_RESULT; mysql->status=MYSQL_STATUS_GET_RESULT;
@ -1456,7 +1457,7 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7))) if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7)))
DBUG_RETURN(1); DBUG_RETURN(1);
if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root, if (!(stmt->fields= unpack_fields(mysql, fields_data,&stmt->mem_root,
field_count,0, field_count,0,
mysql->server_capabilities))) mysql->server_capabilities)))
DBUG_RETURN(1); DBUG_RETURN(1);

View file

@ -15,9 +15,9 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include ${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${MY_READLINE_INCLUDE_DIR} ${MY_READLINE_INCLUDE_DIR}
) )

View file

@ -0,0 +1,34 @@
#############################################
# checks if mysqlbinlog is debug compiled
# this "cannot" be done simply by using
# have_debug.inc
#############################################
--disable_query_log
--let $temp_out_help_file=$MYSQL_TMP_DIR/mysqlbinlog_help.tmp
--exec $MYSQL_BINLOG --help>$temp_out_help_file
let log_tmp=$temp_out_help_file;
--let $temp_inc=$MYSQL_TMP_DIR/temp.inc
let inc_tmp=$temp_inc;
--perl
use strict;
my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set";
open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n");
my $count = () = grep(/Output debug log/g,<FILE>);
close FILE;
my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set";
open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!");
print FILE_INC '--let $is_debug= '.$count;
close FILE_INC;
EOF
--source $temp_inc
if (!$is_debug)
{
--skip mysqlbinlog needs to be debug compiled
}
--remove_file $temp_out_help_file
--remove_file $temp_inc
--enable_query_log

View file

@ -53,8 +53,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;; create table t1 select 1 as i;;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
alter table t3 rename to t1; alter table t3 rename to t1;
ERROR 42S01: Table 't1' already exists
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
ERROR 42S01: Table 't1' already exists
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -65,8 +65,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;; create table t1 select 1 as i;;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
alter table t3 rename to t1, add k int; alter table t3 rename to t1, add k int;
ERROR 42S01: Table 't1' already exists
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
ERROR 42S01: Table 't1' already exists
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (

View file

@ -2039,6 +2039,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1; drop table t1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
select hex(concat(a)) from t1; select hex(concat(a)) from t1;
hex(concat(a)) hex(concat(a))
@ -2352,6 +2354,8 @@ hex(a)
drop table t1; drop table t1;
drop view v1; drop view v1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
create view v1(a) as select concat(a) from t1; create view v1(a) as select concat(a) from t1;
show columns from v1; show columns from v1;

View file

@ -2431,6 +2431,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1; drop table t1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
select hex(concat(a)) from t1; select hex(concat(a)) from t1;
hex(concat(a)) hex(concat(a))
@ -2744,6 +2746,8 @@ hex(a)
drop table t1; drop table t1;
drop view v1; drop view v1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
create view v1(a) as select concat(a) from t1; create view v1(a) as select concat(a) from t1;
show columns from v1; show columns from v1;

View file

@ -2458,6 +2458,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1; drop table t1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
select hex(concat(a)) from t1; select hex(concat(a)) from t1;
hex(concat(a)) hex(concat(a))
@ -2771,6 +2773,8 @@ hex(a)
drop table t1; drop table t1;
drop view v1; drop view v1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
create view v1(a) as select concat(a) from t1; create view v1(a) as select concat(a) from t1;
show columns from v1; show columns from v1;

View file

@ -3341,6 +3341,8 @@ hex(concat(a)) a
00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1 00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1
drop table t1; drop table t1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
select hex(concat(a)) from t1; select hex(concat(a)) from t1;
hex(concat(a)) hex(concat(a))
@ -3654,6 +3656,8 @@ hex(a)
drop table t1; drop table t1;
drop view v1; drop view v1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
create view v1(a) as select concat(a) from t1; create view v1(a) as select concat(a) from t1;
show columns from v1; show columns from v1;

View file

@ -4197,6 +4197,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1; drop table t1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
select hex(concat(a)) from t1; select hex(concat(a)) from t1;
hex(concat(a)) hex(concat(a))
@ -4510,6 +4512,8 @@ hex(a)
drop table t1; drop table t1;
drop view v1; drop view v1;
create table t1 (a year(2)); create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1); insert into t1 values (1);
create view v1(a) as select concat(a) from t1; create view v1(a) as select concat(a) from t1;
show columns from v1; show columns from v1;

View file

@ -1527,6 +1527,8 @@ DROP TABLE t1;
# Bug#43668: Wrong comparison and MIN/MAX for YEAR(2) # Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
# #
create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime); create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values insert into t1 values
(98,1998,19980101,"1998-01-01 00:00:00"), (98,1998,19980101,"1998-01-01 00:00:00"),
(00,2000,20000101,"2000-01-01 00:00:01"), (00,2000,20000101,"2000-01-01 00:00:01"),

View file

@ -697,7 +697,7 @@ The following options may be given as the first argument:
partial matching partial matching
--rpl-recovery-rank=# --rpl-recovery-rank=#
Unused, will be removed Unused, will be removed
--safe-mode Skip some optimize stages (for testing). --safe-mode Skip some optimize stages (for testing). Deprecated.
--safe-user-create Don't allow new user creation by the user who has no --safe-user-create Don't allow new user creation by the user who has no
write privileges to the mysql.user table. write privileges to the mysql.user table.
--secure-auth Disallow authentication for accounts that have old --secure-auth Disallow authentication for accounts that have old
@ -737,6 +737,9 @@ The following options may be given as the first argument:
--slave-load-tmpdir=name --slave-load-tmpdir=name
The location where the slave should put its temporary The location where the slave should put its temporary
files when replicating a LOAD DATA INFILE command files when replicating a LOAD DATA INFILE command
--slave-max-allowed-packet=#
The maximum packet length to sent successfully from the
master to slave.
--slave-net-timeout=# --slave-net-timeout=#
Number of seconds to wait for more data from a Number of seconds to wait for more data from a
master/slave connection before aborting the read master/slave connection before aborting the read
@ -1057,6 +1060,7 @@ skip-show-database FALSE
skip-slave-start FALSE skip-slave-start FALSE
slave-compressed-protocol FALSE slave-compressed-protocol FALSE
slave-exec-mode STRICT slave-exec-mode STRICT
slave-max-allowed-packet 1073741824
slave-net-timeout 3600 slave-net-timeout 3600
slave-skip-errors (No default value) slave-skip-errors (No default value)
slave-sql-verify-checksum TRUE slave-sql-verify-checksum TRUE

View file

@ -2073,7 +2073,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` ( /*!50001 CREATE TABLE `v2` (
`a` varchar(30) `a` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP TABLE IF EXISTS `v2`*/;
@ -2167,7 +2167,7 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` ( /*!50001 CREATE TABLE `v1` (
`a` int(11) `a` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP TABLE IF EXISTS `v1`*/;
@ -2241,7 +2241,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` ( /*!50001 CREATE TABLE `v2` (
`a` varchar(30) `a` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP TABLE IF EXISTS `v2`*/;
@ -2355,9 +2355,9 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` ( /*!50001 CREATE TABLE `v1` (
`a` int(11), `a` tinyint NOT NULL,
`b` int(11), `b` tinyint NOT NULL,
`c` varchar(30) `c` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`; DROP TABLE IF EXISTS `v2`;
@ -2365,7 +2365,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` ( /*!50001 CREATE TABLE `v2` (
`a` int(11) `a` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v3`; DROP TABLE IF EXISTS `v3`;
@ -2373,9 +2373,9 @@ DROP TABLE IF EXISTS `v3`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v3` ( /*!50001 CREATE TABLE `v3` (
`a` int(11), `a` tinyint NOT NULL,
`b` int(11), `b` tinyint NOT NULL,
`c` varchar(30) `c` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP TABLE IF EXISTS `v1`*/;
@ -3112,9 +3112,9 @@ DROP TABLE IF EXISTS `v0`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v0` ( /*!50001 CREATE TABLE `v0` (
`a` int(11), `a` tinyint NOT NULL,
`b` varchar(32), `b` tinyint NOT NULL,
`c` varchar(32) `c` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v1`; DROP TABLE IF EXISTS `v1`;
@ -3122,9 +3122,9 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` ( /*!50001 CREATE TABLE `v1` (
`a` int(11), `a` tinyint NOT NULL,
`b` varchar(32), `b` tinyint NOT NULL,
`c` varchar(32) `c` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`; DROP TABLE IF EXISTS `v2`;
@ -3132,9 +3132,9 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` ( /*!50001 CREATE TABLE `v2` (
`a` int(11), `a` tinyint NOT NULL,
`b` varchar(32), `b` tinyint NOT NULL,
`c` varchar(32) `c` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
@ -3514,7 +3514,7 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` ( /*!50001 CREATE TABLE `v1` (
`id` int(11) `id` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
@ -3574,7 +3574,7 @@ USE `mysqldump_views`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `nasishnasifu` ( /*!50001 CREATE TABLE `nasishnasifu` (
`id` bigint(20) unsigned `id` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
@ -3967,7 +3967,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` ( /*!50001 CREATE TABLE `v2` (
`c` int(11) `c` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP TABLE IF EXISTS `v2`*/;
@ -4384,7 +4384,7 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` ( /*!50001 CREATE TABLE `v1` (
`id` int(11) `id` tinyint NOT NULL
) ENGINE=MyISAM */; ) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;

View file

@ -878,6 +878,8 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT
CREATE TABLE b15776 (a char(4294967296)); CREATE TABLE b15776 (a char(4294967296));
ERROR 42000: Display width out of range for 'a' (max = 4294967295) ERROR 42000: Display width out of range for 'a' (max = 4294967295)
CREATE TABLE b15776 (a year(4294967295)); CREATE TABLE b15776 (a year(4294967295));
Warnings:
Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO b15776 VALUES (42); INSERT INTO b15776 VALUES (42);
SELECT * FROM b15776; SELECT * FROM b15776;
a a
@ -886,6 +888,8 @@ DROP TABLE b15776;
CREATE TABLE b15776 (a year(4294967296)); CREATE TABLE b15776 (a year(4294967296));
ERROR 42000: Display width out of range for 'a' (max = 4294967295) ERROR 42000: Display width out of range for 'a' (max = 4294967295)
CREATE TABLE b15776 (a year(0)); CREATE TABLE b15776 (a year(0));
Warnings:
Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE b15776; DROP TABLE b15776;
CREATE TABLE b15776 (a year(-2)); CREATE TABLE b15776 (a year(-2));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1

View file

@ -1,5 +1,7 @@
drop table if exists t1; drop table if exists t1;
create table t1 (y year,y2 year(2)); create table t1 (y year,y2 year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1; select * from t1;
y y2 y y2
@ -50,6 +52,8 @@ End of 5.0 tests
# Bug #49480: WHERE using YEAR columns returns unexpected results # Bug #49480: WHERE using YEAR columns returns unexpected results
# #
CREATE TABLE t2(yy YEAR(2), c2 CHAR(4)); CREATE TABLE t2(yy YEAR(2), c2 CHAR(4));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4)); CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4));
INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069); INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069);
INSERT INTO t4 (c4) SELECT c2 FROM t2; INSERT INTO t4 (c4) SELECT c2 FROM t2;
@ -358,9 +362,22 @@ total_rows min_value MAX(c1+0)
3 0 2155 3 0 2155
DROP TABLE t1; DROP TABLE t1;
# #
# WL#6219: Deprecate and remove YEAR(2) type
#
CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE t1;
#
End of 5.1 tests End of 5.1 tests
create function y2k() returns int deterministic return 2000; create function y2k() returns int deterministic return 2000;
create table t1 (a year(2), b int); create table t1 (a year(2), b int);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert t1 values (0,2000); insert t1 values (0,2000);
select a from t1 where a=2000; select a from t1 where a=2000;
a a

View file

@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4;
CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1));
CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2));
CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);

View file

@ -3235,9 +3235,21 @@ c1 c2 c3 c4
1999 1999 1998-12-30 1998-12-30 11:30:45 1999 1999 1998-12-30 1998-12-30 11:30:45
DROP TABLE t1,t2,t3,t4; DROP TABLE t1,t2,t3,t4;
CREATE TABLE t1(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2)); CREATE TABLE t1(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2)); CREATE TABLE t2(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t3(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME); CREATE TABLE t4(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t1 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45');
INSERT INTO t2 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t2 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45');
INSERT INTO t3 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t3 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45');

View file

@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4;
CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1));
CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2));
CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);

View file

@ -53,6 +53,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = innodb; ) engine = innodb;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2; into table tb2;
DROP DATABASE IF EXISTS test1; DROP DATABASE IF EXISTS test1;
@ -112,6 +114,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = innodb; ) engine = innodb;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2; into table tb2;
USE test; USE test;

View file

@ -132,6 +132,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = innodb; ) engine = innodb;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2; into table tb2;
drop table if exists tb3 ; drop table if exists tb3 ;
@ -262,6 +264,8 @@ f239 varchar(20000) binary,
f240 varchar(2000), f240 varchar(2000),
f241 char(100) f241 char(100)
) engine = innodb; ) engine = innodb;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt'
into table tb4; into table tb4;
USE test1; USE test1;
@ -319,6 +323,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = innodb; ) engine = innodb;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2; into table tb2;
USE test; USE test;

View file

@ -128,6 +128,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = memory; ) engine = memory;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ; into table tb2 ;
drop table if exists tb3; drop table if exists tb3;
@ -251,6 +253,8 @@ f238 varchar(25000) binary,
f239 varbinary(0), f239 varbinary(0),
f240 varchar(1200) f240 varchar(1200)
) engine = memory; ) engine = memory;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt'
into table tb4; into table tb4;
USE test1; USE test1;
@ -308,6 +312,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = memory; ) engine = memory;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ; into table tb2 ;
USE test; USE test;

View file

@ -144,6 +144,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null, f116 VARBINARY(64) null,
f117 VARBINARY(192) null f117 VARBINARY(192) null
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2; into table tb2;
drop table if exists tb3 ; drop table if exists tb3 ;
@ -283,6 +285,8 @@ f240 varchar(120),
f241 char(100), f241 char(100),
f242 bit(30) f242 bit(30)
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt'
into table tb4; into table tb4;
USE test1; USE test1;
@ -348,6 +352,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null, f116 VARBINARY(64) null,
f117 VARBINARY(192) null f117 VARBINARY(192) null
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2; into table tb2;
USE test; USE test;

View file

@ -144,6 +144,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null, f116 VARBINARY(64) null,
f117 VARBINARY(192) null f117 VARBINARY(192) null
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2; into table tb2;
drop table if exists tb3 ; drop table if exists tb3 ;
@ -283,6 +285,8 @@ f240 varchar(120),
f241 char(100), f241 char(100),
f242 bit(30) f242 bit(30)
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt'
into table tb4; into table tb4;
USE test1; USE test1;
@ -348,6 +352,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null, f116 VARBINARY(64) null,
f117 VARBINARY(192) null f117 VARBINARY(192) null
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2; into table tb2;
USE test; USE test;

View file

@ -54,6 +54,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = memory; ) engine = memory;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ; into table tb2 ;
DROP DATABASE IF EXISTS test1; DROP DATABASE IF EXISTS test1;
@ -113,6 +115,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum", f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set" f109 set("1set","2set") not null default "1set"
) engine = memory; ) engine = memory;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ; into table tb2 ;
USE test; USE test;

View file

@ -62,6 +62,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null, f116 VARBINARY(64) null,
f117 VARBINARY(192) null f117 VARBINARY(192) null
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2; into table tb2;
DROP DATABASE IF EXISTS test1; DROP DATABASE IF EXISTS test1;
@ -129,6 +131,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null, f116 VARBINARY(64) null,
f117 VARBINARY(192) null f117 VARBINARY(192) null
) engine = myisam; ) engine = myisam;
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2; into table tb2;
USE test; USE test;

View file

@ -7499,9 +7499,13 @@ BEGIN
declare x, y, z year(3) default 2005; declare x, y, z year(3) default 2005;
SELECT x, y, z; SELECT x, y, z;
END// END//
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CALL sp1(); CALL sp1();
x y z x y z
2005 2005 2005 2005 2005 2005
Warnings:
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP PROCEDURE IF EXISTS sp1; DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( ) CREATE PROCEDURE sp1( )
BEGIN BEGIN

View file

@ -58,6 +58,7 @@ col89 float unsigned zerofill DEFAULT NULL,
col90 tinyblob col90 tinyblob
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
Warnings: Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1291 Column 'col82' has duplicated value '' in ENUM Note 1291 Column 'col82' has duplicated value '' in ENUM
Note 1291 Column 'col82' has duplicated value '' in ENUM Note 1291 Column 'col82' has duplicated value '' in ENUM
INSERT INTO bug52745 SET INSERT INTO bug52745 SET

View file

@ -9,4 +9,4 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
misc : bug#14113704 24/04/2012 Mayank issue reported causing failure.

View file

@ -15,6 +15,9 @@ SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD')); AND (OBJECT_NAME LIKE '%t1.MYD'));
SELECT (@before_count >= 0) as have_before_count;
have_before_count
1
SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation;
has_instrumentation has_instrumentation
Success Success
@ -27,6 +30,9 @@ SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1));
SELECT (@after_count >= 0) as have_after_count;
have_after_count
1
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed;
test_ff1_timed test_ff1_timed
Success Success
@ -35,6 +41,9 @@ SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2));
SELECT (@before_count >= 0) as have_before_count;
have_before_count
1
SELECT * FROM t1 WHERE id < 6; SELECT * FROM t1 WHERE id < 6;
id b id b
1 initial value 1 initial value
@ -46,6 +55,9 @@ SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.events_waits_history_long FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3));
SELECT (@after_count >= 0) as have_after_count;
have_after_count
1
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed;
test_ff2_timed test_ff2_timed
Success Success

View file

@ -36,9 +36,9 @@ Qcache_hits 1
select spins from performance_schema.events_waits_current order by event_name limit 1; select spins from performance_schema.events_waits_current order by event_name limit 1;
spins spins
NULL NULL
select name from performance_schema.setup_instruments order by name limit 1; select * from performance_schema.setup_timers where name='wait';
name NAME TIMER_NAME
wait/io/file/aria/control wait CYCLE
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
Variable_name Value Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
@ -51,9 +51,9 @@ Qcache_hits 1
select spins from performance_schema.events_waits_current order by event_name limit 1; select spins from performance_schema.events_waits_current order by event_name limit 1;
spins spins
NULL NULL
select name from performance_schema.setup_instruments order by name limit 1; select * from performance_schema.setup_timers where name='wait';
name NAME TIMER_NAME
wait/io/file/aria/control wait CYCLE
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
Variable_name Value Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1

View file

@ -41,6 +41,7 @@ SET @before_count = (SELECT SUM(TIMER_WAIT)
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD')); AND (OBJECT_NAME LIKE '%t1.MYD'));
SELECT (@before_count >= 0) as have_before_count;
SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation;
SELECT * FROM t1 WHERE id < 4; SELECT * FROM t1 WHERE id < 4;
@ -50,6 +51,7 @@ SET @after_count = (SELECT SUM(TIMER_WAIT)
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1));
SELECT (@after_count >= 0) as have_after_count;
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed;
UPDATE performance_schema.setup_instruments SET enabled='NO'; UPDATE performance_schema.setup_instruments SET enabled='NO';
@ -59,6 +61,7 @@ SET @before_count = (SELECT SUM(TIMER_WAIT)
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2));
SELECT (@before_count >= 0) as have_before_count;
SELECT * FROM t1 WHERE id < 6; SELECT * FROM t1 WHERE id < 6;
SET @after_count = (SELECT SUM(TIMER_WAIT) SET @after_count = (SELECT SUM(TIMER_WAIT)
@ -66,6 +69,7 @@ SET @after_count = (SELECT SUM(TIMER_WAIT)
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3));
SELECT (@after_count >= 0) as have_after_count;
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed;
# #

View file

@ -34,7 +34,7 @@ show status like "Qcache_hits";
select spins from performance_schema.events_waits_current order by event_name limit 1; select spins from performance_schema.events_waits_current order by event_name limit 1;
select name from performance_schema.setup_instruments order by name limit 1; select * from performance_schema.setup_timers where name='wait';
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts"; show status like "Qcache_inserts";
@ -42,7 +42,7 @@ show status like "Qcache_hits";
select spins from performance_schema.events_waits_current order by event_name limit 1; select spins from performance_schema.events_waits_current order by event_name limit 1;
select name from performance_schema.setup_instruments order by name limit 1; select * from performance_schema.setup_timers where name='wait';
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts"; show status like "Qcache_inserts";

View file

@ -114,22 +114,23 @@ id c
3 3 3 3
[on master] [on master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TABLE test.t1 (a INT); CREATE TABLE test.t1 (a INT);
INSERT INTO test.t1 VALUES(1); INSERT INTO test.t1 VALUES(1);
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
SET INSERT_ID=2; SET INSERT_ID=2;
SET @c=2; SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000; SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); INSERT INTO t5 VALUES (NULL, RAND(), @c);
SELECT b into @b FROM test.t5; SELECT b into @b FROM test.t5;
UPDATE test.t1 SET a=2; UPDATE test.t1 SET a=2;
SELECT a AS 'ONE' into @a FROM test.t_slave; SELECT a AS 'ONE' into @a FROM test.t_slave;
SELECT c AS 'NULL' into @c FROM test.t_slave; SELECT c AS 'NULL' into @c FROM test.t_slave;
SELECT b into @b FROM test.t_slave; SELECT b into @b FROM test.t_slave;
include/assert.inc [Random values from master and slave must be different]
drop table test.t5; drop table test.t5;
drop table test.t1; drop table test.t1;
drop table test.t_slave; drop table test.t_slave;

View file

@ -11,7 +11,7 @@ include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=MASTER_LOG_POS;
start slave; start slave;
include/wait_for_slave_io_error.inc [errno=1236] include/wait_for_slave_io_error.inc [errno=1236]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
include/stop_slave_sql.inc include/stop_slave_sql.inc
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB

View file

@ -1,7 +1,7 @@
include/master-slave.inc include/master-slave.inc
[connection master] [connection master]
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153");
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024; SET @@global.max_allowed_packet=1024;
@ -30,14 +30,14 @@ include/start_slave.inc
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
include/wait_for_slave_io_error.inc [errno=1153] include/wait_for_slave_io_error.inc [errno=1153]
Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes' Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
include/stop_slave_sql.inc include/stop_slave_sql.inc
include/rpl_reset.inc include/rpl_reset.inc
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
include/wait_for_slave_io_error.inc [errno=1236] include/wait_for_slave_io_error.inc [errno=1153]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
@ -52,6 +52,7 @@ SET @@global.max_allowed_packet= 1024;
Warnings: Warnings:
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.net_buffer_length= 1024; SET @@global.net_buffer_length= 1024;
SET @@global.slave_max_allowed_packet= 1073741824;
DROP TABLE t1; DROP TABLE t1;
RESET SLAVE; RESET SLAVE;
include/rpl_end.inc include/rpl_end.inc

View file

@ -4,7 +4,7 @@ DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3; DROP TABLE IF EXISTS t3;
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
create table t2 (a int auto_increment, primary key (a), b int); create table t2 (a int auto_increment, primary key (a), b int) engine=innodb;
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
create trigger t1 before insert on t1 for each row create trigger t1 before insert on t1 for each row
begin begin
@ -29,7 +29,7 @@ a b
1 2 1 2
3 0 3 0
4 0 4 0
5 0 6 0
500 0 500 0
select a,name, old_a, old_b, truncate(rand_value,4) from t3; select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4) a name old_a old_b truncate(rand_value,4)
@ -39,7 +39,7 @@ a name old_a old_b truncate(rand_value,4)
103 t2 1 2 0.9164 103 t2 1 2 0.9164
104 t2 3 0 0.8826 104 t2 3 0 0.8826
105 t2 4 0 0.6635 105 t2 4 0 0.6635
106 t2 5 0 0.6699 106 t2 6 0 0.6699
107 t2 500 0 0.3593 107 t2 500 0 0.3593
--- On slave -- --- On slave --
@ -52,7 +52,7 @@ a b
1 2 1 2
3 0 3 0
4 0 4 0
5 0 6 0
500 0 500 0
select a,name, old_a, old_b, truncate(rand_value,4) from t3; select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4) a name old_a old_b truncate(rand_value,4)
@ -62,7 +62,7 @@ a name old_a old_b truncate(rand_value,4)
103 t2 1 2 0.9164 103 t2 1 2 0.9164
104 t2 3 0 0.8826 104 t2 3 0 0.8826
105 t2 4 0 0.6635 105 t2 4 0 0.6635
106 t2 5 0 0.6699 106 t2 6 0 0.6699
107 t2 500 0 0.3593 107 t2 500 0 0.3593
drop table t1,t2,t3; drop table t1,t2,t3;
select get_lock("bug12480",2); select get_lock("bug12480",2);

View file

@ -215,21 +215,23 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
# be filtered as well. # be filtered as well.
# #
connection master; connection master;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # ignored on slave # Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D.
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); # ignored on slave
CREATE TABLE test.t1 (a INT); # accepted on slave CREATE TABLE test.t1 (a INT); # accepted on slave
INSERT INTO test.t1 VALUES(1); INSERT INTO test.t1 VALUES(1);
--sync_slave_with_master --sync_slave_with_master
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D.
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
connection master; connection master;
SET INSERT_ID=2; SET INSERT_ID=2;
SET @c=2; SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000; SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); # to be ignored INSERT INTO t5 VALUES (NULL, RAND(), @c); # to be ignored
SELECT b into @b FROM test.t5; SELECT b into @b FROM test.t5;
--let $b_master=`select @b` --let $b_master=`select @b`
UPDATE test.t1 SET a=2; # to run trigger on slave UPDATE test.t1 SET a=2; # to run trigger on slave
@ -253,10 +255,9 @@ if (`SELECT @a != 2 and @c != NULL`)
SELECT b into @b FROM test.t_slave; SELECT b into @b FROM test.t_slave;
--let $b_slave=`select @b` --let $b_slave=`select @b`
if (`SELECT $b_slave = $b_master`) --let $assert_text= Random values from master and slave must be different
{ --let $assert_cond= $b_master != $b_slave
--echo Might be pure coincidence of two randoms from master and slave table. Don not panic yet. --source include/assert.inc
}
# cleanup BUG#11754117 # cleanup BUG#11754117
connection master; connection master;

View file

@ -1 +1 @@
--max_allowed_packet=1024 --net_buffer_length=1024 --max_allowed_packet=1024 --net_buffer_length=1024 --slave_max_allowed_packet=1024

View file

@ -11,9 +11,8 @@
# max-out size db name # max-out size db name
source include/master-slave.inc; source include/master-slave.inc;
source include/have_binlog_format_row.inc; source include/have_binlog_format_row.inc;
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153");
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
disable_warnings; disable_warnings;
eval drop database if exists $db; eval drop database if exists $db;
@ -23,6 +22,7 @@ eval create database $db;
connection master; connection master;
let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
SET @@global.max_allowed_packet=1024; SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024; SET @@global.net_buffer_length=1024;
@ -123,11 +123,9 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R
connection slave; connection slave;
# The slave I/O thread must stop after receiving # The slave I/O thread must stop after receiving
# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. # 1153 = ER_NET_PACKET_TOO_LARGE
--let $slave_io_errno= 1236 --let $slave_io_errno= 1153
--let $show_slave_io_error= 1
# Mask line numbers
--let $slave_io_error_replace= / at [0-9]*/ at XXX/
--source include/wait_for_slave_io_error.inc --source include/wait_for_slave_io_error.inc
# Remove the bad binlog and clear error status on slave. # Remove the bad binlog and clear error status on slave.
@ -167,6 +165,7 @@ connection master;
DROP TABLE t1; DROP TABLE t1;
eval SET @@global.max_allowed_packet= $old_max_allowed_packet; eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
eval SET @@global.net_buffer_length= $old_net_buffer_length; eval SET @@global.net_buffer_length= $old_net_buffer_length;
eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
# slave is stopped # slave is stopped
connection slave; connection slave;
DROP TABLE t1; DROP TABLE t1;

View file

@ -3,13 +3,10 @@
# Adding statement include due to Bug 12574 # Adding statement include due to Bug 12574
# TODO: Remove statement include once 12574 is patched # TODO: Remove statement include once 12574 is patched
--source include/have_binlog_format_mixed_or_statement.inc --source include/have_binlog_format_mixed_or_statement.inc
--source include/have_innodb.inc
--source include/master-slave.inc --source include/master-slave.inc
--source include/have_innodb.inc
connection slave;
--source include/have_innodb.inc
connection master; connection master;
disable_query_log; disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log; enable_query_log;
@ -26,7 +23,7 @@ DROP TABLE IF EXISTS t3;
# #
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
create table t2 (a int auto_increment, primary key (a), b int); create table t2 (a int auto_increment, primary key (a), b int) engine=innodb;
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
delimiter |; delimiter |;

View file

@ -0,0 +1,147 @@
SET @start_value = @@global.slave_max_allowed_packet;
SELECT @start_value;
@start_value
1073741824
'#--------------------FN_DYNVARS_072_01------------------------#'
SET @@global.slave_max_allowed_packet = 5000;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '5000'
SET @@global.slave_max_allowed_packet = DEFAULT;
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824
'#---------------------FN_DYNVARS_072_02-------------------------#'
SET @@global.slave_max_allowed_packet = @start_value;
SELECT @@global.slave_max_allowed_packet = 1073741824;
@@global.slave_max_allowed_packet = 1073741824
1
'Bug# 34876: Incorrect Default Value is assigned to variable';
'#--------------------FN_DYNVARS_072_03------------------------#'
SET @@global.slave_max_allowed_packet = 1024;
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
SET @@global.slave_max_allowed_packet = 1073741824;
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824
SET @@global.slave_max_allowed_packet = 1073741824;
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824
SET @@global.slave_max_allowed_packet = 1025;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1025'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
SET @@global.slave_max_allowed_packet = 65535;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '65535'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
64512
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.slave_max_allowed_packet = -1;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
SET @@global.slave_max_allowed_packet = 100000000000;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '100000000000'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824
SET @@global.slave_max_allowed_packet = 10000.01;
ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824
SET @@global.slave_max_allowed_packet = -1024;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1024'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
SET @@global.slave_max_allowed_packet = 4294967296;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '4294967296'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824
SET @@global.slave_max_allowed_packet = 1023;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1023'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@global.slave_max_allowed_packet = ON;
ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
SET @@global.slave_max_allowed_packet = 'test';
ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
'#-------------------FN_DYNVARS_072_05----------------------------#'
SET @@session.slave_max_allowed_packet = 4096;
ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@session.slave_max_allowed_packet;
ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable
'#----------------------FN_DYNVARS_072_06------------------------#'
SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slave_max_allowed_packet';
@@global.slave_max_allowed_packet = VARIABLE_VALUE
1
SELECT @@slave_max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='slave_max_allowed_packet';
@@slave_max_allowed_packet = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_072_07----------------------#'
SET @@global.slave_max_allowed_packet = TRUE;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
SET @@global.slave_max_allowed_packet = FALSE;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '0'
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1024
'#---------------------FN_DYNVARS_072_08----------------------#'
SET @@global.slave_max_allowed_packet = 5000;
Warnings:
Warning 1292 Truncated incorrect slave_max_allowed_packet value: '5000'
SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet;
@@slave_max_allowed_packet = @@global.slave_max_allowed_packet
1
'#---------------------FN_DYNVARS_072_09----------------------#'
SET slave_max_allowed_packet = 6000;
ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@slave_max_allowed_packet;
@@slave_max_allowed_packet
4096
SET local.slave_max_allowed_packet = 7000;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'slave_max_allowed_packet = 7000' at line 1
SELECT local.slave_max_allowed_packet;
ERROR 42S02: Unknown table 'local' in field list
SET global.slave_max_allowed_packet = 8000;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'slave_max_allowed_packet = 8000' at line 1
SELECT global.slave_max_allowed_packet;
ERROR 42S02: Unknown table 'global' in field list
SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet;
ERROR 42S22: Unknown column 'slave_max_allowed_packet' in 'field list'
SET @@global.slave_max_allowed_packet = @start_value;
SELECT @@global.slave_max_allowed_packet;
@@global.slave_max_allowed_packet
1073741824

View file

@ -0,0 +1,177 @@
############## mysql-test\t\slave_max_allowed_packet_basic.test ##################
# #
# Variable Name: slave_max_allowed_packet #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value:1073741824 #
# Range: 1024 - 1073741824 #
# #
# #
# #
# Description: Test Cases of Dynamic System Variable slave_max_allowed_packet #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF slave_max_allowed_packet TESTS #
########################################################################
###########################################################################
# Saving initial value of slave_max_allowed_packet in a temporary variable#
###########################################################################
SET @start_value = @@global.slave_max_allowed_packet;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_072_01------------------------#'
########################################################################
# Display the DEFAULT value of slave_max_allowed_packet #
########################################################################
SET @@global.slave_max_allowed_packet = 5000;
SET @@global.slave_max_allowed_packet = DEFAULT;
SELECT @@global.slave_max_allowed_packet;
--echo '#---------------------FN_DYNVARS_072_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.slave_max_allowed_packet = @start_value;
SELECT @@global.slave_max_allowed_packet = 1073741824;
--echo 'Bug# 34876: Incorrect Default Value is assigned to variable';
--echo '#--------------------FN_DYNVARS_072_03------------------------#'
########################################################################
# Change the value of slave_max_allowed_packet to a valid value #
########################################################################
SET @@global.slave_max_allowed_packet = 1024;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 1073741824;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 1073741824;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 1025;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 65535;
SELECT @@global.slave_max_allowed_packet;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
###########################################################################
# Change the value of slave_max_allowed_packet to invalid value #
###########################################################################
SET @@global.slave_max_allowed_packet = -1;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 100000000000;
SELECT @@global.slave_max_allowed_packet;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_max_allowed_packet = 10000.01;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = -1024;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 4294967296;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = 1023;
SELECT @@global.slave_max_allowed_packet;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_max_allowed_packet = ON;
SELECT @@global.slave_max_allowed_packet;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_max_allowed_packet = 'test';
SELECT @@global.slave_max_allowed_packet;
--echo '#-------------------FN_DYNVARS_072_05----------------------------#'
###########################################################################
# Test if accessing session slave_max_allowed_packet gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.slave_max_allowed_packet = 4096;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.slave_max_allowed_packet;
--echo '#----------------------FN_DYNVARS_072_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slave_max_allowed_packet';
SELECT @@slave_max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='slave_max_allowed_packet';
--echo '#---------------------FN_DYNVARS_072_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.slave_max_allowed_packet = TRUE;
SELECT @@global.slave_max_allowed_packet;
SET @@global.slave_max_allowed_packet = FALSE;
SELECT @@global.slave_max_allowed_packet;
--echo '#---------------------FN_DYNVARS_072_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.slave_max_allowed_packet = 5000;
SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet;
--echo '#---------------------FN_DYNVARS_072_09----------------------#'
################################################################################
# Check if slave_max_allowed_packet can be accessed with and without @@ sign #
################################################################################
--Error ER_GLOBAL_VARIABLE
SET slave_max_allowed_packet = 6000;
SELECT @@slave_max_allowed_packet;
--Error ER_PARSE_ERROR
SET local.slave_max_allowed_packet = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.slave_max_allowed_packet;
--Error ER_PARSE_ERROR
SET global.slave_max_allowed_packet = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.slave_max_allowed_packet;
--Error ER_BAD_FIELD_ERROR
SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet;
##############################
# Restore initial value #
##############################
SET @@global.slave_max_allowed_packet = @start_value;
SELECT @@global.slave_max_allowed_packet;
########################################################################
# END OF slave_max_allowed_packet TESTS #
########################################################################

View file

@ -132,11 +132,20 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
--send create table t1 select 1 as i; --send create table t1 select 1 as i;
connection addconroot1; connection addconroot1;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
--error ER_TABLE_EXISTS_ERROR --send alter table t3 rename to t1
alter table t3 rename to t1; connection addconroot2;
# Wait until the above ALTER TABLE RENAME is blocked due to CREATE
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock" and
info = "alter table t3 rename to t1";
--source include/wait_condition.inc
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
connection default; connection default;
--reap --reap
connection addconroot1;
--error ER_TABLE_EXISTS_ERROR
--reap
connection default; connection default;
show create table t1; show create table t1;
drop table t1; drop table t1;
@ -146,11 +155,21 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
--send create table t1 select 1 as i; --send create table t1 select 1 as i;
connection addconroot1; connection addconroot1;
set debug_sync='now WAIT_FOR parked'; set debug_sync='now WAIT_FOR parked';
--error ER_TABLE_EXISTS_ERROR --send alter table t3 rename to t1, add k int
alter table t3 rename to t1, add k int; connection addconroot2;
# Wait until the above ALTER TABLE RENAME is blocked due to CREATE
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock" and
info = "alter table t3 rename to t1, add k int";
--source include/wait_condition.inc
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
connection default; connection default;
--reap --reap
connection addconroot1;
--error ER_TABLE_EXISTS_ERROR
--reap
connection default;
show create table t1; show create table t1;
drop table t1,t3; drop table t1,t3;

View file

@ -372,11 +372,11 @@ let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQ
--echo # Show the help. --echo # Show the help.
--echo # --echo #
replace_result $MYSQL_PLUGIN mysql_plugin; replace_result $MYSQL_PLUGIN mysql_plugin;
--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ --replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/
--exec $MYSQL_PLUGIN --help --exec $MYSQL_PLUGIN --help
replace_result $MYSQL_PLUGIN mysql_plugin; replace_result $MYSQL_PLUGIN mysql_plugin;
--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ --replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/
--exec $MYSQL_PLUGIN --version --exec $MYSQL_PLUGIN --version
# #

View file

@ -160,6 +160,14 @@ SELECT COUNT(*) AS total_rows, MIN(c1) AS min_value, MAX(c1) FROM t1;
SELECT COUNT(*) AS total_rows, MIN(c1+0) AS min_value, MAX(c1+0) FROM t1; SELECT COUNT(*) AS total_rows, MIN(c1+0) AS min_value, MAX(c1+0) FROM t1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # WL#6219: Deprecate and remove YEAR(2) type
--echo #
CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
DROP TABLE t1;
--echo # --echo #
--echo End of 5.1 tests --echo End of 5.1 tests

View file

@ -433,7 +433,11 @@ process_flags:
memset(buffz, '0', minimum_width - length2); memset(buffz, '0', minimum_width - length2);
else else
memset(buffz, ' ', minimum_width - length2); memset(buffz, ' ', minimum_width - length2);
my_b_write(info, buffz, minimum_width - length2); if (my_b_write(info, buffz, minimum_width - length2))
{
my_afree(buffz);
goto err;
}
my_afree(buffz); my_afree(buffz);
} }

View file

@ -47,6 +47,11 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
#else #else
writtenbytes= write(Filedes, Buffer, Count); writtenbytes= write(Filedes, Buffer, Count);
#endif #endif
DBUG_EXECUTE_IF("simulate_file_write_error",
{
errno= ENOSPC;
writtenbytes= (size_t) -1;
});
if (writtenbytes == Count) if (writtenbytes == Count)
break; break;
if (writtenbytes != (size_t) -1) if (writtenbytes != (size_t) -1)

View file

@ -26,5 +26,5 @@ const unsigned long Trace::kTraceDetail = 0x0010;
const unsigned long Trace::kTraceNetWait = 0x0020; const unsigned long Trace::kTraceNetWait = 0x0020;
const unsigned long Trace::kTraceFunction = 0x0040; const unsigned long Trace::kTraceFunction = 0x0040;
const char ReplSemiSyncBase::kSyncHeader[2] = const unsigned char ReplSemiSyncBase::kSyncHeader[2] =
{ReplSemiSyncBase::kPacketMagicNum, 0}; {ReplSemiSyncBase::kPacketMagicNum, 0};

View file

@ -71,7 +71,7 @@ public:
class ReplSemiSyncBase class ReplSemiSyncBase
:public Trace { :public Trace {
public: public:
static const char kSyncHeader[2]; /* three byte packet header */ static const unsigned char kSyncHeader[2]; /* three byte packet header */
/* Constants in network packet header. */ /* Constants in network packet header. */
static const unsigned char kPacketMagicNum; static const unsigned char kPacketMagicNum;

View file

@ -180,7 +180,7 @@ static MYSQL_SYSVAR_ULONG(timeout, rpl_semi_sync_master_timeout,
"The timeout value (in ms) for semi-synchronous replication in the master", "The timeout value (in ms) for semi-synchronous replication in the master",
NULL, // check NULL, // check
fix_rpl_semi_sync_master_timeout, // update fix_rpl_semi_sync_master_timeout, // update
10000, 0, ~0L, 1); 10000, 0, ~0UL, 1);
static MYSQL_SYSVAR_BOOL(wait_no_slave, rpl_semi_sync_master_wait_no_slave, static MYSQL_SYSVAR_BOOL(wait_no_slave, rpl_semi_sync_master_wait_no_slave,
PLUGIN_VAR_OPCMDARG, PLUGIN_VAR_OPCMDARG,
@ -194,7 +194,7 @@ static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_master_trace_level,
"The tracing level for semi-sync replication.", "The tracing level for semi-sync replication.",
NULL, // check NULL, // check
&fix_rpl_semi_sync_master_trace_level, // update &fix_rpl_semi_sync_master_trace_level, // update
32, 0, ~0L, 1); 32, 0, ~0UL, 1);
static SYS_VAR* semi_sync_master_system_vars[]= { static SYS_VAR* semi_sync_master_system_vars[]= {
MYSQL_SYSVAR(enabled), MYSQL_SYSVAR(enabled),

View file

@ -161,7 +161,7 @@ static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_slave_trace_level,
"The tracing level for semi-sync replication.", "The tracing level for semi-sync replication.",
NULL, // check NULL, // check
&fix_rpl_semi_sync_trace_level, // update &fix_rpl_semi_sync_trace_level, // update
32, 0, ~0L, 1); 32, 0, ~0UL, 1);
static SYS_VAR* semi_sync_slave_system_vars[]= { static SYS_VAR* semi_sync_slave_system_vars[]= {
MYSQL_SYSVAR(enabled), MYSQL_SYSVAR(enabled),

View file

@ -1,5 +1,5 @@
/* /* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
Copyright (c) 2003, 2011, Oracle and/or its affiliates. Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -1439,7 +1439,7 @@ static void cli_fetch_lengths(ulong *to, MYSQL_ROW column,
***************************************************************************/ ***************************************************************************/
MYSQL_FIELD * MYSQL_FIELD *
unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities) my_bool default_value, uint server_capabilities)
{ {
MYSQL_ROWS *row; MYSQL_ROWS *row;
@ -1452,6 +1452,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
if (!result) if (!result)
{ {
free_rows(data); /* Free old data */ free_rows(data); /* Free old data */
set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
bzero((char*) field, (uint) sizeof(MYSQL_FIELD)*fields); bzero((char*) field, (uint) sizeof(MYSQL_FIELD)*fields);
@ -1479,6 +1480,14 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->org_name_length= lengths[5]; field->org_name_length= lengths[5];
/* Unpack fixed length parts */ /* Unpack fixed length parts */
if (lengths[6] != 12)
{
/* malformed packet. signal an error. */
free_rows(data); /* Free old data */
set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate);
DBUG_RETURN(0);
}
pos= (uchar*) row->data[6]; pos= (uchar*) row->data[6];
field->charsetnr= uint2korr(pos); field->charsetnr= uint2korr(pos);
field->length= (uint) uint4korr(pos+2); field->length= (uint) uint4korr(pos+2);
@ -3361,6 +3370,12 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql->server_status=uint2korr(end+3); mysql->server_status=uint2korr(end+3);
mysql->server_capabilities|= uint2korr(end+5) << 16; mysql->server_capabilities|= uint2korr(end+5) << 16;
pkt_scramble_len= end[7]; pkt_scramble_len= end[7];
if (pkt_scramble_len < 0)
{
set_mysql_error(mysql, CR_MALFORMED_PACKET,
unknown_sqlstate); /* purecov: inspected */
goto error;
}
} }
end+= 18; end+= 18;
@ -3896,7 +3911,7 @@ get_info:
if (!(fields=cli_read_rows(mysql,(MYSQL_FIELD*)0, protocol_41(mysql) ? 7:5))) if (!(fields=cli_read_rows(mysql,(MYSQL_FIELD*)0, protocol_41(mysql) ? 7:5)))
DBUG_RETURN(1); DBUG_RETURN(1);
if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc, if (!(mysql->fields=unpack_fields(mysql, fields,&mysql->field_alloc,
(uint) field_count,0, (uint) field_count,0,
mysql->server_capabilities))) mysql->server_capabilities)))
DBUG_RETURN(1); DBUG_RETURN(1);

View file

@ -9567,6 +9567,17 @@ Create_field::Create_field(Field *old_field,Field *orig_field)
geom_type= ((Field_geom*)old_field)->geom_type; geom_type= ((Field_geom*)old_field)->geom_type;
break; break;
#endif #endif
case MYSQL_TYPE_YEAR:
if (length != 4)
{
char buff[sizeof("YEAR()") + MY_INT64_NUM_DECIMAL_DIGITS + 1];
my_snprintf(buff, sizeof(buff), "YEAR(%lu)", length);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_WARN_DEPRECATED_SYNTAX,
ER(ER_WARN_DEPRECATED_SYNTAX),
buff, "YEAR(4)");
}
break;
default: default:
break; break;
} }

View file

@ -6490,7 +6490,17 @@ ha_rows ha_partition::min_rows_for_estimate()
DBUG_ENTER("ha_partition::min_rows_for_estimate"); DBUG_ENTER("ha_partition::min_rows_for_estimate");
tot_used_partitions= bitmap_bits_set(&m_part_info->used_partitions); tot_used_partitions= bitmap_bits_set(&m_part_info->used_partitions);
DBUG_ASSERT(tot_used_partitions);
/*
All partitions might have been left as unused during partition pruning
due to, for example, an impossible WHERE condition. Nonetheless, the
optimizer might still attempt to perform (e.g. range) analysis where an
estimate of the the number of rows is calculated using records_in_range.
Hence, to handle this and other possible cases, use zero as the minimum
number of rows to base the estimate on if no partition is being used.
*/
if (!tot_used_partitions)
DBUG_RETURN(0);
/* /*
Allow O(log2(tot_partitions)) increase in number of used partitions. Allow O(log2(tot_partitions)) increase in number of used partitions.

View file

@ -2554,8 +2554,19 @@ int handler::update_auto_increment()
reservation means potentially losing unused values). reservation means potentially losing unused values).
Note that in prelocked mode no estimation is given. Note that in prelocked mode no estimation is given.
*/ */
if ((auto_inc_intervals_count == 0) && (estimation_rows_to_insert > 0)) if ((auto_inc_intervals_count == 0) && (estimation_rows_to_insert > 0))
nb_desired_values= estimation_rows_to_insert; nb_desired_values= estimation_rows_to_insert;
else if ((auto_inc_intervals_count == 0) &&
(thd->lex->many_values.elements > 0))
{
/*
For multi-row inserts, if the bulk inserts cannot be started, the
handler::estimation_rows_to_insert will not be set. But we still
want to reserve the autoinc values.
*/
nb_desired_values= thd->lex->many_values.elements;
}
else /* go with the increasing defaults */ else /* go with the increasing defaults */
{ {
/* avoid overflow in formula, with this if() */ /* avoid overflow in formula, with this if() */
@ -5071,6 +5082,8 @@ int handler::ha_write_row(uchar *buf)
rows_changed++; rows_changed++;
if (unlikely(error= binlog_log_row(table, 0, buf, log_func))) if (unlikely(error= binlog_log_row(table, 0, buf, log_func)))
DBUG_RETURN(error); /* purecov: inspected */ DBUG_RETURN(error); /* purecov: inspected */
DEBUG_SYNC_C("ha_write_row_end");
DBUG_RETURN(0); DBUG_RETURN(0);
} }

View file

@ -6823,7 +6823,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
if (from_field != not_found_field) if (from_field != not_found_field)
{ {
Item_field* fld; Item_field* fld;
if (!(fld= new Item_field(from_field))) if (!(fld= new Item_field(thd, last_checked_context, from_field)))
goto error; goto error;
thd->change_item_tree(reference, fld); thd->change_item_tree(reference, fld);
mark_as_dependent(thd, last_checked_context->select_lex, mark_as_dependent(thd, last_checked_context->select_lex,

View file

@ -4866,8 +4866,8 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
} }
if (canDoTurboBM) if (canDoTurboBM)
{ {
pattern = first + 1;
pattern_len = (int) len - 2; pattern_len = (int) len - 2;
pattern = thd->strmake(first + 1, pattern_len);
DBUG_PRINT("info", ("Initializing pattern: '%s'", first)); DBUG_PRINT("info", ("Initializing pattern: '%s'", first));
int *suff = (int*) thd->alloc((int) (sizeof(int)* int *suff = (int*) thd->alloc((int) (sizeof(int)*
((pattern_len + 1)*2+ ((pattern_len + 1)*2+

View file

@ -2836,7 +2836,10 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
{ {
end= strxmov(buff, "# administrator command: ", NullS); end= strxmov(buff, "# administrator command: ", NullS);
buff_len= (ulong) (end - buff); buff_len= (ulong) (end - buff);
my_b_write(&log_file, (uchar*) buff, buff_len); DBUG_EXECUTE_IF("simulate_slow_log_write_error",
{DBUG_SET("+d,simulate_file_write_error");});
if(my_b_write(&log_file, (uchar*) buff, buff_len))
tmp_errno= errno;
} }
if (my_b_write(&log_file, (uchar*) sql_text, sql_text_len) || if (my_b_write(&log_file, (uchar*) sql_text, sql_text_len) ||
my_b_write(&log_file, (uchar*) ";\n",2) || my_b_write(&log_file, (uchar*) ";\n",2) ||
@ -2890,7 +2893,7 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period)
need_start_event(TRUE), need_start_event(TRUE),
group_commit_queue(0), group_commit_queue_busy(FALSE), group_commit_queue(0), group_commit_queue_busy(FALSE),
num_commits(0), num_group_commits(0), num_commits(0), num_group_commits(0),
sync_period_ptr(sync_period), sync_period_ptr(sync_period), sync_counter(0),
is_relay_log(0), signal_cnt(0), is_relay_log(0), signal_cnt(0),
checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF), checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF),
relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF), relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF),

View file

@ -1,5 +1,5 @@
/* /* Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2005, 2011, Oracle and/or its affiliates. Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View file

@ -1348,7 +1348,7 @@ failed my_b_read"));
Log_event *res= 0; Log_event *res= 0;
#ifndef max_allowed_packet #ifndef max_allowed_packet
THD *thd=current_thd; THD *thd=current_thd;
uint max_allowed_packet= thd ? thd->variables.max_allowed_packet : ~(ulong)0; uint max_allowed_packet= thd ? slave_max_allowed_packet:~(ulong)0;
#endif #endif
if (data_len > max_allowed_packet) if (data_len > max_allowed_packet)
@ -3218,24 +3218,41 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
pos= (const uchar*) end; // Break loop pos= (const uchar*) end; // Break loop
} }
} }
/**
Layout for the data buffer is as follows
+--------+-----------+------+------+---------+----+-------+
| catlog | time_zone | user | host | db name | \0 | Query |
+--------+-----------+------+------+---------+----+-------+
To support the query cache we append the following buffer to the above
+-------+----------------------------------------+-------+
|db len | uninitiatlized space of size of db len | FLAGS |
+-------+----------------------------------------+-------+
The area of buffer starting from Query field all the way to the end belongs
to the Query buffer and its structure is described in alloc_query() in
sql_parse.cc
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE) #if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE)
if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1
time_zone_len + 1 + + time_zone_len + 1
data_len + 1 + + user.length + 1
QUERY_CACHE_DB_LENGTH_SIZE + + host.length + 1
QUERY_CACHE_FLAGS_SIZE + + data_len + 1
user.length + 1 + + sizeof(size_t)//for db_len
host.length + 1 + + db_len + 1
db_len + 1, + QUERY_CACHE_DB_LENGTH_SIZE
MYF(MY_WME)))) + QUERY_CACHE_FLAGS_SIZE,
MYF(MY_WME))))
#else #else
if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1
time_zone_len + 1 + + time_zone_len + 1
data_len + 1 + + user.length + 1
user.length + 1 + + host.length + 1
host.length + 1, + data_len + 1,
MYF(MY_WME)))) MYF(MY_WME))))
#endif #endif
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
if (catalog_len) // If catalog is given if (catalog_len) // If catalog is given
@ -3275,6 +3292,14 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
db= (char *)start; db= (char *)start;
query= (char *)(start + db_len + 1); query= (char *)(start + db_len + 1);
q_len= data_len - db_len -1; q_len= data_len - db_len -1;
/**
Append the db length at the end of the buffer. This will be used by
Query_cache::send_result_to_client() in case the query cache is On.
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE)
size_t db_length= (size_t)db_len;
memcpy(start + data_len + 1, &db_length, sizeof(size_t));
#endif
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -3461,6 +3486,12 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{ {
Write_on_release_cache cache(&print_event_info->head_cache, file); Write_on_release_cache cache(&print_event_info->head_cache, file);
/**
reduce the size of io cache so that the write function is called
for every call to my_b_write().
*/
DBUG_EXECUTE_IF ("simulate_file_write_error",
{(&cache)->write_pos= (&cache)->write_end- 500;});
print_query_header(&cache, print_event_info); print_query_header(&cache, print_event_info);
my_b_write(&cache, (uchar*) query, q_len); my_b_write(&cache, (uchar*) query, q_len);
my_b_printf(&cache, "\n%s\n", print_event_info->delimiter); my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
@ -6205,6 +6236,9 @@ User_var_log_event::
User_var_log_event(const char* buf, User_var_log_event(const char* buf,
const Format_description_log_event* description_event) const Format_description_log_event* description_event)
:Log_event(buf, description_event) :Log_event(buf, description_event)
#ifndef MYSQL_CLIENT
, deferred(false)
#endif
{ {
/* The Post-Header is empty. The Variable Data part begins immediately. */ /* The Post-Header is empty. The Variable Data part begins immediately. */
const char *start= buf; const char *start= buf;
@ -6454,7 +6488,10 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
CHARSET_INFO *charset; CHARSET_INFO *charset;
if (rli->deferred_events_collecting) if (rli->deferred_events_collecting)
{
set_deferred();
return rli->deferred_events->add(this); return rli->deferred_events->add(this);
}
if (!(charset= get_charset(charset_number, MYF(MY_WME)))) if (!(charset= get_charset(charset_number, MYF(MY_WME))))
return 1; return 1;
@ -6506,7 +6543,8 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
return 0; return 0;
} }
} }
Item_func_set_user_var e(user_var_name, it);
Item_func_set_user_var *e= new Item_func_set_user_var(user_var_name, it);
/* /*
Item_func_set_user_var can't substitute something else on its place => Item_func_set_user_var can't substitute something else on its place =>
0 can be passed as last argument (reference on item) 0 can be passed as last argument (reference on item)
@ -6515,7 +6553,7 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
crash the server, so if fix fields fails, we just return with an crash the server, so if fix fields fails, we just return with an
error. error.
*/ */
if (e.fix_fields(thd, 0)) if (e->fix_fields(thd, 0))
return 1; return 1;
/* /*
@ -6523,9 +6561,10 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
a single record and with a single column. Thus, like a single record and with a single column. Thus, like
a column value, it could always have IMPLICIT derivation. a column value, it could always have IMPLICIT derivation.
*/ */
e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, e->update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT,
(flags & User_var_log_event::UNSIGNED_F)); (flags & User_var_log_event::UNSIGNED_F));
free_root(thd->mem_root,0); if (!is_deferred())
free_root(thd->mem_root, 0);
return 0; return 0;
} }
@ -6922,11 +6961,18 @@ void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info
{ {
Load_log_event::print(file, print_event_info, Load_log_event::print(file, print_event_info,
!check_fname_outside_temp_buf()); !check_fname_outside_temp_buf());
/* /**
That one is for "file_id: etc" below: in mysqlbinlog we want the #, in reduce the size of io cache so that the write function is called
SHOW BINLOG EVENTS we don't. for every call to my_b_printf().
*/ */
my_b_printf(&cache, "#"); DBUG_EXECUTE_IF ("simulate_create_event_write_error",
{(&cache)->write_pos= (&cache)->write_end;
DBUG_SET("+d,simulate_file_write_error");});
/*
That one is for "file_id: etc" below: in mysqlbinlog we want the #, in
SHOW BINLOG EVENTS we don't.
*/
my_b_printf(&cache, "#");
} }
my_b_printf(&cache, " file_id: %d block_len: %d\n", file_id, block_len); my_b_printf(&cache, " file_id: %d block_len: %d\n", file_id, block_len);
@ -7616,6 +7662,13 @@ void Execute_load_query_log_event::print(FILE* file,
Write_on_release_cache cache(&print_event_info->head_cache, file); Write_on_release_cache cache(&print_event_info->head_cache, file);
print_query_header(&cache, print_event_info); print_query_header(&cache, print_event_info);
/**
reduce the size of io cache so that the write function is called
for every call to my_b_printf().
*/
DBUG_EXECUTE_IF ("simulate_execute_event_write_error",
{(&cache)->write_pos= (&cache)->write_end;
DBUG_SET("+d,simulate_file_write_error");});
if (local_fname) if (local_fname)
{ {

View file

@ -284,6 +284,13 @@ struct sql_ex_info
MAX_SIZE_LOG_EVENT_STATUS + /* status */ \ MAX_SIZE_LOG_EVENT_STATUS + /* status */ \
NAME_LEN + 1) NAME_LEN + 1)
/*
The new option is added to handle large packets that are sent from the master
to the slave. It is used to increase the thd(max_allowed) for both the
DUMP thread on the master and the SQL/IO thread on the slave.
*/
#define MAX_MAX_ALLOWED_PACKET 1024*1024*1024
/* /*
Event header offsets; Event header offsets;
these point to places inside the fixed header. these point to places inside the fixed header.
@ -2666,6 +2673,7 @@ public:
bool is_null; bool is_null;
uchar flags; uchar flags;
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
bool deferred;
User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg, User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg,
char *val_arg, ulong val_len_arg, Item_result type_arg, char *val_arg, ulong val_len_arg, Item_result type_arg,
uint charset_number_arg, uchar flags_arg, uint charset_number_arg, uchar flags_arg,
@ -2673,7 +2681,7 @@ public:
:Log_event(thd_arg, 0, using_trans), :Log_event(thd_arg, 0, using_trans),
name(name_arg), name_len(name_len_arg), val(val_arg), name(name_arg), name_len(name_len_arg), val(val_arg),
val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg), val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg),
flags(flags_arg) flags(flags_arg), deferred(false)
{ {
is_null= !val; is_null= !val;
if (direct) if (direct)
@ -2690,6 +2698,13 @@ public:
Log_event_type get_type_code() { return USER_VAR_EVENT;} Log_event_type get_type_code() { return USER_VAR_EVENT;}
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
bool write(IO_CACHE* file); bool write(IO_CACHE* file);
/*
Getter and setter for deferred User-event.
Returns true if the event is not applied directly
and which case the applier adjusts execution path.
*/
bool is_deferred() { return deferred; }
void set_deferred() { deferred= val; }
#endif #endif
bool is_valid() const { return 1; } bool is_valid() const { return 1; }

View file

@ -477,6 +477,7 @@ ulonglong slave_type_conversions_options;
ulong thread_cache_size=0; ulong thread_cache_size=0;
ulonglong binlog_cache_size=0; ulonglong binlog_cache_size=0;
ulonglong max_binlog_cache_size=0; ulonglong max_binlog_cache_size=0;
ulong slave_max_allowed_packet= 0;
ulonglong binlog_stmt_cache_size=0; ulonglong binlog_stmt_cache_size=0;
ulonglong max_binlog_stmt_cache_size=0; ulonglong max_binlog_stmt_cache_size=0;
ulonglong query_cache_size=0; ulonglong query_cache_size=0;
@ -6371,7 +6372,7 @@ struct my_option my_long_options[]=
"will not do updates to tables in databases that start with foo and whose " "will not do updates to tables in databases that start with foo and whose "
"table names start with bar.", "table names start with bar.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).", {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing). Deprecated.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"safe-user-create", 0, {"safe-user-create", 0,
"Don't allow new user creation by the user who has no write privileges to the mysql.user table.", "Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
@ -7612,6 +7613,8 @@ mysqld_get_one_option(int optid,
#ifdef HAVE_QUERY_CACHE #ifdef HAVE_QUERY_CACHE
query_cache_size=0; query_cache_size=0;
#endif #endif
sql_print_warning("The syntax '--safe-mode' is deprecated and will be "
"removed in a future release.");
break; break;
case (int) OPT_SKIP_PRIOR: case (int) OPT_SKIP_PRIOR:
opt_specialflag|= SPECIAL_NO_PRIOR; opt_specialflag|= SPECIAL_NO_PRIOR;

View file

@ -170,6 +170,7 @@ extern ulong open_files_limit;
extern ulonglong binlog_cache_size, binlog_stmt_cache_size; extern ulonglong binlog_cache_size, binlog_stmt_cache_size;
extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size; extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
extern ulong max_binlog_size, max_relay_log_size; extern ulong max_binlog_size, max_relay_log_size;
extern ulong slave_max_allowed_packet;
extern ulong opt_binlog_rows_event_max_size; extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size; extern ulong rpl_recovery_rank, thread_cache_size;
extern ulong stored_program_cache_size; extern ulong stored_program_cache_size;

View file

@ -11804,9 +11804,10 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time)
have_min= TRUE; have_min= TRUE;
else if (min_max_item->sum_func() == Item_sum::MAX_FUNC) else if (min_max_item->sum_func() == Item_sum::MAX_FUNC)
have_max= TRUE; have_max= TRUE;
else if (min_max_item->sum_func() == Item_sum::COUNT_DISTINCT_FUNC || else if (is_agg_distinct &&
min_max_item->sum_func() == Item_sum::SUM_DISTINCT_FUNC || (min_max_item->sum_func() == Item_sum::COUNT_DISTINCT_FUNC ||
min_max_item->sum_func() == Item_sum::AVG_DISTINCT_FUNC) min_max_item->sum_func() == Item_sum::SUM_DISTINCT_FUNC ||
min_max_item->sum_func() == Item_sum::AVG_DISTINCT_FUNC))
continue; continue;
else else
DBUG_RETURN(NULL); DBUG_RETURN(NULL);

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. /* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2008, 2011, Monty Program Ab Copyright (c) 2008, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -775,6 +775,8 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
/* Store fixed length fields */ /* Store fixed length fields */
pos= (char*) local_packet->ptr()+local_packet->length(); pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields *pos++= 12; // Length of packed fields
/* inject a NULL to test the client */
DBUG_EXECUTE_IF("poison_rs_fields", pos[-1]= 0xfb;);
if (item->charset_for_protocol() == &my_charset_bin || thd_charset == NULL) if (item->charset_for_protocol() == &my_charset_bin || thd_charset == NULL)
{ {
/* No conversion */ /* No conversion */

View file

@ -272,7 +272,7 @@ private:
public: public:
Deferred_log_events(Relay_log_info *rli); Deferred_log_events(Relay_log_info *rli);
~Deferred_log_events(); ~Deferred_log_events();
/* queue for exection at Query-log-event time prior the Query */; /* queue for exection at Query-log-event time prior the Query */
int add(Log_event *ev); int add(Log_event *ev);
bool is_empty(); bool is_empty();
bool execute(Relay_log_info *rli); bool execute(Relay_log_info *rli);

View file

@ -2281,8 +2281,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
slave threads, since a replication event can become this much larger slave threads, since a replication event can become this much larger
than the corresponding packet (query) sent from client to master. than the corresponding packet (query) sent from client to master.
*/ */
thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet thd->variables.max_allowed_packet= slave_max_allowed_packet;
+ MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */
thd->slave_thread = 1; thd->slave_thread = 1;
thd->enable_slow_log= opt_log_slow_slave_statements; thd->enable_slow_log= opt_log_slow_slave_statements;
thd->variables.log_slow_filter= global_system_variables.log_slow_filter; thd->variables.log_slow_filter= global_system_variables.log_slow_filter;
@ -3070,6 +3069,7 @@ pthread_handler_t handle_slave_io(void *arg)
thread, since a replication event can become this much larger than thread, since a replication event can become this much larger than
the corresponding packet (query) sent from client to master. the corresponding packet (query) sent from client to master.
*/ */
thd->net.max_packet_size= slave_max_allowed_packet;
mysql->net.max_packet_size= thd->net.max_packet_size+= MAX_LOG_EVENT_HEADER; mysql->net.max_packet_size= thd->net.max_packet_size+= MAX_LOG_EVENT_HEADER;
} }
else else
@ -3202,12 +3202,12 @@ reading event"))
switch (mysql_error_number) { switch (mysql_error_number) {
case CR_NET_PACKET_TOO_LARGE: case CR_NET_PACKET_TOO_LARGE:
sql_print_error("\ sql_print_error("\
Log entry on master is longer than max_allowed_packet (%ld) on \ Log entry on master is longer than slave_max_allowed_packet (%lu) on \
slave. If the entry is correct, restart the server with a higher value of \ slave. If the entry is correct, restart the server with a higher value of \
max_allowed_packet", slave_max_allowed_packet",
thd->variables.max_allowed_packet); slave_max_allowed_packet);
mi->report(ERROR_LEVEL, ER_NET_PACKET_TOO_LARGE, mi->report(ERROR_LEVEL, ER_NET_PACKET_TOO_LARGE,
"%s", ER(ER_NET_PACKET_TOO_LARGE)); "%s", "Got a packet bigger than 'slave_max_allowed_packet' bytes");
goto err; goto err;
case ER_MASTER_FATAL_ERROR_READING_BINLOG: case ER_MASTER_FATAL_ERROR_READING_BINLOG:
mi->report(ERROR_LEVEL, ER_MASTER_FATAL_ERROR_READING_BINLOG, mi->report(ERROR_LEVEL, ER_MASTER_FATAL_ERROR_READING_BINLOG,

View file

@ -8044,6 +8044,7 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
int2store(end+3, mpvio->thd->server_status); int2store(end+3, mpvio->thd->server_status);
int2store(end+5, thd->client_capabilities >> 16); int2store(end+5, thd->client_capabilities >> 16);
end[7]= data_len; end[7]= data_len;
DBUG_EXECUTE_IF("poison_srv_handshake_scramble_len", end[7]= -100;);
bzero(end + 8, 10); bzero(end + 8, 10);
end+= 18; end+= 18;
/* write scramble tail */ /* write scramble tail */

View file

@ -5186,6 +5186,134 @@ show_query_type(THD::enum_binlog_query_type qtype)
} }
#endif #endif
/*
Constants required for the limit unsafe warnings suppression
*/
//seconds after which the limit unsafe warnings suppression will be activated
#define LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT 50
//number of limit unsafe warnings after which the suppression will be activated
#define LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT 50
static ulonglong limit_unsafe_suppression_start_time= 0;
static bool unsafe_warning_suppression_is_activated= false;
static int limit_unsafe_warning_count= 0;
/**
Auxiliary function to reset the limit unsafety warning suppression.
*/
static void reset_binlog_unsafe_suppression()
{
DBUG_ENTER("reset_binlog_unsafe_suppression");
unsafe_warning_suppression_is_activated= false;
limit_unsafe_warning_count= 0;
limit_unsafe_suppression_start_time= my_interval_timer()/10000000;
DBUG_VOID_RETURN;
}
/**
Auxiliary function to print warning in the error log.
*/
static void print_unsafe_warning_to_log(int unsafe_type, char* buf,
char* query)
{
DBUG_ENTER("print_unsafe_warning_in_log");
sprintf(buf, ER(ER_BINLOG_UNSAFE_STATEMENT),
ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type]));
sql_print_warning(ER(ER_MESSAGE_AND_STATEMENT), buf, query);
DBUG_VOID_RETURN;
}
/**
Auxiliary function to check if the warning for limit unsafety should be
thrown or suppressed. Details of the implementation can be found in the
comments inline.
SYNOPSIS:
@params
buf - buffer to hold the warning message text
unsafe_type - The type of unsafety.
query - The actual query statement.
TODO: Remove this function and implement a general service for all warnings
that would prevent flooding the error log.
*/
static void do_unsafe_limit_checkout(char* buf, int unsafe_type, char* query)
{
ulonglong now= 0;
DBUG_ENTER("do_unsafe_limit_checkout");
DBUG_ASSERT(unsafe_type == LEX::BINLOG_STMT_UNSAFE_LIMIT);
limit_unsafe_warning_count++;
/*
INITIALIZING:
If this is the first time this function is called with log warning
enabled, the monitoring the unsafe warnings should start.
*/
if (limit_unsafe_suppression_start_time == 0)
{
limit_unsafe_suppression_start_time= my_interval_timer()/10000000;
print_unsafe_warning_to_log(unsafe_type, buf, query);
}
else
{
if (!unsafe_warning_suppression_is_activated)
print_unsafe_warning_to_log(unsafe_type, buf, query);
if (limit_unsafe_warning_count >=
LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT)
{
now= my_interval_timer()/10000000;
if (!unsafe_warning_suppression_is_activated)
{
/*
ACTIVATION:
We got LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT warnings in
less than LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT we activate the
suppression.
*/
if ((now-limit_unsafe_suppression_start_time) <=
LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT)
{
unsafe_warning_suppression_is_activated= true;
DBUG_PRINT("info",("A warning flood has been detected and the limit \
unsafety warning suppression has been activated."));
}
else
{
/*
there is no flooding till now, therefore we restart the monitoring
*/
limit_unsafe_suppression_start_time= my_interval_timer()/10000000;
limit_unsafe_warning_count= 0;
}
}
else
{
/*
Print the suppression note and the unsafe warning.
*/
sql_print_information("The following warning was suppressed %d times \
during the last %d seconds in the error log",
limit_unsafe_warning_count,
(int)
(now-limit_unsafe_suppression_start_time));
print_unsafe_warning_to_log(unsafe_type, buf, query);
/*
DEACTIVATION: We got LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT
warnings in more than LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT, the
suppression should be deactivated.
*/
if ((now - limit_unsafe_suppression_start_time) >
LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT)
{
reset_binlog_unsafe_suppression();
DBUG_PRINT("info",("The limit unsafety warning supression has been \
deactivated"));
}
}
limit_unsafe_warning_count= 0;
}
}
DBUG_VOID_RETURN;
}
/** /**
Auxiliary method used by @c binlog_query() to raise warnings. Auxiliary method used by @c binlog_query() to raise warnings.
@ -5195,6 +5323,7 @@ show_query_type(THD::enum_binlog_query_type qtype)
*/ */
void THD::issue_unsafe_warnings() void THD::issue_unsafe_warnings()
{ {
char buf[MYSQL_ERRMSG_SIZE * 2];
DBUG_ENTER("issue_unsafe_warnings"); DBUG_ENTER("issue_unsafe_warnings");
/* /*
Ensure that binlog_unsafe_warning_flags is big enough to hold all Ensure that binlog_unsafe_warning_flags is big enough to hold all
@ -5220,17 +5349,16 @@ void THD::issue_unsafe_warnings()
ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type]));
if (global_system_variables.log_warnings) if (global_system_variables.log_warnings)
{ {
char buf[MYSQL_ERRMSG_SIZE * 2]; if (unsafe_type == LEX::BINLOG_STMT_UNSAFE_LIMIT)
sprintf(buf, ER(ER_BINLOG_UNSAFE_STATEMENT), do_unsafe_limit_checkout( buf, unsafe_type, query());
ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); else //cases other than LIMIT unsafety
sql_print_warning(ER(ER_MESSAGE_AND_STATEMENT), buf, query()); print_unsafe_warning_to_log(unsafe_type, buf, query());
} }
} }
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
/** /**
Log the current query. Log the current query.
@ -5406,3 +5534,4 @@ bool Discrete_intervals_list::append(Discrete_interval *new_interval)
} }
#endif /* !defined(MYSQL_CLIENT) */ #endif /* !defined(MYSQL_CLIENT) */

View file

@ -368,8 +368,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
} }
} }
} }
else /*
Don't try unlocking the row if skip_record reported an error since in
this case the transaction might have been rolled back already.
*/
else if (!thd->is_error())
table->file->unlock_row(); // Row failed selection, release lock on it table->file->unlock_row(); // Row failed selection, release lock on it
else
break;
} }
killed_status= thd->killed; killed_status= thd->killed;
if (killed_status != NOT_KILLED || thd->is_error()) if (killed_status != NOT_KILLED || thd->is_error())

View file

@ -907,7 +907,7 @@ bool plugin_is_ready(const LEX_STRING *name, int type)
} }
SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type) SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type)
{ {
LEX_STRING plugin_name= { (char *) name, len }; LEX_STRING plugin_name= { (char *) name, len };
return plugin_status(&plugin_name, type); return plugin_status(&plugin_name, type);

View file

@ -1,5 +1,5 @@
/* /* Copyright (c) 2005, 2012, Oracle and/or its affiliates.
Copyright (c) 2005, 2010, Oracle and/or its affiliates. Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -165,7 +165,7 @@ extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
extern bool plugin_register_builtin(struct st_mysql_plugin *plugin); extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
extern void plugin_thdvar_init(THD *thd); extern void plugin_thdvar_init(THD *thd);
extern void plugin_thdvar_cleanup(THD *thd); extern void plugin_thdvar_cleanup(THD *thd);
extern SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type); extern SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type);
extern bool check_valid_path(const char *path, size_t length); extern bool check_valid_path(const char *path, size_t length);
typedef my_bool (plugin_foreach_func)(THD *thd, typedef my_bool (plugin_foreach_func)(THD *thd,

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. /* Copyright (c) 2007, 2012, Oracle and/or its affiliates.
Copyright (c) 2008, 2011, Monty Program Ab Copyright (c) 2008, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -88,8 +88,8 @@ ST_FIELD_INFO query_profile_statistics_info[]=
int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table) int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
{ {
int profile_options = thd->lex->profile_options; uint profile_options = thd->lex->profile_options;
int fields_include_condition_truth_values[]= { uint fields_include_condition_truth_values[]= {
FALSE, /* Query_id */ FALSE, /* Query_id */
FALSE, /* Seq */ FALSE, /* Seq */
TRUE, /* Status */ TRUE, /* Status */

View file

@ -653,7 +653,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
heartbeat_ts= &heartbeat_buf; heartbeat_ts= &heartbeat_buf;
set_timespec_nsec(*heartbeat_ts, 0); set_timespec_nsec(*heartbeat_ts, 0);
} }
sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)", if (global_system_variables.log_warnings > 1)
sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)",
thd->server_id, log_ident, (ulong)pos); thd->server_id, log_ident, (ulong)pos);
if (RUN_HOOK(binlog_transmit, transmit_start, (thd, flags, log_ident, pos))) if (RUN_HOOK(binlog_transmit, transmit_start, (thd, flags, log_ident, pos)))
{ {
@ -765,7 +766,7 @@ impossible position";
this larger than the corresponding packet (query) sent this larger than the corresponding packet (query) sent
from client to master. from client to master.
*/ */
thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER; thd->variables.max_allowed_packet= MAX_MAX_ALLOWED_PACKET;
/* /*
We can set log_lock now, it does not move (it's a member of We can set log_lock now, it does not move (it's a member of

View file

@ -715,6 +715,8 @@ JOIN::prepare(Item ***rref_pointer_array,
if (having) if (having)
{ {
Query_arena backup, *arena;
arena= thd->activate_stmt_arena_if_needed(&backup);
nesting_map save_allow_sum_func= thd->lex->allow_sum_func; nesting_map save_allow_sum_func= thd->lex->allow_sum_func;
thd->where="having clause"; thd->where="having clause";
thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level; thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level;
@ -730,6 +732,10 @@ JOIN::prepare(Item ***rref_pointer_array,
(having->fix_fields(thd, &having) || (having->fix_fields(thd, &having) ||
having->check_cols(1))); having->check_cols(1)));
select_lex->having_fix_field= 0; select_lex->having_fix_field= 0;
select_lex->having= having;
if (arena)
thd->restore_active_arena(arena, &backup);
if (having_fix_rc || thd->is_error()) if (having_fix_rc || thd->is_error())
DBUG_RETURN(-1); /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */
thd->lex->allow_sum_func= save_allow_sum_func; thd->lex->allow_sum_func= save_allow_sum_func;
@ -16454,7 +16460,8 @@ int report_error(TABLE *table, int error)
Locking reads can legally return also these errors, do not Locking reads can legally return also these errors, do not
print them to the .err log print them to the .err log
*/ */
if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT) if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT
&& !table->in_use->killed)
{ {
push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN, error, push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN, error,
"Got error %d when reading table `%s`.`%s`", "Got error %d when reading table `%s`.`%s`",
@ -18861,6 +18868,14 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
/* Currently ORDER BY ... LIMIT is not supported in subqueries. */ /* Currently ORDER BY ... LIMIT is not supported in subqueries. */
DBUG_ASSERT(join->group_list || !join->is_in_subquery()); DBUG_ASSERT(join->group_list || !join->is_in_subquery());
/*
If we have a select->quick object that is created outside of
create_sort_index() and this is part of a subquery that
potentially can be executed multiple times then we should not
delete the quick object on exit from this function.
*/
bool keep_quick= select && select->quick && join->join_tab_save;
/* /*
When there is SQL_BIG_RESULT do not sort using index for GROUP BY, When there is SQL_BIG_RESULT do not sort using index for GROUP BY,
and thus force sorting on disk unless a group min-max optimization and thus force sorting on disk unless a group min-max optimization
@ -18912,6 +18927,7 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
get_quick_select_for_ref(thd, table, &tab->ref, get_quick_select_for_ref(thd, table, &tab->ref,
tab->found_records)))) tab->found_records))))
goto err; goto err;
DBUG_ASSERT(!keep_quick);
} }
} }
@ -18944,9 +18960,26 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
tablesort_result_cache= table->sort.io_cache; tablesort_result_cache= table->sort.io_cache;
table->sort.io_cache= NULL; table->sort.io_cache= NULL;
select->cleanup(); // filesort did select /*
table->quick_keys.clear_all(); // as far as we cleanup select->quick If a quick object was created outside of create_sort_index()
table->intersect_keys.clear_all(); that might be reused, then do not call select->cleanup() since
it will delete the quick object.
*/
if (!keep_quick)
{
select->cleanup();
/*
The select object should now be ready for the next use. If it
is re-used then there exists a backup copy of this join tab
which has the pointer to it. The join tab will be restored in
JOIN::reset(). So here we just delete the pointer to it.
*/
tab->select= NULL;
// If we deleted the quick select object we need to clear quick_keys
table->quick_keys.clear_all();
table->intersect_keys.clear_all();
}
// Restore the output resultset
table->sort.io_cache= tablesort_result_cache; table->sort.io_cache= tablesort_result_cache;
} }
tab->set_select_cond(NULL, __LINE__); tab->set_select_cond(NULL, __LINE__);

View file

@ -3225,9 +3225,12 @@ int make_db_list(THD *thd, List<LEX_STRING> *files,
/* /*
If we have db lookup vaule we just add it to list and If we have db lookup vaule we just add it to list and
exit from the function exit from the function.
We don't do this for database names longer than the maximum
path length.
*/ */
if (lookup_field_vals->db_value.str) if (lookup_field_vals->db_value.str &&
lookup_field_vals->db_value.length < FN_REFLEN)
{ {
if (is_infoschema_db(lookup_field_vals->db_value.str, if (is_infoschema_db(lookup_field_vals->db_value.str,
lookup_field_vals->db_value.length)) lookup_field_vals->db_value.length))

View file

@ -6096,8 +6096,26 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
} }
else else
{ {
MDL_request_list mdl_requests;
MDL_request target_db_mdl_request;
target_mdl_request.init(MDL_key::TABLE, new_db, new_name, target_mdl_request.init(MDL_key::TABLE, new_db, new_name,
MDL_EXCLUSIVE, MDL_TRANSACTION); MDL_EXCLUSIVE, MDL_TRANSACTION);
mdl_requests.push_front(&target_mdl_request);
/*
If we are moving the table to a different database, we also
need IX lock on the database name so that the target database
is protected by MDL while the table is moved.
*/
if (new_db != db)
{
target_db_mdl_request.init(MDL_key::SCHEMA, new_db, "",
MDL_INTENTION_EXCLUSIVE,
MDL_TRANSACTION);
mdl_requests.push_front(&target_db_mdl_request);
}
/* /*
Global intention exclusive lock must have been already acquired when Global intention exclusive lock must have been already acquired when
table to be altered was open, so there is no need to do it here. table to be altered was open, so there is no need to do it here.
@ -6106,14 +6124,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
"", "", "", "",
MDL_INTENTION_EXCLUSIVE)); MDL_INTENTION_EXCLUSIVE));
if (thd->mdl_context.try_acquire_lock(&target_mdl_request)) if (thd->mdl_context.acquire_locks(&mdl_requests,
thd->variables.lock_wait_timeout))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
if (target_mdl_request.ticket == NULL)
{
/* Table exists and is locked by some thread. */
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
DBUG_RETURN(TRUE);
}
DEBUG_SYNC(thd, "locked_table_name"); DEBUG_SYNC(thd, "locked_table_name");
/* /*
Table maybe does not exist, but we got an exclusive lock Table maybe does not exist, but we got an exclusive lock
@ -6539,11 +6553,23 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
the primary key is not added and dropped in the same statement. the primary key is not added and dropped in the same statement.
Otherwise we have to recreate the table. Otherwise we have to recreate the table.
need_copy_table is no-zero at this place. need_copy_table is no-zero at this place.
Also, in-place is not possible if we add a primary key
and drop another key in the same statement. If the drop fails,
we will not be able to revert adding of primary key.
*/ */
if ( pk_changed < 2 ) if ( pk_changed < 2 )
{ {
if ((alter_flags & needed_inplace_with_read_flags) == if ((needed_inplace_with_read_flags & HA_INPLACE_ADD_PK_INDEX_NO_WRITE) &&
needed_inplace_with_read_flags) index_drop_count > 0)
{
/*
Do copy, not in-place ALTER.
Avoid setting ALTER_TABLE_METADATA_ONLY.
*/
}
else if ((alter_flags & needed_inplace_with_read_flags) ==
needed_inplace_with_read_flags)
{ {
/* All required in-place flags to allow concurrent reads are present. */ /* All required in-place flags to allow concurrent reads are present. */
need_copy_table= ALTER_TABLE_METADATA_ONLY; need_copy_table= ALTER_TABLE_METADATA_ONLY;
@ -6821,17 +6847,38 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
Tell the handler to prepare for drop indexes. Tell the handler to prepare for drop indexes.
This re-numbers the indexes to get rid of gaps. This re-numbers the indexes to get rid of gaps.
*/ */
if ((error= table->file->prepare_drop_index(table, key_numbers, error= table->file->prepare_drop_index(table, key_numbers,
index_drop_count))) index_drop_count);
if (!error)
{ {
table->file->print_error(error, MYF(0)); /* Tell the handler to finally drop the indexes. */
goto err_new_table_cleanup; error= table->file->final_drop_index(table);
} }
/* Tell the handler to finally drop the indexes. */ if (error)
if ((error= table->file->final_drop_index(table)))
{ {
table->file->print_error(error, MYF(0)); table->file->print_error(error, MYF(0));
if (index_add_count) // Drop any new indexes added.
{
/*
Temporarily set table-key_info to include information about the
indexes added above that we now need to drop.
*/
KEY *save_key_info= table->key_info;
table->key_info= key_info_buffer;
if ((error= table->file->prepare_drop_index(table, index_add_buffer,
index_add_count)))
table->file->print_error(error, MYF(0));
else if ((error= table->file->final_drop_index(table)))
table->file->print_error(error, MYF(0));
table->key_info= save_key_info;
}
/*
Mark this TABLE instance as stale to avoid
out-of-sync index information.
*/
table->m_needs_reopen= true;
goto err_new_table_cleanup; goto err_new_table_cleanup;
} }
} }

View file

@ -5644,7 +5644,23 @@ type:
$$= MYSQL_TYPE_VARCHAR; $$= MYSQL_TYPE_VARCHAR;
} }
| YEAR_SYM opt_field_length field_options | YEAR_SYM opt_field_length field_options
{ $$=MYSQL_TYPE_YEAR; } {
if (Lex->length)
{
errno= 0;
ulong length= strtoul(Lex->length, NULL, 10);
if (errno == 0 && length <= MAX_FIELD_BLOBLENGTH && length != 4)
{
char buff[sizeof("YEAR()") + MY_INT64_NUM_DECIMAL_DIGITS + 1];
my_snprintf(buff, sizeof(buff), "YEAR(%lu)", length);
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_WARN_DEPRECATED_SYNTAX,
ER(ER_WARN_DEPRECATED_SYNTAX),
buff, "YEAR(4)");
}
}
$$=MYSQL_TYPE_YEAR;
}
| DATE_SYM | DATE_SYM
{ $$=MYSQL_TYPE_DATE; } { $$=MYSQL_TYPE_DATE; }
| TIME_SYM opt_field_length | TIME_SYM opt_field_length

View file

@ -48,6 +48,7 @@
#include <myisam.h> #include <myisam.h>
#include "log_slow.h" #include "log_slow.h"
#include "log_event.h"
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#include "../storage/perfschema/pfs_server.h" #include "../storage/perfschema/pfs_server.h"
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
@ -1052,6 +1053,14 @@ static Sys_var_ulong Sys_max_allowed_packet(
BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(check_max_allowed_packet)); ON_CHECK(check_max_allowed_packet));
static Sys_var_ulong Sys_slave_max_allowed_packet(
"slave_max_allowed_packet",
"The maximum packet length to sent successfully from the master to slave.",
GLOBAL_VAR(slave_max_allowed_packet), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1024, MAX_MAX_ALLOWED_PACKET),
DEFAULT(MAX_MAX_ALLOWED_PACKET),
BLOCK_SIZE(1024));
static Sys_var_ulonglong Sys_max_binlog_cache_size( static Sys_var_ulonglong Sys_max_binlog_cache_size(
"max_binlog_cache_size", "max_binlog_cache_size",
"Sets the total size of the transactional cache", "Sets the total size of the transactional cache",

View file

@ -39,6 +39,10 @@ void putLong(File file, uLong x);
uLong getLong(azio_stream *s); uLong getLong(azio_stream *s);
void read_header(azio_stream *s, unsigned char *buffer); void read_header(azio_stream *s, unsigned char *buffer);
#ifdef HAVE_PSI_INTERFACE
extern PSI_file_key arch_key_file_data;
#endif
/* =========================================================================== /* ===========================================================================
Opens a gzip (.gz) file for reading or writing. The mode parameter Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb"). The file is given either by file descriptor is as in fopen ("rb" or "wb"). The file is given either by file descriptor
@ -115,7 +119,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
s->stream.avail_out = AZ_BUFSIZE_WRITE; s->stream.avail_out = AZ_BUFSIZE_WRITE;
errno = 0; errno = 0;
s->file = fd < 0 ? my_open(path, Flags, MYF(0)) : fd; s->file = fd < 0 ? mysql_file_open(arch_key_file_data, path, Flags, MYF(0)) : fd;
DBUG_EXECUTE_IF("simulate_archive_open_failure", DBUG_EXECUTE_IF("simulate_archive_open_failure",
{ {
if (s->file >= 0) if (s->file >= 0)
@ -248,8 +252,8 @@ int get_byte(s)
if (s->stream.avail_in == 0) if (s->stream.avail_in == 0)
{ {
errno = 0; errno = 0;
s->stream.avail_in= (uInt) my_read(s->file, (uchar *)s->inbuf, s->stream.avail_in= (uInt) mysql_file_read(s->file, (uchar *)s->inbuf,
AZ_BUFSIZE_READ, MYF(0)); AZ_BUFSIZE_READ, MYF(0));
if (s->stream.avail_in == 0) if (s->stream.avail_in == 0)
{ {
s->z_eof = 1; s->z_eof = 1;
@ -290,7 +294,8 @@ void check_header(azio_stream *s)
if (len < 2) { if (len < 2) {
if (len) s->inbuf[0] = s->stream.next_in[0]; if (len) s->inbuf[0] = s->stream.next_in[0];
errno = 0; errno = 0;
len = (uInt)my_read(s->file, (uchar *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0)); len = (uInt)mysql_file_read(s->file, (uchar *)s->inbuf + len,
AZ_BUFSIZE_READ >> len, MYF(0));
if (len == (uInt)-1) s->z_err = Z_ERRNO; if (len == (uInt)-1) s->z_err = Z_ERRNO;
s->stream.avail_in += len; s->stream.avail_in += len;
s->stream.next_in = s->inbuf; s->stream.next_in = s->inbuf;
@ -481,7 +486,8 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error)
if (s->stream.avail_out > 0) if (s->stream.avail_out > 0)
{ {
s->stream.avail_out -= s->stream.avail_out -=
(uInt)my_read(s->file, (uchar *)next_out, s->stream.avail_out, MYF(0)); (uInt)mysql_file_read(s->file, (uchar *)next_out,
s->stream.avail_out, MYF(0));
} }
len -= s->stream.avail_out; len -= s->stream.avail_out;
s->in += len; s->in += len;
@ -494,7 +500,8 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error)
if (s->stream.avail_in == 0 && !s->z_eof) { if (s->stream.avail_in == 0 && !s->z_eof) {
errno = 0; errno = 0;
s->stream.avail_in = (uInt)my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0)); s->stream.avail_in = (uInt)mysql_file_read(s->file, (uchar *)s->inbuf,
AZ_BUFSIZE_READ, MYF(0));
if (s->stream.avail_in == 0) if (s->stream.avail_in == 0)
{ {
s->z_eof = 1; s->z_eof = 1;
@ -561,8 +568,8 @@ unsigned int azwrite (azio_stream *s, const voidp buf, unsigned int len)
{ {
s->stream.next_out = s->outbuf; s->stream.next_out = s->outbuf;
if (my_write(s->file, (uchar *)s->outbuf, AZ_BUFSIZE_WRITE, if (mysql_file_write(s->file, (uchar *)s->outbuf, AZ_BUFSIZE_WRITE,
MYF(0)) != AZ_BUFSIZE_WRITE) MYF(0)) != AZ_BUFSIZE_WRITE)
{ {
s->z_err = Z_ERRNO; s->z_err = Z_ERRNO;
break; break;
@ -609,7 +616,7 @@ int do_flush (azio_stream *s, int flush)
if (len != 0) if (len != 0)
{ {
s->check_point= my_tell(s->file, MYF(0)); s->check_point= my_tell(s->file, MYF(0));
if ((uInt)my_write(s->file, (uchar *)s->outbuf, len, MYF(0)) != len) if ((uInt)mysql_file_write(s->file, (uchar *)s->outbuf, len, MYF(0)) != len)
{ {
s->z_err = Z_ERRNO; s->z_err = Z_ERRNO;
return Z_ERRNO; return Z_ERRNO;
@ -796,7 +803,7 @@ void putLong (File file, uLong x)
for (n = 0; n < 4; n++) for (n = 0; n < 4; n++)
{ {
buffer[0]= (int)(x & 0xff); buffer[0]= (int)(x & 0xff);
my_write(file, buffer, 1, MYF(0)); mysql_file_write(file, buffer, 1, MYF(0));
x >>= 8; x >>= 8;
} }
} }

View file

@ -112,6 +112,10 @@ static HASH archive_open_tables;
#define DATA_BUFFER_SIZE 2 // Size of the data used in the data file #define DATA_BUFFER_SIZE 2 // Size of the data used in the data file
#define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption #define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption
#ifdef HAVE_PSI_INTERFACE
extern "C" PSI_file_key arch_key_file_data;
#endif
/* Static declarations for handerton */ /* Static declarations for handerton */
static handler *archive_create_handler(handlerton *hton, static handler *archive_create_handler(handlerton *hton,
TABLE_SHARE *table, TABLE_SHARE *table,
@ -157,6 +161,14 @@ static PSI_mutex_info all_archive_mutexes[]=
{ &az_key_mutex_ARCHIVE_SHARE_mutex, "ARCHIVE_SHARE::mutex", 0} { &az_key_mutex_ARCHIVE_SHARE_mutex, "ARCHIVE_SHARE::mutex", 0}
}; };
PSI_file_key arch_key_file_metadata, arch_key_file_data, arch_key_file_frm;
static PSI_file_info all_archive_files[]=
{
{ &arch_key_file_metadata, "metadata", 0},
{ &arch_key_file_data, "data", 0},
{ &arch_key_file_frm, "FRM", 0}
};
static void init_archive_psi_keys(void) static void init_archive_psi_keys(void)
{ {
const char* category= "archive"; const char* category= "archive";
@ -167,6 +179,9 @@ static void init_archive_psi_keys(void)
count= array_elements(all_archive_mutexes); count= array_elements(all_archive_mutexes);
PSI_server->register_mutex(category, all_archive_mutexes, count); PSI_server->register_mutex(category, all_archive_mutexes, count);
count= array_elements(all_archive_files);
PSI_server->register_file(category, all_archive_files, count);
} }
#endif /* HAVE_PSI_INTERFACE */ #endif /* HAVE_PSI_INTERFACE */
@ -260,7 +275,7 @@ int archive_discover(handlerton *hton, THD* thd, const char *db,
build_table_filename(az_file, sizeof(az_file) - 1, db, name, ARZ, 0); build_table_filename(az_file, sizeof(az_file) - 1, db, name, ARZ, 0);
if (!(my_stat(az_file, &file_stat, MYF(0)))) if (!(mysql_file_stat(arch_key_file_data, az_file, &file_stat, MYF(0))))
goto err; goto err;
if (!(azopen(&frm_stream, az_file, O_RDONLY|O_BINARY))) if (!(azopen(&frm_stream, az_file, O_RDONLY|O_BINARY)))
@ -723,7 +738,7 @@ int ha_archive::create(const char *name, TABLE *table_arg,
There is a chance that the file was "discovered". In this case There is a chance that the file was "discovered". In this case
just use whatever file is there. just use whatever file is there.
*/ */
if (!(my_stat(name_buff, &file_stat, MYF(0)))) if (!(mysql_file_stat(arch_key_file_data, name_buff, &file_stat, MYF(0))))
{ {
my_errno= 0; my_errno= 0;
if (!(azopen(&create_stream, name_buff, O_CREAT|O_RDWR|O_BINARY))) if (!(azopen(&create_stream, name_buff, O_CREAT|O_RDWR|O_BINARY)))
@ -740,19 +755,19 @@ int ha_archive::create(const char *name, TABLE *table_arg,
/* /*
Here is where we open up the frm and pass it to archive to store Here is where we open up the frm and pass it to archive to store
*/ */
if ((frm_file= my_open(name_buff, O_RDONLY, MYF(0))) > 0) if ((frm_file= mysql_file_open(arch_key_file_frm, name_buff, O_RDONLY, MYF(0))) >= 0)
{ {
if (!mysql_file_fstat(frm_file, &file_stat, MYF(MY_WME))) if (!mysql_file_fstat(frm_file, &file_stat, MYF(MY_WME)))
{ {
frm_ptr= (uchar *)my_malloc(sizeof(uchar) * (size_t)file_stat.st_size, MYF(0)); frm_ptr= (uchar *)my_malloc(sizeof(uchar) * (size_t)file_stat.st_size, MYF(0));
if (frm_ptr) if (frm_ptr)
{ {
my_read(frm_file, frm_ptr, (size_t)file_stat.st_size, MYF(0)); mysql_file_read(frm_file, frm_ptr, (size_t)file_stat.st_size, MYF(0));
azwrite_frm(&create_stream, (char *)frm_ptr, (size_t)file_stat.st_size); azwrite_frm(&create_stream, (char *)frm_ptr, (size_t)file_stat.st_size);
my_free(frm_ptr); my_free(frm_ptr);
} }
} }
my_close(frm_file, MYF(0)); mysql_file_close(frm_file, MYF(0));
} }
if (create_info->comment.str) if (create_info->comment.str)
@ -1615,7 +1630,7 @@ int ha_archive::info(uint flag)
{ {
MY_STAT file_stat; // Stat information for the data file MY_STAT file_stat; // Stat information for the data file
(void) my_stat(share->data_file_name, &file_stat, MYF(MY_WME)); (void) mysql_file_stat(arch_key_file_data, share->data_file_name, &file_stat, MYF(MY_WME));
if (flag & HA_STATUS_TIME) if (flag & HA_STATUS_TIME)
stats.update_time= (ulong) file_stat.st_mtime; stats.update_time= (ulong) file_stat.st_mtime;

View file

@ -42,6 +42,7 @@ Created 6/2/1994 Heikki Tuuri
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "trx0trx.h" #include "trx0trx.h"
#endif /* UNIV_HOTBACKUP */
/**************************************************************//** /**************************************************************//**
Report that an index page is corrupted. */ Report that an index page is corrupted. */
UNIV_INTERN UNIV_INTERN
@ -64,6 +65,7 @@ btr_corruption_report(
buf_page_print(buf_block_get_frame(block), 0, 0); buf_page_print(buf_block_get_frame(block), 0, 0);
} }
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
# include "srv0srv.h" # include "srv0srv.h"
# include "ut0rbt.h" # include "ut0rbt.h"
@ -1575,7 +1577,9 @@ btr_page_reorganize_low(
dict_index_t* index, /*!< in: record descriptor */ dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
#ifndef UNIV_HOTBACKUP
buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page); buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page);
#endif /* !UNIV_HOTBACKUP */
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
page_zip_des_t* page_zip = buf_block_get_page_zip(block); page_zip_des_t* page_zip = buf_block_get_page_zip(block);
buf_block_t* temp_block; buf_block_t* temp_block;

View file

@ -302,7 +302,6 @@ struct buf_chunk_struct{
was allocated for the frames */ was allocated for the frames */
buf_block_t* blocks; /*!< array of buffer control blocks */ buf_block_t* blocks; /*!< array of buffer control blocks */
}; };
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Gets the smallest oldest_modification lsn for any page in the pool. Returns Gets the smallest oldest_modification lsn for any page in the pool. Returns
@ -438,6 +437,7 @@ buf_block_alloc(
return(block); return(block);
} }
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Calculates a page checksum which is stored to the page when it is written Calculates a page checksum which is stored to the page when it is written
@ -3470,9 +3470,10 @@ buf_mark_space_corrupt(
/********************************************************************//** /********************************************************************//**
Completes an asynchronous read or write request of a file page to or from Completes an asynchronous read or write request of a file page to or from
the buffer pool. */ the buffer pool.
@return TRUE if successful */
UNIV_INTERN UNIV_INTERN
void ibool
buf_page_io_complete( buf_page_io_complete(
/*=================*/ /*=================*/
buf_page_t* bpage) /*!< in: pointer to the block in question */ buf_page_t* bpage) /*!< in: pointer to the block in question */
@ -3599,7 +3600,7 @@ corrupt:
table as corrupted instead of crashing server */ table as corrupted instead of crashing server */
if (bpage->space > TRX_SYS_SPACE if (bpage->space > TRX_SYS_SPACE
&& buf_mark_space_corrupt(bpage)) { && buf_mark_space_corrupt(bpage)) {
return; return(FALSE);
} else { } else {
fputs("InnoDB: Ending processing" fputs("InnoDB: Ending processing"
" because of" " because of"
@ -3689,6 +3690,8 @@ corrupt:
mutex_exit(buf_page_get_mutex(bpage)); mutex_exit(buf_page_get_mutex(bpage));
buf_pool_mutex_exit(buf_pool); buf_pool_mutex_exit(buf_pool);
return(TRUE);
} }
/*********************************************************************//** /*********************************************************************//**

View file

@ -2164,9 +2164,23 @@ buf_LRU_free_one_page(
be in a state where it can be freed; there be in a state where it can be freed; there
may or may not be a hash index to the page */ may or may not be a hash index to the page */
{ {
#ifdef UNIV_DEBUG
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
#endif
mutex_t* block_mutex = buf_page_get_mutex(bpage);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(mutex_own(block_mutex));
if (buf_LRU_block_remove_hashed_page(bpage, TRUE) if (buf_LRU_block_remove_hashed_page(bpage, TRUE)
!= BUF_BLOCK_ZIP_FREE) { != BUF_BLOCK_ZIP_FREE) {
buf_LRU_block_free_hashed_page((buf_block_t*) bpage); buf_LRU_block_free_hashed_page((buf_block_t*) bpage);
} else {
/* The block_mutex should have been released by
buf_LRU_block_remove_hashed_page() when it returns
BUF_BLOCK_ZIP_FREE. */
ut_ad(block_mutex == &buf_pool->zip_mutex);
mutex_enter(block_mutex);
} }
} }

View file

@ -50,6 +50,44 @@ read-ahead is not done: this is to prevent flooding the buffer pool with
i/o-fixed buffer blocks */ i/o-fixed buffer blocks */
#define BUF_READ_AHEAD_PEND_LIMIT 2 #define BUF_READ_AHEAD_PEND_LIMIT 2
/********************************************************************//**
Unfixes the pages, unlatches the page,
removes it from page_hash and removes it from LRU. */
static
void
buf_read_page_handle_error(
/*=======================*/
buf_page_t* bpage) /*!< in: pointer to the block */
{
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
const ibool uncompressed = (buf_page_get_state(bpage)
== BUF_BLOCK_FILE_PAGE);
/* First unfix and release lock on the bpage */
buf_pool_mutex_enter(buf_pool);
mutex_enter(buf_page_get_mutex(bpage));
ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_READ);
ut_ad(bpage->buf_fix_count == 0);
/* Set BUF_IO_NONE before we remove the block from LRU list */
buf_page_set_io_fix(bpage, BUF_IO_NONE);
if (uncompressed) {
rw_lock_x_unlock_gen(
&((buf_block_t*) bpage)->lock,
BUF_IO_READ);
}
/* remove the block from LRU list */
buf_LRU_free_one_page(bpage);
ut_ad(buf_pool->n_pend_reads > 0);
buf_pool->n_pend_reads--;
mutex_exit(buf_page_get_mutex(bpage));
buf_pool_mutex_exit(buf_pool);
}
/********************************************************************//** /********************************************************************//**
Low-level function which reads a page asynchronously from a file to the Low-level function which reads a page asynchronously from a file to the
buffer buf_pool if it is not already there, in which case does nothing. buffer buf_pool if it is not already there, in which case does nothing.
@ -152,12 +190,20 @@ buf_read_page_low(
((buf_block_t*) bpage)->frame, bpage); ((buf_block_t*) bpage)->frame, bpage);
} }
thd_wait_end(NULL); thd_wait_end(NULL);
if (*err == DB_TABLESPACE_DELETED) {
buf_read_page_handle_error(bpage);
return(0);
}
ut_a(*err == DB_SUCCESS); ut_a(*err == DB_SUCCESS);
if (sync) { if (sync) {
/* The i/o is already completed when we arrive from /* The i/o is already completed when we arrive from
fil_read */ fil_read */
buf_page_io_complete(bpage); if (!buf_page_io_complete(bpage)) {
return(0);
}
} }
return(1); return(1);

View file

@ -169,6 +169,7 @@ void
dict_field_print_low( dict_field_print_low(
/*=================*/ /*=================*/
const dict_field_t* field); /*!< in: field */ const dict_field_t* field); /*!< in: field */
#ifndef UNIV_HOTBACKUP
/*********************************************************************//** /*********************************************************************//**
Frees a foreign key struct. */ Frees a foreign key struct. */
static static
@ -182,7 +183,7 @@ and unique key errors */
UNIV_INTERN FILE* dict_foreign_err_file = NULL; UNIV_INTERN FILE* dict_foreign_err_file = NULL;
/* mutex protecting the foreign and unique error buffers */ /* mutex protecting the foreign and unique error buffers */
UNIV_INTERN mutex_t dict_foreign_err_mutex; UNIV_INTERN mutex_t dict_foreign_err_mutex;
#endif /* !UNIV_HOTBACKUP */
/******************************************************************//** /******************************************************************//**
Makes all characters in a NUL-terminated UTF-8 string lower case. */ Makes all characters in a NUL-terminated UTF-8 string lower case. */
UNIV_INTERN UNIV_INTERN
@ -2247,6 +2248,7 @@ dict_index_build_internal_non_clust(
return(new_index); return(new_index);
} }
#ifndef UNIV_HOTBACKUP
/*====================== FOREIGN KEY PROCESSING ========================*/ /*====================== FOREIGN KEY PROCESSING ========================*/
/*********************************************************************//** /*********************************************************************//**
@ -2511,6 +2513,7 @@ dict_foreign_find_equiv_index(
FALSE/* allow columns to be NULL */)); FALSE/* allow columns to be NULL */));
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Returns an index object by matching on the name and column names and Returns an index object by matching on the name and column names and
if more than one index matches return the index with the max id if more than one index matches return the index with the max id
@ -2570,6 +2573,7 @@ dict_table_get_index_by_max_id(
return(found); return(found);
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Report an error in a foreign key definition. */ Report an error in a foreign key definition. */
static static
@ -2735,6 +2739,7 @@ dict_foreign_add_to_cache(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//** /*********************************************************************//**
Scans from pointer onwards. Stops if is at the start of a copy of Scans from pointer onwards. Stops if is at the start of a copy of
'string' where characters are compared without case sensitivity, and 'string' where characters are compared without case sensitivity, and
@ -3214,6 +3219,7 @@ end_of_string:
} }
} }
#ifndef UNIV_HOTBACKUP
/*********************************************************************//** /*********************************************************************//**
Finds the highest [number] for foreign key constraints of the table. Looks Finds the highest [number] for foreign key constraints of the table. Looks
only at the >= 4.0.18-format id's, which are of the form only at the >= 4.0.18-format id's, which are of the form
@ -4050,7 +4056,7 @@ syntax_error:
} }
/*==================== END OF FOREIGN KEY PROCESSING ====================*/ /*==================== END OF FOREIGN KEY PROCESSING ====================*/
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Returns an index object if it is found in the dictionary cache. Returns an index object if it is found in the dictionary cache.
Assumes that dict_sys->mutex is already being held. Assumes that dict_sys->mutex is already being held.
@ -4411,6 +4417,7 @@ fake_statistics:
dict_table_stats_unlock(table, RW_X_LATCH); dict_table_stats_unlock(table, RW_X_LATCH);
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Prints info of a foreign key constraint. */ Prints info of a foreign key constraint. */
static static
@ -4441,6 +4448,7 @@ dict_foreign_print_low(
fputs(" )\n", stderr); fputs(" )\n", stderr);
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Prints a table data. */ Prints a table data. */
UNIV_INTERN UNIV_INTERN
@ -4622,6 +4630,7 @@ dict_field_print_low(
} }
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Outputs info on a foreign key of a table in a format suitable for Outputs info on a foreign key of a table in a format suitable for
CREATE TABLE. */ CREATE TABLE. */
@ -4810,6 +4819,7 @@ dict_print_info_on_foreign_keys(
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
} }
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//** /********************************************************************//**
Displays the names of the index and the table. */ Displays the names of the index and the table. */
UNIV_INTERN UNIV_INTERN
@ -4940,6 +4950,28 @@ dict_table_replace_index_in_foreign_list(
foreign->foreign_index = new_index; foreign->foreign_index = new_index;
} }
} }
for (foreign = UT_LIST_GET_FIRST(table->referenced_list);
foreign;
foreign = UT_LIST_GET_NEXT(referenced_list, foreign)) {
dict_index_t* new_index;
if (foreign->referenced_index == index) {
ut_ad(foreign->referenced_table == index->table);
new_index = dict_foreign_find_index(
foreign->referenced_table,
foreign->referenced_col_names,
foreign->n_fields, index,
/*check_charsets=*/TRUE, /*check_null=*/FALSE);
ut_ad(new_index || !trx->check_foreigns);
ut_ad(!new_index || new_index->table == index->table);
foreign->referenced_index = new_index;
}
}
} }
/**********************************************************************//** /**********************************************************************//**

View file

@ -33,8 +33,8 @@ Created 1/8/1996 Heikki Tuuri
#include "data0type.h" #include "data0type.h"
#include "mach0data.h" #include "mach0data.h"
#include "dict0dict.h" #include "dict0dict.h"
#include "ha_prototypes.h" /* innobase_casedn_str()*/
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
# include "ha_prototypes.h" /* innobase_casedn_str()*/
# include "lock0lock.h" # include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
@ -272,6 +272,7 @@ dict_mem_index_create(
return(index); return(index);
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************************//** /**********************************************************************//**
Creates and initializes a foreign constraint memory object. Creates and initializes a foreign constraint memory object.
@return own: foreign constraint struct */ @return own: foreign constraint struct */
@ -346,6 +347,7 @@ dict_mem_referenced_table_name_lookup_set(
} }
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//** /**********************************************************************//**
Adds a field definition to an index. NOTE: does not take a copy Adds a field definition to an index. NOTE: does not take a copy
of the column name if the field is a column. The memory occupied of the column name if the field is a column. The memory occupied

View file

@ -857,8 +857,10 @@ fil_node_close_file(
ut_a(node->open); ut_a(node->open);
ut_a(node->n_pending == 0); ut_a(node->n_pending == 0);
ut_a(node->n_pending_flushes == 0); ut_a(node->n_pending_flushes == 0);
#ifndef UNIV_HOTBACKUP
ut_a(node->modification_counter == node->flush_counter ut_a(node->modification_counter == node->flush_counter
|| srv_fast_shutdown == 2); || srv_fast_shutdown == 2);
#endif /* !UNIV_HOTBACKUP */
ret = os_file_close(node->handle); ret = os_file_close(node->handle);
ut_a(ret); ut_a(ret);

View file

@ -28,6 +28,7 @@ Created 8/22/1994 Heikki Tuuri
#include "ha0ha.ic" #include "ha0ha.ic"
#endif #endif
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
# include "buf0buf.h" # include "buf0buf.h"
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -51,17 +52,13 @@ ha_create_func(
hash table: must be a power of 2, or 0 */ hash table: must be a power of 2, or 0 */
{ {
hash_table_t* table; hash_table_t* table;
#ifndef UNIV_HOTBACKUP
ulint i; ulint i;
#endif /* !UNIV_HOTBACKUP */
ut_ad(ut_is_2pow(n_mutexes)); ut_ad(ut_is_2pow(n_mutexes));
table = hash_create(n); table = hash_create(n);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
table->adaptive = TRUE; table->adaptive = TRUE;
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
/* Creating MEM_HEAP_BTR_SEARCH type heaps can potentially fail, /* Creating MEM_HEAP_BTR_SEARCH type heaps can potentially fail,
but in practise it never should in this case, hence the asserts. */ but in practise it never should in this case, hence the asserts. */
@ -74,7 +71,6 @@ ha_create_func(
return(table); return(table);
} }
#ifndef UNIV_HOTBACKUP
hash_create_mutexes(table, n_mutexes, mutex_level); hash_create_mutexes(table, n_mutexes, mutex_level);
table->heaps = mem_alloc(n_mutexes * sizeof(void*)); table->heaps = mem_alloc(n_mutexes * sizeof(void*));
@ -83,7 +79,6 @@ ha_create_func(
table->heaps[i] = mem_heap_create_in_btr_search(4096); table->heaps[i] = mem_heap_create_in_btr_search(4096);
ut_a(table->heaps[i]); ut_a(table->heaps[i]);
} }
#endif /* !UNIV_HOTBACKUP */
return(table); return(table);
} }
@ -134,7 +129,6 @@ ha_insert_for_fold_func(
while (prev_node != NULL) { while (prev_node != NULL) {
if (prev_node->fold == fold) { if (prev_node->fold == fold) {
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
buf_block_t* prev_block = prev_node->block; buf_block_t* prev_block = prev_node->block;
ut_a(prev_block->frame ut_a(prev_block->frame
@ -143,7 +137,6 @@ ha_insert_for_fold_func(
prev_block->n_pointers--; prev_block->n_pointers--;
block->n_pointers++; block->n_pointers++;
} }
# endif /* !UNIV_HOTBACKUP */
prev_node->block = block; prev_node->block = block;
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
@ -171,11 +164,9 @@ ha_insert_for_fold_func(
ha_node_set_data(node, block, data); ha_node_set_data(node, block, data);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
block->n_pointers++; block->n_pointers++;
} }
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
node->fold = fold; node->fold = fold;
@ -217,13 +208,11 @@ ha_delete_hash_node(
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_ad(btr_search_enabled); ut_ad(btr_search_enabled);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
ut_a(del_node->block->frame = page_align(del_node->data)); ut_a(del_node->block->frame = page_align(del_node->data));
ut_a(del_node->block->n_pointers > 0); ut_a(del_node->block->n_pointers > 0);
del_node->block->n_pointers--; del_node->block->n_pointers--;
} }
# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
HASH_DELETE_AND_COMPACT(ha_node_t, next, table, del_node); HASH_DELETE_AND_COMPACT(ha_node_t, next, table, del_node);
@ -264,13 +253,11 @@ ha_search_and_update_if_found_func(
if (node) { if (node) {
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) { if (table->adaptive) {
ut_a(node->block->n_pointers > 0); ut_a(node->block->n_pointers > 0);
node->block->n_pointers--; node->block->n_pointers--;
new_block->n_pointers++; new_block->n_pointers++;
} }
# endif /* !UNIV_HOTBACKUP */
node->block = new_block; node->block = new_block;
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
@ -278,7 +265,6 @@ ha_search_and_update_if_found_func(
} }
} }
#ifndef UNIV_HOTBACKUP
/*****************************************************************//** /*****************************************************************//**
Removes from the chain determined by fold all nodes whose data pointer Removes from the chain determined by fold all nodes whose data pointer
points to the page given. */ points to the page given. */

View file

@ -47,6 +47,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include <sql_acl.h> // PROCESS_ACL #include <sql_acl.h> // PROCESS_ACL
#include <m_ctype.h> #include <m_ctype.h>
#include <debug_sync.h> // DEBUG_SYNC
#include <mysys_err.h> #include <mysys_err.h>
#include <mysql/plugin.h> #include <mysql/plugin.h>
#include <innodb_priv.h> #include <innodb_priv.h>
@ -5905,6 +5906,7 @@ ha_innobase::index_read(
ulint ret; ulint ret;
DBUG_ENTER("index_read"); DBUG_ENTER("index_read");
DEBUG_SYNC_C("ha_innobase_index_read_begin");
ut_a(prebuilt->trx == thd_to_trx(user_thd)); ut_a(prebuilt->trx == thd_to_trx(user_thd));
ut_ad(key_len != 0 || find_flag != HA_READ_KEY_EXACT); ut_ad(key_len != 0 || find_flag != HA_READ_KEY_EXACT);
@ -7718,6 +7720,8 @@ ha_innobase::rename_table(
error = innobase_rename_table(trx, from, to, TRUE); error = innobase_rename_table(trx, from, to, TRUE);
DEBUG_SYNC(thd, "after_innobase_rename_table");
/* Tell the InnoDB server that there might be work for /* Tell the InnoDB server that there might be work for
utility threads: */ utility threads: */
@ -8035,10 +8039,15 @@ innobase_get_mysql_key_number_for_index(
} }
} }
/* Print an error message if we cannot find the index /* If index_count in translation table is set to 0, it
** in the "index translation table". */ is possible we are in the process of rebuilding table,
sql_print_error("Cannot find index %s in InnoDB index " do not spit error in this case */
"translation table.", index->name); if (share->idx_trans_tbl.index_count) {
/* Print an error message if we cannot find the index
** in the "index translation table". */
sql_print_error("Cannot find index %s in InnoDB index "
"translation table.", index->name);
}
} }
/* If we do not have an "index translation table", or not able /* If we do not have an "index translation table", or not able
@ -11382,7 +11391,7 @@ static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity, static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
"Number of IOPs the server can do. Tunes the background IO rate", "Number of IOPs the server can do. Tunes the background IO rate",
NULL, NULL, 200, 100, ~0L, 0); NULL, NULL, 200, 100, ~0UL, 0);
static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size, static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size,
PLUGIN_VAR_OPCMDARG, PLUGIN_VAR_OPCMDARG,
@ -11499,7 +11508,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag, static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
"Desired maximum length of the purge queue (0 = no limit)", "Desired maximum length of the purge queue (0 = no limit)",
NULL, NULL, 0, 0, ~0L, 0); NULL, NULL, 0, 0, ~0UL, 0);
static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout, static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
@ -11561,7 +11570,7 @@ static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter, static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
"Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket", "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
NULL, NULL, 500L, 1L, ~0L, 0); NULL, NULL, 500L, 1L, ~0UL, 0);
static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads, static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR,
@ -11623,12 +11632,12 @@ static MYSQL_SYSVAR_LONG(open_files, innobase_open_files,
static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds, static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
"Count of spin-loop rounds in InnoDB mutexes (30 by default)", "Count of spin-loop rounds in InnoDB mutexes (30 by default)",
NULL, NULL, 30L, 0L, ~0L, 0); NULL, NULL, 30L, 0L, ~0UL, 0);
static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay, static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay,
PLUGIN_VAR_OPCMDARG, PLUGIN_VAR_OPCMDARG,
"Maximum delay between polling for a spin lock (6 by default)", "Maximum delay between polling for a spin lock (6 by default)",
NULL, NULL, 6L, 0L, ~0L, 0); NULL, NULL, 6L, 0L, ~0UL, 0);
static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
@ -11638,7 +11647,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay, static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
"Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep", "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep",
NULL, NULL, 10000L, 0L, ~0L, 0); NULL, NULL, 10000L, 0L, ~0UL, 0);
static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,

View file

@ -708,6 +708,10 @@ ha_innobase::add_index(
ut_a(indexed_table == prebuilt->table); ut_a(indexed_table == prebuilt->table);
if (indexed_table->tablespace_discarded) {
DBUG_RETURN(-1);
}
/* Check that index keys are sensible */ /* Check that index keys are sensible */
error = innobase_check_index_keys(key_info, num_of_keys, prebuilt->table); error = innobase_check_index_keys(key_info, num_of_keys, prebuilt->table);
@ -769,7 +773,7 @@ ha_innobase::add_index(
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
dict_locked = TRUE; dict_locked = TRUE;
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
/* If a new primary key is defined for the table we need /* If a new primary key is defined for the table we need
to drop the original table and rebuild all indexes. */ to drop the original table and rebuild all indexes. */
@ -805,7 +809,7 @@ ha_innobase::add_index(
} }
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, ut_d(dict_table_check_for_dup_indexes(prebuilt->table,
FALSE)); TRUE));
mem_heap_free(heap); mem_heap_free(heap);
trx_general_rollback_for_mysql(trx, NULL); trx_general_rollback_for_mysql(trx, NULL);
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
@ -1057,7 +1061,7 @@ ha_innobase::final_add_index(
trx_commit_for_mysql(prebuilt->trx); trx_commit_for_mysql(prebuilt->trx);
} }
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
trx_free_for_mysql(trx); trx_free_for_mysql(trx);
@ -1100,7 +1104,7 @@ ha_innobase::prepare_drop_index(
/* Test and mark all the indexes to be dropped */ /* Test and mark all the indexes to be dropped */
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
/* Check that none of the indexes have previously been flagged /* Check that none of the indexes have previously been flagged
for deletion. */ for deletion. */
@ -1271,7 +1275,7 @@ func_exit:
} while (index); } while (index);
} }
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
DBUG_RETURN(err); DBUG_RETURN(err);
@ -1318,7 +1322,7 @@ ha_innobase::final_drop_index(
prebuilt->table->flags, user_thd); prebuilt->table->flags, user_thd);
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
if (UNIV_UNLIKELY(err)) { if (UNIV_UNLIKELY(err)) {
@ -1362,7 +1366,7 @@ ha_innobase::final_drop_index(
share->idx_trans_tbl.index_count = 0; share->idx_trans_tbl.index_count = 0;
func_exit: func_exit:
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx_commit_for_mysql(prebuilt->trx); trx_commit_for_mysql(prebuilt->trx);
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);

View file

@ -92,6 +92,8 @@ insert/delete buffer when the record is not in the buffer pool. */
buffer when the record is not in the buffer pool. */ buffer when the record is not in the buffer pool. */
#define BTR_DELETE 8192 #define BTR_DELETE 8192
#endif /* UNIV_HOTBACKUP */
/**************************************************************//** /**************************************************************//**
Report that an index page is corrupted. */ Report that an index page is corrupted. */
UNIV_INTERN UNIV_INTERN
@ -112,6 +114,7 @@ btr_corruption_report(
ut_error; \ ut_error; \
} }
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
# include "ut0rbt.h" # include "ut0rbt.h"
/** An index->blobs entry for keeping track of off-page column references */ /** An index->blobs entry for keeping track of off-page column references */

View file

@ -39,6 +39,8 @@ typedef struct btr_cur_struct btr_cur_t;
/** B-tree search information for the adaptive hash index */ /** B-tree search information for the adaptive hash index */
typedef struct btr_search_struct btr_search_t; typedef struct btr_search_struct btr_search_t;
#ifndef UNIV_HOTBACKUP
/** @brief The latch protecting the adaptive search system /** @brief The latch protecting the adaptive search system
This latch protects the This latch protects the
@ -54,6 +56,8 @@ Bear in mind (3) and (4) when using the hash index.
*/ */
extern rw_lock_t* btr_search_latch_temp; extern rw_lock_t* btr_search_latch_temp;
#endif /* UNIV_HOTBACKUP */
/** The latch protecting the adaptive search system */ /** The latch protecting the adaptive search system */
#define btr_search_latch (*btr_search_latch_temp) #define btr_search_latch (*btr_search_latch_temp)

Some files were not shown because too many files have changed in this diff Show more