From 2afa7085e90a257d92f97c8c064cb26c6f95cfae Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Fri, 15 Jan 2010 17:52:46 +0000 Subject: [PATCH 01/54] BUG#49562: SBR out of sync when using numeric data types + user variable The User_var_log_event was not serializing the unsigned flag. This would cause the slave to always assume signed values. We fix this by extending the User_var_log_event to also contain information on the unsigned_flag, meaning that it gets into the binlog as well, therefore the slave will get this information as well. Events without information on unsigned flag (old events) are treated as they were before (always signed: unsigned_flag= FALSE). The information on the unsigned_flag, is shipped in an extra byte appended to the end of the User_var_log_event and added by this patch. This extra byte holds values for general purpose User_var_log_event flags which are now packed in the binlog as well. One of these flags contains information about whether the value is signed or unsigned (currently this extra byte is only used to hold data on the unsigned flag, in the future we can use it to pack extra flags if there is the need to). --- mysql-test/suite/rpl/r/rpl_slave_skip.result | 4 +- .../suite/rpl/r/rpl_stm_user_variables.result | 271 ++++++++++++++++++ .../suite/rpl/t/rpl_stm_user_variables.test | 146 ++++++++++ sql/log.cc | 9 +- sql/log_event.cc | 40 ++- sql/log_event.h | 10 +- 6 files changed, 470 insertions(+), 10 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_stm_user_variables.result create mode 100644 mysql-test/suite/rpl/t/rpl_stm_user_variables.test diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index 963b4d471dd..24000df40d2 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -118,7 +118,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 386 +Read_Master_Log_Pos 387 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -133,7 +133,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 386 +Exec_Master_Log_Pos 387 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result new file mode 100644 index 00000000000..5627283085c --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result @@ -0,0 +1,271 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +SET @positive= 18446744073709551615; +SET @negative= -9223372036854775808; +CREATE TABLE t1 (`tinyint` TINYINT, +`smallint` SMALLINT, +`mediumint` MEDIUMINT, +`integer` INTEGER, +`bigint` BIGINT, +`utinyint` TINYINT UNSIGNED, +`usmallint` SMALLINT UNSIGNED, +`umediumint` MEDIUMINT UNSIGNED, +`uinteger` INTEGER UNSIGNED, +`ubigint` BIGINT UNSIGNED, +`double` DOUBLE, +`float` FLOAT, +`real` REAL(30,2), +`decimal` DECIMAL(30,2)) ENGINE = MyISAM; +### insert max unsigned +### a) declarative +INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615);; +######################################### +#### [ on master ] +SELECT * FROM t1; +tinyint 127 +smallint 32767 +mediumint 8388607 +integer 2147483647 +bigint 9223372036854775807 +utinyint 255 +usmallint 65535 +umediumint 16777215 +uinteger 4294967295 +ubigint 18446744073709551615 +double 1.84467440737096e+19 +float 1.84467e+19 +real 18446744073709551616.00 +decimal 18446744073709551615.00 +#### [ on slave ] +SELECT * FROM t1; +tinyint 127 +smallint 32767 +mediumint 8388607 +integer 2147483647 +bigint 9223372036854775807 +utinyint 255 +usmallint 65535 +umediumint 16777215 +uinteger 4294967295 +ubigint 18446744073709551615 +double 1.84467440737096e+19 +float 1.84467e+19 +real 18446744073709551616.00 +decimal 18446744073709551615.00 +######################################### +## assertion: master and slave tables are in sync +Comparing tables master:test.t1 and slave:test.t1 +TRUNCATE t1; +### b) user var +INSERT INTO t1 VALUES (@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive); +######################################### +#### [ on master ] +SELECT * FROM t1; +tinyint 127 +smallint 32767 +mediumint 8388607 +integer 2147483647 +bigint 9223372036854775807 +utinyint 255 +usmallint 65535 +umediumint 16777215 +uinteger 4294967295 +ubigint 18446744073709551615 +double 1.84467440737096e+19 +float 1.84467e+19 +real 18446744073709551616.00 +decimal 18446744073709551615.00 +#### [ on slave ] +SELECT * FROM t1; +tinyint 127 +smallint 32767 +mediumint 8388607 +integer 2147483647 +bigint 9223372036854775807 +utinyint 255 +usmallint 65535 +umediumint 16777215 +uinteger 4294967295 +ubigint 18446744073709551615 +double 1.84467440737096e+19 +float 1.84467e+19 +real 18446744073709551616.00 +decimal 18446744073709551615.00 +######################################### +## assertion: master and slave tables are in sync +Comparing tables master:test.t1 and slave:test.t1 +TRUNCATE t1; +### insert min signed +### a) declarative +INSERT INTO t1 VALUES (-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808,-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808);; +######################################### +#### [ on master ] +SELECT * FROM t1; +tinyint -128 +smallint -32768 +mediumint -8388608 +integer -2147483648 +bigint -9223372036854775808 +utinyint 0 +usmallint 0 +umediumint 0 +uinteger 0 +ubigint 0 +double -9.22337203685478e+18 +float -9.22337e+18 +real -9223372036854775808.00 +decimal -9223372036854775808.00 +#### [ on slave ] +SELECT * FROM t1; +tinyint -128 +smallint -32768 +mediumint -8388608 +integer -2147483648 +bigint -9223372036854775808 +utinyint 0 +usmallint 0 +umediumint 0 +uinteger 0 +ubigint 0 +double -9.22337203685478e+18 +float -9.22337e+18 +real -9223372036854775808.00 +decimal -9223372036854775808.00 +######################################### +## assertion: master and slave tables are in sync +Comparing tables master:test.t1 and slave:test.t1 +TRUNCATE t1; +### b) user var +INSERT INTO t1 VALUES (@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative); +######################################### +#### [ on master ] +SELECT * FROM t1; +tinyint -128 +smallint -32768 +mediumint -8388608 +integer -2147483648 +bigint -9223372036854775808 +utinyint 0 +usmallint 0 +umediumint 0 +uinteger 0 +ubigint 0 +double -9.22337203685478e+18 +float -9.22337e+18 +real -9223372036854775808.00 +decimal -9223372036854775808.00 +#### [ on slave ] +SELECT * FROM t1; +tinyint -128 +smallint -32768 +mediumint -8388608 +integer -2147483648 +bigint -9223372036854775808 +utinyint 0 +usmallint 0 +umediumint 0 +uinteger 0 +ubigint 0 +double -9.22337203685478e+18 +float -9.22337e+18 +real -9223372036854775808.00 +decimal -9223372036854775808.00 +######################################### +## assertion: master and slave tables are in sync +Comparing tables master:test.t1 and slave:test.t1 +TRUNCATE t1; +## check: contents of both tables master's and slave's +## assertion: checks that User_var_log_event::pack_info correctly +## displays the binlog content by taking into account the +## unsigned_flag +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (`tinyint` TINYINT, +`smallint` SMALLINT, +`mediumint` MEDIUMINT, +`integer` INTEGER, +`bigint` BIGINT, +`utinyint` TINYINT UNSIGNED, +`usmallint` SMALLINT UNSIGNED, +`umediumint` MEDIUMINT UNSIGNED, +`uinteger` INTEGER UNSIGNED, +`ubigint` BIGINT UNSIGNED, +`double` DOUBLE, +`float` FLOAT, +`real` REAL(30,2), +`decimal` DECIMAL(30,2)) ENGINE = MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # User var # # @`positive`=18446744073709551615 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808,-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # User var # # @`negative`=-9223372036854775808 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test new file mode 100644 index 00000000000..d90ee09c720 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test @@ -0,0 +1,146 @@ +# +# BUG#49562: SBR out of sync when using numeric data types + user variable +# + +-- source include/master-slave.inc +-- source include/have_binlog_format_statement.inc + +## Setup user variables for several numeric types, so that we get +## coverage on the User_var_log_event different val types + +-- let $max_unsigned_long= 18446744073709551615 +-- let $min_signed_long= -9223372036854775808 +-- eval SET @positive= $max_unsigned_long +-- eval SET @negative= $min_signed_long + +CREATE TABLE t1 (`tinyint` TINYINT, + `smallint` SMALLINT, + `mediumint` MEDIUMINT, + `integer` INTEGER, + `bigint` BIGINT, + `utinyint` TINYINT UNSIGNED, + `usmallint` SMALLINT UNSIGNED, + `umediumint` MEDIUMINT UNSIGNED, + `uinteger` INTEGER UNSIGNED, + `ubigint` BIGINT UNSIGNED, + `double` DOUBLE, + `float` FLOAT, + `real` REAL(30,2), + `decimal` DECIMAL(30,2)) ENGINE = MyISAM; + +-- disable_warnings + +-- echo ### insert max unsigned +-- echo ### a) declarative +-- eval INSERT INTO t1 VALUES ($max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long,$max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long); + +-- echo ######################################### +-- echo #### [ on master ] +-- query_vertical SELECT * FROM t1 +-- sync_slave_with_master +-- echo #### [ on slave ] +-- query_vertical SELECT * FROM t1 +-- echo ######################################### +-- connection master +-- echo ## assertion: master and slave tables are in sync +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc +-- connection master +TRUNCATE t1; + +-- echo ### b) user var +INSERT INTO t1 VALUES (@positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive); + +-- echo ######################################### +-- echo #### [ on master ] +-- query_vertical SELECT * FROM t1 +-- sync_slave_with_master +-- echo #### [ on slave ] +-- query_vertical SELECT * FROM t1 +-- echo ######################################### +-- connection master +-- echo ## assertion: master and slave tables are in sync +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc +-- connection master +TRUNCATE t1; + + +-- echo ### insert min signed +-- echo ### a) declarative +-- eval INSERT INTO t1 VALUES ($min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long,$min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long); + +-- echo ######################################### +-- echo #### [ on master ] +-- query_vertical SELECT * FROM t1 +-- sync_slave_with_master +-- echo #### [ on slave ] +-- query_vertical SELECT * FROM t1 +-- echo ######################################### +-- connection master +-- echo ## assertion: master and slave tables are in sync +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc +-- connection master +TRUNCATE t1; + +-- echo ### b) user var +INSERT INTO t1 VALUES (@negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative); + +-- echo ######################################### +-- echo #### [ on master ] +-- query_vertical SELECT * FROM t1 +-- sync_slave_with_master +-- echo #### [ on slave ] +-- query_vertical SELECT * FROM t1 +-- echo ######################################### +-- connection master + +-- echo ## assertion: master and slave tables are in sync +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc +-- connection master +TRUNCATE t1; + +-- echo ## check: contents of both tables master's and slave's +-- enable_warnings + +-- echo ## assertion: checks that User_var_log_event::pack_info correctly +-- echo ## displays the binlog content by taking into account the +-- echo ## unsigned_flag +-- source include/show_binlog_events.inc + +## cleanup +-- connection master +DROP TABLE t1; +-- sync_slave_with_master diff --git a/sql/log.cc b/sql/log.cc index 8781fb03031..ba3aed64f21 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -4455,12 +4455,19 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) { BINLOG_USER_VAR_EVENT *user_var_event; get_dynamic(&thd->user_var_events,(uchar*) &user_var_event, i); + + /* setting flags for user var log event */ + uchar flags= User_var_log_event::UNDEF_F; + if (user_var_event->user_var_event->unsigned_flag) + flags|= User_var_log_event::UNSIGNED_F; + User_var_log_event e(thd, user_var_event->user_var_event->name.str, user_var_event->user_var_event->name.length, user_var_event->value, user_var_event->length, user_var_event->type, - user_var_event->charset_number); + user_var_event->charset_number, + flags); if (e.write(file)) goto err; } diff --git a/sql/log_event.cc b/sql/log_event.cc index ed47675d06a..e29eedb7611 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5460,7 +5460,9 @@ void User_var_log_event::pack_info(Protocol* protocol) case INT_RESULT: if (!(buf= (char*) my_malloc(val_offset + 22, MYF(MY_WME)))) return; - event_len= longlong10_to_str(uint8korr(val), buf + val_offset,-10)-buf; + event_len= longlong10_to_str(uint8korr(val), buf + val_offset, + ((flags & User_var_log_event::UNSIGNED_F) ? + 10 : -10))-buf; break; case DECIMAL_RESULT: { @@ -5518,12 +5520,14 @@ User_var_log_event(const char* buf, :Log_event(buf, description_event) { /* The Post-Header is empty. The Variable Data part begins immediately. */ + const char *start= buf; buf+= description_event->common_header_len + description_event->post_header_len[USER_VAR_EVENT-1]; name_len= uint4korr(buf); name= (char *) buf + UV_NAME_LEN_SIZE; buf+= UV_NAME_LEN_SIZE + name_len; is_null= (bool) *buf; + flags= User_var_log_event::UNDEF_F; // defaults to UNDEF_F if (is_null) { type= STRING_RESULT; @@ -5539,6 +5543,27 @@ User_var_log_event(const char* buf, UV_CHARSET_NUMBER_SIZE); val= (char *) (buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE + UV_CHARSET_NUMBER_SIZE + UV_VAL_LEN_SIZE); + + /** + We need to check if this is from an old server + that did not pack information for flags. + We do this by checking if there are extra bytes + after the packed value. If there are we take the + extra byte and it's value is assumed to contain + the flags value. + + Old events will not have this extra byte, thence, + we keep the flags set to UNDEF_F. + */ + uint bytes_read= ((val + val_len) - start); + DBUG_ASSERT(bytes_read==data_written || + bytes_read==(data_written-1)); + if ((data_written - bytes_read) > 0) + { + flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE + + UV_CHARSET_NUMBER_SIZE + UV_VAL_LEN_SIZE + + val_len); + } } } @@ -5550,6 +5575,7 @@ bool User_var_log_event::write(IO_CACHE* file) char buf1[UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE + UV_CHARSET_NUMBER_SIZE + UV_VAL_LEN_SIZE]; uchar buf2[max(8, DECIMAL_MAX_FIELD_SIZE + 2)], *pos= buf2; + uint unsigned_len= 0; uint buf1_length; ulong event_length; @@ -5571,6 +5597,7 @@ bool User_var_log_event::write(IO_CACHE* file) break; case INT_RESULT: int8store(buf2, *(longlong*) val); + unsigned_len= 1; break; case DECIMAL_RESULT: { @@ -5595,13 +5622,14 @@ bool User_var_log_event::write(IO_CACHE* file) } /* Length of the whole event */ - event_length= sizeof(buf)+ name_len + buf1_length + val_len; + event_length= sizeof(buf)+ name_len + buf1_length + val_len + unsigned_len; return (write_header(file, event_length) || my_b_safe_write(file, (uchar*) buf, sizeof(buf)) || my_b_safe_write(file, (uchar*) name, name_len) || my_b_safe_write(file, (uchar*) buf1, buf1_length) || - my_b_safe_write(file, pos, val_len)); + my_b_safe_write(file, pos, val_len) || + my_b_safe_write(file, (uchar*) &flags, unsigned_len)); } #endif @@ -5642,7 +5670,8 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) break; case INT_RESULT: char int_buf[22]; - longlong10_to_str(uint8korr(val), int_buf, -10); + longlong10_to_str(uint8korr(val), int_buf, + ((flags & User_var_log_event::UNSIGNED_F) ? 10 : -10)); my_b_printf(&cache, ":=%s%s\n", int_buf, print_event_info->delimiter); break; case DECIMAL_RESULT: @@ -5789,7 +5818,8 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli) a single record and with a single column. Thus, like a column value, it could always have IMPLICIT derivation. */ - e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, 0); + e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, + (flags & User_var_log_event::UNSIGNED_F)); free_root(thd->mem_root,0); return 0; diff --git a/sql/log_event.h b/sql/log_event.h index cba0264f4ae..9b91d826da7 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2483,6 +2483,10 @@ private: class User_var_log_event: public Log_event { public: + enum { + UNDEF_F= 0, + UNSIGNED_F= 1 + }; char *name; uint name_len; char *val; @@ -2490,12 +2494,14 @@ public: Item_result type; uint charset_number; bool is_null; + uchar flags; #ifndef MYSQL_CLIENT 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, - uint charset_number_arg) + uint charset_number_arg, uchar flags_arg) :Log_event(), 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) { is_null= !val; } void pack_info(Protocol* protocol); #else From fa816292ea0025ba48540d93a34d6c7e5e3c33e8 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Mon, 18 Jan 2010 09:11:28 +0000 Subject: [PATCH 02/54] BUG#49562: SBR out of sync when using numeric data types + user variable Incremental commit: 1. Moved part of the test case to binlog suite. 2. Removed cast set when writing the flags field. --- .../binlog/r/binlog_stm_user_variables.result | 156 ++++++++++++++++++ .../binlog/t/binlog_stm_user_variables.test | 86 ++++++++++ .../suite/rpl/r/rpl_stm_user_variables.result | 63 ------- .../suite/rpl/t/rpl_stm_user_variables.test | 5 - sql/log_event.cc | 2 +- 5 files changed, 243 insertions(+), 69 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_stm_user_variables.result create mode 100644 mysql-test/suite/binlog/t/binlog_stm_user_variables.test diff --git a/mysql-test/suite/binlog/r/binlog_stm_user_variables.result b/mysql-test/suite/binlog/r/binlog_stm_user_variables.result new file mode 100644 index 00000000000..90ce82d90fa --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_stm_user_variables.result @@ -0,0 +1,156 @@ +SET @positive= 18446744073709551615; +SET @negative= -9223372036854775808; +CREATE TABLE t1 (`tinyint` TINYINT, +`smallint` SMALLINT, +`mediumint` MEDIUMINT, +`integer` INTEGER, +`bigint` BIGINT, +`utinyint` TINYINT UNSIGNED, +`usmallint` SMALLINT UNSIGNED, +`umediumint` MEDIUMINT UNSIGNED, +`uinteger` INTEGER UNSIGNED, +`ubigint` BIGINT UNSIGNED, +`double` DOUBLE, +`float` FLOAT, +`real` REAL(30,2), +`decimal` DECIMAL(30,2)) ENGINE = MyISAM; +### insert max unsigned +### a) declarative +INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615);; +TRUNCATE t1; +### b) user var +INSERT INTO t1 VALUES (@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive); +## assertion: checks that User_var_log_event::pack_info +## correctly displays the binlog content by taking into +## account the unsigned_flag +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (`tinyint` TINYINT, +`smallint` SMALLINT, +`mediumint` MEDIUMINT, +`integer` INTEGER, +`bigint` BIGINT, +`utinyint` TINYINT UNSIGNED, +`usmallint` SMALLINT UNSIGNED, +`umediumint` MEDIUMINT UNSIGNED, +`uinteger` INTEGER UNSIGNED, +`ubigint` BIGINT UNSIGNED, +`double` DOUBLE, +`float` FLOAT, +`real` REAL(30,2), +`decimal` DECIMAL(30,2)) ENGINE = MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # User var # # @`positive`=18446744073709551615 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive) +master-bin.000001 # Query # # COMMIT +### insert min signed +### a) declarative +INSERT INTO t1 VALUES (-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808,-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808);; +TRUNCATE t1; +### b) user var +INSERT INTO t1 VALUES (@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative); +## assertion: checks that User_var_log_event::pack_info +## correctly displays the binlog content by taking into +## account the unsigned_flag +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (`tinyint` TINYINT, +`smallint` SMALLINT, +`mediumint` MEDIUMINT, +`integer` INTEGER, +`bigint` BIGINT, +`utinyint` TINYINT UNSIGNED, +`usmallint` SMALLINT UNSIGNED, +`umediumint` MEDIUMINT UNSIGNED, +`uinteger` INTEGER UNSIGNED, +`ubigint` BIGINT UNSIGNED, +`double` DOUBLE, +`float` FLOAT, +`real` REAL(30,2), +`decimal` DECIMAL(30,2)) ENGINE = MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # User var # # @`positive`=18446744073709551615 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive, +@positive) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808,-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # User var # # @`negative`=-9223372036854775808 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative, +@negative) +master-bin.000001 # Query # # COMMIT +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_stm_user_variables.test b/mysql-test/suite/binlog/t/binlog_stm_user_variables.test new file mode 100644 index 00000000000..7217eeb0d62 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_stm_user_variables.test @@ -0,0 +1,86 @@ +-- source include/have_binlog_format_statement.inc +# +# BUG#49562: SBR out of sync when using numeric data types + user variable +# + +-- let $max_unsigned_long= 18446744073709551615 +-- let $min_signed_long= -9223372036854775808 +-- eval SET @positive= $max_unsigned_long +-- eval SET @negative= $min_signed_long + +CREATE TABLE t1 (`tinyint` TINYINT, + `smallint` SMALLINT, + `mediumint` MEDIUMINT, + `integer` INTEGER, + `bigint` BIGINT, + `utinyint` TINYINT UNSIGNED, + `usmallint` SMALLINT UNSIGNED, + `umediumint` MEDIUMINT UNSIGNED, + `uinteger` INTEGER UNSIGNED, + `ubigint` BIGINT UNSIGNED, + `double` DOUBLE, + `float` FLOAT, + `real` REAL(30,2), + `decimal` DECIMAL(30,2)) ENGINE = MyISAM; + +-- echo ### insert max unsigned +-- echo ### a) declarative +-- disable_warnings +-- eval INSERT INTO t1 VALUES ($max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long,$max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long); +-- enable_warnings +TRUNCATE t1; + +-- echo ### b) user var +-- disable_warnings +INSERT INTO t1 VALUES (@positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive, + @positive); +-- enable_warnings + +-- echo ## assertion: checks that User_var_log_event::pack_info +-- echo ## correctly displays the binlog content by taking into +-- echo ## account the unsigned_flag +-- source include/show_binlog_events.inc + +-- echo ### insert min signed +-- echo ### a) declarative +-- disable_warnings +-- eval INSERT INTO t1 VALUES ($min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long,$min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long); +-- enable_warnings +TRUNCATE t1; + +-- echo ### b) user var +-- disable_warnings +INSERT INTO t1 VALUES (@negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative, + @negative); +-- enable_warnings + +-- echo ## assertion: checks that User_var_log_event::pack_info +-- echo ## correctly displays the binlog content by taking into +-- echo ## account the unsigned_flag +-- source include/show_binlog_events.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result index 5627283085c..7943268e30a 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result +++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result @@ -205,67 +205,4 @@ decimal -9223372036854775808.00 Comparing tables master:test.t1 and slave:test.t1 TRUNCATE t1; ## check: contents of both tables master's and slave's -## assertion: checks that User_var_log_event::pack_info correctly -## displays the binlog content by taking into account the -## unsigned_flag -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (`tinyint` TINYINT, -`smallint` SMALLINT, -`mediumint` MEDIUMINT, -`integer` INTEGER, -`bigint` BIGINT, -`utinyint` TINYINT UNSIGNED, -`usmallint` SMALLINT UNSIGNED, -`umediumint` MEDIUMINT UNSIGNED, -`uinteger` INTEGER UNSIGNED, -`ubigint` BIGINT UNSIGNED, -`double` DOUBLE, -`float` FLOAT, -`real` REAL(30,2), -`decimal` DECIMAL(30,2)) ENGINE = MyISAM -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # User var # # @`positive`=18446744073709551615 -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive, -@positive) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808,-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # User var # # @`negative`=-9223372036854775808 -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative, -@negative) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1 DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test index d90ee09c720..c58acdcb084 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test +++ b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test @@ -135,11 +135,6 @@ TRUNCATE t1; -- echo ## check: contents of both tables master's and slave's -- enable_warnings --- echo ## assertion: checks that User_var_log_event::pack_info correctly --- echo ## displays the binlog content by taking into account the --- echo ## unsigned_flag --- source include/show_binlog_events.inc - ## cleanup -- connection master DROP TABLE t1; diff --git a/sql/log_event.cc b/sql/log_event.cc index e29eedb7611..c085815b777 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5629,7 +5629,7 @@ bool User_var_log_event::write(IO_CACHE* file) my_b_safe_write(file, (uchar*) name, name_len) || my_b_safe_write(file, (uchar*) buf1, buf1_length) || my_b_safe_write(file, pos, val_len) || - my_b_safe_write(file, (uchar*) &flags, unsigned_len)); + my_b_safe_write(file, &flags, unsigned_len)); } #endif From 293848c4840a7ab2485c9de342e3c3572e77dae6 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 19 Jan 2010 23:16:22 +0000 Subject: [PATCH 03/54] BUG#49562: SBR out of sync when using numeric data types + user variable Post-push fix: missing 'reset master' at the beginning of the test would cause show binlog events to output events from previous tests. --- mysql-test/suite/binlog/r/binlog_stm_user_variables.result | 1 + mysql-test/suite/binlog/t/binlog_stm_user_variables.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/binlog/r/binlog_stm_user_variables.result b/mysql-test/suite/binlog/r/binlog_stm_user_variables.result index 90ce82d90fa..92a74f63ad9 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_user_variables.result +++ b/mysql-test/suite/binlog/r/binlog_stm_user_variables.result @@ -1,3 +1,4 @@ +RESET MASTER; SET @positive= 18446744073709551615; SET @negative= -9223372036854775808; CREATE TABLE t1 (`tinyint` TINYINT, diff --git a/mysql-test/suite/binlog/t/binlog_stm_user_variables.test b/mysql-test/suite/binlog/t/binlog_stm_user_variables.test index 7217eeb0d62..4bed6db6269 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_user_variables.test +++ b/mysql-test/suite/binlog/t/binlog_stm_user_variables.test @@ -1,4 +1,5 @@ -- source include/have_binlog_format_statement.inc +RESET MASTER; # # BUG#49562: SBR out of sync when using numeric data types + user variable # From b5a3b814021ab6c97d59685a33fa8ea2f4523341 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 20 Jan 2010 14:04:17 +0100 Subject: [PATCH 04/54] Bug #50362 comp_err crashes during compilation on FreeBSD. The reason for the crash is using uinitialized mutex attribute (MY_MUTEX_FAST_INIT) in pthread_mutex_init. The fix is to initialize the attribute before the first use. --- mysys/my_thr_init.c | 47 +++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 83d35863eca..236b694726f 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -88,6 +88,30 @@ my_bool my_thread_basic_global_init(void) return 0; my_thread_basic_global_init_done= 1; +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP + /* + Set mutex type to "fast" a.k.a "adaptive" + + In this case the thread may steal the mutex from some other thread + that is waiting for the same mutex. This will save us some + context switches but may cause a thread to 'starve forever' while + waiting for the mutex (not likely if the code within the mutex is + short). + */ + pthread_mutexattr_init(&my_fast_mutexattr); + pthread_mutexattr_settype(&my_fast_mutexattr, + PTHREAD_MUTEX_ADAPTIVE_NP); +#endif + +#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP + /* + Set mutex type to "errorcheck" + */ + pthread_mutexattr_init(&my_errorcheck_mutexattr); + pthread_mutexattr_settype(&my_errorcheck_mutexattr, + PTHREAD_MUTEX_ERRORCHECK); +#endif + mysql_mutex_init(key_THR_LOCK_malloc, &THR_LOCK_malloc, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_THR_LOCK_open, &THR_LOCK_open, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_THR_LOCK_charset, &THR_LOCK_charset, MY_MUTEX_INIT_FAST); @@ -190,29 +214,6 @@ my_bool my_thread_global_init(void) } #endif /* TARGET_OS_LINUX */ -#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP - /* - Set mutex type to "fast" a.k.a "adaptive" - - In this case the thread may steal the mutex from some other thread - that is waiting for the same mutex. This will save us some - context switches but may cause a thread to 'starve forever' while - waiting for the mutex (not likely if the code within the mutex is - short). - */ - pthread_mutexattr_init(&my_fast_mutexattr); - pthread_mutexattr_settype(&my_fast_mutexattr, - PTHREAD_MUTEX_ADAPTIVE_NP); -#endif -#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP - /* - Set mutex type to "errorcheck" - */ - pthread_mutexattr_init(&my_errorcheck_mutexattr); - pthread_mutexattr_settype(&my_errorcheck_mutexattr, - PTHREAD_MUTEX_ERRORCHECK); -#endif - mysql_mutex_init(key_THR_LOCK_lock, &THR_LOCK_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_THR_LOCK_isam, &THR_LOCK_isam, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_THR_LOCK_myisam, &THR_LOCK_myisam, MY_MUTEX_INIT_SLOW); From c99be56de3faf6164f77279aa9623db43c197f41 Mon Sep 17 00:00:00 2001 From: "Horst.Hunger" Date: Wed, 20 Jan 2010 14:22:49 +0100 Subject: [PATCH 05/54] due to merge. --- .../suite/sys_vars/r/delayed_insert_limit_func.result | 8 ++++---- .../suite/sys_vars/t/delayed_insert_limit_func.test | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result index 0496efa4296..10d9f0d71c3 100644 --- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result +++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result @@ -100,19 +100,19 @@ INSERT DELAYED INTO t1 VALUES('21'); INSERT DELAYED INTO t1 VALUES('22');| ** Connection con0 ** Asynchronous execute -SELECT COUNT(*) = 22 FROM t1; +SELECT COUNT(*) BETWEEN 6 AND 22 FROM t1; ** Connection default ** ** Wait till con0 is blocked ** UNLOCK TABLES; ** Connection con1 ** ** Connection con0 ** Asynchronous "reap" result -COUNT(*) = 22 +COUNT(*) BETWEEN 6 AND 22 1 ** Connection default** Checking if the delayed insert gives the same result afterwards -SELECT COUNT(*) = 22 FROM t1; -COUNT(*) = 22 +SELECT COUNT(*) BETWEEN 6 AND 22 FROM t1; +COUNT(*) BETWEEN 6 AND 22 1 ** Connection default** DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test index 88f247135c8..abe41f021a6 100644 --- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test +++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test @@ -205,7 +205,9 @@ let $wait_condition= WHERE variable_name like 'Not_flushed_delayed_rows'; --source include/wait_condition.inc --echo Asynchronous execute -let $my_select= SELECT COUNT(*) = 22 FROM t1; +# Due to performance and server behaveiour the test observes values between 6 and 22. +# In any case the value must not be outside of that range. +let $my_select= SELECT COUNT(*) BETWEEN 6 AND 22 FROM t1; send; eval $my_select; From 081a3726dd5e44f97abd0018cdb076f82adc9b61 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 20 Jan 2010 18:39:29 +0000 Subject: [PATCH 06/54] BUG#50473: rpl_sync fails on windows debug enabled binaries The test case was failing because it contained instructions to close/reopen files, when they were in use. This raises problems in windows. Example of such instruction: ---exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file The test also contains commands that are not platform agnostic. Example: --exec cat $MYSQLD_SLAVE_DATADIR/master.backup > \ $MYSQLD_SLAVE_DATADIR/master.info We fix this by just truncating the necessary file and write "failure" into it (ie, without closing the file). The platform specific instruction is removed from the test case as it seems redundant. --- mysql-test/suite/rpl/t/rpl_sync.test | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test index 80b6a144187..48c8dc02efb 100644 --- a/mysql-test/suite/rpl/t/rpl_sync.test +++ b/mysql-test/suite/rpl/t/rpl_sync.test @@ -64,8 +64,15 @@ stop slave IO_THREAD; source include/wait_for_slave_io_to_stop.inc; let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1); ---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR ---exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file + +--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file +perl; +$file= $ENV{'FILE_TO_CORRUPT'}; +open(FILE, ">$file") || die "Unable to open $file."; +truncate(FILE,0); +print FILE "failure"; +close ($file); +EOF --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect SET SESSION debug="d,crash_before_rotate_relaylog"; @@ -102,9 +109,6 @@ insert into t1(a) values(8); insert into t1(a) values(9); connection slave; ---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR ---exec cat $MYSQLD_SLAVE_DATADIR/master.backup > $MYSQLD_SLAVE_DATADIR/master.info - let MYSQLD_SLAVE_DATADIR=`select @@datadir`; --perl From 817ae11cc21e078a172686ee460782b5d7f882ab Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 21 Jan 2010 00:41:32 +0000 Subject: [PATCH 07/54] BUG#50474: rpl_slave_load_remove_tmpfile failed on windows debug enabled binary The test case injects an error in the server by deleting the temporary file that it uses during the load data statement execution. The error consisted of closing, deleting and setting the file descriptor to -1 right before calling mysql_file_write. Although, this error injection seems to work OK in Unix like environments, in Windows, this would cause the server to hit an assertion in 'my_get_open_flags': DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit) We fix this by changing the error injection to just call the macro my_delete_allow_opened, instead of the close + delete + set fd=-1. The macro deletes the file and is platform independent. Additionally, this required some changes to how the assertion is handled in the test case to make it cope with this change. --- .../r/rpl_slave_load_remove_tmpfile.result | 44 +------------------ .../rpl/t/rpl_slave_load_remove_tmpfile.test | 18 +++++--- sql/log_event.cc | 4 +- 3 files changed, 16 insertions(+), 50 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index 880fc9e8569..85fbcb69760 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -10,47 +10,7 @@ insert into t1(b) values (1); insert into t1(b) values (2); load data infile '../../std_data/rpl_loaddata.dat' into table t1; commit; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 9 -Last_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 9 -Last_SQL_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed -Replicate_Ignore_Server_Ids -Master_Server_Id 1 drop table t1; drop table t1; -call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3"); +call mtr.add_suppression("Slave: Can't get stat of .*"); +call mtr.add_suppression("Slave: File.* not found.*"); diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 437e1ebb92d..b85ed18ab51 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -33,10 +33,17 @@ commit; connection slave; source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # ---replace_regex /SQL_LOAD-[0-9]-[0-9]-[0-9]*/SQL_LOAD/ -query_vertical show slave status; +--let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1) +# windows and linux different error numbers here: +# Windows: +# - Last_Errno 29 (File not found) +# Unix like OS: +# - Last_Errno 13 (Can't stat file) +--let $assertion= `SELECT $error=29 OR $error=13` +if (!$assertion) +{ + --echo UNEXPECTED ERROR NUMBER: $error +} ########################################################################## # Clean up @@ -49,4 +56,5 @@ connection slave; drop table t1; -call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3"); +call mtr.add_suppression("Slave: Can't get stat of .*"); +call mtr.add_suppression("Slave: File.* not found.*"); diff --git a/sql/log_event.cc b/sql/log_event.cc index 985d2110c9b..758d0aad06f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6355,9 +6355,7 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli) DBUG_EXECUTE_IF("remove_slave_load_file_before_write", { - mysql_file_close(fd, MYF(0)); - fd= -1; - mysql_file_delete(0, fname, MYF(0)); + my_delete_allow_opened(fname, MYF(0)); }); if (mysql_file_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP))) From 4009bf1a15992ac0db2f369195c8ab6e46e35efc Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Thu, 21 Jan 2010 13:10:34 +0000 Subject: [PATCH 08/54] BUG#46364 MyISAM transbuffer problems (NTM problem) It is well-known that due to concurrency issues, a slave can become inconsistent when a transaction contains updates to both transaction and non-transactional tables. In a nutshell, the current code-base tries to preserve causality among the statements by writing non-transactional statements to the txn-cache which is flushed upon commit. However, modifications done to non-transactional tables on behalf of a transaction become immediately visible to other connections but may not immediately get into the binary log and therefore consistency may be broken. In general, it is impossible to automatically detect causality/dependency among statements by just analyzing the statements sent to the server. This happen because dependency may be hidden in the application code and it is necessary to know a priori all the statements processed in the context of a transaction such as in a procedure. Moreover, even for the few cases that we could automatically address in the server, the computation effort required could make the approach infeasible. So, in this patch we introduce the option - "--binlog-direct-non-transactional-updates" that can be used to bypass the current behavior in order to write directly to binary log statements that change non-transactional tables. Besides, it is used to enable the WL#2687 which is disabled by default. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error. mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test: Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache. It also fixes comments. mysql-test/extra/rpl_tests/rpl_mixing_engines.test: The STMT mode is unsafe when mixed-statements are executed thus making slaves to go out of sync. For that reason, it checks consistency if not in STMT mode. mysql-test/include/default_mysqld.cnf: Makes binlog-direct-non-transactional-updates "TRUE" by default in the test cases. mysql-test/r/mysqld--help-notwin.result: Updates the result file with the new option. mysql-test/r/mysqld--help-win.result: Updates the result file with the new option. mysql-test/suite/binlog/r/binlog_multi_engine.result: Updates the result file because non-trx-changes are written ahead of the transaction. mysql-test/suite/binlog/r/binlog_switch_inside_trans.result: Verifies if the user cannot change the opion binlog_direct_non_transactional_updates within a transaction or a procedure/function/trigger. mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. mysql-test/suite/binlog/t/binlog_switch_inside_trans.test: Verifies if the user cannot change the opion binlog_direct_non_transactional_updates within a transaction or a procedure/function/trigger. mysql-test/suite/ndb/r/ndb_binlog_format.result: Updates the result file because non-trx-changes are written ahead of the transaction. mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. mysql-test/suite/rpl/r/rpl_concurrency_error.result: Updates the result file because non-trx-changes are written ahead of the transaction mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result: Updates the result file because non-trx-changes are written ahead of the transaction. mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result: Updates the result file because non-trx-changes are written ahead of the transaction. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error. mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result: Updates the result file because non-trx-changes are written ahead of the transaction. mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result: Updates the result file because non-trx-changes are written ahead of the transaction. mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test: Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file. sql/log.cc: Verifies if changes should be written to either the trx-cache or non-trx-cache through the use of the function use_trans_cache(). It also organizes the code. sql/log.h: Changes the signature of some functions by adding the modifier "const" to the thd parameter. Specifically, the following functions are changed: bool trans_has_updated_trans_table(const THD* thd); bool stmt_has_updated_trans_table(const THD *thd); bool use_trans_cache(const THD*, bool is_transactional); sql/share/errmsg-utf8.txt: Creates error messages to report when an user tries to change the new option binlog_direct_non_transactional_updates within a transaction or a procedure/ function/trigger. sql/share/errmsg.txt: Creates error messages to report when an user tries to change the new option binlog_direct_non_transactional_updates within a transaction or a procedure/ function/trigger. sql/sql_class.h: Adds the new option binlog_direct_non_transactional_updates. sql/sys_vars.cc: Adds the new option binlog_direct_non_transactional_updates. support-files/my-small.cnf.sh: Adds binlog-direct-non-transactional-updates to the example file. By default the option is disabled. --- .../rpl_tests/rpl_binlog_max_cache_size.test | 41 +- .../rpl_tests/rpl_implicit_commit_binlog.test | 38 +- .../extra/rpl_tests/rpl_mixing_engines.test | 5 +- mysql-test/include/default_mysqld.cnf | 1 + mysql-test/r/mysqld--help-notwin.result | 9 + mysql-test/r/mysqld--help-win.result | 9 + .../suite/binlog/r/binlog_multi_engine.result | 4 +- ...sult => binlog_switch_inside_trans.result} | 51 +- .../t/binlog_stm_mix_innodb_myisam-master.opt | 2 +- ...s.test => binlog_switch_inside_trans.test} | 44 +- .../suite/ndb/r/ndb_binlog_format.result | 4 +- .../rpl/r/rpl_begin_commit_rollback.result | 1 + .../suite/rpl/r/rpl_concurrency_error.result | 16 +- .../r/rpl_mixed_implicit_commit_binlog.result | 4 +- .../rpl/r/rpl_mixed_mixing_engines.result | 18 + .../r/rpl_stm_binlog_max_cache_size.result | 7 +- .../r/rpl_stm_implicit_commit_binlog.result | 8 +- .../suite/rpl/r/rpl_stm_mixing_engines.result | 604 +++++++++++++----- .../rpl/r/rpl_stm_start_stop_slave.result | 1 + .../rpl/r/rpl_stm_stop_middle_group.result | 1 + .../rpl/t/rpl_begin_commit_rollback.test | 2 + .../suite/rpl/t/rpl_stm_start_stop_slave.test | 1 + .../rpl/t/rpl_stm_stop_middle_group.test | 1 + ...ect_non_transactional_updates_basic.result | 76 +++ ...irect_non_transactional_updates_basic.test | 97 +++ sql/log.cc | 150 +++-- sql/log.h | 5 +- sql/share/errmsg-utf8.txt | 5 + sql/share/errmsg.txt | 4 + sql/sql_class.h | 1 + sql/sys_vars.cc | 42 ++ support-files/my-small.cnf.sh | 7 + 32 files changed, 962 insertions(+), 297 deletions(-) rename mysql-test/suite/binlog/r/{binlog_format_switch_inside_trans.result => binlog_switch_inside_trans.result} (55%) rename mysql-test/suite/binlog/t/{binlog_format_switch_inside_trans.test => binlog_switch_inside_trans.test} (61%) create mode 100644 mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_basic.result create mode 100644 mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_basic.test diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test index 55dc7ca6514..3d8a8b9fb12 100644 --- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test +++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test @@ -344,30 +344,14 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (1, $data); --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t2 (a, data) VALUES (3, $data); -if (`SELECT @@binlog_format = 'STATEMENT'`) -{ - --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE - --eval INSERT INTO t1 (a, data) VALUES (4, $data); -} -if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) -{ - --eval INSERT INTO t1 (a, data) VALUES (4, $data); -} +--eval INSERT INTO t1 (a, data) VALUES (4, $data); --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (7, $data); -if (`SELECT @@binlog_format = 'STATEMENT'`) -{ - --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE - --eval UPDATE t2 SET data= CONCAT($data, $data); -} -if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) -{ - --eval UPDATE t2 SET data= CONCAT($data, $data); -} +--eval UPDATE t2 SET data= CONCAT($data, $data); --eval INSERT INTO t1 (a, data) VALUES (8, 's'); --eval INSERT INTO t1 (a, data) VALUES (9, 's'); --eval INSERT INTO t2 (a, data) VALUES (10, 's'); @@ -380,31 +364,12 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (15, $data); --eval INSERT INTO t1 (a, data) VALUES (16, $data); --eval INSERT INTO t2 (a, data) VALUES (17, $data); -if (`SELECT @@binlog_format = 'STATEMENT'`) -{ - --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE - --eval INSERT INTO t1 (a, data) VALUES (18, $data); -} -if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) -{ - --eval INSERT INTO t1 (a, data) VALUES (18, $data); -} +--eval INSERT INTO t1 (a, data) VALUES (18, $data); --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (19, $data); --enable_query_log COMMIT; -if (`SELECT @@binlog_format = 'STATEMENT'`) -{ - connection slave; - --source include/wait_for_slave_sql_to_stop.inc - - SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; - START SLAVE SQL_THREAD; - --source include/wait_for_slave_sql_to_start.inc - connection master; -} - let $diff_statement= SELECT * FROM t1; --source include/diff_master_slave.inc diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index 39d18b7403d..056b449b8fb 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -219,13 +219,12 @@ while (`SELECT $ddl_cases >= 1`) # in the binary log: # # 1: DDL EVENT which triggered the previous commmit. - # 2: COMMIT - # 3: BEGIN - # 4: TABLE MAP EVENT - # 5: TABLE MAP EVENT (ndb_apply_status) + # 2: BEGIN + # 3: TABLE MAP EVENT + # 4: TABLE MAP EVENT (ndb_apply_status) + # 5: ROW EVENT # 6: ROW EVENT - # 7: ROW EVENT - # 8: COMMIT + # 7: COMMIT # if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'`) { @@ -362,8 +361,11 @@ while (`SELECT $ddl_cases >= 1`) # does not commit the current transaction. # # 1: BEGIN - # 2: INSERT - # 3: CREATE TEMPORARY + # 2: CREATE TEMPORARY + # 3: COMMIT + # 4: BEGIN + # 5: INSERT + # 6: COMMIT # # In RBR the transaction is not committed either and the statement is not # written to the binary log: @@ -371,10 +373,11 @@ while (`SELECT $ddl_cases >= 1`) # 1: BEGIN # 2: TABLE MAP EVENT # 3: ROW EVENT + # 4: COMMIT # - if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) + if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'` ) { - let $commit_event_row_number= 4; + let $commit_event_row_number= 6; } # # In NDB (RBR mode), the commit event is the sixth event @@ -482,9 +485,14 @@ while (`SELECT $ddl_cases >= 1`) # In SBR and MIXED modes, the DDL statement is written to the binary log # but does not commit the current transaction: # + # In SBR, we have what follows: + # # 1: BEGIN - # 2: INSERT - # 3: DROP TEMPORARY + # 2: DROP TEMPORARY + # 3: COMMIT + # 4: BEGIN + # 5: INSERT + # 6: COMMIT # # In RBR the transaction is not committed either and the statement is not # written to the binary log: @@ -492,8 +500,13 @@ while (`SELECT $ddl_cases >= 1`) # 1: BEGIN # 2: TABLE MAP EVENT # 3: ROW EVENT + # 4: COMMIT # if (`select @@binlog_format = 'STATEMENT'`) + { + let $commit_event_row_number= 6; + } + if (`select @@binlog_format = 'ROW'`) { let $commit_event_row_number= 4; } @@ -503,6 +516,7 @@ while (`SELECT $ddl_cases >= 1`) # 2: TABLE MAP EVENT # 3: ROW EVENT # 4: DROP TEMPORARY table IF EXISTS + # 5: COMMIT # if (`select @@binlog_format = 'MIXED'`) { diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test index b8b2b1bc01b..5df1eaf37cc 100644 --- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test +++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test @@ -1767,7 +1767,10 @@ sync_slave_with_master; --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql ---diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql +if (`select @@session.binlog_format != 'STATEMENT'`) +{ + --diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql +} --echo ################################################################################### --echo # CLEAN diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index def14abf55a..c54ac93133b 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -44,3 +44,4 @@ log-bin=mysqld-bin # Run tests with the performance schema instrumentation loose-enable-performance-schema +binlog-direct-non-transactional-updates diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index bd26012873d..a66b722ba4b 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -37,6 +37,14 @@ The following options may be given as the first argument: binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance + --binlog-direct-non-transactional-updates + Causes updates to non-transactional engines using + statement format to be written directly to binary log. + Before using this option make sure that there are no + dependencies between transactional and non-transactional + tables such as in the statement INSERT INTO t_myisam + SELECT * FROM t_innodb; otherwise, slaves may diverge + from the master. --binlog-do-db=name Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned. @@ -768,6 +776,7 @@ back-log 50 big-tables FALSE bind-address (No default value) binlog-cache-size 32768 +binlog-direct-non-transactional-updates FALSE binlog-format STATEMENT binlog-row-event-max-size 1024 blackhole ON diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 7e261fc203c..16239a6326a 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -37,6 +37,14 @@ The following options may be given as the first argument: binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance + --binlog-direct-non-transactional-updates + Causes updates to non-transactional engines using + statement format to be written directly to binary log. + Before using this option make sure that there are no + dependencies between transactional and non-transactional + tables such as in the statement INSERT INTO t_myisam + SELECT * FROM t_innodb; otherwise, slaves may diverge + from the master. --binlog-do-db=name Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned. @@ -772,6 +780,7 @@ back-log 50 big-tables FALSE bind-address (No default value) binlog-cache-size 32768 +binlog-direct-non-transactional-updates FALSE binlog-format STATEMENT binlog-row-event-max-size 1024 blackhole ON diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index eee83183575..6668c3fa027 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -33,9 +33,11 @@ mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN +mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c +mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f -mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Table_map # # table_id: # (test.t1n) diff --git a/mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result b/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result similarity index 55% rename from mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result rename to mysql-test/suite/binlog/r/binlog_switch_inside_trans.result index c1e900053e4..57feb3f50f0 100644 --- a/mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result +++ b/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result @@ -1,4 +1,5 @@ set @save_binlog_format= @@global.binlog_format; +set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; SELECT @@session.binlog_format; @@ -8,19 +9,27 @@ SET AUTOCOMMIT=1; # Test that the session variable 'binlog_format' # is writable outside a transaction. set @@session.binlog_format= statement; +set @@session.binlog_direct_non_transactional_updates= TRUE; SELECT @@session.binlog_format; @@session.binlog_format STATEMENT +SELECT @@session.binlog_direct_non_transactional_updates; +@@session.binlog_direct_non_transactional_updates +1 begin; # Test that the session variable 'binlog_format' is read-only # inside a transaction with no preceding updates. set @@session.binlog_format= mixed; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +set @@session.binlog_direct_non_transactional_updates= FALSE; +ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction insert into t2 values (1); # Test that the session variable 'binlog_format' is read-only # inside a transaction with preceding transactional updates. set @@session.binlog_format= row; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +set @@session.binlog_direct_non_transactional_updates= FALSE; +ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction commit; begin; insert into t1 values (2); @@ -28,31 +37,47 @@ insert into t1 values (2); # inside a transaction with preceding non-transactional updates. set @@session.binlog_format= statement; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +set @@session.binlog_direct_non_transactional_updates= FALSE; +ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction commit; # Test that the session variable 'binlog_format' is writable # when AUTOCOMMIT=0, before a transaction has started. set AUTOCOMMIT=0; set @@session.binlog_format= row; +set @@session.binlog_direct_non_transactional_updates= FALSE; SELECT @@session.binlog_format; @@session.binlog_format ROW +SELECT @@session.binlog_direct_non_transactional_updates; +@@session.binlog_direct_non_transactional_updates +0 insert into t1 values (4); # Test that the session variable 'binlog_format' is read-only inside an # AUTOCOMMIT=0 transaction with preceding non-transactional updates. set @@session.binlog_format= statement; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +set @@session.binlog_direct_non_transactional_updates= TRUE; +ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction SELECT @@session.binlog_format; @@session.binlog_format ROW +SELECT @@session.binlog_direct_non_transactional_updates; +@@session.binlog_direct_non_transactional_updates +0 commit; insert into t2 values (5); # Test that the session variable 'binlog_format' is read-only inside an # AUTOCOMMIT=0 transaction with preceding transactional updates. set @@session.binlog_format= row; ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +set @@session.binlog_direct_non_transactional_updates= TRUE; +ERROR HY000: Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction SELECT @@session.binlog_format; @@session.binlog_format ROW +SELECT @@session.binlog_direct_non_transactional_updates; +@@session.binlog_direct_non_transactional_updates +0 commit; begin; insert into t2 values (6); @@ -62,15 +87,20 @@ SELECT @@global.binlog_format; @@global.binlog_format ROW set @@global.binlog_format= statement; +set @@global.binlog_direct_non_transactional_updates= TRUE; SELECT @@global.binlog_format; @@global.binlog_format STATEMENT +SELECT @@global.binlog_direct_non_transactional_updates; +@@global.binlog_direct_non_transactional_updates +1 commit; set @@global.binlog_format= @save_binlog_format; +set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; create table t5(a int) engine= innodb; -create trigger tr2 after insert on t3 for each row begin +create trigger tr1 after insert on t3 for each row begin insert into t4(a) values(1); set @@session.binlog_format= statement; insert into t4(a) values(2); @@ -83,8 +113,27 @@ ERROR HY000: Cannot change the binary logging format inside a stored function or SELECT @@session.binlog_format; @@session.binlog_format ROW +create table t6(a int, b int) engine= innodb; +create table t7(a int) engine= innodb; +create table t8(a int) engine= innodb; +create trigger tr2 after insert on t6 for each row begin +insert into t7(a) values(1); +set @@global.binlog_direct_non_transactional_updates= FALSE; +insert into t7(a) values(2); +insert into t8(a) values(3); +end | +# Test that the session variable 'binlog_format' is read-only +# in sub-statements. +insert into t6(a,b) values(1,1); +ERROR HY000: Cannot change the binlog direct flag inside a stored function or trigger +SELECT @@session.binlog_direct_non_transactional_updates; +@@session.binlog_direct_non_transactional_updates +0 drop table t1; drop table t2; drop table t3; drop table t4; drop table t5; +drop table t6; +drop table t7; +drop table t8; diff --git a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt index e76299453d3..5d0037fdc97 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt +++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt @@ -1 +1 @@ ---innodb_lock_wait_timeout=2 +--innodb_lock_wait_timeout=2 --binlog-direct-non-transactional-updates=FALSE diff --git a/mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test b/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test similarity index 61% rename from mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test rename to mysql-test/suite/binlog/t/binlog_switch_inside_trans.test index 8ae87d13a12..7b98b5cd0d5 100644 --- a/mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test +++ b/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test @@ -8,6 +8,7 @@ source include/have_innodb.inc; source include/have_binlog_format_row.inc; set @save_binlog_format= @@global.binlog_format; +set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; @@ -16,19 +17,25 @@ SET AUTOCOMMIT=1; --echo # Test that the session variable 'binlog_format' --echo # is writable outside a transaction. set @@session.binlog_format= statement; +set @@session.binlog_direct_non_transactional_updates= TRUE; SELECT @@session.binlog_format; +SELECT @@session.binlog_direct_non_transactional_updates; begin; --echo # Test that the session variable 'binlog_format' is read-only --echo # inside a transaction with no preceding updates. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= mixed; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT + set @@session.binlog_direct_non_transactional_updates= FALSE; insert into t2 values (1); --echo # Test that the session variable 'binlog_format' is read-only --echo # inside a transaction with preceding transactional updates. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= row; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT + set @@session.binlog_direct_non_transactional_updates= FALSE; commit; begin; @@ -37,20 +44,27 @@ begin; --echo # inside a transaction with preceding non-transactional updates. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= statement; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT + set @@session.binlog_direct_non_transactional_updates= FALSE; commit; --echo # Test that the session variable 'binlog_format' is writable --echo # when AUTOCOMMIT=0, before a transaction has started. set AUTOCOMMIT=0; set @@session.binlog_format= row; +set @@session.binlog_direct_non_transactional_updates= FALSE; SELECT @@session.binlog_format; +SELECT @@session.binlog_direct_non_transactional_updates; insert into t1 values (4); --echo # Test that the session variable 'binlog_format' is read-only inside an --echo # AUTOCOMMIT=0 transaction with preceding non-transactional updates. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= statement; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT +set @@session.binlog_direct_non_transactional_updates= TRUE; SELECT @@session.binlog_format; +SELECT @@session.binlog_direct_non_transactional_updates; commit; insert into t2 values (5); @@ -58,7 +72,10 @@ insert into t2 values (5); --echo # AUTOCOMMIT=0 transaction with preceding transactional updates. --error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT set @@session.binlog_format= row; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT +set @@session.binlog_direct_non_transactional_updates= TRUE; SELECT @@session.binlog_format; +SELECT @@session.binlog_direct_non_transactional_updates; commit; begin; @@ -67,16 +84,19 @@ begin; --echo # inside a transaction. SELECT @@global.binlog_format; set @@global.binlog_format= statement; + set @@global.binlog_direct_non_transactional_updates= TRUE; SELECT @@global.binlog_format; + SELECT @@global.binlog_direct_non_transactional_updates; commit; set @@global.binlog_format= @save_binlog_format; +set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; create table t5(a int) engine= innodb; delimiter |; -eval create trigger tr2 after insert on t3 for each row begin +eval create trigger tr1 after insert on t3 for each row begin insert into t4(a) values(1); set @@session.binlog_format= statement; insert into t4(a) values(2); @@ -90,9 +110,29 @@ delimiter ;| insert into t3(a,b) values(1,1); SELECT @@session.binlog_format; +create table t6(a int, b int) engine= innodb; +create table t7(a int) engine= innodb; +create table t8(a int) engine= innodb; +delimiter |; +eval create trigger tr2 after insert on t6 for each row begin + insert into t7(a) values(1); + set @@global.binlog_direct_non_transactional_updates= FALSE; + insert into t7(a) values(2); + insert into t8(a) values(3); +end | +delimiter ;| + +--echo # Test that the session variable 'binlog_format' is read-only +--echo # in sub-statements. +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT +insert into t6(a,b) values(1,1); +SELECT @@session.binlog_direct_non_transactional_updates; + drop table t1; drop table t2; drop table t3; drop table t4; drop table t5; - +drop table t6; +drop table t7; +drop table t8; diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result index 62d491bc94a..bd4a3291f03 100644 --- a/mysql-test/suite/ndb/r/ndb_binlog_format.result +++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result @@ -29,9 +29,11 @@ mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN +mysqld-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c +mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f -mysqld-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Table_map # # table_id: # (test.t3) diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result index 5be69177550..03fee144205 100644 --- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result +++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result @@ -6,6 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +SET @@session.binlog_direct_non_transactional_updates= FALSE; DROP DATABASE IF EXISTS db1; CREATE DATABASE db1; use db1; diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result index ae4fab7325c..80c4b694a79 100644 --- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result +++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result @@ -38,12 +38,14 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'yellow 2' WHERE i = 3 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 2' WHERE f = 'red' master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (2 * 10),"brown") -master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") master-bin.000001 # Query # # ROLLBACK SET AUTOCOMMIT = 1; BEGIN; @@ -63,12 +65,14 @@ COMMIT; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'gray 2' WHERE i = 3 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 2' WHERE f = 'red' master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (2 * 10),"brown") -master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") master-bin.000001 # Xid # # COMMIT /* XID */ SET AUTOCOMMIT = 0; UPDATE t SET f = 'yellow 1' WHERE i = 3; @@ -88,12 +92,14 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'yellow 1' WHERE i = 3 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 1' WHERE f = 'red' master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (1 * 10),"brown") -master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") master-bin.000001 # Query # # ROLLBACK SET AUTOCOMMIT = 0; UPDATE t SET f = 'gray 1' WHERE i = 3; @@ -111,12 +117,14 @@ COMMIT; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'gray 1' WHERE i = 3 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red' master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown") -master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") master-bin.000001 # Xid # # COMMIT /* XID */ source include/diff_master_slave.inc; source include/diff_master_slave.inc; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index 386274af7b2..82d8fc3b41a 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -393,8 +393,10 @@ CREATE TEMPORARY TABLE tt_xx (a int); -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index 7ee633c0776..8966366c7f0 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -11868,6 +11868,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -11875,6 +11878,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- @@ -11906,6 +11912,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK TO s1; @@ -11919,6 +11928,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- @@ -11942,6 +11954,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5); @@ -11953,6 +11968,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index 3d571f5b6fa..ddbd5177ec2 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -130,8 +130,8 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Got one of the listed errors Got one of the listed errors Got one of the listed errors -Got one of the listed errors -Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. COMMIT; @@ -139,10 +139,7 @@ BEGIN; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Got one of the listed errors -Got one of the listed errors COMMIT; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; -START SLAVE SQL_THREAD; source include/diff_master_slave.inc; ######################################################################################## # CLEAN diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result index 8e245db6c3c..0df07959146 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result @@ -393,8 +393,10 @@ CREATE TEMPORARY TABLE tt_xx (a int); -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- @@ -429,8 +431,10 @@ DROP TEMPORARY TABLE IF EXISTS new_tt_xx; -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8) master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS new_tt_xx +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index f393ac5634f..efcdff769c9 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -3610,20 +3610,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3638,20 +3642,24 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3668,20 +3676,24 @@ SELECT fc_i_nt_5_suc (135, 4); fc_i_nt_5_suc (135, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N-func C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3696,22 +3708,30 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (136, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3728,20 +3748,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3756,20 +3780,24 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3786,20 +3814,24 @@ SELECT fc_i_nt_5_suc (139, 4); fc_i_nt_5_suc (139, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3814,22 +3846,30 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (140, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3848,20 +3888,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3878,20 +3922,24 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3910,20 +3958,24 @@ SELECT fc_i_nt_5_suc (143, 4); fc_i_nt_5_suc (143, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3940,22 +3992,30 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (144, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- @@ -3972,6 +4032,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; @@ -3979,15 +4042,16 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -4002,6 +4066,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; @@ -4009,15 +4076,16 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- @@ -4034,6 +4102,9 @@ SELECT fc_i_nt_5_suc (147, 4); fc_i_nt_5_suc (147, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; @@ -4041,15 +4112,16 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- @@ -4064,6 +4136,12 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (148, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; @@ -4071,17 +4149,19 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- @@ -4192,20 +4272,24 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T Ne C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T Ne C << -e-e-e-e-e-e-e-e-e-e-e- @@ -4232,6 +4316,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4240,14 +4327,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4262,6 +4350,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4270,14 +4361,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4294,6 +4386,9 @@ SELECT fc_i_nt_5_suc (155, 4); fc_i_nt_5_suc (155, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4302,14 +4397,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2) master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4324,6 +4420,12 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (156, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4332,16 +4434,18 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4358,6 +4462,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4366,14 +4473,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4388,6 +4496,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4396,14 +4507,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4420,6 +4532,9 @@ SELECT fc_i_nt_5_suc (159, 4); fc_i_nt_5_suc (159, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4428,14 +4543,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2) master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4450,6 +4566,12 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (160, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4458,16 +4580,18 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4486,6 +4610,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4494,14 +4621,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(161,2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(161,2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(161,2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4518,6 +4646,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4526,14 +4657,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(162,2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(162,2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(162,2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4552,6 +4684,9 @@ SELECT fc_i_nt_5_suc (163, 4); fc_i_nt_5_suc (163, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4560,14 +4695,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(163,2) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(163,2) master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(163,2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4584,6 +4720,12 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (164, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4592,16 +4734,18 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(164,2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(164,2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(164,2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4618,6 +4762,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4627,15 +4774,16 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4650,6 +4798,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4659,15 +4810,16 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4684,6 +4836,9 @@ SELECT fc_i_nt_5_suc (167, 4); fc_i_nt_5_suc (167, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4693,15 +4848,16 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4716,6 +4872,12 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- CALL pc_i_nt_5_suc (168, 4); Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4725,17 +4887,19 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4844,6 +5008,9 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -4852,14 +5019,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T Ne R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T Ne R << -e-e-e-e-e-e-e-e-e-e-e- @@ -6936,20 +7104,24 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T tN C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T tN C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7177,20 +7349,24 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T tNe C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B T tNe C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7360,6 +7536,9 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -7368,14 +7547,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T tN R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T tN R << -e-e-e-e-e-e-e-e-e-e-e- @@ -7607,6 +7787,9 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -7615,14 +7798,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T tNe R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T tNe R << -e-e-e-e-e-e-e-e-e-e-e- @@ -7832,20 +8016,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B nT N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B nT N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7864,20 +8052,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NT N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B NT N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7894,20 +8086,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7924,20 +8120,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7956,20 +8156,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TN N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B TN N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -7986,20 +8190,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -8016,20 +8224,24 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -8119,21 +8331,25 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -8150,21 +8366,25 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -8181,21 +8401,25 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- @@ -8212,21 +8436,25 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N C << -e-e-e-e-e-e-e-e-e-e-e- @@ -8292,6 +8520,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8300,14 +8531,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B nT N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B nT N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8326,6 +8558,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8334,14 +8569,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NT N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B NT N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8358,6 +8594,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8366,14 +8605,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8390,6 +8630,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8398,14 +8641,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8424,6 +8668,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8432,14 +8679,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TN N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B TN N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8456,6 +8704,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8464,14 +8715,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8488,6 +8740,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8496,14 +8751,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8597,6 +8853,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8605,14 +8864,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8630,6 +8890,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8638,14 +8901,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8663,6 +8927,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8671,14 +8938,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8696,6 +8964,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; @@ -8704,14 +8975,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9801,6 +10073,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- SAVEPOINT s1; @@ -9821,7 +10096,6 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 @@ -9830,8 +10104,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 @@ -9855,6 +10131,9 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7); @@ -9872,7 +10151,6 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ @@ -9880,9 +10158,11 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 master-bin.000001 # Xid # # COMMIT /* XID */ @@ -10399,6 +10679,9 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6); @@ -10409,7 +10692,6 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10417,8 +10699,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10440,6 +10724,9 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6); @@ -10450,7 +10737,6 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10458,8 +10744,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10583,6 +10871,9 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6); @@ -10593,7 +10884,6 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10601,8 +10891,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10624,6 +10916,9 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6); @@ -10634,7 +10929,6 @@ COMMIT; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) -master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10642,8 +10936,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10751,20 +11047,24 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- @@ -10797,6 +11097,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK TO s1; @@ -10811,17 +11114,18 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- @@ -10847,6 +11151,9 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5); @@ -10857,15 +11164,16 @@ ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 5897735c74e..c2d644e4a7c 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +SET @@session.binlog_direct_non_transactional_updates= FALSE; call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); create table t1(n int); diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index 8d37686688a..59d6b919c3f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +SET @@session.binlog_direct_non_transactional_updates= FALSE; call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); create table tm (a int auto_increment primary key) engine=myisam; create table ti (a int auto_increment primary key) engine=innodb; diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test index 583268d0f65..d89b76bf44a 100644 --- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test @@ -8,6 +8,8 @@ call mtr.add_suppression("Unsafe statement binlogged in statement format since B connection master; call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +SET @@session.binlog_direct_non_transactional_updates= FALSE; + disable_warnings; DROP DATABASE IF EXISTS db1; enable_warnings; diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test index 067c4b7c9b6..7701cd7aa06 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -5,4 +5,5 @@ --source include/have_binlog_format_statement.inc --source include/have_innodb.inc +SET @@session.binlog_direct_non_transactional_updates= FALSE; --source ./extra/rpl_tests/rpl_start_stop_slave.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test index 649690ebbbe..dd3bf1a7f56 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test +++ b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test @@ -6,4 +6,5 @@ -- source include/have_innodb.inc -- source include/have_binlog_format_statement.inc +SET @@session.binlog_direct_non_transactional_updates= FALSE; -- source extra/rpl_tests/rpl_stop_middle_group.test diff --git a/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_basic.result b/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_basic.result new file mode 100644 index 00000000000..529c1aa59aa --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_basic.result @@ -0,0 +1,76 @@ +SELECT @@GLOBAL.binlog_direct_non_transactional_updates; +@@GLOBAL.binlog_direct_non_transactional_updates +1 +'#---------------------BS_STVARS_002_01----------------------#' +SET @start_value= @@global.binlog_direct_non_transactional_updates; +SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates); +COUNT(@@GLOBAL.binlog_direct_non_transactional_updates) +1 +1 Expected +SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates); +COUNT(@@SESSION.binlog_direct_non_transactional_updates) +1 +1 Expected +'#---------------------BS_STVARS_002_02----------------------#' +SET @@GLOBAL.binlog_direct_non_transactional_updates=TRUE; +SELECT @@GLOBAL.binlog_direct_non_transactional_updates; +@@GLOBAL.binlog_direct_non_transactional_updates +1 +SET @@SESSION.binlog_direct_non_transactional_updates=TRUE; +SELECT @@SESSION.binlog_direct_non_transactional_updates; +@@SESSION.binlog_direct_non_transactional_updates +1 +'#---------------------BS_STVARS_002_03----------------------#' +SELECT +IF(@@GLOBAL.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +IF(@@GLOBAL.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates); +COUNT(@@GLOBAL.binlog_direct_non_transactional_updates) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_002_04----------------------#' +SELECT +IF(@@SESSION.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +IF(@@SESSION.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates); +COUNT(@@SESSION.binlog_direct_non_transactional_updates) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_002_05----------------------#' +SELECT COUNT(@@binlog_direct_non_transactional_updates); +COUNT(@@binlog_direct_non_transactional_updates) +1 +1 Expected +SELECT COUNT(@@local.binlog_direct_non_transactional_updates); +COUNT(@@local.binlog_direct_non_transactional_updates) +1 +1 Expected +SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates); +COUNT(@@SESSION.binlog_direct_non_transactional_updates) +1 +1 Expected +SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates); +COUNT(@@GLOBAL.binlog_direct_non_transactional_updates) +1 +1 Expected +SET @@global.binlog_direct_non_transactional_updates= @start_value; diff --git a/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_basic.test b/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_basic.test new file mode 100644 index 00000000000..9381f022a6d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_basic.test @@ -0,0 +1,97 @@ +######### mysql-test\t\binlog_direct_non_transactional_updates.test ########### +# # +# Variable Name: binlog_direct_non_transactional_updates # +# Scope: Global & Session # +# Access Type: Static # +# Data Type: bool # +# # +# Description:Test Cases of Dynamic System Variable # +# binlog_direct_non_transactional_updates # +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +# # +# Reference: # +# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # +# # +############################################################################### + +SELECT @@GLOBAL.binlog_direct_non_transactional_updates; + +--echo '#---------------------BS_STVARS_002_01----------------------#' +#################################################################### +# Displaying default value # +#################################################################### +SET @start_value= @@global.binlog_direct_non_transactional_updates; + +SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates); +--echo 1 Expected + +SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates); +--echo 1 Expected + +--echo '#---------------------BS_STVARS_002_02----------------------#' +#################################################################### +# Check if Value can set # +#################################################################### +SET @@GLOBAL.binlog_direct_non_transactional_updates=TRUE; +SELECT @@GLOBAL.binlog_direct_non_transactional_updates; + +SET @@SESSION.binlog_direct_non_transactional_updates=TRUE; +SELECT @@SESSION.binlog_direct_non_transactional_updates; + +--echo '#---------------------BS_STVARS_002_03----------------------#' +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +SELECT +IF(@@GLOBAL.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_002_04----------------------#' +################################################################# +# Check if the value in SESSION Table matches value in variable # +################################################################# + +SELECT +IF(@@SESSION.binlog_direct_non_transactional_updates, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +--echo 1 Expected + +SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_direct_non_transactional_updates'; +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_002_05----------------------#' +################################################################################ +# Check if binlog_format can be accessed with and without @@ sign # +################################################################################ + +SELECT COUNT(@@binlog_direct_non_transactional_updates); +--echo 1 Expected +SELECT COUNT(@@local.binlog_direct_non_transactional_updates); +--echo 1 Expected +SELECT COUNT(@@SESSION.binlog_direct_non_transactional_updates); +--echo 1 Expected +SELECT COUNT(@@GLOBAL.binlog_direct_non_transactional_updates); +--echo 1 Expected + +SET @@global.binlog_direct_non_transactional_updates= @start_value; diff --git a/sql/log.cc b/sql/log.cc index 72d0ed43463..24a5caa9234 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -199,7 +199,7 @@ private: class binlog_cache_data { public: - binlog_cache_data(): m_pending(0), before_stmt_pos (MY_OFF_T_UNDEF), + binlog_cache_data(): m_pending(0), before_stmt_pos(MY_OFF_T_UNDEF), incident(FALSE) { cache_log.end_of_file= max_binlog_cache_size; @@ -1760,7 +1760,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) binlog_flush_stmt_cache(thd, cache_mngr); } - if (cache_mngr->trx_cache.empty()) + if (cache_mngr->trx_cache.empty()) { /* we're here because cache_log was flushed in MYSQL_BIN_LOG::log_xid() @@ -1769,7 +1769,6 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) DBUG_RETURN(0); } - if (mysql_bin_log.check_write_error(thd)) { /* @@ -1909,7 +1908,7 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv) non-transactional table. Otherwise, truncate the binlog cache starting from the SAVEPOINT command. */ - if (unlikely(thd->transaction.all.modified_non_trans_table || + if (unlikely(thd->transaction.all.modified_non_trans_table || (thd->variables.option_bits & OPTION_KEEP_LOG))) { int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); @@ -4191,6 +4190,66 @@ bool MYSQL_BIN_LOG::is_query_in_union(THD *thd, query_id_t query_id_param) query_id_param >= thd->binlog_evt_union.first_query_id); } +/** + This function checks if a transactional talbe was updated by the + current transaction. + + @param thd The client thread that executed the current statement. + @return + @c true if a transactional table was updated, @c false otherwise. +*/ +bool +trans_has_updated_trans_table(const THD* thd) +{ + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + + return (cache_mngr ? my_b_tell (&cache_mngr->trx_cache.cache_log) : 0); +} + +/** + This function checks if a transactional talbe was updated by the + current statement. + + @param thd The client thread that executed the current statement. + @return + @c true if a transactional table was updated, @c false otherwise. +*/ +bool +stmt_has_updated_trans_table(const THD *thd) +{ + Ha_trx_info *ha_info; + + for (ha_info= thd->transaction.stmt.ha_list; ha_info; ha_info= ha_info->next()) + { + if (ha_info->is_trx_read_write() && ha_info->ht() != binlog_hton) + return (TRUE); + } + return (FALSE); +} + +/** + This function checks if either a trx-cache or a non-trx-cache should + be used. If @c bin_log_direct_non_trans_update is active, the cache + to be used depends on the flag @c is_transactional. + + Otherswise, we use the trx-cache if either the @c is_transactional + is true or the trx-cache is not empty. + + @param thd The client thread. + @param is_transactional The changes are related to a trx-table. + @return + @c true if a trx-cache should be used, @c false otherwise. +*/ +bool use_trans_cache(const THD* thd, bool is_transactional) +{ + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + + return + (thd->variables.binlog_direct_non_trans_update ? is_transactional : + (cache_mngr->trx_cache.empty() && !is_transactional ? FALSE : TRUE)); +} /* These functions are placed in this file since they need access to @@ -4223,44 +4282,6 @@ int THD::binlog_setup_trx_data() DBUG_RETURN(0); } -/** - This function checks if a transactional talbe was updated by the - current transaction. - - @param thd The client thread that executed the current statement. - @return - @c true if a transactional table was updated, @false otherwise. -*/ -bool -trans_has_updated_trans_table(THD* thd) -{ - binlog_cache_mngr *const cache_mngr= - (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); - - return (cache_mngr ? my_b_tell (&cache_mngr->trx_cache.cache_log) : 0); -} - -/** - This function checks if a transactional talbe was updated by the - current statement. - - @param thd The client thread that executed the current statement. - @return - @c true if a transactional table was updated, @false otherwise. -*/ -bool -stmt_has_updated_trans_table(THD *thd) -{ - Ha_trx_info *ha_info; - - for (ha_info= thd->transaction.stmt.ha_list; ha_info; ha_info= ha_info->next()) - { - if (ha_info->is_trx_read_write() && ha_info->ht() != binlog_hton) - return (TRUE); - } - return (FALSE); -} - /* Function to start a statement and optionally a transaction for the binary log. @@ -4369,8 +4390,8 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional) binlog_cache_mngr *const cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); - IO_CACHE *file= cache_mngr->get_binlog_cache_log(is_transactional); - + IO_CACHE *file= + cache_mngr->get_binlog_cache_log(use_trans_cache(this, is_transactional)); if ((error= the_event.write(file))) DBUG_RETURN(error); @@ -4405,7 +4426,7 @@ THD::binlog_get_pending_rows_event(bool is_transactional) const if (cache_mngr) { binlog_cache_data *cache_data= - cache_mngr->get_binlog_cache_data(is_transactional); + cache_mngr->get_binlog_cache_data(use_trans_cache(this, is_transactional)); rows= cache_data->pending(); } @@ -4434,7 +4455,7 @@ THD::binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional) DBUG_ASSERT(cache_mngr); binlog_cache_data *cache_data= - cache_mngr->get_binlog_cache_data(is_transactional); + cache_mngr->get_binlog_cache_data(use_trans_cache(this, is_transactional)); cache_data->set_pending(ev); } @@ -4460,7 +4481,7 @@ MYSQL_BIN_LOG::remove_pending_rows_event(THD *thd, bool is_transactional) DBUG_ASSERT(cache_mngr); binlog_cache_data *cache_data= - cache_mngr->get_binlog_cache_data(is_transactional); + cache_mngr->get_binlog_cache_data(use_trans_cache(thd, is_transactional)); if (Rows_log_event* pending= cache_data->pending()) { @@ -4497,7 +4518,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd, DBUG_ASSERT(cache_mngr); binlog_cache_data *cache_data= - cache_mngr->get_binlog_cache_data(is_transactional); + cache_mngr->get_binlog_cache_data(use_trans_cache(thd, is_transactional)); DBUG_PRINT("info", ("cache_mngr->pending(): 0x%lx", (long) cache_data->pending())); @@ -4608,35 +4629,9 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) binlog_cache_mngr *const cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); - /* - If we are about to use write rows, we just need to check the type of - the event (either transactional or non-transactional) in order to - choose the cache. - */ - if (thd->is_current_stmt_binlog_format_row()) - { - file= cache_mngr->get_binlog_cache_log(event_info->use_trans_cache()); - cache_data= cache_mngr->get_binlog_cache_data(event_info->use_trans_cache()); - } - /* - However, if we are about to write statements we need to consider other - things. We use the non-transactional cache when: - - . the transactional cache is empty which means that there were no - early statement on behalf of the transaction. - . the respective event is tagged as non-transactional. - */ - else if (cache_mngr->trx_cache.empty() && - !event_info->use_trans_cache()) - { - file= &cache_mngr->stmt_cache.cache_log; - cache_data= &cache_mngr->stmt_cache; - } - else - { - file= &cache_mngr->trx_cache.cache_log; - cache_data= &cache_mngr->trx_cache; - } + bool is_trans_cache= use_trans_cache(thd, event_info->use_trans_cache()); + file= cache_mngr->get_binlog_cache_log(is_trans_cache); + cache_data= cache_mngr->get_binlog_cache_data(is_trans_cache); thd->binlog_start_trans_and_stmt(); } @@ -4898,7 +4893,6 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) do { - /* if we only got a partial header in the last iteration, get the other half now and process a full header. diff --git a/sql/log.h b/sql/log.h index 5e13d153db8..e9429067a34 100644 --- a/sql/log.h +++ b/sql/log.h @@ -20,8 +20,9 @@ class Relay_log_info; class Format_description_log_event; -bool trans_has_updated_trans_table(THD* thd); -bool stmt_has_updated_trans_table(THD *thd); +bool trans_has_updated_trans_table(const THD* thd); +bool stmt_has_updated_trans_table(const THD *thd); +bool use_trans_cache(const THD* thd, bool is_transactional); /* Transaction Coordinator log - a base abstract class diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index dc07fb563e6..92c86cf6e00 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6311,3 +6311,8 @@ ER_WRONG_NATIVE_TABLE_STRUCTURE ER_WRONG_PERFSCHEMA_USAGE eng "Invalid performance_schema usage." + +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT + eng "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction" +ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT + eng "Cannot change the binlog direct flag inside a stored function or trigger" diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 4ee0cf9d758..51bb83f07b9 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6305,3 +6305,7 @@ ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT eng "The syntax '%s' is deprecated and will be removed in MySQL %s." ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt." +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT + eng "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction" +ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT + eng "Cannot change the binlog direct flag inside a stored function or trigger" diff --git a/sql/sql_class.h b/sql/sql_class.h index d413202a8da..9db58b50f7a 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -373,6 +373,7 @@ typedef struct system_variables ulong group_concat_max_len; uint binlog_format; ///< binlog format for this thd (see enum_binlog_format) + my_bool binlog_direct_non_trans_update; uint completion_type; uint query_cache_type; uint tx_isolation; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 0d6c3327f24..fe3114c9d50 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -299,6 +299,48 @@ static Sys_var_enum Sys_binlog_format( NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_format_check), ON_UPDATE(fix_binlog_format_after_update)); +static bool binlog_direct_check(sys_var *self, THD *thd, set_var *var) +{ + /* + Makes the session variable 'binlog_direct_non_transactional_updates' + read-only inside a transaction. + */ + if (thd->active_transaction() && (var->type == OPT_SESSION)) + { + my_error(ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT, MYF(0)); + return 1; + } + /* + Makes the session variable 'binlog_direct_non_transactional_updates' + read-only if within a procedure, trigger or function. + */ + if (thd->in_sub_stmt) + { + my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT, MYF(0)); + return 1; + } + + if (check_has_super(self, thd, var)) + return true; + if (var->type == OPT_GLOBAL || + (thd->variables.binlog_direct_non_trans_update == + var->save_result.ulonglong_value)) + return false; + + return false; +} + +static Sys_var_mybool Sys_binlog_direct( + "binlog_direct_non_transactional_updates", + "Causes updates to non-transactional engines using statement format to " + "be written directly to binary log. Before using this option make sure " + "that there are no dependencies between transactional and " + "non-transactional tables such as in the statement INSERT INTO t_myisam " + "SELECT * FROM t_innodb; otherwise, slaves may diverge from the master.", + SESSION_VAR(binlog_direct_non_trans_update), + CMD_LINE(OPT_ARG), DEFAULT(FALSE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_direct_check)); + static Sys_var_ulong Sys_bulk_insert_buff_size( "bulk_insert_buffer_size", "Size of tree cache used in bulk " "insert optimisation. Note that this is a limit per thread!", diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index 3bfa08d0bd1..b4461ebf90f 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -51,6 +51,13 @@ server-id = 1 # binary logging format - mixed recommended #binlog_format=mixed +# Causes updates to non-transactional engines using statement format to be +# written directly to binary log. Before using this option make sure that +# there are no dependencies between transactional and non-transactional +# tables such as in the statement INSERT INTO t_myisam SELECT * FROM +# t_innodb; otherwise, slaves may diverge from the master. +#binlog_direct_non_transactional_updates=TRUE + # Uncomment the following if you are using InnoDB tables #innodb_data_home_dir = @localstatedir@/ #innodb_data_file_path = ibdata1:10M:autoextend From 7bc7fb576f80fd80f5d922d4c7d06f24fee508b8 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 21 Jan 2010 08:47:05 -0700 Subject: [PATCH 09/54] Merge mysql-next-mr (revno 2966) --> mysql-next-mr-marc From 62fcfbd6c32b684edcd8eb0c91dfc4f71502a3d2 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 21 Jan 2010 11:06:03 -0700 Subject: [PATCH 10/54] Bug#50513 Build failure with ifdef HAVE_OPENSSL + ifndef HAVE_YASSL When compiling wiht ./configure --with-ssl=/usr, which used OPEN_SSL but not YASSL, the code in sql/mysqld.cc failed to build because of an incomplete performance schema instrumentation. This fix implements properly the instrumentation for the rwlock used in openssl_lock_t. Verified that the code builds, and the ssl + performance schema tests do pass. --- .../perfschema/r/dml_setup_instruments.result | 4 +++- .../perfschema/t/dml_setup_instruments.test | 3 +++ sql/mysqld.cc | 21 ++++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index 3a457578b3d..d680f8960d5 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -16,8 +16,10 @@ wait/synch/mutex/sql/LOCK_delayed_insert YES YES wait/synch/mutex/sql/LOCK_delayed_status YES YES select * from performance_schema.SETUP_INSTRUMENTS where name like 'Wait/Synch/Rwlock/sql/%' - order by name limit 10; + and name not in ('wait/synch/mutex/sql/CRYPTO_dynlock_value::lock') +order by name limit 10; NAME ENABLED TIMED +wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock YES YES wait/synch/rwlock/sql/LOCK_dboptions YES YES wait/synch/rwlock/sql/LOCK_grant YES YES wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test index f737160cebd..c6631e42612 100644 --- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -36,8 +36,11 @@ select * from performance_schema.SETUP_INSTRUMENTS and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex') order by name limit 10; +# CRYPTO_dynlock_value::lock is dependent on the build (SSL) + select * from performance_schema.SETUP_INSTRUMENTS where name like 'Wait/Synch/Rwlock/sql/%' + and name not in ('wait/synch/mutex/sql/CRYPTO_dynlock_value::lock') order by name limit 10; # COND_handler_count is dependent on the build (Windows only) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6a9fd8ee37b..ba61eaa62df 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -316,6 +316,10 @@ static PSI_thread_key key_thread_handle_con_sockets; #ifdef __WIN__ static PSI_thread_key key_thread_handle_shutdown; #endif /* __WIN__ */ + +#if defined (HAVE_OPENSSL) && !defined(HAVE_YASSL) +static PSI_rwlock_key key_rwlock_openssl; +#endif #endif /* HAVE_PSI_INTERFACE */ /* the default log output is log tables */ @@ -1538,7 +1542,7 @@ static void clean_up_mutexes() mysql_mutex_destroy(&LOCK_des_key_file); #ifndef HAVE_YASSL for (int i= 0; i < CRYPTO_num_locks(); ++i) - rwlock_destroy(&openssl_stdlocks[i].lock); + mysql_rwlock_destroy(&openssl_stdlocks[i].lock); OPENSSL_free(openssl_stdlocks); #endif #endif @@ -3737,7 +3741,7 @@ static int init_thread_environment() openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * sizeof(openssl_lock_t)); for (int i= 0; i < CRYPTO_num_locks(); ++i) - my_rwlock_init(&openssl_stdlocks[i].lock, NULL); + mysql_rwlock_init(key_rwlock_openssl, &openssl_stdlocks[i].lock); CRYPTO_set_dynlock_create_callback(openssl_dynlock_create); CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy); CRYPTO_set_dynlock_lock_callback(openssl_lock); @@ -3791,7 +3795,7 @@ static unsigned long openssl_id_function() static openssl_lock_t *openssl_dynlock_create(const char *file, int line) { openssl_lock_t *lock= new openssl_lock_t; - my_rwlock_init(&lock->lock, NULL); + mysql_rwlock_init(key_rwlock_openssl, &lock->lock); return lock; } @@ -3799,7 +3803,7 @@ static openssl_lock_t *openssl_dynlock_create(const char *file, int line) static void openssl_dynlock_destroy(openssl_lock_t *lock, const char *file, int line) { - rwlock_destroy(&lock->lock); + mysql_rwlock_destroy(&lock->lock); delete lock; } @@ -3825,16 +3829,16 @@ static void openssl_lock(int mode, openssl_lock_t *lock, const char *file, switch (mode) { case CRYPTO_LOCK|CRYPTO_READ: what = "read lock"; - err = rw_rdlock(&lock->lock); + err= mysql_rwlock_rdlock(&lock->lock); break; case CRYPTO_LOCK|CRYPTO_WRITE: what = "write lock"; - err = rw_wrlock(&lock->lock); + err= mysql_rwlock_wrlock(&lock->lock); break; case CRYPTO_UNLOCK|CRYPTO_READ: case CRYPTO_UNLOCK|CRYPTO_WRITE: what = "unlock"; - err = rw_unlock(&lock->lock); + err= mysql_rwlock_unlock(&lock->lock); break; default: /* Unknown locking mode. */ @@ -7975,6 +7979,9 @@ PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, static PSI_rwlock_info all_server_rwlocks[]= { +#if defined (HAVE_OPENSSL) && !defined(HAVE_YASSL) + { &key_rwlock_openssl, "CRYPTO_dynlock_value::lock", 0}, +#endif { &key_rwlock_LOCK_grant, "LOCK_grant", PSI_FLAG_GLOBAL}, { &key_rwlock_LOCK_logger, "LOGGER::LOCK_logger", 0}, { &key_rwlock_LOCK_sys_init_connect, "LOCK_sys_init_connect", PSI_FLAG_GLOBAL}, From 7610c9eba503575c4be9493e3ea1a30fff9b99b0 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 21 Jan 2010 17:57:57 -0700 Subject: [PATCH 11/54] Fixed merge problem (naming of CRYPTO_dynlock_value::lock in the tests) --- mysql-test/suite/perfschema/r/dml_setup_instruments.result | 3 +-- mysql-test/suite/perfschema/t/dml_setup_instruments.test | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index d680f8960d5..53d15e0a510 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -16,10 +16,9 @@ wait/synch/mutex/sql/LOCK_delayed_insert YES YES wait/synch/mutex/sql/LOCK_delayed_status YES YES select * from performance_schema.SETUP_INSTRUMENTS where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/mutex/sql/CRYPTO_dynlock_value::lock') + and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') order by name limit 10; NAME ENABLED TIMED -wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock YES YES wait/synch/rwlock/sql/LOCK_dboptions YES YES wait/synch/rwlock/sql/LOCK_grant YES YES wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test index c6631e42612..b82cde15fb5 100644 --- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -40,7 +40,7 @@ select * from performance_schema.SETUP_INSTRUMENTS select * from performance_schema.SETUP_INSTRUMENTS where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/mutex/sql/CRYPTO_dynlock_value::lock') + and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') order by name limit 10; # COND_handler_count is dependent on the build (Windows only) From 0e5fa89e4fcb11cb33d00f05ca999cd28e8c1bde Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Fri, 22 Jan 2010 17:08:49 +0100 Subject: [PATCH 12/54] Backport from mysql-6.0-codebase of: ------------------------------------------------------------ revno: 2630.22.42 committer: Konstantin Osipov branch nick: mysql-6.0-runtime timestamp: Fri 2008-10-17 14:36:55 +0400 message: Update old wording (table engine -> storage engine). --- sql/share/errmsg.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 51bb83f07b9..31e630d5fea 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5015,7 +5015,7 @@ ER_WARN_HOSTNAME_WONT_WORK por "MySQL foi inicializado em modo --skip-name-resolve. Você necesita reincializá-lo sem esta opção para este grant funcionar" spa "MySQL esta inicializado en modo --skip-name-resolve. Usted necesita reinicializarlo sin esta opción para este derecho funcionar" ER_UNKNOWN_STORAGE_ENGINE 42000 - eng "Unknown table engine '%s'" + eng "Unknown storage engine '%s'" ger "Unbekannte Speicher-Engine '%s'" por "Motor de tabela desconhecido '%s'" spa "Desconocido motor de tabla '%s'" From f62eb05d0879ff32d5595e4825fc348e823e2107 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 22 Jan 2010 17:15:16 -0700 Subject: [PATCH 13/54] Bug#50478 perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris Reviewed every call to my_error() using the va_args parameters, to make sure the arguments type are ok. Fixed the broken calls to my_error() to pass a strings as 'char *', not LEX_STRING. --- storage/perfschema/pfs_engine_table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc index 4190094b52b..8fe51e8c410 100644 --- a/storage/perfschema/pfs_engine_table.cc +++ b/storage/perfschema/pfs_engine_table.cc @@ -219,7 +219,7 @@ int PFS_engine_table::read_row(TABLE *table, if (! m_share_ptr->m_checked) { my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0), - PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name); + PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name.str); return HA_ERR_TABLE_NEEDS_UPGRADE; } @@ -256,7 +256,7 @@ int PFS_engine_table::update_row(TABLE *table, if (! m_share_ptr->m_checked) { my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0), - PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name); + PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name.str); return HA_ERR_TABLE_NEEDS_UPGRADE; } From 63ea7489a022437695b76e08eccc453b4a76f038 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 22 Jan 2010 18:06:13 -0700 Subject: [PATCH 14/54] Removing perfschema.tampered_perfschema_table1 from the experimental tests --- mysql-test/collections/default.experimental | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 34cf1f964b8..d3a0daf78f8 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -16,9 +16,6 @@ main.plugin # Bug#47146 Linking problem with exampl main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun -perfschema.tampered_perfschema_table1 @windows # Bug#50478 2010-01-20 alik perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris -perfschema.tampered_perfschema_table1 @solaris # Bug#50478 2010-01-20 alik perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris - rpl.rpl_get_master_version_and_clock* # Bug#49191 2009-12-01 Daogang rpl_get_master_version_and_clock failed on PB2: COM_REGISTER_SLAVE failed rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically From 372611d7b5aab43a8e5304cbfe365ce8de72705f Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 22 Jan 2010 19:00:19 -0700 Subject: [PATCH 15/54] Bug#11714 Non-sensical ALTER TABLE ADD CONSTRAINT allowed Bug#35578 Parser allows useless/illegal CREATE TABLE syntax Bug#38696 CREATE TABLE ... CHECK ... allows illegal syntax Backport from 6.0 to mysql-next-mr. --- mysql-test/r/constraints.result | 18 +++++++++++++- mysql-test/t/constraints.test | 44 ++++++++++++++++++++++++++++++++- sql/sql_yacc.yy | 10 +++----- 3 files changed, 63 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index 116efe429d5..46a718e4c42 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -3,7 +3,7 @@ create table t1 (a int check (a>0)); insert into t1 values (1); insert into t1 values (0); drop table t1; -create table t1 (a int ,b int, check a>b); +create table t1 (a int, b int, check (a>b)); insert into t1 values (1,0); insert into t1 values (0,1); drop table t1; @@ -27,3 +27,19 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `key_2` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +drop table if exists t_illegal; +create table t_illegal (a int, b int, check a>b); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a>b)' at line 1 +create table t_illegal (a int, b int, constraint abc check a>b); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a>b)' at line 1 +create table t_illegal (a int, b int, constraint abc); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +drop table if exists t_11714; +create table t_11714(a int, b int); +alter table t_11714 add constraint cons1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +drop table t_11714; +CREATE TABLE t_illegal (col_1 INT CHECK something (whatever)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something (whatever))' at line 1 +CREATE TABLE t_illegal (col_1 INT CHECK something); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something)' at line 1 diff --git a/mysql-test/t/constraints.test b/mysql-test/t/constraints.test index ed268ab5846..70a95e5f16e 100644 --- a/mysql-test/t/constraints.test +++ b/mysql-test/t/constraints.test @@ -10,7 +10,7 @@ create table t1 (a int check (a>0)); insert into t1 values (1); insert into t1 values (0); drop table t1; -create table t1 (a int ,b int, check a>b); +create table t1 (a int, b int, check (a>b)); insert into t1 values (1,0); insert into t1 values (0,1); drop table t1; @@ -29,3 +29,45 @@ show create table t1; drop table t1; # End of 4.1 tests + +# +# Bug#35578 (Parser allows useless/illegal CREATE TABLE syntax) +# + +--disable_warnings +drop table if exists t_illegal; +--enable_warnings + +--error ER_PARSE_ERROR +create table t_illegal (a int, b int, check a>b); + +--error ER_PARSE_ERROR +create table t_illegal (a int, b int, constraint abc check a>b); + +--error ER_PARSE_ERROR +create table t_illegal (a int, b int, constraint abc); + +# +# Bug#11714 (Non-sensical ALTER TABLE ADD CONSTRAINT allowed) +# + +--disable_warnings +drop table if exists t_11714; +--enable_warnings + +create table t_11714(a int, b int); + +--error ER_PARSE_ERROR +alter table t_11714 add constraint cons1; + +drop table t_11714; + +# +# Bug#38696 (CREATE TABLE ... CHECK ... allows illegal syntax) + +--error ER_PARSE_ERROR +CREATE TABLE t_illegal (col_1 INT CHECK something (whatever)); + +--error ER_PARSE_ERROR +CREATE TABLE t_illegal (col_1 INT CHECK something); + diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ab128a9b701..aebf80e340f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -765,10 +765,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %pure_parser /* We have threads */ /* - Currently there are 172 shift/reduce conflicts. + Currently there are 169 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 172 +%expect 169 /* Comments for TOKENS. @@ -5282,10 +5282,6 @@ key_def: /* Only used for ALTER TABLE. Ignored otherwise. */ lex->alter_info.flags|= ALTER_FOREIGN_KEY; } - | constraint opt_check_constraint - { - Lex->col_list.empty(); /* Alloced by sql_alloc */ - } | opt_constraint check_constraint { Lex->col_list.empty(); /* Alloced by sql_alloc */ @@ -5298,7 +5294,7 @@ opt_check_constraint: ; check_constraint: - CHECK_SYM expr + CHECK_SYM '(' expr ')' ; opt_constraint: From 0d6a21807435991d2177d515ac92fecc72e86e97 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 25 Jan 2010 04:55:31 -0700 Subject: [PATCH 16/54] Bug#34455 Ambiguous foreign keys syntax is accepted Backport from 6.0 to 5.5 --- mysql-test/r/foreign_key.result | 42 +++++++++++++++ mysql-test/t/foreign_key.test | 72 +++++++++++++++++++++++++ sql/sql_lex.h | 4 +- sql/sql_yacc.yy | 93 ++++++++++++++++++++++----------- 4 files changed, 180 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/foreign_key.result b/mysql-test/r/foreign_key.result index ece53db2e9a..a6577dd376b 100644 --- a/mysql-test/r/foreign_key.result +++ b/mysql-test/r/foreign_key.result @@ -13,3 +13,45 @@ foreign key (a,b) references t3 (c,d) on update set null); create index a on t1 (a); create unique index b on t1 (a,b); drop table t1; +drop table if exists t_34455; +create table t_34455 ( +a int not null, +foreign key (a) references t3 (a) match full match partial); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match partial)' at line 3 +create table t_34455 ( +a int not null, +foreign key (a) references t3 (a) on delete set default match full); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 3 +create table t_34455 ( +a int not null, +foreign key (a) references t3 (a) on update set default match full); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 3 +create table t_34455 ( +a int not null, +foreign key (a) references t3 (a) +on delete set default on delete set default); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete set default)' at line 4 +create table t_34455 ( +a int not null, +foreign key (a) references t3 (a) +on update set default on update set default); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update set default)' at line 4 +create table t_34455 (a int not null); +alter table t_34455 +add foreign key (a) references t3 (a) match full match partial); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match partial)' at line 2 +alter table t_34455 +add foreign key (a) references t3 (a) on delete set default match full); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 2 +alter table t_34455 +add foreign key (a) references t3 (a) on update set default match full); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match full)' at line 2 +alter table t_34455 +add foreign key (a) references t3 (a) +on delete set default on delete set default); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete set default)' at line 3 +alter table t_34455 +add foreign key (a) references t3 (a) +on update set default on update set default); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update set default)' at line 3 +drop table t_34455; diff --git a/mysql-test/t/foreign_key.test b/mysql-test/t/foreign_key.test index 0a3708e6dc8..2a6ab01f511 100644 --- a/mysql-test/t/foreign_key.test +++ b/mysql-test/t/foreign_key.test @@ -23,3 +23,75 @@ create unique index b on t1 (a,b); drop table t1; # End of 4.1 tests + +# +# Bug#34455 (Ambiguous foreign keys syntax is accepted) +# + +--disable_warnings +drop table if exists t_34455; +--enable_warnings + +# 2 match clauses, illegal +--error ER_PARSE_ERROR +create table t_34455 ( + a int not null, + foreign key (a) references t3 (a) match full match partial); + +# match after on delete, illegal +--error ER_PARSE_ERROR +create table t_34455 ( + a int not null, + foreign key (a) references t3 (a) on delete set default match full); + +# match after on update, illegal +--error ER_PARSE_ERROR +create table t_34455 ( + a int not null, + foreign key (a) references t3 (a) on update set default match full); + +# 2 on delete clauses, illegal +--error ER_PARSE_ERROR +create table t_34455 ( + a int not null, + foreign key (a) references t3 (a) + on delete set default on delete set default); + +# 2 on update clauses, illegal +--error ER_PARSE_ERROR +create table t_34455 ( + a int not null, + foreign key (a) references t3 (a) + on update set default on update set default); + +create table t_34455 (a int not null); + +# 2 match clauses, illegal +--error ER_PARSE_ERROR +alter table t_34455 + add foreign key (a) references t3 (a) match full match partial); + +# match after on delete, illegal +--error ER_PARSE_ERROR +alter table t_34455 + add foreign key (a) references t3 (a) on delete set default match full); + +# match after on update, illegal +--error ER_PARSE_ERROR +alter table t_34455 + add foreign key (a) references t3 (a) on update set default match full); + +# 2 on delete clauses, illegal +--error ER_PARSE_ERROR +alter table t_34455 + add foreign key (a) references t3 (a) + on delete set default on delete set default); + +# 2 on update clauses, illegal +--error ER_PARSE_ERROR +alter table t_34455 + add foreign key (a) references t3 (a) + on update set default on update set default); + +drop table t_34455; + diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 800a16cf2b6..7eb72bc5358 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1903,7 +1903,9 @@ struct LEX: public Query_tables_list uint profile_options; uint uint_geom_type; uint grant, grant_tot_col, which_columns; - uint fk_delete_opt, fk_update_opt, fk_match_option; + enum Foreign_key::fk_match_opt fk_match_option; + enum Foreign_key::fk_option fk_update_opt; + enum Foreign_key::fk_option fk_delete_opt; uint slave_thd_opt, start_transaction_opt; int nest_level; /* diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index aebf80e340f..5e900b69aa3 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -756,6 +756,7 @@ static bool add_create_index (LEX *lex, Key::Keytype type, struct p_elem_val *p_elem_value; enum index_hint_type index_hint; enum enum_filetype filetype; + enum Foreign_key::fk_option m_fk_option; Diag_condition_item_name diag_condition_item_name; } @@ -1422,7 +1423,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); type type_with_opt_collate int_type real_type order_dir lock_option udf_type if_exists opt_local opt_table_options table_options table_option opt_if_not_exists opt_no_write_to_binlog - delete_option opt_temporary all_or_any opt_distinct + opt_temporary all_or_any opt_distinct opt_ignore_leaves fulltext_options spatial_type union_option start_transaction_opts opt_chain opt_release union_opt select_derived_init option_type2 @@ -1430,6 +1431,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); opt_ev_status opt_ev_on_completion ev_on_completion opt_ev_comment ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt +%type + delete_option + %type ulong_num real_ulong_num merge_insert_types @@ -1544,7 +1548,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); opt_precision opt_ignore opt_column opt_restrict grant revoke set lock unlock string_list field_options field_option field_opt_list opt_binary ascii unicode table_lock_list table_lock - ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use + ref_list opt_match_clause opt_on_update_delete use opt_delete_options opt_delete_option varchar nchar nvarchar opt_outer table_list table_name table_alias_ref_list table_alias_ref opt_option opt_place @@ -5833,21 +5837,20 @@ opt_primary: ; references: - REFERENCES table_ident - { - LEX *lex=Lex; - lex->fk_delete_opt= lex->fk_update_opt= lex->fk_match_option= 0; - lex->ref_list.empty(); - } + REFERENCES + table_ident opt_ref_list + opt_match_clause + opt_on_update_delete { $$=$2; } ; opt_ref_list: - /* empty */ opt_on_delete {} - | '(' ref_list ')' opt_on_delete {} + /* empty */ + { Lex->ref_list.empty(); } + | '(' ref_list ')' ; ref_list: @@ -5863,34 +5866,64 @@ ref_list: Key_part_spec *key= new Key_part_spec($1, 0); if (key == NULL) MYSQL_YYABORT; - Lex->ref_list.push_back(key); + LEX *lex= Lex; + lex->ref_list.empty(); + lex->ref_list.push_back(key); } ; -opt_on_delete: - /* empty */ {} - | opt_on_delete_list {} +opt_match_clause: + /* empty */ + { Lex->fk_match_option= Foreign_key::FK_MATCH_UNDEF; } + | MATCH FULL + { Lex->fk_match_option= Foreign_key::FK_MATCH_FULL; } + | MATCH PARTIAL + { Lex->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; } + | MATCH SIMPLE_SYM + { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; } ; -opt_on_delete_list: - opt_on_delete_list opt_on_delete_item {} - | opt_on_delete_item {} - ; - -opt_on_delete_item: - ON DELETE_SYM delete_option { Lex->fk_delete_opt= $3; } - | ON UPDATE_SYM delete_option { Lex->fk_update_opt= $3; } - | MATCH FULL { Lex->fk_match_option= Foreign_key::FK_MATCH_FULL; } - | MATCH PARTIAL { Lex->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; } - | MATCH SIMPLE_SYM { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; } +opt_on_update_delete: + /* empty */ + { + LEX *lex= Lex; + lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF; + lex->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF; + } + | ON UPDATE_SYM delete_option + { + LEX *lex= Lex; + lex->fk_update_opt= $3; + lex->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF; + } + | ON DELETE_SYM delete_option + { + LEX *lex= Lex; + lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF; + lex->fk_delete_opt= $3; + } + | ON UPDATE_SYM delete_option + ON DELETE_SYM delete_option + { + LEX *lex= Lex; + lex->fk_update_opt= $3; + lex->fk_delete_opt= $6; + } + | ON DELETE_SYM delete_option + ON UPDATE_SYM delete_option + { + LEX *lex= Lex; + lex->fk_update_opt= $6; + lex->fk_delete_opt= $3; + } ; delete_option: - RESTRICT { $$= (int) Foreign_key::FK_OPTION_RESTRICT; } - | CASCADE { $$= (int) Foreign_key::FK_OPTION_CASCADE; } - | SET NULL_SYM { $$= (int) Foreign_key::FK_OPTION_SET_NULL; } - | NO_SYM ACTION { $$= (int) Foreign_key::FK_OPTION_NO_ACTION; } - | SET DEFAULT { $$= (int) Foreign_key::FK_OPTION_DEFAULT; } + RESTRICT { $$= Foreign_key::FK_OPTION_RESTRICT; } + | CASCADE { $$= Foreign_key::FK_OPTION_CASCADE; } + | SET NULL_SYM { $$= Foreign_key::FK_OPTION_SET_NULL; } + | NO_SYM ACTION { $$= Foreign_key::FK_OPTION_NO_ACTION; } + | SET DEFAULT { $$= Foreign_key::FK_OPTION_DEFAULT; } ; normal_key_type: From e34eb3b5076e83555ba53a3a454c54995d5c7e99 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 25 Jan 2010 22:34:34 +0100 Subject: [PATCH 17/54] Patch to eliminate warnings in mysql-next-mr-bugteam. --- sql/repl_failsafe.cc | 2 +- sql/repl_failsafe.h | 2 +- sql/rpl_injector.cc | 12 ++++++------ sql/rpl_mi.cc | 4 ++-- sql/slave.cc | 12 ++++++------ sql/sql_class.cc | 6 +++--- sql/sql_db.cc | 2 +- sql/sql_parse.cc | 2 +- sql/sql_repl.cc | 4 ++-- sql/sql_table.cc | 2 +- sql/sys_vars.cc | 2 +- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 5bf87dea90e..29443eb6e65 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -38,7 +38,7 @@ #define SLAVE_ERRMSG_SIZE (FN_REFLEN+64) -uint rpl_status=RPL_NULL; +RPL_STATUS rpl_status=RPL_NULL; mysql_mutex_t LOCK_rpl_status; mysql_cond_t COND_rpl_status; HASH slave_list; diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h index dd6770be0b4..94b151aaee7 100644 --- a/sql/repl_failsafe.h +++ b/sql/repl_failsafe.h @@ -26,7 +26,7 @@ typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE, RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER, RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */, RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS; -extern uint rpl_status; +extern RPL_STATUS rpl_status; extern mysql_mutex_t LOCK_rpl_status; extern mysql_cond_t COND_rpl_status; diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index ac879b5033f..64f79092057 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -112,8 +112,8 @@ int injector::transaction::write_row (server_id_type sid, table tbl, { DBUG_ENTER("injector::transaction::write_row(...)"); - int error= 0; - if (error= check_state(ROW_STATE)) + int error= check_state(ROW_STATE); + if (error) DBUG_RETURN(error); server_id_type save_id= m_thd->server_id; @@ -131,8 +131,8 @@ int injector::transaction::delete_row(server_id_type sid, table tbl, { DBUG_ENTER("injector::transaction::delete_row(...)"); - int error= 0; - if (error= check_state(ROW_STATE)) + int error= check_state(ROW_STATE); + if (error) DBUG_RETURN(error); server_id_type save_id= m_thd->server_id; @@ -150,8 +150,8 @@ int injector::transaction::update_row(server_id_type sid, table tbl, { DBUG_ENTER("injector::transaction::update_row(...)"); - int error= 0; - if (error= check_state(ROW_STATE)) + int error= check_state(ROW_STATE); + if (error) DBUG_RETURN(error); server_id_type save_id= m_thd->server_id; diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 38382fd2a0e..7f81834c1d3 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -33,8 +33,8 @@ int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f); Master_info::Master_info(bool is_slave_recovery) :Slave_reporting_capability("I/O"), ssl(0), ssl_verify_server_cert(0), fd(-1), io_thd(0), - port(MYSQL_PORT), connect_retry(DEFAULT_CONNECT_RETRY), inited(0), - rli(is_slave_recovery), abort_slave(0), + rli(is_slave_recovery), port(MYSQL_PORT), + connect_retry(DEFAULT_CONNECT_RETRY), inited(0), abort_slave(0), slave_running(0), slave_run_id(0), sync_counter(0), heartbeat_period(0), received_heartbeats(0), master_id(0) { diff --git a/sql/slave.cc b/sql/slave.cc index a4f16f6ed28..af43b39c63b 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1111,7 +1111,7 @@ int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f) memcpy(buf_act, buf, read_size); snd_size= my_b_gets(f, buf_act + read_size, max_size - read_size); if (snd_size == 0 || - (snd_size + 1 == max_size - read_size) && buf[max_size - 2] != '\n') + ((snd_size + 1 == max_size - read_size) && buf[max_size - 2] != '\n')) { /* failure to make the 2nd read or short read again @@ -3943,8 +3943,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) /* everything is filtered out from non-master */ (s_id != mi->master_id || /* for the master meta information is necessary */ - buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && - buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT))) + (buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && + buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT)))) { /* Do not write it to the relay log. @@ -3964,9 +3964,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) as well as rli->group_relay_log_pos. */ if (!(s_id == ::server_id && !mi->rli.replicate_same_server_id) || - buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && - buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT && - buf[EVENT_TYPE_OFFSET] != STOP_EVENT) + (buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && + buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT && + buf[EVENT_TYPE_OFFSET] != STOP_EVENT)) { mi->master_log_pos+= inc_pos; memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 28e5e56d8b9..d02d69aca0c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3531,7 +3531,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) { DBUG_ENTER("THD::decide_logging_format"); DBUG_PRINT("info", ("query: %s", query())); - DBUG_PRINT("info", ("variables.binlog_format: %ld", + DBUG_PRINT("info", ("variables.binlog_format: %u", variables.binlog_format)); DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", lex->get_stmt_unsafe_flags())); @@ -3672,7 +3672,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) lock history on the slave will be different from the master. */ if (mixed_engine || - trans_has_updated_trans_table(this) && !all_trans_engines) + (trans_has_updated_trans_table(this) && !all_trans_engines)) lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS); DBUG_PRINT("info", ("flags_all_set: 0x%llx", flags_all_set)); @@ -3802,7 +3802,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) DBUG_PRINT("info", ("decision: no logging since " "mysql_bin_log.is_open() = %d " "and (options & OPTION_BIN_LOG) = 0x%llx " - "and binlog_format = %ld " + "and binlog_format = %u " "and binlog_filter->db_ok(db) = %d", mysql_bin_log.is_open(), (variables.option_bits & OPTION_BIN_LOG), diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 9fef7114898..4cb47c7b2df 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -854,7 +854,7 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) qinfo.db_len = strlen(db); /* These DDL methods and logging protected with LOCK_mysql_create_db */ - if (error= mysql_bin_log.write(&qinfo)) + if ((error= mysql_bin_log.write(&qinfo))) goto exit; } my_ok(thd, result); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 5c272353664..bef00b13978 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3887,7 +3887,7 @@ end_with_restore_list: */ if (!lex->no_write_to_binlog && write_to_binlog) { - if (res= write_bin_log(thd, FALSE, thd->query(), thd->query_length())) + if ((res= write_bin_log(thd, FALSE, thd->query(), thd->query_length()))) break; } my_ok(thd); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 00cc28e6213..1fb0fcaf6dd 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -828,11 +828,11 @@ impossible position"; { if (coord) { - DBUG_ASSERT(heartbeat_ts && heartbeat_period != LL(0)); + DBUG_ASSERT(heartbeat_ts && heartbeat_period != 0); set_timespec_nsec(*heartbeat_ts, heartbeat_period); } ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts); - DBUG_ASSERT(ret == 0 || heartbeat_period != LL(0) && coord != NULL); + DBUG_ASSERT(ret == 0 || (heartbeat_period != 0 && coord != NULL)); if (ret == ETIMEDOUT || ret == ETIME) { #ifndef DBUG_OFF diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e87e52d5819..1e06b070494 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6533,7 +6533,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, thd->clear_error(); Query_log_event qinfo(thd, thd->query(), thd->query_length(), FALSE, TRUE, FALSE, 0); - if (error= mysql_bin_log.write(&qinfo)) + if ((error= mysql_bin_log.write(&qinfo))) goto view_err_unlock; } my_ok(thd); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index fe3114c9d50..eb7781be5b9 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -324,7 +324,7 @@ static bool binlog_direct_check(sys_var *self, THD *thd, set_var *var) return true; if (var->type == OPT_GLOBAL || (thd->variables.binlog_direct_non_trans_update == - var->save_result.ulonglong_value)) + static_cast(var->save_result.ulonglong_value))) return false; return false; From f0a938c4571c6ceecf62012e1849267312c61edc Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Mon, 25 Jan 2010 23:19:34 +0100 Subject: [PATCH 18/54] fixes for gcc 4.4.1 warnings sql/mysql_priv.h: see change done in sys_vars.cc sql/mysqld.cc: functions were defined all the time but not used if in libmysqld sql/sql_select.cc: const_part is unsigned, 1<("MyISAM"); /* Add server status variables to the dynamic list of @@ -3701,15 +3711,6 @@ You should consider changing lower_case_table_names to 1 or 2", return 0; } -static void init_error_log_mutex() -{ - mysql_mutex_init(key_LOCK_error_log, &LOCK_error_log, MY_MUTEX_INIT_FAST); -} - -static void clean_up_error_log_mutex() -{ - mysql_mutex_destroy(&LOCK_error_log); -} static int init_thread_environment() { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4775a297b0c..030c12de897 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4378,7 +4378,7 @@ best_access_path(JOIN *join, */ if (table->quick_keys.is_set(key) && (const_part & ((1 << table->quick_key_parts[key])-1)) == - ((1 << table->quick_key_parts[key])-1) && + (((key_part_map)1 << table->quick_key_parts[key])-1) && table->quick_n_ranges[key] == 1 && records > (double) table->quick_rows[key]) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ab128a9b701..5ee6f292204 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9218,8 +9218,8 @@ table_factor: lex->pop_context(); lex->nest_level--; } - else if ($3->select_lex && - $3->select_lex->master_unit()->is_union() || $5) + else if (($3->select_lex && + $3->select_lex->master_unit()->is_union()) || $5) { /* simple nested joins cannot have aliases or unions */ my_parse_error(ER(ER_SYNTAX_ERROR)); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index fe3114c9d50..e4dc0026128 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2956,14 +2956,14 @@ static bool check_locale(sys_var *self, THD *thd, set_var *var) static Sys_var_struct Sys_lc_messages( "lc_messages", "Set the language used for the error messages", SESSION_VAR(lc_messages), NO_CMD_LINE, - offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_messages), + my_offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_messages), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_locale)); static Sys_var_struct Sys_lc_time_names( "lc_time_names", "Set the language used for the month " "names and the days of the week", SESSION_VAR(lc_time_names), NO_CMD_LINE, - offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_time_names), + my_offsetof(MY_LOCALE, name), DEFAULT(&my_default_lc_time_names), NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_locale)); static Sys_var_tz Sys_time_zone( From f2338872bbf8f1c21fafc373a7276322311b894e Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 25 Jan 2010 20:12:20 -0700 Subject: [PATCH 19/54] Bug#50596 Spurious test failures in perfschema.dml_mutex_instances Fixed the dml_mutex_instances and dml_rwlock_instances to be more reliable. In particular, the tests may not assume a mutex or rwlock is never locked. --- mysql-test/suite/perfschema/r/dml_mutex_instances.result | 2 +- mysql-test/suite/perfschema/r/dml_rwlock_instances.result | 2 +- mysql-test/suite/perfschema/t/dml_mutex_instances.test | 2 +- mysql-test/suite/perfschema/t/dml_rwlock_instances.test | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/perfschema/r/dml_mutex_instances.result b/mysql-test/suite/perfschema/r/dml_mutex_instances.result index 655ca811c06..862123b3450 100644 --- a/mysql-test/suite/perfschema/r/dml_mutex_instances.result +++ b/mysql-test/suite/perfschema/r/dml_mutex_instances.result @@ -1,6 +1,6 @@ select * from performance_schema.MUTEX_INSTANCES limit 1; NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID -# # NULL +# # # select * from performance_schema.MUTEX_INSTANCES where name='FOO'; NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID diff --git a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result index 62b5fbeaa8a..686007e58e9 100644 --- a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result +++ b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result @@ -1,6 +1,6 @@ select * from performance_schema.RWLOCK_INSTANCES limit 1; NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT -# # NULL 0 +# # # # select * from performance_schema.RWLOCK_INSTANCES where name='FOO'; NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT diff --git a/mysql-test/suite/perfschema/t/dml_mutex_instances.test b/mysql-test/suite/perfschema/t/dml_mutex_instances.test index e3062c7b34c..0971c664eb8 100644 --- a/mysql-test/suite/perfschema/t/dml_mutex_instances.test +++ b/mysql-test/suite/perfschema/t/dml_mutex_instances.test @@ -18,7 +18,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # +--replace_column 1 # 2 # 3 # select * from performance_schema.MUTEX_INSTANCES limit 1; select * from performance_schema.MUTEX_INSTANCES diff --git a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test index 251168237eb..33a42450681 100644 --- a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test +++ b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test @@ -18,7 +18,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # +--replace_column 1 # 2 # 3 # 4 # select * from performance_schema.RWLOCK_INSTANCES limit 1; select * from performance_schema.RWLOCK_INSTANCES From 3694c5a928c0dc6f30b90523722cca8dd6ab3ed6 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 25 Jan 2010 20:50:31 -0700 Subject: [PATCH 20/54] Bug#50337 --defaults-file=~/something doesn't work anymore Before this fix, opening a configuration file located under "~" failed. To evaluate the "~" path, home_dir needs to be initialized. The 'home_dir' variable was initialized too late in my_init(). This fix: - moved the home_dir initialization from my_init() to my_basic_init(), using getenv("HOME")) - moved the initialization of my_umask / my_umask_dir also to my_basic_init(), to have all the my_umask / my_umask_dir init code in the same place. The second part is not strictly required, but makes the code more maintainable. Tested the fix manually. No MTR tests added, because MTR should not access or modify the $HOME directory of the user running tests. --- mysys/my_init.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/mysys/my_init.c b/mysys/my_init.c index 31adc5ed99e..a3e53fdaae1 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -74,6 +74,8 @@ static MYSQL_FILE instrumented_stdin; */ my_bool my_basic_init(void) { + char * str; + if (my_basic_init_done) return 0; my_basic_init_done= 1; @@ -82,6 +84,19 @@ my_bool my_basic_init(void) my_umask= 0660; /* Default umask for new files */ my_umask_dir= 0700; /* Default umask for new directories */ +#ifndef VMS + /* Default creation of new files */ + if ((str= getenv("UMASK")) != 0) + my_umask= (int) (atoi_octal(str) | 0600); + /* Default creation of new dir's */ + if ((str= getenv("UMASK_DIR")) != 0) + my_umask_dir= (int) (atoi_octal(str) | 0700); +#endif + + /* $HOME is needed early to parse configuration files located in ~/ */ + if ((home_dir= getenv("HOME")) != 0) + home_dir= intern_filename(home_dir_buff, home_dir); + init_glob_errs(); instrumented_stdin.m_file= stdin; @@ -124,7 +139,6 @@ my_bool my_basic_init(void) my_bool my_init(void) { - char * str; if (my_init_done) return 0; my_init_done= 1; @@ -142,24 +156,11 @@ my_bool my_init(void) { DBUG_ENTER("my_init"); DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown")); - if (!home_dir) - { /* Don't initialize twice */ - my_win_init(); - if ((home_dir=getenv("HOME")) != 0) - home_dir=intern_filename(home_dir_buff,home_dir); -#ifndef VMS - /* Default creation of new files */ - if ((str=getenv("UMASK")) != 0) - my_umask=(int) (atoi_octal(str) | 0600); - /* Default creation of new dir's */ - if ((str=getenv("UMASK_DIR")) != 0) - my_umask_dir=(int) (atoi_octal(str) | 0700); -#endif + my_win_init(); #ifdef VMS - init_ctype(); /* Stupid linker don't link _ctype.c */ + init_ctype(); /* Stupid linker don't link _ctype.c */ #endif - DBUG_PRINT("exit",("home: '%s'",home_dir)); - } + DBUG_PRINT("exit", ("home: '%s'", home_dir)); #ifdef __WIN__ win32_init_tcp_ip(); #endif From e17faeeaaaff9fb1c75c15b54b2d6e85180c9a7e Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 25 Jan 2010 21:53:04 -0700 Subject: [PATCH 21/54] Bug#50436 perfschema.aggregate fails on HPUX in 6.0 Relaxed the test conditions to account for objects destroyed, as was intended in the comments in mysql-test/suite/perfschema/t/aggregate.test --- mysql-test/suite/perfschema/r/aggregate.result | 12 ++++++------ mysql-test/suite/perfschema/t/aggregate.test | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result index 598f9297cc5..3e38aebacfc 100644 --- a/mysql-test/suite/perfschema/r/aggregate.result +++ b/mysql-test/suite/perfschema/r/aggregate.result @@ -51,14 +51,14 @@ SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT) FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.SUM_TIMER_WAIT <> SUM(i.SUM_TIMER_WAIT)) +HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT)) OR @dump_all; EVENT_NAME SUM_TIMER_WAIT SUM(i.SUM_TIMER_WAIT) SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT) FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MIN_TIMER_WAIT <> MIN(i.MIN_TIMER_WAIT)) +HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT)) AND (MIN(i.MIN_TIMER_WAIT) != 0) OR @dump_all; EVENT_NAME MIN_TIMER_WAIT MIN(i.MIN_TIMER_WAIT) @@ -66,7 +66,7 @@ SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT) FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MAX_TIMER_WAIT <> MAX(i.MAX_TIMER_WAIT)) +HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT)) OR @dump_all; EVENT_NAME MAX_TIMER_WAIT MAX(i.MAX_TIMER_WAIT) "Verifying waits aggregate consistency (thread)" @@ -75,7 +75,7 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT)) +HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT)) OR @dump_all; EVENT_NAME SUM_TIMER_WAIT SUM(t.SUM_TIMER_WAIT) SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT) @@ -83,7 +83,7 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT)) +HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT)) AND (MIN(t.MIN_TIMER_WAIT) != 0) OR @dump_all; EVENT_NAME MIN_TIMER_WAIT MIN(t.MIN_TIMER_WAIT) @@ -92,7 +92,7 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT)) +HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT)) OR @dump_all; EVENT_NAME MAX_TIMER_WAIT MAX(t.MAX_TIMER_WAIT) update performance_schema.SETUP_CONSUMERS set enabled = 'YES'; diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test index 7c01bdd0a4b..75bd5ad822e 100644 --- a/mysql-test/suite/perfschema/t/aggregate.test +++ b/mysql-test/suite/perfschema/t/aggregate.test @@ -1,4 +1,4 @@ -# Copyright (C) 2009 Sun Microsystems, Inc +# Copyright (C) 2009-2010 Sun Microsystems, Inc # # 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 @@ -132,14 +132,14 @@ SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT) FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.SUM_TIMER_WAIT <> SUM(i.SUM_TIMER_WAIT)) +HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT)) OR @dump_all; SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT) FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MIN_TIMER_WAIT <> MIN(i.MIN_TIMER_WAIT)) +HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT)) AND (MIN(i.MIN_TIMER_WAIT) != 0) OR @dump_all; @@ -147,7 +147,7 @@ SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT) FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MAX_TIMER_WAIT <> MAX(i.MAX_TIMER_WAIT)) +HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT)) OR @dump_all; --echo "Verifying waits aggregate consistency (thread)" @@ -157,7 +157,7 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT)) +HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT)) OR @dump_all; SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT) @@ -165,7 +165,7 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT)) +HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT)) AND (MIN(t.MIN_TIMER_WAIT) != 0) OR @dump_all; @@ -174,7 +174,7 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t USING (EVENT_NAME) GROUP BY EVENT_NAME -HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT)) +HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT)) OR @dump_all; From 32b6e904551e0aaff66b71d66dde7fbca288ddac Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jan 2010 17:41:15 +0800 Subject: [PATCH 22/54] Bug #45855 row events in binlog after switch from binlog_fmt=mix to stmt with open tmp tbl Bug #45856 can't switch from binlog_format=row to mix with open tmp tbl If binlog_format=MIXED, there are open temporary tables, an unsafe statement is executed, and the user issues 'SET @@session.binlog_format = STATEMENT', then subsequent DML statements will be written in row format despite binlog_format=STATEMENT. Because the binlog format can't be reset to statement based by 'reset_current_stmt_binlog_row_based' function. If binlog_format=ROW, there are open temporary tables, and an unsafe statement is executed, then the statement 'SET @@session.binlog_format = MIXED' generates the error: "Cannot switch out of the row-based binary log format when the session has open temporary tables" However, it is safe to switch to MIXED mode because events in row format are allowed. To fix the above two problems, generate ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR and forbid switching from MIXED or ROW to STATEMENT when there are open temp tables and we are logging in row format. There is no error in any other case. mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result: Test result for bug#45855 and bug#45856. mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test: Added test file to verify if the program will generate ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR error and forbid switching from MIXED or ROW to STATEMENT when there are open temp tables and we are logging in row format. There is no error in any other case. --- .../binlog_format_switch_in_tmp_table.result | 78 +++++++++++++++++++ .../t/binlog_format_switch_in_tmp_table.test | 76 ++++++++++++++++++ sql/set_var.cc | 36 +++++---- 3 files changed, 173 insertions(+), 17 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result create mode 100644 mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test diff --git a/mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result b/mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result new file mode 100644 index 00000000000..f886ccb134d --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_format_switch_in_tmp_table.result @@ -0,0 +1,78 @@ +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +MIXED +CREATE TABLE t1 (a VARCHAR(100)); +CREATE TEMPORARY TABLE t2 (a VARCHAR(100)); +# Test allow switching @@SESSION.binlog_format from MIXED to STATEMENT +# when there are open temp tables and we are logging in statement based format. +SET SESSION binlog_format = STATEMENT; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +STATEMENT +# Test allow switching @@SESSION.binlog_format from STATEMENT to +# STATEMENT when there are open temp tables. +SET SESSION binlog_format = STATEMENT; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +STATEMENT +INSERT INTO t1 VALUES ('statement based'); +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +STATEMENT +# Test allow switching @@SESSION.binlog_format from STATEMENT to +# MIXED when there are open temp tables. +SET SESSION binlog_format = MIXED; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +MIXED +# Test allow switching @@SESSION.binlog_format from MIXED to MIXED +# when there are open temp tables. +SET SESSION binlog_format = MIXED; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +MIXED +INSERT INTO t2 VALUES (UUID()); +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +MIXED +# Test forbit switching @@SESSION.binlog_format from MIXED to STATEMENT +# when there are open temp tables and we are logging in row based format. +SET SESSION binlog_format = STATEMENT; +ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +MIXED +SET SESSION binlog_format = ROW; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +ROW +INSERT INTO t1 VALUES ('row based'); +# Test allow switching @@SESSION.binlog_format from ROW to MIXED +# when there are open temp tables. +SET SESSION binlog_format = MIXED; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +MIXED +INSERT INTO t1 VALUES ('row based'); +# Test allow switching @@SESSION.binlog_format from MIXED to ROW +# when there are open temp tables. +SET SESSION binlog_format = ROW; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +ROW +# Test allow switching @@SESSION.binlog_format from ROW to ROW +# when there are open temp tables. +SET SESSION binlog_format = ROW; +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +ROW +INSERT INTO t1 VALUES ('row based'); +# Test forbit switching @@SESSION.binlog_format from ROW to STATEMENT +# when there are open temp tables. +SET SESSION binlog_format = STATEMENT; +ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables +SELECT @@SESSION.binlog_format; +@@SESSION.binlog_format +ROW +DROP TEMPORARY TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test b/mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test new file mode 100644 index 00000000000..6868506008c --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_format_switch_in_tmp_table.test @@ -0,0 +1,76 @@ +# +# Bug #45855 row events in binlog after switch from binlog_fmt=mix to stmt with open tmp tbl +# Bug #45856 can't switch from binlog_format=row to mix with open tmp tbl +# This test verfies if the program will generate ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR +# error and forbid switching @@SESSION.binlog_format from MIXED or ROW to +# STATEMENT when there are open temp tables and we are logging in row format. +# There is no error in any other case. +# + +source include/have_binlog_format_mixed.inc; + +SELECT @@SESSION.binlog_format; +CREATE TABLE t1 (a VARCHAR(100)); +CREATE TEMPORARY TABLE t2 (a VARCHAR(100)); + +--echo # Test allow switching @@SESSION.binlog_format from MIXED to STATEMENT +--echo # when there are open temp tables and we are logging in statement based format. +SET SESSION binlog_format = STATEMENT; +SELECT @@SESSION.binlog_format; + +--echo # Test allow switching @@SESSION.binlog_format from STATEMENT to +--echo # STATEMENT when there are open temp tables. +SET SESSION binlog_format = STATEMENT; +SELECT @@SESSION.binlog_format; + +INSERT INTO t1 VALUES ('statement based'); +SELECT @@SESSION.binlog_format; +--echo # Test allow switching @@SESSION.binlog_format from STATEMENT to +--echo # MIXED when there are open temp tables. +SET SESSION binlog_format = MIXED; +SELECT @@SESSION.binlog_format; + +--echo # Test allow switching @@SESSION.binlog_format from MIXED to MIXED +--echo # when there are open temp tables. +SET SESSION binlog_format = MIXED; +SELECT @@SESSION.binlog_format; + +INSERT INTO t2 VALUES (UUID()); +SELECT @@SESSION.binlog_format; + +--echo # Test forbit switching @@SESSION.binlog_format from MIXED to STATEMENT +--echo # when there are open temp tables and we are logging in row based format. +--ERROR ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR +SET SESSION binlog_format = STATEMENT; +SELECT @@SESSION.binlog_format; + +SET SESSION binlog_format = ROW; +SELECT @@SESSION.binlog_format; + +INSERT INTO t1 VALUES ('row based'); +--echo # Test allow switching @@SESSION.binlog_format from ROW to MIXED +--echo # when there are open temp tables. +SET SESSION binlog_format = MIXED; +SELECT @@SESSION.binlog_format; + +INSERT INTO t1 VALUES ('row based'); +--echo # Test allow switching @@SESSION.binlog_format from MIXED to ROW +--echo # when there are open temp tables. +SET SESSION binlog_format = ROW; +SELECT @@SESSION.binlog_format; + +--echo # Test allow switching @@SESSION.binlog_format from ROW to ROW +--echo # when there are open temp tables. +SET SESSION binlog_format = ROW; +SELECT @@SESSION.binlog_format; + +INSERT INTO t1 VALUES ('row based'); +--echo # Test forbit switching @@SESSION.binlog_format from ROW to STATEMENT +--echo # when there are open temp tables. +--ERROR ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR +SET SESSION binlog_format = STATEMENT; +SELECT @@SESSION.binlog_format; + +DROP TEMPORARY TABLE t2; +DROP TABLE t1; + diff --git a/sql/set_var.cc b/sql/set_var.cc index d9bd14564bf..9dfbf2c7a6c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1294,6 +1294,25 @@ bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) { bool result= sys_var_thd_enum::check(thd, var); if (!result) result= check_log_update(thd, var); + /* + If RBR and open temporary tables, their CREATE TABLE may not be in the + binlog, so we can't toggle to SBR in this connection. + + If binlog_format=MIXED, there are open temporary tables, and an unsafe + statement is executed, then subsequent statements are logged in row + format and hence changes to temporary tables may be lost. So we forbid + switching @@SESSION.binlog_format from MIXED to STATEMENT when there are + open temp tables and we are logging in row format. + */ + if (thd->temporary_tables && var->type == OPT_SESSION && + var->save_result.ulong_value == BINLOG_FORMAT_STMT && + ((thd->variables.binlog_format == BINLOG_FORMAT_MIXED && + thd->is_current_stmt_binlog_format_row()) || + thd->variables.binlog_format == BINLOG_FORMAT_ROW)) + { + my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0)); + return 1; + } return result; } @@ -1303,23 +1322,6 @@ bool sys_var_thd_binlog_format::is_readonly() const Under certain circumstances, the variable is read-only (unchangeable): */ THD *thd= current_thd; - /* - If RBR and open temporary tables, their CREATE TABLE may not be in the - binlog, so we can't toggle to SBR in this connection. - The test below will also prevent SET GLOBAL, well it was not easy to test - if global or not here. - And this test will also prevent switching from RBR to RBR (a no-op which - should not happen too often). - - If we don't have row-based replication compiled in, the variable - is always read-only. - */ - if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) && - thd->temporary_tables) - { - my_error(ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, MYF(0)); - return 1; - } /* if in a stored function/trigger, it's too late to change mode */ From 1b6391e93089d9ede9f8880bed82a6e9780b7284 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 26 Jan 2010 10:11:16 +0000 Subject: [PATCH 23/54] Removed test cases from experimental list: - rpl.rpl_slave_load_remove_tmpfile - rpl.rpl_sync --- mysql-test/collections/default.experimental | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 34cf1f964b8..e34d5c24996 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -27,8 +27,6 @@ rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_inn rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows rpl.rpl_plugin_load* @solaris # Bug#47146 rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun -rpl.rpl_slave_load_remove_tmpfile* @windows # Bug#50474 2010-01-20 alik rpl_slave_load_remove_tmpfile failed on windows debug enabled binary -rpl.rpl_sync* @windows # Bug#50473 2010-01-20 alik rpl_sync fails on windows debug enabled binaries rpl.rpl_timezone* # Bug#47017 2009-10-27 alik rpl_timezone fails on PB-2 with mismatch error sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun From a1917ee6873839e124b2e22603368db9ef30808f Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 26 Jan 2010 16:42:54 -0700 Subject: [PATCH 24/54] Bug#44210 Performance schema: pool-of-threads threads instrumentation is missing WL#5136 Pool of threads Added an explicit delete_thread() API in the instrumentation, to be used by the pool of threads implementations. --- include/mysql/psi/psi.h | 7 ++++++- include/mysql/psi/psi_abi_v1.h.pp | 2 ++ storage/perfschema/pfs.cc | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index a9277cd18bd..51446fa83a5 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (C) 2008-2010 Sun Microsystems, Inc 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 @@ -614,6 +614,9 @@ typedef void (*set_thread_v1_t)(struct PSI_thread *thread); /** Delete the current thread instrumentation. */ typedef void (*delete_current_thread_v1_t)(void); +/** Delete a thread instrumentation. */ +typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); + /** Get a mutex instrumentation locker. @param mutex the instrumented mutex to lock @@ -890,6 +893,8 @@ struct PSI_v1 set_thread_v1_t set_thread; /** @sa delete_current_thread_v1_t. */ delete_current_thread_v1_t delete_current_thread; + /** @sa delete_thread_v1_t. */ + delete_thread_v1_t delete_thread; /** @sa get_thread_mutex_locker_v1_t. */ get_thread_mutex_locker_v1_t get_thread_mutex_locker; /** @sa get_thread_rwlock_locker_v1_t. */ diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp index aedf28ba694..6ecd0f3098d 100644 --- a/include/mysql/psi/psi_abi_v1.h.pp +++ b/include/mysql/psi/psi_abi_v1.h.pp @@ -127,6 +127,7 @@ typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, typedef struct PSI_thread* (*get_thread_v1_t)(void); typedef void (*set_thread_v1_t)(struct PSI_thread *thread); typedef void (*delete_current_thread_v1_t)(void); +typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t) (struct PSI_mutex *mutex, enum PSI_mutex_operation op); typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t) @@ -204,6 +205,7 @@ struct PSI_v1 get_thread_v1_t get_thread; set_thread_v1_t set_thread; delete_current_thread_v1_t delete_current_thread; + delete_thread_v1_t delete_thread; get_thread_mutex_locker_v1_t get_thread_mutex_locker; get_thread_rwlock_locker_v1_t get_thread_rwlock_locker; get_thread_cond_locker_v1_t get_thread_cond_locker; diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 01b4b3711c1..380801c8677 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1081,6 +1081,13 @@ static void delete_current_thread_v1(void) } } +static void delete_thread_v1(PSI_thread *thread) +{ + PFS_thread *pfs= reinterpret_cast (thread); + if (pfs != NULL) + destroy_thread(pfs); +} + static PSI_mutex_locker* get_thread_mutex_locker_v1(PSI_mutex *mutex, PSI_mutex_operation op) { @@ -2007,6 +2014,7 @@ PSI_v1 PFS_v1= get_thread_v1, set_thread_v1, delete_current_thread_v1, + delete_thread_v1, get_thread_mutex_locker_v1, get_thread_rwlock_locker_v1, get_thread_cond_locker_v1, From af37c866decb8c33908de52a6cc4f1c3c60b6e4a Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 27 Jan 2010 08:26:05 -0700 Subject: [PATCH 25/54] Misc cleanup --- mysql-test/suite/perfschema/r/aggregate.result | 1 + mysql-test/suite/perfschema/t/aggregate.test | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result index 3e38aebacfc..197378ca38f 100644 --- a/mysql-test/suite/perfschema/r/aggregate.result +++ b/mysql-test/suite/perfschema/r/aggregate.result @@ -16,6 +16,7 @@ b CHAR(100) DEFAULT 'initial value') ENGINE=MyISAM; insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8); update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'; +update performance_schema.SETUP_CONSUMERS set enabled = 'NO'; set @dump_all=FALSE; "Verifying file aggregate consistency" SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ) diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test index 75bd5ad822e..0fa4651ecda 100644 --- a/mysql-test/suite/perfschema/t/aggregate.test +++ b/mysql-test/suite/perfschema/t/aggregate.test @@ -50,6 +50,8 @@ insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8); # Stop recording data, so the select below don't add noise. update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'; +# Disable all consumers, for long standing waits +update performance_schema.SETUP_CONSUMERS set enabled = 'NO'; # Helper to debug set @dump_all=FALSE; From 7252bdfa90c5ccdf12b28098efc2c824ba4e8622 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 27 Jan 2010 21:59:10 +0300 Subject: [PATCH 26/54] Typo fix for result file. --- mysql-test/r/mysqld--help-win.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 16239a6326a..e7048c71a48 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -37,7 +37,7 @@ The following options may be given as the first argument: binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance - --binlog-direct-non-transactional-updates + --binlog-direct-non-transactional-updates Causes updates to non-transactional engines using statement format to be written directly to binary log. Before using this option make sure that there are no From 013dcdbd67ad499730d25b618afbb7afa169552b Mon Sep 17 00:00:00 2001 From: Omer BarNir Date: Thu, 28 Jan 2010 22:33:00 -0800 Subject: [PATCH 27/54] Modified and added tests following review of WL#4738. - Added tests for innodb and semisync plugin - Modified existing tests to include variable values in I_S tables - Updated the all_vars test to include optional checkes for INNODB and semisync plugin if loaded mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_file_format_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_io_capacity_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_read_io_threads_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result: Updated result file mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_version_basic.result: New result file mysql-test/suite/sys_vars/r/innodb_write_io_threads_basic.result: New result file mysql-test/suite/sys_vars/r/last_insert_id_basic.result: Updated result file mysql-test/suite/sys_vars/r/lc_messages_basic.result: Updated result file mysql-test/suite/sys_vars/r/log_slow_queries_basic.result: Updated result file mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result: Updated result file mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result: Updated result file mysql-test/suite/sys_vars/r/max_join_size_basic.result: Updated result file mysql-test/suite/sys_vars/r/old_alter_table_basic.result: Updated result file mysql-test/suite/sys_vars/r/optimizer_switch_basic.result: Updated result file mysql-test/suite/sys_vars/r/profiling_basic.result: Updated result file mysql-test/suite/sys_vars/r/profiling_history_size_basic.result: Updated result file mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result: Updated result file mysql-test/suite/sys_vars/r/rand_seed1_basic.result: Updated result file mysql-test/suite/sys_vars/r/rand_seed2_basic.result: Updated result file mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result: Updated result file mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result: New result file mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result: New result file mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result: New result file mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result: New result file mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result: New result file mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result: New result file mysql-test/suite/sys_vars/r/sql_log_update_basic.result: Added check for variable values in I_S tables mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result: Added check for variable values in I_S tables mysql-test/suite/sys_vars/r/sql_select_limit_basic.result: Added check for variable values in I_S tables mysql-test/suite/sys_vars/r/thread_cache_size_basic.result: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/all_vars-master.opt: Added opt file for all_vars.test mysql-test/suite/sys_vars/t/all_vars.test: Modified test to check for semisync plugin and innodb mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_file_format_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_version_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test: Added test for innodb variable mysql-test/suite/sys_vars/t/last_insert_id_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/lc_messages_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/log_slow_queries_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/max_join_size_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/old_alter_table_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/optimizer_switch_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/profiling_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/profiling_history_size_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test: Added check for variable values in I_S tables and check for session variable being numeric mysql-test/suite/sys_vars/t/rand_seed1_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/rand_seed2_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt: Added option file for semisync variable test mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test: Added test file for semisync variable mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt: Added option file for semisync variable test mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test: Added test file for semisync variable mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt: Added option file for semisync variable test mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test: Added test file for semisync variable mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt: Added option file for semisync variable test mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test: Added test file for semisync variable mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt: Added option file for semisync variable test mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test: Added test file for semisync variable mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt: Added option file for semisync variable test mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test: Added test file for semisync variable mysql-test/suite/sys_vars/t/sql_log_update_basic.test: Added check for variable values in I_S tables and check for ON/OFF value changes mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/sql_select_limit_basic.test: Added check for variable values in I_S tables mysql-test/suite/sys_vars/t/thread_cache_size_basic.test: Added check for variable values in I_S tables --- .../r/innodb_adaptive_flushing_basic.result | 92 +++++++++++++ .../r/innodb_adaptive_hash_index_basic.result | 92 +++++++++++++ .../r/innodb_change_buffering_basic.result | 63 +++++++++ .../r/innodb_file_format_basic.result | 59 ++++++++ .../r/innodb_file_format_check_basic.result | 59 ++++++++ .../r/innodb_io_capacity_basic.result | 69 ++++++++++ .../r/innodb_old_blocks_pct_basic.result | 82 +++++++++++ .../r/innodb_old_blocks_time_basic.result | 56 ++++++++ .../innodb_read_ahead_threshold_basic.result | 73 ++++++++++ .../r/innodb_read_io_threads_basic.result | 21 +++ .../r/innodb_replication_delay_basic.result | 56 ++++++++ .../r/innodb_spin_wait_delay_basic.result | 56 ++++++++ .../r/innodb_stats_on_metadata_basic.result | 92 +++++++++++++ .../r/innodb_stats_sample_pages_basic.result | 56 ++++++++ .../r/innodb_strict_mode_basic.result | 120 ++++++++++++++++ .../r/innodb_thread_sleep_delay_basic.result | 130 +++++++----------- .../r/innodb_use_sys_malloc_basic.result | 25 ++++ .../sys_vars/r/innodb_version_basic.result | 17 +++ .../r/innodb_write_io_threads_basic.result | 21 +++ .../sys_vars/r/last_insert_id_basic.result | 20 ++- .../suite/sys_vars/r/lc_messages_basic.result | 8 +- .../sys_vars/r/log_slow_queries_basic.result | 20 +++ .../r/lower_case_file_system_basic.result | 25 ++-- .../r/lower_case_table_names_basic.result | 25 ++-- .../sys_vars/r/max_join_size_basic.result | 14 +- .../sys_vars/r/old_alter_table_basic.result | 14 +- .../sys_vars/r/optimizer_switch_basic.result | 16 ++- .../suite/sys_vars/r/profiling_basic.result | 34 ++++- .../r/profiling_history_size_basic.result | 14 +- .../sys_vars/r/pseudo_thread_id_basic.result | 23 ++-- .../suite/sys_vars/r/rand_seed1_basic.result | 5 + .../suite/sys_vars/r/rand_seed2_basic.result | 5 + .../r/relay_log_recovery_basic.result | 12 ++ .../rpl_semi_sync_master_enabled_basic.result | 73 ++++++++++ .../rpl_semi_sync_master_timeout_basic.result | 54 ++++++++ ..._semi_sync_master_trace_level_basic.result | 72 ++++++++++ ...emi_sync_master_wait_no_slave_basic.result | 73 ++++++++++ .../rpl_semi_sync_slave_enabled_basic.result | 73 ++++++++++ ...l_semi_sync_slave_trace_level_basic.result | 72 ++++++++++ .../sys_vars/r/sql_log_update_basic.result | 42 +++++- .../sys_vars/r/sql_max_join_size_basic.result | 18 ++- .../sys_vars/r/sql_select_limit_basic.result | 14 +- .../sys_vars/r/thread_cache_size_basic.result | 6 + .../suite/sys_vars/t/all_vars-master.opt | 1 + mysql-test/suite/sys_vars/t/all_vars.test | 25 ++++ .../t/innodb_adaptive_flushing_basic.test | 70 ++++++++++ .../t/innodb_adaptive_hash_index_basic.test | 70 ++++++++++ .../t/innodb_change_buffering_basic.test | 59 ++++++++ .../sys_vars/t/innodb_file_format_basic.test | 55 ++++++++ .../t/innodb_file_format_check_basic.test | 55 ++++++++ .../sys_vars/t/innodb_io_capacity_basic.test | 58 ++++++++ .../t/innodb_old_blocks_pct_basic.test | 63 +++++++++ .../t/innodb_old_blocks_time_basic.test | 52 +++++++ .../t/innodb_read_ahead_threshold_basic.test | 60 ++++++++ .../t/innodb_read_io_threads_basic.test | 26 ++++ .../t/innodb_replication_delay_basic.test | 52 +++++++ .../t/innodb_spin_wait_delay_basic.test | 52 +++++++ .../t/innodb_stats_on_metadata_basic.test | 70 ++++++++++ .../t/innodb_stats_sample_pages_basic.test | 52 +++++++ .../sys_vars/t/innodb_strict_mode_basic.test | 84 +++++++++++ .../t/innodb_thread_sleep_delay_basic.test | 52 +++++++ .../t/innodb_use_sys_malloc_basic.test | 28 ++++ .../sys_vars/t/innodb_version_basic.test | 28 ++++ .../t/innodb_write_io_threads_basic.test | 26 ++++ .../sys_vars/t/last_insert_id_basic.test | 14 +- .../suite/sys_vars/t/lc_messages_basic.test | 9 +- .../sys_vars/t/log_slow_queries_basic.test | 18 ++- .../t/lower_case_file_system_basic.test | 24 ++-- .../t/lower_case_table_names_basic.test | 25 ++-- .../suite/sys_vars/t/max_join_size_basic.test | 14 +- .../sys_vars/t/old_alter_table_basic.test | 11 +- .../sys_vars/t/optimizer_switch_basic.test | 13 +- .../suite/sys_vars/t/profiling_basic.test | 19 ++- .../t/profiling_history_size_basic.test | 11 +- .../sys_vars/t/pseudo_thread_id_basic.test | 24 +++- .../suite/sys_vars/t/rand_seed1_basic.test | 6 +- .../suite/sys_vars/t/rand_seed2_basic.test | 7 +- .../sys_vars/t/relay_log_recovery_basic.test | 10 ++ ..._semi_sync_master_enabled_basic-master.opt | 1 + .../t/rpl_semi_sync_master_enabled_basic.test | 62 +++++++++ ..._semi_sync_master_timeout_basic-master.opt | 1 + .../t/rpl_semi_sync_master_timeout_basic.test | 52 +++++++ ...i_sync_master_trace_level_basic-master.opt | 1 + ...pl_semi_sync_master_trace_level_basic.test | 60 ++++++++ ...sync_master_wait_no_slave_basic-master.opt | 1 + ..._semi_sync_master_wait_no_slave_basic.test | 62 +++++++++ ...l_semi_sync_slave_enabled_basic-master.opt | 1 + .../t/rpl_semi_sync_slave_enabled_basic.test | 63 +++++++++ ...mi_sync_slave_trace_level_basic-master.opt | 1 + ...rpl_semi_sync_slave_trace_level_basic.test | 60 ++++++++ .../sys_vars/t/sql_log_update_basic.test | 20 ++- .../sys_vars/t/sql_max_join_size_basic.test | 11 +- .../sys_vars/t/sql_select_limit_basic.test | 11 +- .../sys_vars/t/thread_cache_size_basic.test | 6 + 94 files changed, 3462 insertions(+), 165 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_file_format_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_io_capacity_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_read_io_threads_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_version_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_write_io_threads_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result create mode 100644 mysql-test/suite/sys_vars/t/all_vars-master.opt create mode 100644 mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_file_format_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_version_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result new file mode 100644 index 00000000000..418a693d319 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result @@ -0,0 +1,92 @@ +SET @start_global_value = @@global.innodb_adaptive_flushing; +SELECT @start_global_value; +@start_global_value +1 +Valid values are 'ON' and 'OFF' +select @@global.innodb_adaptive_flushing in (0, 1); +@@global.innodb_adaptive_flushing in (0, 1) +1 +select @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +1 +select @@session.innodb_adaptive_flushing; +ERROR HY000: Variable 'innodb_adaptive_flushing' is a GLOBAL variable +show global variables like 'innodb_adaptive_flushing'; +Variable_name Value +innodb_adaptive_flushing ON +show session variables like 'innodb_adaptive_flushing'; +Variable_name Value +innodb_adaptive_flushing ON +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +set global innodb_adaptive_flushing='OFF'; +select @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +0 +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING OFF +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING OFF +set @@global.innodb_adaptive_flushing=1; +select @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +1 +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +set global innodb_adaptive_flushing=0; +select @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +0 +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING OFF +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING OFF +set @@global.innodb_adaptive_flushing='ON'; +select @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +1 +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +set session innodb_adaptive_flushing='OFF'; +ERROR HY000: Variable 'innodb_adaptive_flushing' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_adaptive_flushing='ON'; +ERROR HY000: Variable 'innodb_adaptive_flushing' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_adaptive_flushing=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing' +set global innodb_adaptive_flushing=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing' +set global innodb_adaptive_flushing=2; +ERROR 42000: Variable 'innodb_adaptive_flushing' can't be set to the value of '2' +NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_adaptive_flushing=-3; +select @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +1 +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_FLUSHING ON +set global innodb_adaptive_flushing='AUTO'; +ERROR 42000: Variable 'innodb_adaptive_flushing' can't be set to the value of 'AUTO' +SET @@global.innodb_adaptive_flushing = @start_global_value; +SELECT @@global.innodb_adaptive_flushing; +@@global.innodb_adaptive_flushing +1 diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result new file mode 100644 index 00000000000..bc908090627 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result @@ -0,0 +1,92 @@ +SET @start_global_value = @@global.innodb_adaptive_hash_index; +SELECT @start_global_value; +@start_global_value +1 +Valid values are 'ON' and 'OFF' +select @@global.innodb_adaptive_hash_index in (0, 1); +@@global.innodb_adaptive_hash_index in (0, 1) +1 +select @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +1 +select @@session.innodb_adaptive_hash_index; +ERROR HY000: Variable 'innodb_adaptive_hash_index' is a GLOBAL variable +show global variables like 'innodb_adaptive_hash_index'; +Variable_name Value +innodb_adaptive_hash_index ON +show session variables like 'innodb_adaptive_hash_index'; +Variable_name Value +innodb_adaptive_hash_index ON +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +set global innodb_adaptive_hash_index='OFF'; +select @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +0 +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX OFF +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX OFF +set @@global.innodb_adaptive_hash_index=1; +select @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +1 +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +set global innodb_adaptive_hash_index=0; +select @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +0 +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX OFF +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX OFF +set @@global.innodb_adaptive_hash_index='ON'; +select @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +1 +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +set session innodb_adaptive_hash_index='OFF'; +ERROR HY000: Variable 'innodb_adaptive_hash_index' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_adaptive_hash_index='ON'; +ERROR HY000: Variable 'innodb_adaptive_hash_index' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_adaptive_hash_index=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_hash_index' +set global innodb_adaptive_hash_index=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_hash_index' +set global innodb_adaptive_hash_index=2; +ERROR 42000: Variable 'innodb_adaptive_hash_index' can't be set to the value of '2' +NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_adaptive_hash_index=-3; +select @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +1 +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_ADAPTIVE_HASH_INDEX ON +set global innodb_adaptive_hash_index='AUTO'; +ERROR 42000: Variable 'innodb_adaptive_hash_index' can't be set to the value of 'AUTO' +SET @@global.innodb_adaptive_hash_index = @start_global_value; +SELECT @@global.innodb_adaptive_hash_index; +@@global.innodb_adaptive_hash_index +1 diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result new file mode 100644 index 00000000000..70b0425ce6f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result @@ -0,0 +1,63 @@ +SET @start_global_value = @@global.innodb_change_buffering; +SELECT @start_global_value; +@start_global_value +inserts +Valid values are 'inserts' and 'none' +select @@global.innodb_change_buffering in ('inserts', 'none'); +@@global.innodb_change_buffering in ('inserts', 'none') +1 +select @@global.innodb_change_buffering; +@@global.innodb_change_buffering +inserts +select @@session.innodb_change_buffering; +ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable +show global variables like 'innodb_change_buffering'; +Variable_name Value +innodb_change_buffering inserts +show session variables like 'innodb_change_buffering'; +Variable_name Value +innodb_change_buffering inserts +select * from information_schema.global_variables where variable_name='innodb_change_buffering'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING inserts +select * from information_schema.session_variables where variable_name='innodb_change_buffering'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING inserts +set global innodb_change_buffering='none'; +select @@global.innodb_change_buffering; +@@global.innodb_change_buffering +none +select * from information_schema.global_variables where variable_name='innodb_change_buffering'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING none +select * from information_schema.session_variables where variable_name='innodb_change_buffering'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING none +set @@global.innodb_change_buffering='inserts'; +select @@global.innodb_change_buffering; +@@global.innodb_change_buffering +inserts +select * from information_schema.global_variables where variable_name='innodb_change_buffering'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING inserts +select * from information_schema.session_variables where variable_name='innodb_change_buffering'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING inserts +set session innodb_change_buffering='some'; +ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_change_buffering='some'; +ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_change_buffering=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering' +set global innodb_change_buffering=1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering' +set global innodb_change_buffering=-2; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering' +set global innodb_change_buffering=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering' +set global innodb_change_buffering='some'; +ERROR 42000: Variable 'innodb_change_buffering' can't be set to the value of 'some' +SET @@global.innodb_change_buffering = @start_global_value; +SELECT @@global.innodb_change_buffering; +@@global.innodb_change_buffering +inserts diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result new file mode 100644 index 00000000000..58e009ea705 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result @@ -0,0 +1,59 @@ +SET @start_global_value = @@global.innodb_file_format; +SELECT @start_global_value; +@start_global_value +Antelope +Valid values are 'Antelope' and 'Barracuda' +select @@global.innodb_file_format in ('Antelope', 'Barracuda'); +@@global.innodb_file_format in ('Antelope', 'Barracuda') +1 +select @@global.innodb_file_format; +@@global.innodb_file_format +Antelope +select @@session.innodb_file_format; +ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable +show global variables like 'innodb_file_format'; +Variable_name Value +innodb_file_format Antelope +show session variables like 'innodb_file_format'; +Variable_name Value +innodb_file_format Antelope +select * from information_schema.global_variables where variable_name='innodb_file_format'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT Antelope +select * from information_schema.session_variables where variable_name='innodb_file_format'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT Antelope +set global innodb_file_format='Antelope'; +select @@global.innodb_file_format; +@@global.innodb_file_format +Antelope +select * from information_schema.global_variables where variable_name='innodb_file_format'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT Antelope +select * from information_schema.session_variables where variable_name='innodb_file_format'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT Antelope +set @@global.innodb_file_format='Barracuda'; +select @@global.innodb_file_format; +@@global.innodb_file_format +Barracuda +select * from information_schema.global_variables where variable_name='innodb_file_format'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT Barracuda +select * from information_schema.session_variables where variable_name='innodb_file_format'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT Barracuda +set session innodb_file_format='Salmon'; +ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_file_format='Salmon'; +ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_file_format=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_file_format' +set global innodb_file_format=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_file_format' +set global innodb_file_format='Salmon'; +ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Salmon' +SET @@global.innodb_file_format = @start_global_value; +SELECT @@global.innodb_file_format; +@@global.innodb_file_format +Antelope diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result new file mode 100644 index 00000000000..29be30cf096 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result @@ -0,0 +1,59 @@ +SET @start_global_value = @@global.innodb_file_format_check; +SELECT @start_global_value; +@start_global_value +Antelope +Valid values are 'Antelope' and 'Barracuda' +select @@global.innodb_file_format_check in ('Antelope', 'Barracuda'); +@@global.innodb_file_format_check in ('Antelope', 'Barracuda') +1 +select @@global.innodb_file_format_check; +@@global.innodb_file_format_check +Antelope +select @@session.innodb_file_format_check; +ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable +show global variables like 'innodb_file_format_check'; +Variable_name Value +innodb_file_format_check Antelope +show session variables like 'innodb_file_format_check'; +Variable_name Value +innodb_file_format_check Antelope +select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT_CHECK Antelope +select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT_CHECK Antelope +set global innodb_file_format_check='Antelope'; +select @@global.innodb_file_format_check; +@@global.innodb_file_format_check +Antelope +select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT_CHECK Antelope +select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT_CHECK Antelope +set @@global.innodb_file_format_check='Barracuda'; +select @@global.innodb_file_format_check; +@@global.innodb_file_format_check +Barracuda +select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT_CHECK Barracuda +select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_FILE_FORMAT_CHECK Barracuda +set session innodb_file_format_check='Salmon'; +ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_file_format_check='Salmon'; +ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_file_format_check=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_file_format_check' +set global innodb_file_format_check=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_file_format_check' +set global innodb_file_format_check='Salmon'; +ERROR 42000: Variable 'innodb_file_format_check' can't be set to the value of 'Salmon' +SET @@global.innodb_file_format_check = @start_global_value; +SELECT @@global.innodb_file_format_check; +@@global.innodb_file_format_check +Antelope diff --git a/mysql-test/suite/sys_vars/r/innodb_io_capacity_basic.result b/mysql-test/suite/sys_vars/r/innodb_io_capacity_basic.result new file mode 100644 index 00000000000..25058bc6f09 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_io_capacity_basic.result @@ -0,0 +1,69 @@ +SET @start_global_value = @@global.innodb_io_capacity; +SELECT @start_global_value; +@start_global_value +200 +Valid value 100 or more +select @@global.innodb_io_capacity > 99; +@@global.innodb_io_capacity > 99 +1 +select @@global.innodb_io_capacity; +@@global.innodb_io_capacity +200 +select @@session.innodb_io_capacity; +ERROR HY000: Variable 'innodb_io_capacity' is a GLOBAL variable +show global variables like 'innodb_io_capacity'; +Variable_name Value +innodb_io_capacity 200 +show session variables like 'innodb_io_capacity'; +Variable_name Value +innodb_io_capacity 200 +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_IO_CAPACITY 200 +select * from information_schema.session_variables where variable_name='innodb_io_capacity'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_IO_CAPACITY 200 +set global innodb_io_capacity=123; +select @@global.innodb_io_capacity; +@@global.innodb_io_capacity +123 +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_IO_CAPACITY 123 +select * from information_schema.session_variables where variable_name='innodb_io_capacity'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_IO_CAPACITY 123 +set session innodb_io_capacity=444; +ERROR HY000: Variable 'innodb_io_capacity' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_io_capacity=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity' +set global innodb_io_capacity=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity' +set global innodb_io_capacity="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity' +set global innodb_io_capacity=7; +Warnings: +Warning 1292 Truncated incorrect innodb_io_capacity value: '7' +select @@global.innodb_io_capacity; +@@global.innodb_io_capacity +100 +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_IO_CAPACITY 100 +set global innodb_io_capacity=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_io_capacity value: '-7' +select @@global.innodb_io_capacity; +@@global.innodb_io_capacity +100 +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_IO_CAPACITY 100 +set global innodb_io_capacity=100; +select @@global.innodb_io_capacity; +@@global.innodb_io_capacity +100 +SET @@global.innodb_io_capacity = @start_global_value; +SELECT @@global.innodb_io_capacity; +@@global.innodb_io_capacity +200 diff --git a/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result new file mode 100644 index 00000000000..bbcc2dabb22 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result @@ -0,0 +1,82 @@ +SET @start_global_value = @@global.innodb_old_blocks_pct; +SELECT @start_global_value; +@start_global_value +37 +Valid values are between 5 and 95 +select @@global.innodb_old_blocks_pct between 5 and 95; +@@global.innodb_old_blocks_pct between 5 and 95 +1 +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +37 +select @@session.innodb_old_blocks_pct; +ERROR HY000: Variable 'innodb_old_blocks_pct' is a GLOBAL variable +show global variables like 'innodb_old_blocks_pct'; +Variable_name Value +innodb_old_blocks_pct 37 +show session variables like 'innodb_old_blocks_pct'; +Variable_name Value +innodb_old_blocks_pct 37 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 37 +select * from information_schema.session_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 37 +set global innodb_old_blocks_pct=10; +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +10 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 10 +select * from information_schema.session_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 10 +set session innodb_old_blocks_pct=1; +ERROR HY000: Variable 'innodb_old_blocks_pct' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_old_blocks_pct=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct' +set global innodb_old_blocks_pct=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct' +set global innodb_old_blocks_pct="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct' +set global innodb_old_blocks_pct=4; +Warnings: +Warning 1292 Truncated incorrect innodb_old_blocks_pct value: '4' +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +5 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 5 +set global innodb_old_blocks_pct=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_old_blocks_pct value: '-7' +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +5 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 5 +set global innodb_old_blocks_pct=96; +Warnings: +Warning 1292 Truncated incorrect innodb_old_blocks_pct value: '96' +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +95 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_PCT 95 +set global innodb_old_blocks_pct=5; +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +5 +set global innodb_old_blocks_pct=95; +select @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +95 +SET @@global.innodb_old_blocks_pct = @start_global_value; +SELECT @@global.innodb_old_blocks_pct; +@@global.innodb_old_blocks_pct +37 diff --git a/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result b/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result new file mode 100644 index 00000000000..a285cc14a01 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result @@ -0,0 +1,56 @@ +SET @start_global_value = @@global.innodb_old_blocks_time; +SELECT @start_global_value; +@start_global_value +0 +Valid values are zero or above +select @@global.innodb_old_blocks_time >=0; +@@global.innodb_old_blocks_time >=0 +1 +select @@global.innodb_old_blocks_time; +@@global.innodb_old_blocks_time +0 +select @@session.innodb_old_blocks_time; +ERROR HY000: Variable 'innodb_old_blocks_time' is a GLOBAL variable +show global variables like 'innodb_old_blocks_time'; +Variable_name Value +innodb_old_blocks_time 0 +show session variables like 'innodb_old_blocks_time'; +Variable_name Value +innodb_old_blocks_time 0 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_time'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_TIME 0 +select * from information_schema.session_variables where variable_name='innodb_old_blocks_time'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_TIME 0 +set global innodb_old_blocks_time=10; +select @@global.innodb_old_blocks_time; +@@global.innodb_old_blocks_time +10 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_time'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_TIME 10 +select * from information_schema.session_variables where variable_name='innodb_old_blocks_time'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_TIME 10 +set session innodb_old_blocks_time=1; +ERROR HY000: Variable 'innodb_old_blocks_time' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_old_blocks_time=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_time' +set global innodb_old_blocks_time=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_time' +set global innodb_old_blocks_time="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_time' +set global innodb_old_blocks_time=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_old_blocks_time value: '-7' +select @@global.innodb_old_blocks_time; +@@global.innodb_old_blocks_time +0 +select * from information_schema.global_variables where variable_name='innodb_old_blocks_time'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_OLD_BLOCKS_TIME 0 +SET @@global.innodb_old_blocks_time = @start_global_value; +SELECT @@global.innodb_old_blocks_time; +@@global.innodb_old_blocks_time +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result b/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result new file mode 100644 index 00000000000..65a1a8e319f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result @@ -0,0 +1,73 @@ +SET @start_global_value = @@global.innodb_read_ahead_threshold; +SELECT @start_global_value; +@start_global_value +56 +Valid values are between 0 and 64 +select @@global.innodb_read_ahead_threshold between 0 and 64; +@@global.innodb_read_ahead_threshold between 0 and 64 +1 +select @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +56 +select @@session.innodb_read_ahead_threshold; +ERROR HY000: Variable 'innodb_read_ahead_threshold' is a GLOBAL variable +show global variables like 'innodb_read_ahead_threshold'; +Variable_name Value +innodb_read_ahead_threshold 56 +show session variables like 'innodb_read_ahead_threshold'; +Variable_name Value +innodb_read_ahead_threshold 56 +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_AHEAD_THRESHOLD 56 +select * from information_schema.session_variables where variable_name='innodb_read_ahead_threshold'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_AHEAD_THRESHOLD 56 +set global innodb_read_ahead_threshold=10; +select @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +10 +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_AHEAD_THRESHOLD 10 +select * from information_schema.session_variables where variable_name='innodb_read_ahead_threshold'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_AHEAD_THRESHOLD 10 +set session innodb_read_ahead_threshold=1; +ERROR HY000: Variable 'innodb_read_ahead_threshold' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_read_ahead_threshold=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold' +set global innodb_read_ahead_threshold=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold' +set global innodb_read_ahead_threshold="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold' +set global innodb_read_ahead_threshold=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_read_ahead_threshold value: '-7' +select @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +0 +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_AHEAD_THRESHOLD 0 +set global innodb_read_ahead_threshold=96; +Warnings: +Warning 1292 Truncated incorrect innodb_read_ahead_threshold value: '96' +select @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +64 +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_AHEAD_THRESHOLD 64 +set global innodb_read_ahead_threshold=0; +select @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +0 +set global innodb_read_ahead_threshold=64; +select @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +64 +SET @@global.innodb_read_ahead_threshold = @start_global_value; +SELECT @@global.innodb_read_ahead_threshold; +@@global.innodb_read_ahead_threshold +56 diff --git a/mysql-test/suite/sys_vars/r/innodb_read_io_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_read_io_threads_basic.result new file mode 100644 index 00000000000..f43fa81c0d0 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_read_io_threads_basic.result @@ -0,0 +1,21 @@ +select @@global.innodb_read_io_threads; +@@global.innodb_read_io_threads +2 +select @@session.innodb_read_io_threads; +ERROR HY000: Variable 'innodb_read_io_threads' is a GLOBAL variable +show global variables like 'innodb_read_io_threads'; +Variable_name Value +innodb_read_io_threads 2 +show session variables like 'innodb_read_io_threads'; +Variable_name Value +innodb_read_io_threads 2 +select * from information_schema.global_variables where variable_name='innodb_read_io_threads'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_IO_THREADS 2 +select * from information_schema.session_variables where variable_name='innodb_read_io_threads'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_READ_IO_THREADS 2 +set global innodb_read_io_threads=1; +ERROR HY000: Variable 'innodb_read_io_threads' is a read only variable +set session innodb_read_io_threads=1; +ERROR HY000: Variable 'innodb_read_io_threads' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result new file mode 100644 index 00000000000..fa00baa218e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result @@ -0,0 +1,56 @@ +SET @start_global_value = @@global.innodb_replication_delay; +SELECT @start_global_value; +@start_global_value +0 +Valid values are zero or above +select @@global.innodb_replication_delay >=0; +@@global.innodb_replication_delay >=0 +1 +select @@global.innodb_replication_delay; +@@global.innodb_replication_delay +0 +select @@session.innodb_replication_delay; +ERROR HY000: Variable 'innodb_replication_delay' is a GLOBAL variable +show global variables like 'innodb_replication_delay'; +Variable_name Value +innodb_replication_delay 0 +show session variables like 'innodb_replication_delay'; +Variable_name Value +innodb_replication_delay 0 +select * from information_schema.global_variables where variable_name='innodb_replication_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_REPLICATION_DELAY 0 +select * from information_schema.session_variables where variable_name='innodb_replication_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_REPLICATION_DELAY 0 +set global innodb_replication_delay=10; +select @@global.innodb_replication_delay; +@@global.innodb_replication_delay +10 +select * from information_schema.global_variables where variable_name='innodb_replication_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_REPLICATION_DELAY 10 +select * from information_schema.session_variables where variable_name='innodb_replication_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_REPLICATION_DELAY 10 +set session innodb_replication_delay=1; +ERROR HY000: Variable 'innodb_replication_delay' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_replication_delay=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay' +set global innodb_replication_delay=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay' +set global innodb_replication_delay="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay' +set global innodb_replication_delay=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_replication_delay value: '-7' +select @@global.innodb_replication_delay; +@@global.innodb_replication_delay +0 +select * from information_schema.global_variables where variable_name='innodb_replication_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_REPLICATION_DELAY 0 +SET @@global.innodb_replication_delay = @start_global_value; +SELECT @@global.innodb_replication_delay; +@@global.innodb_replication_delay +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result new file mode 100644 index 00000000000..05672cbb966 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result @@ -0,0 +1,56 @@ +SET @start_global_value = @@global.innodb_spin_wait_delay; +SELECT @start_global_value; +@start_global_value +6 +Valid values are zero or above +select @@global.innodb_spin_wait_delay >=0; +@@global.innodb_spin_wait_delay >=0 +1 +select @@global.innodb_spin_wait_delay; +@@global.innodb_spin_wait_delay +6 +select @@session.innodb_spin_wait_delay; +ERROR HY000: Variable 'innodb_spin_wait_delay' is a GLOBAL variable +show global variables like 'innodb_spin_wait_delay'; +Variable_name Value +innodb_spin_wait_delay 6 +show session variables like 'innodb_spin_wait_delay'; +Variable_name Value +innodb_spin_wait_delay 6 +select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_SPIN_WAIT_DELAY 6 +select * from information_schema.session_variables where variable_name='innodb_spin_wait_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_SPIN_WAIT_DELAY 6 +set global innodb_spin_wait_delay=10; +select @@global.innodb_spin_wait_delay; +@@global.innodb_spin_wait_delay +10 +select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_SPIN_WAIT_DELAY 10 +select * from information_schema.session_variables where variable_name='innodb_spin_wait_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_SPIN_WAIT_DELAY 10 +set session innodb_spin_wait_delay=1; +ERROR HY000: Variable 'innodb_spin_wait_delay' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_spin_wait_delay=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay' +set global innodb_spin_wait_delay=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay' +set global innodb_spin_wait_delay="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay' +set global innodb_spin_wait_delay=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '-7' +select @@global.innodb_spin_wait_delay; +@@global.innodb_spin_wait_delay +0 +select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_SPIN_WAIT_DELAY 0 +SET @@global.innodb_spin_wait_delay = @start_global_value; +SELECT @@global.innodb_spin_wait_delay; +@@global.innodb_spin_wait_delay +6 diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result new file mode 100644 index 00000000000..d3410d7b9c1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result @@ -0,0 +1,92 @@ +SET @start_global_value = @@global.innodb_stats_on_metadata; +SELECT @start_global_value; +@start_global_value +1 +Valid values are 'ON' and 'OFF' +select @@global.innodb_stats_on_metadata in (0, 1); +@@global.innodb_stats_on_metadata in (0, 1) +1 +select @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +1 +select @@session.innodb_stats_on_metadata; +ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable +show global variables like 'innodb_stats_on_metadata'; +Variable_name Value +innodb_stats_on_metadata ON +show session variables like 'innodb_stats_on_metadata'; +Variable_name Value +innodb_stats_on_metadata ON +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +set global innodb_stats_on_metadata='OFF'; +select @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +0 +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA OFF +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA OFF +set @@global.innodb_stats_on_metadata=1; +select @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +1 +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +set global innodb_stats_on_metadata=0; +select @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +0 +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA OFF +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA OFF +set @@global.innodb_stats_on_metadata='ON'; +select @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +1 +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +set session innodb_stats_on_metadata='OFF'; +ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_stats_on_metadata='ON'; +ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_stats_on_metadata=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_stats_on_metadata' +set global innodb_stats_on_metadata=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_stats_on_metadata' +set global innodb_stats_on_metadata=2; +ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of '2' +NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_stats_on_metadata=-3; +select @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +1 +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_ON_METADATA ON +set global innodb_stats_on_metadata='AUTO'; +ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of 'AUTO' +SET @@global.innodb_stats_on_metadata = @start_global_value; +SELECT @@global.innodb_stats_on_metadata; +@@global.innodb_stats_on_metadata +1 diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result new file mode 100644 index 00000000000..153ae95a4fe --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result @@ -0,0 +1,56 @@ +SET @start_global_value = @@global.innodb_stats_sample_pages; +SELECT @start_global_value; +@start_global_value +8 +Valid values are one or above +select @@global.innodb_stats_sample_pages >=1; +@@global.innodb_stats_sample_pages >=1 +1 +select @@global.innodb_stats_sample_pages; +@@global.innodb_stats_sample_pages +8 +select @@session.innodb_stats_sample_pages; +ERROR HY000: Variable 'innodb_stats_sample_pages' is a GLOBAL variable +show global variables like 'innodb_stats_sample_pages'; +Variable_name Value +innodb_stats_sample_pages 8 +show session variables like 'innodb_stats_sample_pages'; +Variable_name Value +innodb_stats_sample_pages 8 +select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_SAMPLE_PAGES 8 +select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_SAMPLE_PAGES 8 +set global innodb_stats_sample_pages=10; +select @@global.innodb_stats_sample_pages; +@@global.innodb_stats_sample_pages +10 +select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_SAMPLE_PAGES 10 +select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_SAMPLE_PAGES 10 +set session innodb_stats_sample_pages=1; +ERROR HY000: Variable 'innodb_stats_sample_pages' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_stats_sample_pages=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages' +set global innodb_stats_sample_pages=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages' +set global innodb_stats_sample_pages="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages' +set global innodb_stats_sample_pages=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_stats_sample_pages value: '-7' +select @@global.innodb_stats_sample_pages; +@@global.innodb_stats_sample_pages +1 +select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STATS_SAMPLE_PAGES 1 +SET @@global.innodb_stats_sample_pages = @start_global_value; +SELECT @@global.innodb_stats_sample_pages; +@@global.innodb_stats_sample_pages +8 diff --git a/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result b/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result new file mode 100644 index 00000000000..200f9166215 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result @@ -0,0 +1,120 @@ +SET @start_global_value = @@global.innodb_strict_mode; +SELECT @start_global_value; +@start_global_value +0 +Valid values are 'ON' and 'OFF' +select @@global.innodb_strict_mode in (0, 1); +@@global.innodb_strict_mode in (0, 1) +1 +select @@global.innodb_strict_mode; +@@global.innodb_strict_mode +0 +select @@session.innodb_strict_mode in (0, 1); +@@session.innodb_strict_mode in (0, 1) +1 +select @@session.innodb_strict_mode; +@@session.innodb_strict_mode +0 +show global variables like 'innodb_strict_mode'; +Variable_name Value +innodb_strict_mode OFF +show session variables like 'innodb_strict_mode'; +Variable_name Value +innodb_strict_mode OFF +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE OFF +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE OFF +set global innodb_strict_mode='OFF'; +set session innodb_strict_mode='OFF'; +select @@global.innodb_strict_mode; +@@global.innodb_strict_mode +0 +select @@session.innodb_strict_mode; +@@session.innodb_strict_mode +0 +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE OFF +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE OFF +set @@global.innodb_strict_mode=1; +set @@session.innodb_strict_mode=1; +select @@global.innodb_strict_mode; +@@global.innodb_strict_mode +1 +select @@session.innodb_strict_mode; +@@session.innodb_strict_mode +1 +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE ON +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE ON +set global innodb_strict_mode=0; +set session innodb_strict_mode=0; +select @@global.innodb_strict_mode; +@@global.innodb_strict_mode +0 +select @@session.innodb_strict_mode; +@@session.innodb_strict_mode +0 +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE OFF +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE OFF +set @@global.innodb_strict_mode='ON'; +set @@session.innodb_strict_mode='ON'; +select @@global.innodb_strict_mode; +@@global.innodb_strict_mode +1 +select @@session.innodb_strict_mode; +@@session.innodb_strict_mode +1 +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE ON +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE ON +set global innodb_strict_mode=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_strict_mode' +set session innodb_strict_mode=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_strict_mode' +set global innodb_strict_mode=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_strict_mode' +set session innodb_strict_mode=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_strict_mode' +set global innodb_strict_mode=2; +ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of '2' +set session innodb_strict_mode=2; +ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of '2' +set global innodb_strict_mode='AUTO'; +ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of 'AUTO' +set session innodb_strict_mode='AUTO'; +ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of 'AUTO' +NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_strict_mode=-3; +set session innodb_strict_mode=-7; +select @@global.innodb_strict_mode; +@@global.innodb_strict_mode +1 +select @@session.innodb_strict_mode; +@@session.innodb_strict_mode +1 +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE ON +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_STRICT_MODE ON +SET @@global.innodb_strict_mode = @start_global_value; +SELECT @@global.innodb_strict_mode; +@@global.innodb_strict_mode +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result index 979bfd930ca..fb7093ec3b3 100644 --- a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result @@ -1,84 +1,56 @@ -SET @global_start_value = @@global.innodb_thread_sleep_delay; -SELECT @global_start_value; -@global_start_value +SET @start_global_value = @@global.innodb_thread_sleep_delay; +SELECT @start_global_value; +@start_global_value 10000 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_thread_sleep_delay = 0; -SET @@global.innodb_thread_sleep_delay = DEFAULT; -SELECT @@global.innodb_thread_sleep_delay; +Valid values are zero or above +select @@global.innodb_thread_sleep_delay >=0; +@@global.innodb_thread_sleep_delay >=0 +1 +select @@global.innodb_thread_sleep_delay; @@global.innodb_thread_sleep_delay 10000 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_thread_sleep_delay = 1; +select @@session.innodb_thread_sleep_delay; +ERROR HY000: Variable 'innodb_thread_sleep_delay' is a GLOBAL variable +show global variables like 'innodb_thread_sleep_delay'; +Variable_name Value +innodb_thread_sleep_delay 10000 +show session variables like 'innodb_thread_sleep_delay'; +Variable_name Value +innodb_thread_sleep_delay 10000 +select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_THREAD_SLEEP_DELAY 10000 +select * from information_schema.session_variables where variable_name='innodb_thread_sleep_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_THREAD_SLEEP_DELAY 10000 +set global innodb_thread_sleep_delay=10; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +10 +select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_THREAD_SLEEP_DELAY 10 +select * from information_schema.session_variables where variable_name='innodb_thread_sleep_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_THREAD_SLEEP_DELAY 10 +set session innodb_thread_sleep_delay=1; ERROR HY000: Variable 'innodb_thread_sleep_delay' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_thread_sleep_delay; -@@innodb_thread_sleep_delay +set global innodb_thread_sleep_delay=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' +set global innodb_thread_sleep_delay=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' +set global innodb_thread_sleep_delay="foo"; +ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' +set global innodb_thread_sleep_delay=-7; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7' +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +0 +select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_THREAD_SLEEP_DELAY 0 +SET @@global.innodb_thread_sleep_delay = @start_global_value; +SELECT @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay 10000 -SELECT local.innodb_thread_sleep_delay; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_thread_sleep_delay = 0; -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -0 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_thread_sleep_delay = 0; -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -0 -SET @@global.innodb_thread_sleep_delay = 1; -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -1 -SET @@global.innodb_thread_sleep_delay = 4294967295; -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -4294967295 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_thread_sleep_delay = -1; -SELECT @@global.innodb_autoextend_increment; -@@global.innodb_autoextend_increment -8 -SET @@global.innodb_thread_sleep_delay = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' -SELECT @@global.innodb_autoextend_increment; -@@global.innodb_autoextend_increment -8 -SET @@global.innodb_thread_sleep_delay = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' -SELECT @@global.innodb_autoextend_increment; -@@global.innodb_autoextend_increment -8 -SET @@global.innodb_thread_sleep_delay = 1001; -SELECT @@global.innodb_autoextend_increment; -@@global.innodb_autoextend_increment -8 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_thread_sleep_delay = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_thread_sleep_delay'; -@@global.innodb_thread_sleep_delay = VARIABLE_VALUE -1 -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='innodb_thread_sleep_delay'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_thread_sleep_delay = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -1001 -SET @@global.innodb_thread_sleep_delay = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_thread_sleep_delay = TRUE; -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -1 -SET @@global.innodb_thread_sleep_delay = FALSE; -SELECT @@global.innodb_thread_sleep_delay; -@@global.innodb_thread_sleep_delay -0 diff --git a/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result new file mode 100644 index 00000000000..0c2685b1a49 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result @@ -0,0 +1,25 @@ +Valid values are 'ON' and 'OFF' +select @@global.innodb_adaptive_flushing in (0, 1); +@@global.innodb_adaptive_flushing in (0, 1) +1 +select @@global.innodb_use_sys_malloc; +@@global.innodb_use_sys_malloc +1 +select @@session.innodb_use_sys_malloc; +ERROR HY000: Variable 'innodb_use_sys_malloc' is a GLOBAL variable +show global variables like 'innodb_use_sys_malloc'; +Variable_name Value +innodb_use_sys_malloc ON +show session variables like 'innodb_use_sys_malloc'; +Variable_name Value +innodb_use_sys_malloc ON +select * from information_schema.global_variables where variable_name='innodb_use_sys_malloc'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_USE_SYS_MALLOC ON +select * from information_schema.session_variables where variable_name='innodb_use_sys_malloc'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_USE_SYS_MALLOC ON +set global innodb_use_sys_malloc=1; +ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable +set session innodb_use_sys_malloc=1; +ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/innodb_version_basic.result b/mysql-test/suite/sys_vars/r/innodb_version_basic.result new file mode 100644 index 00000000000..759b5048512 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_version_basic.result @@ -0,0 +1,17 @@ +select @@global.innodb_version; +@@global.innodb_version +x.y.z +select @@session.innodb_version; +ERROR HY000: Variable 'innodb_version' is a GLOBAL variable +show global variables like 'innodb_version' disabled so to not change with every version; +show session variables like 'innodb_version' disabled so to not change with every version; +select VARIABLE_VALUE=@@global.innodb_version from information_schema.global_variables where variable_name='innodb_version'; +VARIABLE_VALUE=@@global.innodb_version +1 +select VARIABLE_VALUE=@@global.innodb_version from information_schema.session_variables where variable_name='innodb_version'; +VARIABLE_VALUE=@@global.innodb_version +1 +set global innodb_version=1; +ERROR HY000: Variable 'innodb_version' is a read only variable +set session innodb_version=1; +ERROR HY000: Variable 'innodb_version' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/innodb_write_io_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_write_io_threads_basic.result new file mode 100644 index 00000000000..a363f4292dd --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_write_io_threads_basic.result @@ -0,0 +1,21 @@ +select @@global.innodb_write_io_threads; +@@global.innodb_write_io_threads +2 +select @@session.innodb_write_io_threads; +ERROR HY000: Variable 'innodb_write_io_threads' is a GLOBAL variable +show global variables like 'innodb_write_io_threads'; +Variable_name Value +innodb_write_io_threads 2 +show session variables like 'innodb_write_io_threads'; +Variable_name Value +innodb_write_io_threads 2 +select * from information_schema.global_variables where variable_name='innodb_write_io_threads'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_WRITE_IO_THREADS 2 +select * from information_schema.session_variables where variable_name='innodb_write_io_threads'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_WRITE_IO_THREADS 2 +set global innodb_write_io_threads=1; +ERROR HY000: Variable 'innodb_write_io_threads' is a read only variable +set session innodb_write_io_threads=1; +ERROR HY000: Variable 'innodb_write_io_threads' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/last_insert_id_basic.result b/mysql-test/suite/sys_vars/r/last_insert_id_basic.result index c29a313b9e7..a4ae20dbabb 100644 --- a/mysql-test/suite/sys_vars/r/last_insert_id_basic.result +++ b/mysql-test/suite/sys_vars/r/last_insert_id_basic.result @@ -13,12 +13,24 @@ VARIABLE_NAME VARIABLE_VALUE select * from information_schema.session_variables where variable_name='last_insert_id'; VARIABLE_NAME VARIABLE_VALUE LAST_INSERT_ID 0 -set session last_insert_id=1; +set global last_insert_id=99; +ERROR HY000: Variable 'last_insert_id' is a SESSION variable and can't be used with SET GLOBAL +set session last_insert_id=42; +select @@global.last_insert_id; +ERROR HY000: Variable 'last_insert_id' is a SESSION variable select @@session.last_insert_id; @@session.last_insert_id -1 -set global last_insert_id=1; -ERROR HY000: Variable 'last_insert_id' is a SESSION variable and can't be used with SET GLOBAL +42 +show global variables like 'last_insert_id'; +Variable_name Value +show session variables like 'last_insert_id'; +Variable_name Value +last_insert_id 42 +select * from information_schema.global_variables where variable_name='last_insert_id'; +VARIABLE_NAME VARIABLE_VALUE +select * from information_schema.session_variables where variable_name='last_insert_id'; +VARIABLE_NAME VARIABLE_VALUE +LAST_INSERT_ID 42 set session last_insert_id=1.1; ERROR 42000: Incorrect argument type to variable 'last_insert_id' set session last_insert_id=1e1; diff --git a/mysql-test/suite/sys_vars/r/lc_messages_basic.result b/mysql-test/suite/sys_vars/r/lc_messages_basic.result index e765dd53516..b9350828dba 100644 --- a/mysql-test/suite/sys_vars/r/lc_messages_basic.result +++ b/mysql-test/suite/sys_vars/r/lc_messages_basic.result @@ -29,13 +29,19 @@ select @@session.lc_messages; @@session.lc_messages ja_JP set global lc_messages="en_US"; +set session lc_messages="en_GB"; select @@global.lc_messages; @@global.lc_messages en_US -set session lc_messages="en_GB"; select @@session.lc_messages; @@session.lc_messages en_GB +select * from information_schema.global_variables where variable_name='lc_messages'; +VARIABLE_NAME VARIABLE_VALUE +LC_MESSAGES en_US +select * from information_schema.session_variables where variable_name='lc_messages'; +VARIABLE_NAME VARIABLE_VALUE +LC_MESSAGES en_GB set global lc_messages=1.1; ERROR 42000: Incorrect argument type to variable 'lc_messages' set global lc_messages=1e1; diff --git a/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result b/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result index ca530ebb41a..1748406b74b 100644 --- a/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result +++ b/mysql-test/suite/sys_vars/r/log_slow_queries_basic.result @@ -65,12 +65,22 @@ Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed i SELECT @@global.log_slow_queries; @@global.log_slow_queries 0 +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; +IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +1 SET @@global.log_slow_queries = 1; Warnings: Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead SELECT @@global.log_slow_queries; @@global.log_slow_queries 1 +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; +IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +1 '#---------------------FN_DYNVARS_004_07----------------------#' SET @@global.log_slow_queries = TRUE; Warnings: @@ -78,12 +88,22 @@ Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed i SELECT @@global.log_slow_queries; @@global.log_slow_queries 1 +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; +IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +1 SET @@global.log_slow_queries = FALSE; Warnings: Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead SELECT @@global.log_slow_queries; @@global.log_slow_queries 0 +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; +IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +1 '#---------------------FN_DYNVARS_004_08----------------------#' SET @@global.log_slow_queries = ON; Warnings: diff --git a/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result b/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result index 0488ed30dc0..4ecd81685c5 100644 --- a/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result +++ b/mysql-test/suite/sys_vars/r/lower_case_file_system_basic.result @@ -3,18 +3,19 @@ select @@global.lower_case_file_system=2; 0 select @@session.lower_case_file_system; ERROR HY000: Variable 'lower_case_file_system' is a GLOBAL variable -show global variables like 'lower_case_file_system'; -Variable_name Value -lower_case_file_system # -show session variables like 'lower_case_file_system'; -Variable_name Value -lower_case_file_system # -select * from information_schema.global_variables where variable_name='lower_case_file_system'; -VARIABLE_NAME VARIABLE_VALUE -LOWER_CASE_FILE_SYSTEM # -select * from information_schema.session_variables where variable_name='lower_case_file_system'; -VARIABLE_NAME VARIABLE_VALUE -LOWER_CASE_FILE_SYSTEM # +SELECT @@global.lower_case_file_system in (0,1); +@@global.lower_case_file_system in (0,1) +1 +SELECT IF(@@global.lower_case_file_system, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='lower_case_file_system'; +IF(@@global.lower_case_file_system, "ON", "OFF") = VARIABLE_VALUE +1 +SELECT IF(@@global.lower_case_file_system, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='lower_case_file_system'; +IF(@@global.lower_case_file_system, "ON", "OFF") = VARIABLE_VALUE +1 set global lower_case_file_system=1; ERROR HY000: Variable 'lower_case_file_system' is a read only variable set session lower_case_file_system=1; diff --git a/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result b/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result index d7dc6d69e30..cae6ecb215c 100644 --- a/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result +++ b/mysql-test/suite/sys_vars/r/lower_case_table_names_basic.result @@ -3,18 +3,19 @@ select @@global.lower_case_table_names=20; 0 select @@session.lower_case_table_names; ERROR HY000: Variable 'lower_case_table_names' is a GLOBAL variable -show global variables like 'lower_case_table_names'; -Variable_name Value -lower_case_table_names # -show session variables like 'lower_case_table_names'; -Variable_name Value -lower_case_table_names # -select * from information_schema.global_variables where variable_name='lower_case_table_names'; -VARIABLE_NAME VARIABLE_VALUE -LOWER_CASE_TABLE_NAMES # -select * from information_schema.session_variables where variable_name='lower_case_table_names'; -VARIABLE_NAME VARIABLE_VALUE -LOWER_CASE_TABLE_NAMES # +SELECT @@global.lower_case_table_names in (0,1,2); +@@global.lower_case_table_names in (0,1,2) +1 +SELECT @@global.lower_case_table_names = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='lower_case_table_names'; +@@global.lower_case_table_names = VARIABLE_VALUE +1 +SELECT @@global.lower_case_table_names = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='lower_case_table_names'; +@@global.lower_case_table_names = VARIABLE_VALUE +1 set global lower_case_table_names=1; ERROR HY000: Variable 'lower_case_table_names' is a read only variable set session lower_case_table_names=1; diff --git a/mysql-test/suite/sys_vars/r/max_join_size_basic.result b/mysql-test/suite/sys_vars/r/max_join_size_basic.result index 5cebefe9ea3..acf9f123238 100644 --- a/mysql-test/suite/sys_vars/r/max_join_size_basic.result +++ b/mysql-test/suite/sys_vars/r/max_join_size_basic.result @@ -21,13 +21,25 @@ select * from information_schema.session_variables where variable_name='max_join VARIABLE_NAME VARIABLE_VALUE MAX_JOIN_SIZE 18446744073709551615 set global max_join_size=10; +set session max_join_size=20; select @@global.max_join_size; @@global.max_join_size 10 -set session max_join_size=20; select @@session.max_join_size; @@session.max_join_size 20 +show global variables like 'max_join_size'; +Variable_name Value +max_join_size 10 +show session variables like 'max_join_size'; +Variable_name Value +max_join_size 20 +select * from information_schema.global_variables where variable_name='max_join_size'; +VARIABLE_NAME VARIABLE_VALUE +MAX_JOIN_SIZE 10 +select * from information_schema.session_variables where variable_name='max_join_size'; +VARIABLE_NAME VARIABLE_VALUE +MAX_JOIN_SIZE 20 set global max_join_size=1.1; ERROR 42000: Incorrect argument type to variable 'max_join_size' set global max_join_size=1e1; diff --git a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result index 0619235b8e0..5cc17917242 100644 --- a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result +++ b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result @@ -21,13 +21,25 @@ select * from information_schema.session_variables where variable_name='old_alte VARIABLE_NAME VARIABLE_VALUE OLD_ALTER_TABLE OFF set global old_alter_table=1; +set session old_alter_table=ON; select @@global.old_alter_table; @@global.old_alter_table 1 -set session old_alter_table=ON; select @@session.old_alter_table; @@session.old_alter_table 1 +show global variables like 'old_alter_table'; +Variable_name Value +old_alter_table ON +show session variables like 'old_alter_table'; +Variable_name Value +old_alter_table ON +select * from information_schema.global_variables where variable_name='old_alter_table'; +VARIABLE_NAME VARIABLE_VALUE +OLD_ALTER_TABLE ON +select * from information_schema.session_variables where variable_name='old_alter_table'; +VARIABLE_NAME VARIABLE_VALUE +OLD_ALTER_TABLE ON set global old_alter_table=1.1; ERROR 42000: Incorrect argument type to variable 'old_alter_table' set global old_alter_table=1e1; diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index 2d648259a26..acc8cd699f8 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -21,21 +21,33 @@ select * from information_schema.session_variables where variable_name='optimize VARIABLE_NAME VARIABLE_VALUE OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set global optimizer_switch=10; +set session optimizer_switch=5; select @@global.optimizer_switch; @@global.optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=off -set session optimizer_switch=5; select @@session.optimizer_switch; @@session.optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off set global optimizer_switch="index_merge_sort_union=on"; +set session optimizer_switch="index_merge=off"; select @@global.optimizer_switch; @@global.optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off -set session optimizer_switch="index_merge=off"; select @@session.optimizer_switch; @@session.optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off +show global variables like 'optimizer_switch'; +Variable_name Value +optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +show session variables like 'optimizer_switch'; +Variable_name Value +optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off +select * from information_schema.global_variables where variable_name='optimizer_switch'; +VARIABLE_NAME VARIABLE_VALUE +OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +select * from information_schema.session_variables where variable_name='optimizer_switch'; +VARIABLE_NAME VARIABLE_VALUE +OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch diff --git a/mysql-test/suite/sys_vars/r/profiling_basic.result b/mysql-test/suite/sys_vars/r/profiling_basic.result index 26704b6b725..4f987d690ba 100644 --- a/mysql-test/suite/sys_vars/r/profiling_basic.result +++ b/mysql-test/suite/sys_vars/r/profiling_basic.result @@ -21,13 +21,45 @@ select * from information_schema.session_variables where variable_name='profilin VARIABLE_NAME VARIABLE_VALUE PROFILING OFF set global profiling=1; +set session profiling=ON; select @@global.profiling; @@global.profiling 1 -set session profiling=ON; select @@session.profiling; @@session.profiling 1 +show global variables like 'profiling'; +Variable_name Value +profiling ON +show session variables like 'profiling'; +Variable_name Value +profiling ON +select * from information_schema.global_variables where variable_name='profiling'; +VARIABLE_NAME VARIABLE_VALUE +PROFILING ON +select * from information_schema.session_variables where variable_name='profiling'; +VARIABLE_NAME VARIABLE_VALUE +PROFILING ON +set global profiling=0; +set session profiling=OFF; +select @@global.profiling; +@@global.profiling +0 +select @@session.profiling; +@@session.profiling +0 +show global variables like 'profiling'; +Variable_name Value +profiling OFF +show session variables like 'profiling'; +Variable_name Value +profiling OFF +select * from information_schema.global_variables where variable_name='profiling'; +VARIABLE_NAME VARIABLE_VALUE +PROFILING OFF +select * from information_schema.session_variables where variable_name='profiling'; +VARIABLE_NAME VARIABLE_VALUE +PROFILING OFF set global profiling=1.1; ERROR 42000: Incorrect argument type to variable 'profiling' set global profiling=1e1; diff --git a/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result b/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result index be92d075326..396d280ad18 100644 --- a/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result +++ b/mysql-test/suite/sys_vars/r/profiling_history_size_basic.result @@ -21,13 +21,25 @@ select * from information_schema.session_variables where variable_name='profilin VARIABLE_NAME VARIABLE_VALUE PROFILING_HISTORY_SIZE 15 set global profiling_history_size=10; +set session profiling_history_size=20; select @@global.profiling_history_size; @@global.profiling_history_size 10 -set session profiling_history_size=20; select @@session.profiling_history_size; @@session.profiling_history_size 20 +show global variables like 'profiling_history_size'; +Variable_name Value +profiling_history_size 10 +show session variables like 'profiling_history_size'; +Variable_name Value +profiling_history_size 20 +select * from information_schema.global_variables where variable_name='profiling_history_size'; +VARIABLE_NAME VARIABLE_VALUE +PROFILING_HISTORY_SIZE 10 +select * from information_schema.session_variables where variable_name='profiling_history_size'; +VARIABLE_NAME VARIABLE_VALUE +PROFILING_HISTORY_SIZE 20 set global profiling_history_size=1.1; ERROR 42000: Incorrect argument type to variable 'profiling_history_size' set global profiling_history_size=1e1; diff --git a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result index e6619e206f1..6b0a8899560 100644 --- a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result +++ b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result @@ -1,22 +1,29 @@ select @@global.pseudo_thread_id; ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable -select @@session.pseudo_thread_id=0; -@@session.pseudo_thread_id=0 -0 +select @@session.pseudo_thread_id between 1 and 1000; +@@session.pseudo_thread_id between 1 and 1000 +1 +should be empty show global variables like 'pseudo_thread_id'; Variable_name Value show session variables like 'pseudo_thread_id'; Variable_name Value pseudo_thread_id # +should be empty select * from information_schema.global_variables where variable_name='pseudo_thread_id'; VARIABLE_NAME VARIABLE_VALUE -select * from information_schema.session_variables where variable_name='pseudo_thread_id'; -VARIABLE_NAME VARIABLE_VALUE -PSEUDO_THREAD_ID # -set session pseudo_thread_id=1; +select @@session.pseudo_thread_id = variable_value from information_schema.session_variables where variable_name='pseudo_thread_id'; +@@session.pseudo_thread_id = variable_value +1 +set session pseudo_thread_id=42; select @@session.pseudo_thread_id; @@session.pseudo_thread_id -1 +42 +select * from information_schema.global_variables where variable_name='pseudo_thread_id'; +VARIABLE_NAME VARIABLE_VALUE +select variable_value from information_schema.session_variables where variable_name='pseudo_thread_id'; +variable_value +42 set global pseudo_thread_id=1; ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable and can't be used with SET GLOBAL set session pseudo_thread_id=1.1; diff --git a/mysql-test/suite/sys_vars/r/rand_seed1_basic.result b/mysql-test/suite/sys_vars/r/rand_seed1_basic.result index 7b92d533c9e..155d7169168 100644 --- a/mysql-test/suite/sys_vars/r/rand_seed1_basic.result +++ b/mysql-test/suite/sys_vars/r/rand_seed1_basic.result @@ -17,6 +17,11 @@ set session rand_seed1=1; select @@session.rand_seed1; @@session.rand_seed1 0 +select * from information_schema.global_variables where variable_name='rand_seed1'; +VARIABLE_NAME VARIABLE_VALUE +select * from information_schema.session_variables where variable_name='rand_seed1'; +VARIABLE_NAME VARIABLE_VALUE +RAND_SEED1 0 set global rand_seed1=1; ERROR HY000: Variable 'rand_seed1' is a SESSION variable and can't be used with SET GLOBAL set session rand_seed1=1.1; diff --git a/mysql-test/suite/sys_vars/r/rand_seed2_basic.result b/mysql-test/suite/sys_vars/r/rand_seed2_basic.result index 3d84aa3e37e..4974d8a53a3 100644 --- a/mysql-test/suite/sys_vars/r/rand_seed2_basic.result +++ b/mysql-test/suite/sys_vars/r/rand_seed2_basic.result @@ -17,6 +17,11 @@ set session rand_seed2=1; select @@session.rand_seed2; @@session.rand_seed2 0 +select * from information_schema.global_variables where variable_name='rand_seed2'; +VARIABLE_NAME VARIABLE_VALUE +select * from information_schema.session_variables where variable_name='rand_seed2'; +VARIABLE_NAME VARIABLE_VALUE +RAND_SEED2 0 set global rand_seed2=1; ERROR HY000: Variable 'rand_seed2' is a SESSION variable and can't be used with SET GLOBAL set session rand_seed2=1.1; diff --git a/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result b/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result index 97b991ce65b..af3b51bcffe 100644 --- a/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result +++ b/mysql-test/suite/sys_vars/r/relay_log_recovery_basic.result @@ -23,10 +23,22 @@ set global relay_log_recovery=1; select @@global.relay_log_recovery; @@global.relay_log_recovery 1 +select * from information_schema.global_variables where variable_name='relay_log_recovery'; +VARIABLE_NAME VARIABLE_VALUE +RELAY_LOG_RECOVERY ON +select * from information_schema.session_variables where variable_name='relay_log_recovery'; +VARIABLE_NAME VARIABLE_VALUE +RELAY_LOG_RECOVERY ON set global relay_log_recovery=OFF; select @@global.relay_log_recovery; @@global.relay_log_recovery 0 +select * from information_schema.global_variables where variable_name='relay_log_recovery'; +VARIABLE_NAME VARIABLE_VALUE +RELAY_LOG_RECOVERY OFF +select * from information_schema.session_variables where variable_name='relay_log_recovery'; +VARIABLE_NAME VARIABLE_VALUE +RELAY_LOG_RECOVERY OFF set session relay_log_recovery=1; ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable and should be set with SET GLOBAL set global relay_log_recovery=1.1; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result new file mode 100644 index 00000000000..ad3ca0de0fa --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result @@ -0,0 +1,73 @@ +INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; +select @@global.rpl_semi_sync_master_enabled; +@@global.rpl_semi_sync_master_enabled +0 +SET @start_global_value = @@global.rpl_semi_sync_master_enabled; +select @@global.rpl_semi_sync_master_enabled in (0,1); +@@global.rpl_semi_sync_master_enabled in (0,1) +1 +select @@session.rpl_semi_sync_master_enabled; +ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_enabled'; +Variable_name Value +rpl_semi_sync_master_enabled OFF +show session variables like 'rpl_semi_sync_master_enabled'; +Variable_name Value +rpl_semi_sync_master_enabled OFF +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_ENABLED OFF +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_ENABLED OFF +set global rpl_semi_sync_master_enabled=0; +set session rpl_semi_sync_master_enabled=0; +ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_master_enabled; +@@global.rpl_semi_sync_master_enabled +0 +select @@session.rpl_semi_sync_master_enabled; +ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_enabled'; +Variable_name Value +rpl_semi_sync_master_enabled OFF +show session variables like 'rpl_semi_sync_master_enabled'; +Variable_name Value +rpl_semi_sync_master_enabled OFF +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_ENABLED OFF +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_ENABLED OFF +set global rpl_semi_sync_master_enabled=1; +set session rpl_semi_sync_master_enabled=1; +ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_master_enabled; +@@global.rpl_semi_sync_master_enabled +-1 +select @@session.rpl_semi_sync_master_enabled; +ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_enabled'; +Variable_name Value +rpl_semi_sync_master_enabled ON +show session variables like 'rpl_semi_sync_master_enabled'; +Variable_name Value +rpl_semi_sync_master_enabled ON +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_ENABLED ON +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_ENABLED ON +set global rpl_semi_sync_master_enabled=1.1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_enabled' +set global rpl_semi_sync_master_enabled=1e1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_enabled' +set global rpl_semi_sync_master_enabled="some text"; +ERROR 42000: Variable 'rpl_semi_sync_master_enabled' can't be set to the value of 'some text' +SET @@global.rpl_semi_sync_master_enabled = @start_global_value; +select @@global.rpl_semi_sync_master_enabled; +@@global.rpl_semi_sync_master_enabled +0 +UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result new file mode 100644 index 00000000000..e77bcc1c12a --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result @@ -0,0 +1,54 @@ +INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; +select @@global.rpl_semi_sync_master_timeout; +@@global.rpl_semi_sync_master_timeout +10000 +SET @start_global_value = @@global.rpl_semi_sync_master_timeout; +Assuming value will not be more then 100 sec +select @@global.rpl_semi_sync_master_timeout between 1 and 100000; +@@global.rpl_semi_sync_master_timeout between 1 and 100000 +1 +select @@session.rpl_semi_sync_master_timeout; +ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_timeout'; +Variable_name Value +rpl_semi_sync_master_timeout 10000 +show session variables like 'rpl_semi_sync_master_timeout'; +Variable_name Value +rpl_semi_sync_master_timeout 10000 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_timeout'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TIMEOUT 10000 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_timeout'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TIMEOUT 10000 +set global rpl_semi_sync_master_timeout=42; +set session rpl_semi_sync_master_timeout=99; +ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_master_timeout; +@@global.rpl_semi_sync_master_timeout +42 +select @@session.rpl_semi_sync_master_timeout; +ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_timeout'; +Variable_name Value +rpl_semi_sync_master_timeout 42 +show session variables like 'rpl_semi_sync_master_timeout'; +Variable_name Value +rpl_semi_sync_master_timeout 42 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_timeout'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TIMEOUT 42 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_timeout'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TIMEOUT 42 +set global rpl_semi_sync_master_timeout=1.1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_timeout' +set global rpl_semi_sync_master_timeout=1e1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_timeout' +set global rpl_semi_sync_master_timeout="some text"; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_timeout' +SET @@global.rpl_semi_sync_master_timeout = @start_global_value; +select @@global.rpl_semi_sync_master_timeout; +@@global.rpl_semi_sync_master_timeout +10000 +UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result new file mode 100644 index 00000000000..55df5f57d9e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result @@ -0,0 +1,72 @@ +INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; +select @@global.rpl_semi_sync_master_trace_level; +@@global.rpl_semi_sync_master_trace_level +32 +SET @start_global_value = @@global.rpl_semi_sync_master_trace_level; +select @@global.rpl_semi_sync_master_trace_level in (1,16,32,64); +@@global.rpl_semi_sync_master_trace_level in (1,16,32,64) +1 +select @@session.rpl_semi_sync_master_trace_level; +ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_trace_level'; +Variable_name Value +rpl_semi_sync_master_trace_level 32 +show session variables like 'rpl_semi_sync_master_trace_level'; +Variable_name Value +rpl_semi_sync_master_trace_level 32 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TRACE_LEVEL 32 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TRACE_LEVEL 32 +set global rpl_semi_sync_master_trace_level=16; +set session rpl_semi_sync_master_trace_level=99; +ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_master_trace_level; +@@global.rpl_semi_sync_master_trace_level +16 +select @@session.rpl_semi_sync_master_trace_level; +ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_trace_level'; +Variable_name Value +rpl_semi_sync_master_trace_level 16 +show session variables like 'rpl_semi_sync_master_trace_level'; +Variable_name Value +rpl_semi_sync_master_trace_level 16 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TRACE_LEVEL 16 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TRACE_LEVEL 16 +NOTE: Value can also be set to values that are combinations of values +set global rpl_semi_sync_master_trace_level=42; +select @@global.rpl_semi_sync_master_trace_level; +@@global.rpl_semi_sync_master_trace_level +42 +select @@session.rpl_semi_sync_master_trace_level; +ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_trace_level'; +Variable_name Value +rpl_semi_sync_master_trace_level 42 +show session variables like 'rpl_semi_sync_master_trace_level'; +Variable_name Value +rpl_semi_sync_master_trace_level 42 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TRACE_LEVEL 42 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_TRACE_LEVEL 42 +set global rpl_semi_sync_master_trace_level=1.1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_trace_level' +set global rpl_semi_sync_master_trace_level=1e1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_trace_level' +set global rpl_semi_sync_master_trace_level="some text"; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_trace_level' +SET @@global.rpl_semi_sync_master_trace_level = @start_global_value; +select @@global.rpl_semi_sync_master_trace_level; +@@global.rpl_semi_sync_master_trace_level +32 +UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result new file mode 100644 index 00000000000..3d951b499ed --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result @@ -0,0 +1,73 @@ +INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; +select @@global.rpl_semi_sync_master_wait_no_slave; +@@global.rpl_semi_sync_master_wait_no_slave +1 +SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave; +select @@global.rpl_semi_sync_master_wait_no_slave in (0,1); +@@global.rpl_semi_sync_master_wait_no_slave in (0,1) +1 +select @@session.rpl_semi_sync_master_wait_no_slave; +ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_wait_no_slave'; +Variable_name Value +rpl_semi_sync_master_wait_no_slave ON +show session variables like 'rpl_semi_sync_master_wait_no_slave'; +Variable_name Value +rpl_semi_sync_master_wait_no_slave ON +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE ON +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE ON +set global rpl_semi_sync_master_wait_no_slave=0; +set session rpl_semi_sync_master_wait_no_slave=0; +ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_master_wait_no_slave; +@@global.rpl_semi_sync_master_wait_no_slave +0 +select @@session.rpl_semi_sync_master_wait_no_slave; +ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_wait_no_slave'; +Variable_name Value +rpl_semi_sync_master_wait_no_slave OFF +show session variables like 'rpl_semi_sync_master_wait_no_slave'; +Variable_name Value +rpl_semi_sync_master_wait_no_slave OFF +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE OFF +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE OFF +set global rpl_semi_sync_master_wait_no_slave=1; +set session rpl_semi_sync_master_wait_no_slave=1; +ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_master_wait_no_slave; +@@global.rpl_semi_sync_master_wait_no_slave +1 +select @@session.rpl_semi_sync_master_wait_no_slave; +ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable +show global variables like 'rpl_semi_sync_master_wait_no_slave'; +Variable_name Value +rpl_semi_sync_master_wait_no_slave ON +show session variables like 'rpl_semi_sync_master_wait_no_slave'; +Variable_name Value +rpl_semi_sync_master_wait_no_slave ON +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE ON +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE ON +set global rpl_semi_sync_master_wait_no_slave=1.1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_wait_no_slave' +set global rpl_semi_sync_master_wait_no_slave=1e1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_master_wait_no_slave' +set global rpl_semi_sync_master_wait_no_slave="some text"; +ERROR 42000: Variable 'rpl_semi_sync_master_wait_no_slave' can't be set to the value of 'some text' +SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value; +select @@global.rpl_semi_sync_master_wait_no_slave; +@@global.rpl_semi_sync_master_wait_no_slave +1 +UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result new file mode 100644 index 00000000000..25688f55ecd --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result @@ -0,0 +1,73 @@ +INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; +select @@global.rpl_semi_sync_slave_enabled; +@@global.rpl_semi_sync_slave_enabled +0 +SET @start_global_value = @@global.rpl_semi_sync_slave_enabled; +select @@global.rpl_semi_sync_slave_enabled in (0,1); +@@global.rpl_semi_sync_slave_enabled in (0,1) +1 +select @@session.rpl_semi_sync_slave_enabled; +ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable +show global variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled OFF +show session variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled OFF +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_ENABLED OFF +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_ENABLED OFF +set global rpl_semi_sync_slave_enabled=0; +set session rpl_semi_sync_slave_enabled=0; +ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_slave_enabled; +@@global.rpl_semi_sync_slave_enabled +0 +select @@session.rpl_semi_sync_slave_enabled; +ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable +show global variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled OFF +show session variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled OFF +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_ENABLED OFF +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_ENABLED OFF +set global rpl_semi_sync_slave_enabled=1; +set session rpl_semi_sync_slave_enabled=1; +ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_slave_enabled; +@@global.rpl_semi_sync_slave_enabled +-1 +select @@session.rpl_semi_sync_slave_enabled; +ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable +show global variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled ON +show session variables like 'rpl_semi_sync_slave_enabled'; +Variable_name Value +rpl_semi_sync_slave_enabled ON +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_ENABLED ON +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_enabled'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_ENABLED ON +set global rpl_semi_sync_slave_enabled=1.1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_slave_enabled' +set global rpl_semi_sync_slave_enabled=1e1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_slave_enabled' +set global rpl_semi_sync_slave_enabled="some text"; +ERROR 42000: Variable 'rpl_semi_sync_slave_enabled' can't be set to the value of 'some text' +SET @@global.rpl_semi_sync_slave_enabled = @start_global_value; +select @@global.rpl_semi_sync_slave_enabled; +@@global.rpl_semi_sync_slave_enabled +0 +UNINSTALL PLUGIN rpl_semi_sync_slave; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result new file mode 100644 index 00000000000..f7796309aea --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result @@ -0,0 +1,72 @@ +INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; +select @@global.rpl_semi_sync_slave_trace_level; +@@global.rpl_semi_sync_slave_trace_level +32 +SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level; +select @@global.rpl_semi_sync_slave_trace_level in (1,16,32,64); +@@global.rpl_semi_sync_slave_trace_level in (1,16,32,64) +1 +select @@session.rpl_semi_sync_slave_trace_level; +ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable +show global variables like 'rpl_semi_sync_slave_trace_level'; +Variable_name Value +rpl_semi_sync_slave_trace_level 32 +show session variables like 'rpl_semi_sync_slave_trace_level'; +Variable_name Value +rpl_semi_sync_slave_trace_level 32 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL 32 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL 32 +set global rpl_semi_sync_slave_trace_level=16; +set session rpl_semi_sync_slave_trace_level=99; +ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL +select @@global.rpl_semi_sync_slave_trace_level; +@@global.rpl_semi_sync_slave_trace_level +16 +select @@session.rpl_semi_sync_slave_trace_level; +ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable +show global variables like 'rpl_semi_sync_slave_trace_level'; +Variable_name Value +rpl_semi_sync_slave_trace_level 16 +show session variables like 'rpl_semi_sync_slave_trace_level'; +Variable_name Value +rpl_semi_sync_slave_trace_level 16 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL 16 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL 16 +NOTE: Value can also be set to values that are combinations of values +set global rpl_semi_sync_slave_trace_level=42; +select @@global.rpl_semi_sync_slave_trace_level; +@@global.rpl_semi_sync_slave_trace_level +42 +select @@session.rpl_semi_sync_slave_trace_level; +ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable +show global variables like 'rpl_semi_sync_slave_trace_level'; +Variable_name Value +rpl_semi_sync_slave_trace_level 42 +show session variables like 'rpl_semi_sync_slave_trace_level'; +Variable_name Value +rpl_semi_sync_slave_trace_level 42 +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL 42 +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_trace_level'; +VARIABLE_NAME VARIABLE_VALUE +RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL 42 +set global rpl_semi_sync_slave_trace_level=1.1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_slave_trace_level' +set global rpl_semi_sync_slave_trace_level=1e1; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_slave_trace_level' +set global rpl_semi_sync_slave_trace_level="some text"; +ERROR 42000: Incorrect argument type to variable 'rpl_semi_sync_slave_trace_level' +SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value; +select @@global.rpl_semi_sync_slave_trace_level; +@@global.rpl_semi_sync_slave_trace_level +32 +UNINSTALL PLUGIN rpl_semi_sync_slave; diff --git a/mysql-test/suite/sys_vars/r/sql_log_update_basic.result b/mysql-test/suite/sys_vars/r/sql_log_update_basic.result index f48cf6870da..11cd039da00 100644 --- a/mysql-test/suite/sys_vars/r/sql_log_update_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_log_update_basic.result @@ -23,15 +23,51 @@ SQL_LOG_UPDATE ON set global sql_log_update=1; Warnings: Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored -select @@global.sql_log_update; -@@global.sql_log_update -1 set session sql_log_update=ON; Warnings: Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored +select @@global.sql_log_update; +@@global.sql_log_update +1 select @@session.sql_log_update; @@session.sql_log_update 1 +show global variables like 'sql_log_update'; +Variable_name Value +sql_log_update ON +show session variables like 'sql_log_update'; +Variable_name Value +sql_log_update ON +select * from information_schema.global_variables where variable_name='sql_log_update'; +VARIABLE_NAME VARIABLE_VALUE +SQL_LOG_UPDATE ON +select * from information_schema.session_variables where variable_name='sql_log_update'; +VARIABLE_NAME VARIABLE_VALUE +SQL_LOG_UPDATE ON +set global sql_log_update=0; +Warnings: +Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored +set session sql_log_update=OFF; +Warnings: +Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored +select @@global.sql_log_update; +@@global.sql_log_update +0 +select @@session.sql_log_update; +@@session.sql_log_update +0 +show global variables like 'sql_log_update'; +Variable_name Value +sql_log_update OFF +show session variables like 'sql_log_update'; +Variable_name Value +sql_log_update OFF +select * from information_schema.global_variables where variable_name='sql_log_update'; +VARIABLE_NAME VARIABLE_VALUE +SQL_LOG_UPDATE OFF +select * from information_schema.session_variables where variable_name='sql_log_update'; +VARIABLE_NAME VARIABLE_VALUE +SQL_LOG_UPDATE OFF set global sql_log_update=1.1; ERROR 42000: Incorrect argument type to variable 'sql_log_update' set global sql_log_update=1e1; diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result index 8aaea049b94..8ec2a60887f 100644 --- a/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result @@ -23,15 +23,27 @@ SQL_MAX_JOIN_SIZE 18446744073709551615 set global sql_max_join_size=10; Warnings: Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. -select @@global.sql_max_join_size; -@@global.sql_max_join_size -10 set session sql_max_join_size=20; Warnings: Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +select @@global.sql_max_join_size; +@@global.sql_max_join_size +10 select @@session.sql_max_join_size; @@session.sql_max_join_size 20 +show global variables like 'sql_max_join_size'; +Variable_name Value +sql_max_join_size 10 +show session variables like 'sql_max_join_size'; +Variable_name Value +sql_max_join_size 20 +select * from information_schema.global_variables where variable_name='sql_max_join_size'; +VARIABLE_NAME VARIABLE_VALUE +SQL_MAX_JOIN_SIZE 10 +select * from information_schema.session_variables where variable_name='sql_max_join_size'; +VARIABLE_NAME VARIABLE_VALUE +SQL_MAX_JOIN_SIZE 20 set global sql_max_join_size=1.1; ERROR 42000: Incorrect argument type to variable 'sql_max_join_size' set global sql_max_join_size=1e1; diff --git a/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result b/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result index c601fa148ce..78119cd9dff 100644 --- a/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_select_limit_basic.result @@ -21,13 +21,25 @@ select * from information_schema.session_variables where variable_name='sql_sele VARIABLE_NAME VARIABLE_VALUE SQL_SELECT_LIMIT 18446744073709551615 set global sql_select_limit=10; +set session sql_select_limit=20; select @@global.sql_select_limit; @@global.sql_select_limit 10 -set session sql_select_limit=20; select @@session.sql_select_limit; @@session.sql_select_limit 20 +show global variables like 'sql_select_limit'; +Variable_name Value +sql_select_limit 10 +show session variables like 'sql_select_limit'; +Variable_name Value +sql_select_limit 20 +select * from information_schema.global_variables where variable_name='sql_select_limit'; +VARIABLE_NAME VARIABLE_VALUE +SQL_SELECT_LIMIT 10 +select * from information_schema.session_variables where variable_name='sql_select_limit'; +VARIABLE_NAME VARIABLE_VALUE +SQL_SELECT_LIMIT 20 set global sql_select_limit=1.1; ERROR 42000: Incorrect argument type to variable 'sql_select_limit' set global sql_select_limit=1e1; diff --git a/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result b/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result index 1c802f1afdd..83501ca929b 100644 --- a/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/thread_cache_size_basic.result @@ -23,6 +23,12 @@ set global thread_cache_size=1; select @@global.thread_cache_size; @@global.thread_cache_size 1 +select * from information_schema.global_variables where variable_name='thread_cache_size'; +VARIABLE_NAME VARIABLE_VALUE +THREAD_CACHE_SIZE 1 +select * from information_schema.session_variables where variable_name='thread_cache_size'; +VARIABLE_NAME VARIABLE_VALUE +THREAD_CACHE_SIZE 1 set session thread_cache_size=1; ERROR HY000: Variable 'thread_cache_size' is a GLOBAL variable and should be set with SET GLOBAL set global thread_cache_size=1.1; diff --git a/mysql-test/suite/sys_vars/t/all_vars-master.opt b/mysql-test/suite/sys_vars/t/all_vars-master.opt new file mode 100644 index 00000000000..3eec696ce86 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/all_vars-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT --loose-innodb diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test index 6a18b5e3d37..0e831319898 100644 --- a/mysql-test/suite/sys_vars/t/all_vars.test +++ b/mysql-test/suite/sys_vars/t/all_vars.test @@ -15,6 +15,22 @@ --source include/not_embedded.inc +# 2010-01-28 OBN Added support to load 'innodb' and 'semisync' if possible. +# As we need to have there variables loaded if the components exist but do +# not want the test skiped if they are not, we cannot use the 'have_xxx' mecanizm. +# Added an 'all_vars-master.opt' file that includes +# "$SEMISYNC_PLUGIN_OPT --loose-innodb" (see $SEMISYNC_PLUGIN_OPT setting in mysql-test-run.pl) +# and logic similar to 'include/have_semisync_plugin.inc' that will load semisync plugin +if (`SELECT @@have_dynamic_loading = 'YES' AND LENGTH('$SEMISYNC_MASTER_PLUGIN') > 0`) +{ + --disable_query_log + eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; + eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; + --enable_query_log +} + + + # # This test verifies that *all* system variables are tested # by the sys_vars suite. For every system variable @@ -58,3 +74,12 @@ select variable_name as `There should be *no* variables listed below:` from t2 drop table t1; drop table t2; + +# Unloading the semisync plugins in case they were loaded +if (`SELECT @@have_dynamic_loading = 'YES' AND LENGTH('$SEMISYNC_MASTER_PLUGIN') > 0`) +{ + --disable_query_log + UNINSTALL PLUGIN rpl_semi_sync_master; + UNINSTALL PLUGIN rpl_semi_sync_slave; + --enable_query_log +} diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test new file mode 100644 index 00000000000..236b652f9c6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test @@ -0,0 +1,70 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_adaptive_flushing; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are 'ON' and 'OFF' +select @@global.innodb_adaptive_flushing in (0, 1); +select @@global.innodb_adaptive_flushing; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_adaptive_flushing; +show global variables like 'innodb_adaptive_flushing'; +show session variables like 'innodb_adaptive_flushing'; +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; + +# +# show that it's writable +# +set global innodb_adaptive_flushing='OFF'; +select @@global.innodb_adaptive_flushing; +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +set @@global.innodb_adaptive_flushing=1; +select @@global.innodb_adaptive_flushing; +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +set global innodb_adaptive_flushing=0; +select @@global.innodb_adaptive_flushing; +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +set @@global.innodb_adaptive_flushing='ON'; +select @@global.innodb_adaptive_flushing; +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +--error ER_GLOBAL_VARIABLE +set session innodb_adaptive_flushing='OFF'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_adaptive_flushing='ON'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_adaptive_flushing=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_adaptive_flushing=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_adaptive_flushing=2; +--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_adaptive_flushing=-3; +select @@global.innodb_adaptive_flushing; +select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_flushing'; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_adaptive_flushing='AUTO'; + +# +# Cleanup +# + +SET @@global.innodb_adaptive_flushing = @start_global_value; +SELECT @@global.innodb_adaptive_flushing; diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test new file mode 100644 index 00000000000..d6d48ab460c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test @@ -0,0 +1,70 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_adaptive_hash_index; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are 'ON' and 'OFF' +select @@global.innodb_adaptive_hash_index in (0, 1); +select @@global.innodb_adaptive_hash_index; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_adaptive_hash_index; +show global variables like 'innodb_adaptive_hash_index'; +show session variables like 'innodb_adaptive_hash_index'; +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; + +# +# show that it's writable +# +set global innodb_adaptive_hash_index='OFF'; +select @@global.innodb_adaptive_hash_index; +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +set @@global.innodb_adaptive_hash_index=1; +select @@global.innodb_adaptive_hash_index; +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +set global innodb_adaptive_hash_index=0; +select @@global.innodb_adaptive_hash_index; +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +set @@global.innodb_adaptive_hash_index='ON'; +select @@global.innodb_adaptive_hash_index; +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +--error ER_GLOBAL_VARIABLE +set session innodb_adaptive_hash_index='OFF'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_adaptive_hash_index='ON'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_adaptive_hash_index=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_adaptive_hash_index=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_adaptive_hash_index=2; +--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_adaptive_hash_index=-3; +select @@global.innodb_adaptive_hash_index; +select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; +select * from information_schema.session_variables where variable_name='innodb_adaptive_hash_index'; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_adaptive_hash_index='AUTO'; + +# +# Cleanup +# + +SET @@global.innodb_adaptive_hash_index = @start_global_value; +SELECT @@global.innodb_adaptive_hash_index; diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test new file mode 100644 index 00000000000..65e36aa9cb3 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test @@ -0,0 +1,59 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_change_buffering; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are 'inserts' and 'none' +select @@global.innodb_change_buffering in ('inserts', 'none'); +select @@global.innodb_change_buffering; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_change_buffering; +show global variables like 'innodb_change_buffering'; +show session variables like 'innodb_change_buffering'; +select * from information_schema.global_variables where variable_name='innodb_change_buffering'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering'; + +# +# show that it's writable +# +set global innodb_change_buffering='none'; +select @@global.innodb_change_buffering; +select * from information_schema.global_variables where variable_name='innodb_change_buffering'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering'; +set @@global.innodb_change_buffering='inserts'; +select @@global.innodb_change_buffering; +select * from information_schema.global_variables where variable_name='innodb_change_buffering'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering'; +--error ER_GLOBAL_VARIABLE +set session innodb_change_buffering='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_change_buffering='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering=1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_change_buffering='some'; + +# +# Cleanup +# + +SET @@global.innodb_change_buffering = @start_global_value; +SELECT @@global.innodb_change_buffering; diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test new file mode 100644 index 00000000000..bfc092f2f05 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test @@ -0,0 +1,55 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_file_format; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are 'Antelope' and 'Barracuda' +select @@global.innodb_file_format in ('Antelope', 'Barracuda'); +select @@global.innodb_file_format; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_file_format; +show global variables like 'innodb_file_format'; +show session variables like 'innodb_file_format'; +select * from information_schema.global_variables where variable_name='innodb_file_format'; +select * from information_schema.session_variables where variable_name='innodb_file_format'; + +# +# show that it's writable +# +set global innodb_file_format='Antelope'; +select @@global.innodb_file_format; +select * from information_schema.global_variables where variable_name='innodb_file_format'; +select * from information_schema.session_variables where variable_name='innodb_file_format'; +set @@global.innodb_file_format='Barracuda'; +select @@global.innodb_file_format; +select * from information_schema.global_variables where variable_name='innodb_file_format'; +select * from information_schema.session_variables where variable_name='innodb_file_format'; +--error ER_GLOBAL_VARIABLE +set session innodb_file_format='Salmon'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_file_format='Salmon'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_file_format=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_file_format=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_file_format='Salmon'; + +# +# Cleanup +# + +SET @@global.innodb_file_format = @start_global_value; +SELECT @@global.innodb_file_format; diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test new file mode 100644 index 00000000000..4c60957561c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test @@ -0,0 +1,55 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_file_format_check; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are 'Antelope' and 'Barracuda' +select @@global.innodb_file_format_check in ('Antelope', 'Barracuda'); +select @@global.innodb_file_format_check; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_file_format_check; +show global variables like 'innodb_file_format_check'; +show session variables like 'innodb_file_format_check'; +select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +select * from information_schema.session_variables where variable_name='innodb_file_format_check'; + +# +# show that it's writable +# +set global innodb_file_format_check='Antelope'; +select @@global.innodb_file_format_check; +select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +set @@global.innodb_file_format_check='Barracuda'; +select @@global.innodb_file_format_check; +select * from information_schema.global_variables where variable_name='innodb_file_format_check'; +select * from information_schema.session_variables where variable_name='innodb_file_format_check'; +--error ER_GLOBAL_VARIABLE +set session innodb_file_format_check='Salmon'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_file_format_check='Salmon'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_file_format_check=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_file_format_check=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_file_format_check='Salmon'; + +# +# Cleanup +# + +SET @@global.innodb_file_format_check = @start_global_value; +SELECT @@global.innodb_file_format_check; diff --git a/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test b/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test new file mode 100644 index 00000000000..3f00b50cf08 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test @@ -0,0 +1,58 @@ + + +# 2010-01-27 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_io_capacity; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid value 100 or more +select @@global.innodb_io_capacity > 99; +select @@global.innodb_io_capacity; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_io_capacity; +show global variables like 'innodb_io_capacity'; +show session variables like 'innodb_io_capacity'; +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +select * from information_schema.session_variables where variable_name='innodb_io_capacity'; + +# +# show that it's writable +# +set global innodb_io_capacity=123; +select @@global.innodb_io_capacity; +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +select * from information_schema.session_variables where variable_name='innodb_io_capacity'; +--error ER_GLOBAL_VARIABLE +set session innodb_io_capacity=444; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_io_capacity=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_io_capacity=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_io_capacity="foo"; + +set global innodb_io_capacity=7; +select @@global.innodb_io_capacity; +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; +set global innodb_io_capacity=-7; +select @@global.innodb_io_capacity; +select * from information_schema.global_variables where variable_name='innodb_io_capacity'; + +# +# min/max values +# +set global innodb_io_capacity=100; +select @@global.innodb_io_capacity; + +SET @@global.innodb_io_capacity = @start_global_value; +SELECT @@global.innodb_io_capacity; diff --git a/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test new file mode 100644 index 00000000000..0dcef3bb09f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test @@ -0,0 +1,63 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_old_blocks_pct; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are between 5 and 95 +select @@global.innodb_old_blocks_pct between 5 and 95; +select @@global.innodb_old_blocks_pct; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_old_blocks_pct; +show global variables like 'innodb_old_blocks_pct'; +show session variables like 'innodb_old_blocks_pct'; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +select * from information_schema.session_variables where variable_name='innodb_old_blocks_pct'; + +# +# show that it's writable +# +set global innodb_old_blocks_pct=10; +select @@global.innodb_old_blocks_pct; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +select * from information_schema.session_variables where variable_name='innodb_old_blocks_pct'; +--error ER_GLOBAL_VARIABLE +set session innodb_old_blocks_pct=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_old_blocks_pct=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_old_blocks_pct=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_old_blocks_pct="foo"; + +set global innodb_old_blocks_pct=4; +select @@global.innodb_old_blocks_pct; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +set global innodb_old_blocks_pct=-7; +select @@global.innodb_old_blocks_pct; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; +set global innodb_old_blocks_pct=96; +select @@global.innodb_old_blocks_pct; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct'; + +# +# min/max values +# +set global innodb_old_blocks_pct=5; +select @@global.innodb_old_blocks_pct; +set global innodb_old_blocks_pct=95; +select @@global.innodb_old_blocks_pct; + +SET @@global.innodb_old_blocks_pct = @start_global_value; +SELECT @@global.innodb_old_blocks_pct; diff --git a/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test b/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test new file mode 100644 index 00000000000..3efec2bbf15 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test @@ -0,0 +1,52 @@ + +# +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_old_blocks_time; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are zero or above +select @@global.innodb_old_blocks_time >=0; +select @@global.innodb_old_blocks_time; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_old_blocks_time; +show global variables like 'innodb_old_blocks_time'; +show session variables like 'innodb_old_blocks_time'; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_time'; +select * from information_schema.session_variables where variable_name='innodb_old_blocks_time'; + +# +# show that it's writable +# +set global innodb_old_blocks_time=10; +select @@global.innodb_old_blocks_time; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_time'; +select * from information_schema.session_variables where variable_name='innodb_old_blocks_time'; +--error ER_GLOBAL_VARIABLE +set session innodb_old_blocks_time=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_old_blocks_time=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_old_blocks_time=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_old_blocks_time="foo"; + +set global innodb_old_blocks_time=-7; +select @@global.innodb_old_blocks_time; +select * from information_schema.global_variables where variable_name='innodb_old_blocks_time'; + +# +# cleanup +# +SET @@global.innodb_old_blocks_time = @start_global_value; +SELECT @@global.innodb_old_blocks_time; diff --git a/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test b/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test new file mode 100644 index 00000000000..1298a28b3d3 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test @@ -0,0 +1,60 @@ + + +# 2010-01-27 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_read_ahead_threshold; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are between 0 and 64 +select @@global.innodb_read_ahead_threshold between 0 and 64; +select @@global.innodb_read_ahead_threshold; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_read_ahead_threshold; +show global variables like 'innodb_read_ahead_threshold'; +show session variables like 'innodb_read_ahead_threshold'; +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +select * from information_schema.session_variables where variable_name='innodb_read_ahead_threshold'; + +# +# show that it's writable +# +set global innodb_read_ahead_threshold=10; +select @@global.innodb_read_ahead_threshold; +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +select * from information_schema.session_variables where variable_name='innodb_read_ahead_threshold'; +--error ER_GLOBAL_VARIABLE +set session innodb_read_ahead_threshold=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_read_ahead_threshold=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_read_ahead_threshold=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_read_ahead_threshold="foo"; + +set global innodb_read_ahead_threshold=-7; +select @@global.innodb_read_ahead_threshold; +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; +set global innodb_read_ahead_threshold=96; +select @@global.innodb_read_ahead_threshold; +select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold'; + +# +# min/max values +# +set global innodb_read_ahead_threshold=0; +select @@global.innodb_read_ahead_threshold; +set global innodb_read_ahead_threshold=64; +select @@global.innodb_read_ahead_threshold; + +SET @@global.innodb_read_ahead_threshold = @start_global_value; +SELECT @@global.innodb_read_ahead_threshold; diff --git a/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test new file mode 100644 index 00000000000..14426395d6c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test @@ -0,0 +1,26 @@ + +# +# 2010-01-27 OBN - Added (this variable is also covered in innodb_file_io_threads_basic.test) +# + +--source include/have_innodb.inc + +# +# show the global and session values; +# +select @@global.innodb_read_io_threads; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_read_io_threads; +show global variables like 'innodb_read_io_threads'; +show session variables like 'innodb_read_io_threads'; +select * from information_schema.global_variables where variable_name='innodb_read_io_threads'; +select * from information_schema.session_variables where variable_name='innodb_read_io_threads'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_read_io_threads=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session innodb_read_io_threads=1; + diff --git a/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test new file mode 100644 index 00000000000..e495de46611 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test @@ -0,0 +1,52 @@ + +# +# 2010-01-27 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_replication_delay; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are zero or above +select @@global.innodb_replication_delay >=0; +select @@global.innodb_replication_delay; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_replication_delay; +show global variables like 'innodb_replication_delay'; +show session variables like 'innodb_replication_delay'; +select * from information_schema.global_variables where variable_name='innodb_replication_delay'; +select * from information_schema.session_variables where variable_name='innodb_replication_delay'; + +# +# show that it's writable +# +set global innodb_replication_delay=10; +select @@global.innodb_replication_delay; +select * from information_schema.global_variables where variable_name='innodb_replication_delay'; +select * from information_schema.session_variables where variable_name='innodb_replication_delay'; +--error ER_GLOBAL_VARIABLE +set session innodb_replication_delay=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_replication_delay=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_replication_delay=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_replication_delay="foo"; + +set global innodb_replication_delay=-7; +select @@global.innodb_replication_delay; +select * from information_schema.global_variables where variable_name='innodb_replication_delay'; + +# +# cleanup +# +SET @@global.innodb_replication_delay = @start_global_value; +SELECT @@global.innodb_replication_delay; diff --git a/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test new file mode 100644 index 00000000000..8f2eee08b6a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test @@ -0,0 +1,52 @@ + +# +# 2010-01-27 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_spin_wait_delay; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are zero or above +select @@global.innodb_spin_wait_delay >=0; +select @@global.innodb_spin_wait_delay; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_spin_wait_delay; +show global variables like 'innodb_spin_wait_delay'; +show session variables like 'innodb_spin_wait_delay'; +select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; +select * from information_schema.session_variables where variable_name='innodb_spin_wait_delay'; + +# +# show that it's writable +# +set global innodb_spin_wait_delay=10; +select @@global.innodb_spin_wait_delay; +select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; +select * from information_schema.session_variables where variable_name='innodb_spin_wait_delay'; +--error ER_GLOBAL_VARIABLE +set session innodb_spin_wait_delay=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_spin_wait_delay=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_spin_wait_delay=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_spin_wait_delay="foo"; + +set global innodb_spin_wait_delay=-7; +select @@global.innodb_spin_wait_delay; +select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; + +# +# cleanup +# +SET @@global.innodb_spin_wait_delay = @start_global_value; +SELECT @@global.innodb_spin_wait_delay; diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test new file mode 100644 index 00000000000..e6d59997ac6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test @@ -0,0 +1,70 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_stats_on_metadata; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are 'ON' and 'OFF' +select @@global.innodb_stats_on_metadata in (0, 1); +select @@global.innodb_stats_on_metadata; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_stats_on_metadata; +show global variables like 'innodb_stats_on_metadata'; +show session variables like 'innodb_stats_on_metadata'; +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; + +# +# show that it's writable +# +set global innodb_stats_on_metadata='OFF'; +select @@global.innodb_stats_on_metadata; +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +set @@global.innodb_stats_on_metadata=1; +select @@global.innodb_stats_on_metadata; +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +set global innodb_stats_on_metadata=0; +select @@global.innodb_stats_on_metadata; +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +set @@global.innodb_stats_on_metadata='ON'; +select @@global.innodb_stats_on_metadata; +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +--error ER_GLOBAL_VARIABLE +set session innodb_stats_on_metadata='OFF'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_stats_on_metadata='ON'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_stats_on_metadata=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_stats_on_metadata=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_stats_on_metadata=2; +--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_stats_on_metadata=-3; +select @@global.innodb_stats_on_metadata; +select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; +select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata'; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_stats_on_metadata='AUTO'; + +# +# Cleanup +# + +SET @@global.innodb_stats_on_metadata = @start_global_value; +SELECT @@global.innodb_stats_on_metadata; diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test new file mode 100644 index 00000000000..2c91f11405d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test @@ -0,0 +1,52 @@ + +# +# 2010-01-27 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_stats_sample_pages; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are one or above +select @@global.innodb_stats_sample_pages >=1; +select @@global.innodb_stats_sample_pages; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_stats_sample_pages; +show global variables like 'innodb_stats_sample_pages'; +show session variables like 'innodb_stats_sample_pages'; +select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages'; +select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages'; + +# +# show that it's writable +# +set global innodb_stats_sample_pages=10; +select @@global.innodb_stats_sample_pages; +select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages'; +select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages'; +--error ER_GLOBAL_VARIABLE +set session innodb_stats_sample_pages=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_stats_sample_pages=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_stats_sample_pages=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_stats_sample_pages="foo"; + +set global innodb_stats_sample_pages=-7; +select @@global.innodb_stats_sample_pages; +select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages'; + +# +# cleanup +# +SET @@global.innodb_stats_sample_pages = @start_global_value; +SELECT @@global.innodb_stats_sample_pages; diff --git a/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test new file mode 100644 index 00000000000..53fbdca2d32 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test @@ -0,0 +1,84 @@ + + +# 2010-01-25 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_strict_mode; +SELECT @start_global_value; + +# +# exists as global and session +# +--echo Valid values are 'ON' and 'OFF' +select @@global.innodb_strict_mode in (0, 1); +select @@global.innodb_strict_mode; +select @@session.innodb_strict_mode in (0, 1); +select @@session.innodb_strict_mode; +show global variables like 'innodb_strict_mode'; +show session variables like 'innodb_strict_mode'; +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; + +# +# show that it's writable +# +set global innodb_strict_mode='OFF'; +set session innodb_strict_mode='OFF'; +select @@global.innodb_strict_mode; +select @@session.innodb_strict_mode; +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +set @@global.innodb_strict_mode=1; +set @@session.innodb_strict_mode=1; +select @@global.innodb_strict_mode; +select @@session.innodb_strict_mode; +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +set global innodb_strict_mode=0; +set session innodb_strict_mode=0; +select @@global.innodb_strict_mode; +select @@session.innodb_strict_mode; +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; +set @@global.innodb_strict_mode='ON'; +set @@session.innodb_strict_mode='ON'; +select @@global.innodb_strict_mode; +select @@session.innodb_strict_mode; +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_strict_mode=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set session innodb_strict_mode=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_strict_mode=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set session innodb_strict_mode=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_strict_mode=2; +--error ER_WRONG_VALUE_FOR_VAR +set session innodb_strict_mode=2; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_strict_mode='AUTO'; +--error ER_WRONG_VALUE_FOR_VAR +set session innodb_strict_mode='AUTO'; +--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) +set global innodb_strict_mode=-3; +set session innodb_strict_mode=-7; +select @@global.innodb_strict_mode; +select @@session.innodb_strict_mode; +select * from information_schema.global_variables where variable_name='innodb_strict_mode'; +select * from information_schema.session_variables where variable_name='innodb_strict_mode'; + +# +# Cleanup +# + +SET @@global.innodb_strict_mode = @start_global_value; +SELECT @@global.innodb_strict_mode; diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test new file mode 100644 index 00000000000..7156f309a64 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test @@ -0,0 +1,52 @@ + +# +# 2010-01-27 - Added +# + +--source include/have_innodb.inc + +SET @start_global_value = @@global.innodb_thread_sleep_delay; +SELECT @start_global_value; + +# +# exists as global only +# +--echo Valid values are zero or above +select @@global.innodb_thread_sleep_delay >=0; +select @@global.innodb_thread_sleep_delay; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_thread_sleep_delay; +show global variables like 'innodb_thread_sleep_delay'; +show session variables like 'innodb_thread_sleep_delay'; +select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; +select * from information_schema.session_variables where variable_name='innodb_thread_sleep_delay'; + +# +# show that it's writable +# +set global innodb_thread_sleep_delay=10; +select @@global.innodb_thread_sleep_delay; +select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; +select * from information_schema.session_variables where variable_name='innodb_thread_sleep_delay'; +--error ER_GLOBAL_VARIABLE +set session innodb_thread_sleep_delay=1; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_thread_sleep_delay=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_thread_sleep_delay=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_thread_sleep_delay="foo"; + +set global innodb_thread_sleep_delay=-7; +select @@global.innodb_thread_sleep_delay; +select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; + +# +# cleanup +# +SET @@global.innodb_thread_sleep_delay = @start_global_value; +SELECT @@global.innodb_thread_sleep_delay; diff --git a/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test new file mode 100644 index 00000000000..21f3e904547 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test @@ -0,0 +1,28 @@ + +# +# 2010-01-27 OBN - Added +# + +--source include/have_innodb.inc + +# +# show the global and session values; +# +--echo Valid values are 'ON' and 'OFF' +select @@global.innodb_adaptive_flushing in (0, 1); +select @@global.innodb_use_sys_malloc; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_use_sys_malloc; +show global variables like 'innodb_use_sys_malloc'; +show session variables like 'innodb_use_sys_malloc'; +select * from information_schema.global_variables where variable_name='innodb_use_sys_malloc'; +select * from information_schema.session_variables where variable_name='innodb_use_sys_malloc'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_use_sys_malloc=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session innodb_use_sys_malloc=1; + diff --git a/mysql-test/suite/sys_vars/t/innodb_version_basic.test b/mysql-test/suite/sys_vars/t/innodb_version_basic.test new file mode 100644 index 00000000000..6ee2adf6cf9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_version_basic.test @@ -0,0 +1,28 @@ + +# +# 2010-01-27 OBN - Added +# + +--source include/have_innodb.inc + +# +# show the global and session values; +# +--let $inno_ver= `select @@global.innodb_version` +--replace_result $inno_ver x.y.z +select @@global.innodb_version; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_version; +--echo show global variables like 'innodb_version' disabled so to not change with every version; +--echo show session variables like 'innodb_version' disabled so to not change with every version; +select VARIABLE_VALUE=@@global.innodb_version from information_schema.global_variables where variable_name='innodb_version'; +select VARIABLE_VALUE=@@global.innodb_version from information_schema.session_variables where variable_name='innodb_version'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_version=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session innodb_version=1; + diff --git a/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test new file mode 100644 index 00000000000..8efa6576a66 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test @@ -0,0 +1,26 @@ + +# +# 2010-01-27 OBN - Added (this variable is also covered in innodb_file_io_threads_basic.test) +# + +--source include/have_innodb.inc + +# +# show the global and session values; +# +select @@global.innodb_write_io_threads; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_write_io_threads; +show global variables like 'innodb_write_io_threads'; +show session variables like 'innodb_write_io_threads'; +select * from information_schema.global_variables where variable_name='innodb_write_io_threads'; +select * from information_schema.session_variables where variable_name='innodb_write_io_threads'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_write_io_threads=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session innodb_write_io_threads=1; + diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_basic.test b/mysql-test/suite/sys_vars/t/last_insert_id_basic.test index a2e0116f11d..ca971c660ca 100644 --- a/mysql-test/suite/sys_vars/t/last_insert_id_basic.test +++ b/mysql-test/suite/sys_vars/t/last_insert_id_basic.test @@ -2,6 +2,8 @@ # # exists as a session only # +# 2010-01-20 OBN - Added check for variable value matching I_S tables +# --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.last_insert_id; select @@session.last_insert_id; @@ -13,10 +15,16 @@ select * from information_schema.session_variables where variable_name='last_ins # # show that it's writable # -set session last_insert_id=1; -select @@session.last_insert_id; --error ER_LOCAL_VARIABLE -set global last_insert_id=1; +set global last_insert_id=99; +set session last_insert_id=42; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@global.last_insert_id; +select @@session.last_insert_id; +show global variables like 'last_insert_id'; +show session variables like 'last_insert_id'; +select * from information_schema.global_variables where variable_name='last_insert_id'; +select * from information_schema.session_variables where variable_name='last_insert_id'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/lc_messages_basic.test b/mysql-test/suite/sys_vars/t/lc_messages_basic.test index f8a25738285..a76381e8cb4 100644 --- a/mysql-test/suite/sys_vars/t/lc_messages_basic.test +++ b/mysql-test/suite/sys_vars/t/lc_messages_basic.test @@ -1,3 +1,8 @@ +# +# 2010-01-20 OBN - Added check for variable value matching I_S tables +# + + SET @start_global_value = @@global.lc_messages; SELECT @start_global_value; @@ -19,9 +24,11 @@ select @@global.lc_messages; set session lc_messages=2; select @@session.lc_messages; set global lc_messages="en_US"; -select @@global.lc_messages; set session lc_messages="en_GB"; +select @@global.lc_messages; select @@session.lc_messages; +select * from information_schema.global_variables where variable_name='lc_messages'; +select * from information_schema.session_variables where variable_name='lc_messages'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test b/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test index 95dda5b73c9..22fe4dfaa6e 100644 --- a/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test +++ b/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test @@ -11,7 +11,7 @@ # Creation Date: 2008-03-16 # # Author: Salman Rawala # # # -# Description: Test Cases of Dynamic System Variable "log_slow_queries" # +# Description: Test Cases of Dynamic System Variable "log_slow_queries" # # that checks behavior of this variable in the following ways # # * Default Value # # * Valid & Invalid values # @@ -21,6 +21,10 @@ # Reference: http://dev.mysql.com/doc/refman/5.1/en/ # # server-options.html#option_mysqld_event-scheduler # # # +# # +# 2010-01-20 OBN - Added check for variable value matching I_S tables after # +# variable value change # +# # ################################################################################ --source include/load_sysvars.inc @@ -116,8 +120,14 @@ WHERE VARIABLE_NAME='log_slow_queries'; SET @@global.log_slow_queries = 0; SELECT @@global.log_slow_queries; +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; SET @@global.log_slow_queries = 1; SELECT @@global.log_slow_queries; +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; --echo '#---------------------FN_DYNVARS_004_07----------------------#' ################################################################### @@ -126,8 +136,14 @@ SELECT @@global.log_slow_queries; SET @@global.log_slow_queries = TRUE; SELECT @@global.log_slow_queries; +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; SET @@global.log_slow_queries = FALSE; SELECT @@global.log_slow_queries; +SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_slow_queries'; --echo '#---------------------FN_DYNVARS_004_08----------------------#' ############################################################################## diff --git a/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test b/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test index 6c15f188880..6c2af693128 100644 --- a/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test +++ b/mysql-test/suite/sys_vars/t/lower_case_file_system_basic.test @@ -1,17 +1,25 @@ # # only global # +# 2010-01-20 OBN - Modified to include check for valid values +# - Added check for variable value matching I_S tables +# select @@global.lower_case_file_system=2; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.lower_case_file_system; ---replace_column 2 # -show global variables like 'lower_case_file_system'; ---replace_column 2 # -show session variables like 'lower_case_file_system'; ---replace_column 2 # -select * from information_schema.global_variables where variable_name='lower_case_file_system'; ---replace_column 2 # -select * from information_schema.session_variables where variable_name='lower_case_file_system'; + +# Show variable has a valid value +SELECT @@global.lower_case_file_system in (0,1); + +# Show that value of the variable matches the value in the GLOBAL I_S table +SELECT IF(@@global.lower_case_file_system, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='lower_case_file_system'; + +# Show that value of the variable matches the value in the SESSION I_S table +SELECT IF(@@global.lower_case_file_system, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='lower_case_file_system'; # # show that it's read-only diff --git a/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test b/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test index 8d6a3bb5ca6..eaa6c95974e 100644 --- a/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test +++ b/mysql-test/suite/sys_vars/t/lower_case_table_names_basic.test @@ -1,17 +1,26 @@ # # only global # +# 2010-01-20 OBN - Modified to include check for valid values +# - Added check for variable value matching I_S tables +# + select @@global.lower_case_table_names=20; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.lower_case_table_names; ---replace_column 2 # -show global variables like 'lower_case_table_names'; ---replace_column 2 # -show session variables like 'lower_case_table_names'; ---replace_column 2 # -select * from information_schema.global_variables where variable_name='lower_case_table_names'; ---replace_column 2 # -select * from information_schema.session_variables where variable_name='lower_case_table_names'; + +# Show variable has a valid value +SELECT @@global.lower_case_table_names in (0,1,2); + +# Show that value of the variable matches the value in the GLOBAL I_S table +SELECT @@global.lower_case_table_names = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='lower_case_table_names'; + +# Show that value of the variable matches the value in the SESSION I_S table +SELECT @@global.lower_case_table_names = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='lower_case_table_names'; # # show that it's read-only diff --git a/mysql-test/suite/sys_vars/t/max_join_size_basic.test b/mysql-test/suite/sys_vars/t/max_join_size_basic.test index 7566ab11520..bbe13457ee7 100644 --- a/mysql-test/suite/sys_vars/t/max_join_size_basic.test +++ b/mysql-test/suite/sys_vars/t/max_join_size_basic.test @@ -1,3 +1,11 @@ + + +# +# 2010-01-20 - OBN - Added check for variable value sameas I_S table +# after variable value change +# + + SET @start_global_value = @@global.max_join_size; SELECT @start_global_value; @@ -15,9 +23,13 @@ select * from information_schema.session_variables where variable_name='max_join # show that it's writable # set global max_join_size=10; -select @@global.max_join_size; set session max_join_size=20; +select @@global.max_join_size; select @@session.max_join_size; +show global variables like 'max_join_size'; +show session variables like 'max_join_size'; +select * from information_schema.global_variables where variable_name='max_join_size'; +select * from information_schema.session_variables where variable_name='max_join_size'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test index 32d0f45ad25..cce180fea67 100644 --- a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test +++ b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test @@ -1,3 +1,8 @@ + +# +# 2010-01-20 OBN - added check of I_S values after variable value changed +# + SET @start_global_value = @@global.old_alter_table; SELECT @start_global_value; @@ -15,9 +20,13 @@ select * from information_schema.session_variables where variable_name='old_alte # show that it's writable # set global old_alter_table=1; -select @@global.old_alter_table; set session old_alter_table=ON; +select @@global.old_alter_table; select @@session.old_alter_table; +show global variables like 'old_alter_table'; +show session variables like 'old_alter_table'; +select * from information_schema.global_variables where variable_name='old_alter_table'; +select * from information_schema.session_variables where variable_name='old_alter_table'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test index 32a77c90b34..4267b3726aa 100644 --- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test +++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test @@ -1,3 +1,8 @@ + +# +# 2010-01-20 OBN Added check for I_S values after variable value changed +# + SET @start_global_value = @@global.optimizer_switch; SELECT @start_global_value; @@ -15,13 +20,17 @@ select * from information_schema.session_variables where variable_name='optimize # show that it's writable # set global optimizer_switch=10; -select @@global.optimizer_switch; set session optimizer_switch=5; +select @@global.optimizer_switch; select @@session.optimizer_switch; set global optimizer_switch="index_merge_sort_union=on"; -select @@global.optimizer_switch; set session optimizer_switch="index_merge=off"; +select @@global.optimizer_switch; select @@session.optimizer_switch; +show global variables like 'optimizer_switch'; +show session variables like 'optimizer_switch'; +select * from information_schema.global_variables where variable_name='optimizer_switch'; +select * from information_schema.session_variables where variable_name='optimizer_switch'; set session optimizer_switch="default"; select @@session.optimizer_switch; diff --git a/mysql-test/suite/sys_vars/t/profiling_basic.test b/mysql-test/suite/sys_vars/t/profiling_basic.test index aef56e50900..da54d5a207d 100644 --- a/mysql-test/suite/sys_vars/t/profiling_basic.test +++ b/mysql-test/suite/sys_vars/t/profiling_basic.test @@ -1,3 +1,8 @@ + +# +# 2010-01-20 OBN - Added check for I_S values after variable value change +# + --source include/have_profiling.inc SET @start_global_value = @@global.profiling; @@ -17,9 +22,21 @@ select * from information_schema.session_variables where variable_name='profilin # show that it's writable # set global profiling=1; -select @@global.profiling; set session profiling=ON; +select @@global.profiling; select @@session.profiling; +show global variables like 'profiling'; +show session variables like 'profiling'; +select * from information_schema.global_variables where variable_name='profiling'; +select * from information_schema.session_variables where variable_name='profiling'; +set global profiling=0; +set session profiling=OFF; +select @@global.profiling; +select @@session.profiling; +show global variables like 'profiling'; +show session variables like 'profiling'; +select * from information_schema.global_variables where variable_name='profiling'; +select * from information_schema.session_variables where variable_name='profiling'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test b/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test index 01d3533be3d..26fdc55328b 100644 --- a/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test +++ b/mysql-test/suite/sys_vars/t/profiling_history_size_basic.test @@ -1,3 +1,8 @@ + +# +# 2010-01-20 OBN Added check for variable and I_S values after incorrect change attempt +# + --source include/have_profiling.inc SET @start_global_value = @@global.profiling_history_size; @@ -17,9 +22,13 @@ select * from information_schema.session_variables where variable_name='profilin # show that it's writable # set global profiling_history_size=10; -select @@global.profiling_history_size; set session profiling_history_size=20; +select @@global.profiling_history_size; select @@session.profiling_history_size; +show global variables like 'profiling_history_size'; +show session variables like 'profiling_history_size'; +select * from information_schema.global_variables where variable_name='profiling_history_size'; +select * from information_schema.session_variables where variable_name='profiling_history_size'; # # incorrect assignments diff --git a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test index a948f2a8ff0..0722b42099d 100644 --- a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test +++ b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test @@ -2,21 +2,37 @@ # # exists as a session only # +# 2010-01-20 OBN - Added check for session I_S values being equal to variable value +# - Added check for session variable value being numberic +# + --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.pseudo_thread_id; -select @@session.pseudo_thread_id=0; + +# Check the variable has a valid numeric value (assumed to be less then 10000) +select @@session.pseudo_thread_id between 1 and 1000; + +--echo should be empty show global variables like 'pseudo_thread_id'; + +# Check that shows returns a value (can't confirm the actual one) --replace_column 2 # show session variables like 'pseudo_thread_id'; + +# Global I_S variable is empty +--echo should be empty select * from information_schema.global_variables where variable_name='pseudo_thread_id'; ---replace_column 2 # -select * from information_schema.session_variables where variable_name='pseudo_thread_id'; + +# Check that I_S value is same as variable +select @@session.pseudo_thread_id = variable_value from information_schema.session_variables where variable_name='pseudo_thread_id'; # # show that it's writable # -set session pseudo_thread_id=1; +set session pseudo_thread_id=42; select @@session.pseudo_thread_id; +select * from information_schema.global_variables where variable_name='pseudo_thread_id'; +select variable_value from information_schema.session_variables where variable_name='pseudo_thread_id'; --error ER_LOCAL_VARIABLE set global pseudo_thread_id=1; diff --git a/mysql-test/suite/sys_vars/t/rand_seed1_basic.test b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test index 79c946a3d2f..3745d2fcb1e 100644 --- a/mysql-test/suite/sys_vars/t/rand_seed1_basic.test +++ b/mysql-test/suite/sys_vars/t/rand_seed1_basic.test @@ -2,6 +2,8 @@ # # exists as a session only # +# 2010-01-20 OBN - Added check for I_S value after variable value change +# --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.rand_seed1; select @@session.rand_seed1; @@ -11,10 +13,12 @@ select * from information_schema.global_variables where variable_name='rand_seed select * from information_schema.session_variables where variable_name='rand_seed1'; # -# show that it's writable +# show that it's writable (note value can be set but not read - returned value is zero) # set session rand_seed1=1; select @@session.rand_seed1; +select * from information_schema.global_variables where variable_name='rand_seed1'; +select * from information_schema.session_variables where variable_name='rand_seed1'; --error ER_LOCAL_VARIABLE set global rand_seed1=1; diff --git a/mysql-test/suite/sys_vars/t/rand_seed2_basic.test b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test index 18e2a62557c..7a5abcd340b 100644 --- a/mysql-test/suite/sys_vars/t/rand_seed2_basic.test +++ b/mysql-test/suite/sys_vars/t/rand_seed2_basic.test @@ -2,6 +2,9 @@ # # exists as a session only # +# +# 2010-01-20 OBN - Added check for I_S value after variable value change +# --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.rand_seed2; select @@session.rand_seed2; @@ -11,10 +14,12 @@ select * from information_schema.global_variables where variable_name='rand_seed select * from information_schema.session_variables where variable_name='rand_seed2'; # -# show that it's writable +# show that it's writable (note value can be set but not read - returned value is zero) # set session rand_seed2=1; select @@session.rand_seed2; +select * from information_schema.global_variables where variable_name='rand_seed2'; +select * from information_schema.session_variables where variable_name='rand_seed2'; --error ER_LOCAL_VARIABLE set global rand_seed2=1; diff --git a/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test b/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test index 57c28468bd1..a6f218a59ae 100644 --- a/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test +++ b/mysql-test/suite/sys_vars/t/relay_log_recovery_basic.test @@ -1,3 +1,9 @@ + + +# +# 2010-01-10 - Added check for I_S values aver variable value change +# + --source include/not_embedded.inc SET @start_global_value = @@global.relay_log_recovery; @@ -19,8 +25,12 @@ select * from information_schema.session_variables where variable_name='relay_lo # set global relay_log_recovery=1; select @@global.relay_log_recovery; +select * from information_schema.global_variables where variable_name='relay_log_recovery'; +select * from information_schema.session_variables where variable_name='relay_log_recovery'; set global relay_log_recovery=OFF; select @@global.relay_log_recovery; +select * from information_schema.global_variables where variable_name='relay_log_recovery'; +select * from information_schema.session_variables where variable_name='relay_log_recovery'; --error ER_GLOBAL_VARIABLE set session relay_log_recovery=1; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt new file mode 100644 index 00000000000..58029d28ace --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test new file mode 100644 index 00000000000..5aea6e165ea --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test @@ -0,0 +1,62 @@ + +# +# exists as a global only +# +# 2010-01-21 OBN - Added +# +# +source include/have_semisync_plugin.inc; +eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; +select @@global.rpl_semi_sync_master_enabled; +SET @start_global_value = @@global.rpl_semi_sync_master_enabled; + +select @@global.rpl_semi_sync_master_enabled in (0,1); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_enabled; +show global variables like 'rpl_semi_sync_master_enabled'; +show session variables like 'rpl_semi_sync_master_enabled'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_enabled'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_enabled'; + +# +# show that it's writable +# +set global rpl_semi_sync_master_enabled=0; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_master_enabled=0; +select @@global.rpl_semi_sync_master_enabled; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_enabled; +show global variables like 'rpl_semi_sync_master_enabled'; +show session variables like 'rpl_semi_sync_master_enabled'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_enabled'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_enabled'; +set global rpl_semi_sync_master_enabled=1; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_master_enabled=1; +select @@global.rpl_semi_sync_master_enabled; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_enabled; +show global variables like 'rpl_semi_sync_master_enabled'; +show session variables like 'rpl_semi_sync_master_enabled'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_enabled'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_enabled'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_enabled=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_enabled=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global rpl_semi_sync_master_enabled="some text"; + + +# +# Cleanup +# +SET @@global.rpl_semi_sync_master_enabled = @start_global_value; +select @@global.rpl_semi_sync_master_enabled; +UNINSTALL PLUGIN rpl_semi_sync_master; + diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt new file mode 100644 index 00000000000..58029d28ace --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test new file mode 100644 index 00000000000..6c4aae8e3bf --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test @@ -0,0 +1,52 @@ + +# +# exists as a global only +# +# 2010-01-21 OBN - Added +# +source include/have_semisync_plugin.inc; +eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; +select @@global.rpl_semi_sync_master_timeout; +SET @start_global_value = @@global.rpl_semi_sync_master_timeout; + +--echo Assuming value will not be more then 100 sec +select @@global.rpl_semi_sync_master_timeout between 1 and 100000; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_timeout; +show global variables like 'rpl_semi_sync_master_timeout'; +show session variables like 'rpl_semi_sync_master_timeout'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_timeout'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_timeout'; + +# +# show that it's writable +# +set global rpl_semi_sync_master_timeout=42; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_master_timeout=99; +select @@global.rpl_semi_sync_master_timeout; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_timeout; +show global variables like 'rpl_semi_sync_master_timeout'; +show session variables like 'rpl_semi_sync_master_timeout'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_timeout'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_timeout'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_timeout=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_timeout=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_timeout="some text"; + + +# +# Cleanup +# +SET @@global.rpl_semi_sync_master_timeout = @start_global_value; +select @@global.rpl_semi_sync_master_timeout; +UNINSTALL PLUGIN rpl_semi_sync_master; + diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt new file mode 100644 index 00000000000..58029d28ace --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test new file mode 100644 index 00000000000..c37248ffa9a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test @@ -0,0 +1,60 @@ + +# +# exists as a global only +# +# 2010-01-21 OBN - Added +# +source include/have_semisync_plugin.inc; +eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; +select @@global.rpl_semi_sync_master_trace_level; +SET @start_global_value = @@global.rpl_semi_sync_master_trace_level; + +select @@global.rpl_semi_sync_master_trace_level in (1,16,32,64); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_trace_level; +show global variables like 'rpl_semi_sync_master_trace_level'; +show session variables like 'rpl_semi_sync_master_trace_level'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_trace_level'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_trace_level'; + +# +# show that it's writable +# +set global rpl_semi_sync_master_trace_level=16; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_master_trace_level=99; +select @@global.rpl_semi_sync_master_trace_level; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_trace_level; +show global variables like 'rpl_semi_sync_master_trace_level'; +show session variables like 'rpl_semi_sync_master_trace_level'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_trace_level'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_trace_level'; + +--echo NOTE: Value can also be set to values that are combinations of values +set global rpl_semi_sync_master_trace_level=42; +select @@global.rpl_semi_sync_master_trace_level; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_trace_level; +show global variables like 'rpl_semi_sync_master_trace_level'; +show session variables like 'rpl_semi_sync_master_trace_level'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_trace_level'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_trace_level'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_trace_level=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_trace_level=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_trace_level="some text"; + +# +# Cleanup +# +SET @@global.rpl_semi_sync_master_trace_level = @start_global_value; +select @@global.rpl_semi_sync_master_trace_level; +UNINSTALL PLUGIN rpl_semi_sync_master; + diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt new file mode 100644 index 00000000000..58029d28ace --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test new file mode 100644 index 00000000000..a90024b8961 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test @@ -0,0 +1,62 @@ + +# +# exists as a global only +# +# 2010-01-21 OBN - Added +# +# +source include/have_semisync_plugin.inc; +eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; +select @@global.rpl_semi_sync_master_wait_no_slave; +SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave; + +select @@global.rpl_semi_sync_master_wait_no_slave in (0,1); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_wait_no_slave; +show global variables like 'rpl_semi_sync_master_wait_no_slave'; +show session variables like 'rpl_semi_sync_master_wait_no_slave'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; + +# +# show that it's writable +# +set global rpl_semi_sync_master_wait_no_slave=0; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_master_wait_no_slave=0; +select @@global.rpl_semi_sync_master_wait_no_slave; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_wait_no_slave; +show global variables like 'rpl_semi_sync_master_wait_no_slave'; +show session variables like 'rpl_semi_sync_master_wait_no_slave'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +set global rpl_semi_sync_master_wait_no_slave=1; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_master_wait_no_slave=1; +select @@global.rpl_semi_sync_master_wait_no_slave; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_master_wait_no_slave; +show global variables like 'rpl_semi_sync_master_wait_no_slave'; +show session variables like 'rpl_semi_sync_master_wait_no_slave'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_master_wait_no_slave'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_wait_no_slave=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_master_wait_no_slave=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global rpl_semi_sync_master_wait_no_slave="some text"; + + +# +# Cleanup +# +SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value; +select @@global.rpl_semi_sync_master_wait_no_slave; +UNINSTALL PLUGIN rpl_semi_sync_master; + diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt new file mode 100644 index 00000000000..58029d28ace --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test new file mode 100644 index 00000000000..5dca63d5e2d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test @@ -0,0 +1,63 @@ + +# +# exists as a global only +# +# 2010-01-21 OBN - Added +# +# +source include/have_semisync_plugin.inc; +eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; +select @@global.rpl_semi_sync_slave_enabled; +SET @start_global_value = @@global.rpl_semi_sync_slave_enabled; + +select @@global.rpl_semi_sync_slave_enabled in (0,1); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_slave_enabled; +show global variables like 'rpl_semi_sync_slave_enabled'; +show session variables like 'rpl_semi_sync_slave_enabled'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_enabled'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_enabled'; + +# +# show that it's writable +# +set global rpl_semi_sync_slave_enabled=0; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_slave_enabled=0; +select @@global.rpl_semi_sync_slave_enabled; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_slave_enabled; +show global variables like 'rpl_semi_sync_slave_enabled'; +show session variables like 'rpl_semi_sync_slave_enabled'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_enabled'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_enabled'; +set global rpl_semi_sync_slave_enabled=1; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_slave_enabled=1; +select @@global.rpl_semi_sync_slave_enabled; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_slave_enabled; +show global variables like 'rpl_semi_sync_slave_enabled'; +show session variables like 'rpl_semi_sync_slave_enabled'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_enabled'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_enabled'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_slave_enabled=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_slave_enabled=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global rpl_semi_sync_slave_enabled="some text"; +--error ER_WRONG_VALUE_FOR_VAR + + +# +# Cleanup +# +SET @@global.rpl_semi_sync_slave_enabled = @start_global_value; +select @@global.rpl_semi_sync_slave_enabled; +UNINSTALL PLUGIN rpl_semi_sync_slave; + diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt new file mode 100644 index 00000000000..58029d28ace --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test new file mode 100644 index 00000000000..afac5244eb2 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test @@ -0,0 +1,60 @@ + +# +# exists as a global only +# +# 2010-01-21 OBN - Added +# +source include/have_semisync_plugin.inc; +eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; +select @@global.rpl_semi_sync_slave_trace_level; +SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level; + +select @@global.rpl_semi_sync_slave_trace_level in (1,16,32,64); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_slave_trace_level; +show global variables like 'rpl_semi_sync_slave_trace_level'; +show session variables like 'rpl_semi_sync_slave_trace_level'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_trace_level'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_trace_level'; + +# +# show that it's writable +# +set global rpl_semi_sync_slave_trace_level=16; +--error ER_GLOBAL_VARIABLE +set session rpl_semi_sync_slave_trace_level=99; +select @@global.rpl_semi_sync_slave_trace_level; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_slave_trace_level; +show global variables like 'rpl_semi_sync_slave_trace_level'; +show session variables like 'rpl_semi_sync_slave_trace_level'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_trace_level'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_trace_level'; + +--echo NOTE: Value can also be set to values that are combinations of values +set global rpl_semi_sync_slave_trace_level=42; +select @@global.rpl_semi_sync_slave_trace_level; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.rpl_semi_sync_slave_trace_level; +show global variables like 'rpl_semi_sync_slave_trace_level'; +show session variables like 'rpl_semi_sync_slave_trace_level'; +select * from information_schema.global_variables where variable_name='rpl_semi_sync_slave_trace_level'; +select * from information_schema.session_variables where variable_name='rpl_semi_sync_slave_trace_level'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_slave_trace_level=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_slave_trace_level=1e1; +--error ER_WRONG_TYPE_FOR_VAR +set global rpl_semi_sync_slave_trace_level="some text"; + +# +# Cleanup +# +SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value; +select @@global.rpl_semi_sync_slave_trace_level; +UNINSTALL PLUGIN rpl_semi_sync_slave; + diff --git a/mysql-test/suite/sys_vars/t/sql_log_update_basic.test b/mysql-test/suite/sys_vars/t/sql_log_update_basic.test index c48840d4a81..9b9f6f375b6 100644 --- a/mysql-test/suite/sys_vars/t/sql_log_update_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_log_update_basic.test @@ -1,3 +1,9 @@ + +# +# 2010-01-20 OBN - Added check of I_S tables after variable value changes. +# - Added value change to ON/OFF to ensure change of current value +# + --source include/have_profiling.inc SET @start_global_value = @@global.sql_log_update; @@ -17,9 +23,21 @@ select * from information_schema.session_variables where variable_name='sql_log_ # show that it's writable # set global sql_log_update=1; -select @@global.sql_log_update; set session sql_log_update=ON; +select @@global.sql_log_update; select @@session.sql_log_update; +show global variables like 'sql_log_update'; +show session variables like 'sql_log_update'; +select * from information_schema.global_variables where variable_name='sql_log_update'; +select * from information_schema.session_variables where variable_name='sql_log_update'; +set global sql_log_update=0; +set session sql_log_update=OFF; +select @@global.sql_log_update; +select @@session.sql_log_update; +show global variables like 'sql_log_update'; +show session variables like 'sql_log_update'; +select * from information_schema.global_variables where variable_name='sql_log_update'; +select * from information_schema.session_variables where variable_name='sql_log_update'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test b/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test index bafa11379aa..9a72846b29c 100644 --- a/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test @@ -1,3 +1,8 @@ + +# +# 2010-01-20 OBN - Added check of I_S values after variable value change +# + SET @start_global_value = @@global.sql_max_join_size; SELECT @start_global_value; @@ -15,9 +20,13 @@ select * from information_schema.session_variables where variable_name='sql_max_ # show that it's writable # set global sql_max_join_size=10; -select @@global.sql_max_join_size; set session sql_max_join_size=20; +select @@global.sql_max_join_size; select @@session.sql_max_join_size; +show global variables like 'sql_max_join_size'; +show session variables like 'sql_max_join_size'; +select * from information_schema.global_variables where variable_name='sql_max_join_size'; +select * from information_schema.session_variables where variable_name='sql_max_join_size'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test b/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test index 0b941d25f42..c6bc5962205 100644 --- a/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_select_limit_basic.test @@ -1,3 +1,8 @@ + +# +# 2010-01-10 OBN - Added check for I_S values after change of variable value +# + SET @start_global_value = @@global.sql_select_limit; SELECT @start_global_value; @@ -15,9 +20,13 @@ select * from information_schema.session_variables where variable_name='sql_sele # show that it's writable # set global sql_select_limit=10; -select @@global.sql_select_limit; set session sql_select_limit=20; +select @@global.sql_select_limit; select @@session.sql_select_limit; +show global variables like 'sql_select_limit'; +show session variables like 'sql_select_limit'; +select * from information_schema.global_variables where variable_name='sql_select_limit'; +select * from information_schema.session_variables where variable_name='sql_select_limit'; # # incorrect types diff --git a/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test b/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test index 48a4c0797e5..22aaff6d426 100644 --- a/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test +++ b/mysql-test/suite/sys_vars/t/thread_cache_size_basic.test @@ -1,4 +1,8 @@ +# +# 2010-01-20 OBN - Added check of I_S values after variable value change +# + SET @start_global_value = @@global.thread_cache_size; SELECT @start_global_value; @@ -18,6 +22,8 @@ select * from information_schema.session_variables where variable_name='thread_c # set global thread_cache_size=1; select @@global.thread_cache_size; +select * from information_schema.global_variables where variable_name='thread_cache_size'; +select * from information_schema.session_variables where variable_name='thread_cache_size'; --error ER_GLOBAL_VARIABLE set session thread_cache_size=1; From f594cc4b3b18d5679d14ed3dea5024d95ac126e7 Mon Sep 17 00:00:00 2001 From: "Horst.Hunger" Date: Fri, 29 Jan 2010 11:48:11 +0100 Subject: [PATCH 28/54] New patch for bug#49579, now with "have_ipv4_mapped.inc". --- mysql-test/include/have_ipv4_mapped.inc | 14 ++ mysql-test/r/ipv4_as_ipv6_win.result | 32 ---- mysql-test/r/ipv6.result | 176 ------------------ mysql-test/r/ipv6_win.result | 88 --------- mysql-test/suite/rpl/r/rpl_ip_mix.result | 102 +--------- mysql-test/suite/rpl/r/rpl_ip_mix2.result | 118 +----------- mysql-test/suite/rpl/r/rpl_ip_mix2_win.result | 84 --------- mysql-test/suite/rpl/r/rpl_ip_mix_win.result | 84 --------- .../suite/rpl/r/rpl_ipv4_as_ipv6.result | 10 +- .../suite/rpl/r/rpl_ipv4_as_ipv6_win.result | 35 ---- mysql-test/suite/rpl/r/rpl_ipv6.result | 96 +--------- mysql-test/suite/rpl/r/rpl_ipv6_win.result | 80 -------- mysql-test/suite/rpl/t/rpl_ip_mix.test | 36 +--- mysql-test/suite/rpl/t/rpl_ip_mix2.test | 40 +--- mysql-test/suite/rpl/t/rpl_ip_mix2_win.cnf | 56 ------ mysql-test/suite/rpl/t/rpl_ip_mix2_win.test | 78 -------- mysql-test/suite/rpl/t/rpl_ip_mix_win.cnf | 56 ------ mysql-test/suite/rpl/t/rpl_ip_mix_win.test | 65 ------- mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test | 23 +-- .../suite/rpl/t/rpl_ipv4_as_ipv6_win.cnf | 56 ------ .../suite/rpl/t/rpl_ipv4_as_ipv6_win.test | 63 ------- mysql-test/suite/rpl/t/rpl_ipv6.test | 34 +--- mysql-test/suite/rpl/t/rpl_ipv6_win.cnf | 56 ------ mysql-test/suite/rpl/t/rpl_ipv6_win.test | 65 ------- mysql-test/t/ipv4_as_ipv6.test | 3 +- mysql-test/t/ipv4_as_ipv6_win-master.opt | 1 - mysql-test/t/ipv4_as_ipv6_win.test | 31 --- mysql-test/t/ipv6.test | 43 ----- mysql-test/t/ipv6_win-master.opt | 1 - mysql-test/t/ipv6_win.test | 39 ---- 30 files changed, 36 insertions(+), 1629 deletions(-) create mode 100644 mysql-test/include/have_ipv4_mapped.inc delete mode 100644 mysql-test/r/ipv4_as_ipv6_win.result delete mode 100644 mysql-test/r/ipv6_win.result delete mode 100644 mysql-test/suite/rpl/r/rpl_ip_mix2_win.result delete mode 100644 mysql-test/suite/rpl/r/rpl_ip_mix_win.result delete mode 100644 mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6_win.result delete mode 100644 mysql-test/suite/rpl/r/rpl_ipv6_win.result delete mode 100644 mysql-test/suite/rpl/t/rpl_ip_mix2_win.cnf delete mode 100644 mysql-test/suite/rpl/t/rpl_ip_mix2_win.test delete mode 100644 mysql-test/suite/rpl/t/rpl_ip_mix_win.cnf delete mode 100644 mysql-test/suite/rpl/t/rpl_ip_mix_win.test delete mode 100644 mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.cnf delete mode 100644 mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.test delete mode 100644 mysql-test/suite/rpl/t/rpl_ipv6_win.cnf delete mode 100644 mysql-test/suite/rpl/t/rpl_ipv6_win.test delete mode 100644 mysql-test/t/ipv4_as_ipv6_win-master.opt delete mode 100644 mysql-test/t/ipv4_as_ipv6_win.test delete mode 100644 mysql-test/t/ipv6_win-master.opt delete mode 100644 mysql-test/t/ipv6_win.test diff --git a/mysql-test/include/have_ipv4_mapped.inc b/mysql-test/include/have_ipv4_mapped.inc new file mode 100644 index 00000000000..d85580405cd --- /dev/null +++ b/mysql-test/include/have_ipv4_mapped.inc @@ -0,0 +1,14 @@ +# Check if ipv4 mapped to ipv6 is available. +--disable_query_log +--disable_abort_on_error +connect (checkcon123456789,::FFFF:127.0.0.1,root,,test); +if($mysql_errno) +{ +skip wrong IP; +} +connection default; +disconnect checkcon123456789; +--enable_abort_on_error +--enable_query_log +# end check + diff --git a/mysql-test/r/ipv4_as_ipv6_win.result b/mysql-test/r/ipv4_as_ipv6_win.result deleted file mode 100644 index 45e23d4d7e6..00000000000 --- a/mysql-test/r/ipv4_as_ipv6_win.result +++ /dev/null @@ -1,32 +0,0 @@ -=============Test of '127.0.0.1' (IPv4) =========================== -mysqld is alive -CREATE USER testuser@'127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'127.0.0.1'; -SHOW GRANTS FOR testuser@'127.0.0.1'; -Grants for testuser@127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1' -SET @nip= inet_aton('127.0.0.1'); -SELECT @nip; -@nip -2130706433 -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -127.0.0.1 -SELECT USER(); -USER() -root@127.0.0.1 -SELECT current_user(); -current_user() -root@127.0.0.1 -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'127.0.0.1'; -RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1'; -SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@127.0.0.1 -DROP USER testuser1@'127.0.0.1'; -=============Test of '::1' ======================== -connect (con1, ::1, root, , test, MASTER_MYPORT); -Got one of the listed errors diff --git a/mysql-test/r/ipv6.result b/mysql-test/r/ipv6.result index 566938296a9..1ff51fcc831 100644 --- a/mysql-test/r/ipv6.result +++ b/mysql-test/r/ipv6.result @@ -86,179 +86,3 @@ SELECT USER(); USER() root@localhost DROP USER testuser1@'0:0:0:0:0:0:0:1'; -=============Test of '127.0.0.1' (IPv4) =========================== -mysqld is alive -CREATE USER testuser@'127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'127.0.0.1'; -SHOW GRANTS FOR testuser@'127.0.0.1'; -Grants for testuser@127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1' -SET @nip= inet_aton('127.0.0.1'); -SELECT @nip; -@nip -2130706433 -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -127.0.0.1 -SELECT USER(); -USER() -root@localhost -SELECT current_user(); -current_user() -root@localhost -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'127.0.0.1'; -RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1'; -SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@localhost -DROP USER testuser1@'127.0.0.1'; -=============Test of '0:0:0:0:0:FFFF:127.0.0.1' =================== -mysqld is alive -CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1'; -SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1'; -Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' -SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@localhost -SELECT current_user(); -current_user() -root@localhost -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:FFFF:127.0.0.1'; -RENAME USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' to testuser1@'0:0:0:0:0:FFFF:127.0.0.1'; -SET PASSWORD FOR testuser1@'0:0:0:0:0:FFFF:127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@localhost -DROP USER testuser1@'0:0:0:0:0:FFFF:127.0.0.1'; -=============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ==== -mysqld is alive -CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' -SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@localhost -SELECT current_user(); -current_user() -root@localhost -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -RENAME USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' to testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@localhost -DROP USER testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -=============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ==== -mysqld is alive -CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1'; -SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1'; -Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' -SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@localhost -SELECT current_user(); -current_user() -root@localhost -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1'; -RENAME USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' to testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1'; -SET PASSWORD FOR testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@localhost -DROP USER testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1'; -=============Test of '0::0000:FFFF:127.0.0.1' ==== -mysqld is alive -CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1'; -SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1'; -Grants for testuser@0::0000:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' -SET @nip= inet_aton('0::0000:FFFF:127.0.0.1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@localhost -SELECT current_user(); -current_user() -root@localhost -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'0::0000:FFFF:127.0.0.1'; -RENAME USER testuser@'0::0000:FFFF:127.0.0.1' to testuser1@'0::0000:FFFF:127.0.0.1'; -SET PASSWORD FOR testuser1@'0::0000:FFFF:127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@localhost -DROP USER testuser1@'0::0000:FFFF:127.0.0.1'; -=============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================ -=============Test of '::FFFF:127.0.0.1' =========================== -mysqld is alive -CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1'; -SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1'; -Grants for testuser@::FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1' -SET @nip= inet_aton('::FFFF:127.0.0.1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@localhost -SELECT current_user(); -current_user() -root@localhost -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'::FFFF:127.0.0.1'; -RENAME USER testuser@'::FFFF:127.0.0.1' to testuser1@'::FFFF:127.0.0.1'; -SET PASSWORD FOR testuser1@'::FFFF:127.0.0.1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@localhost -DROP USER testuser1@'::FFFF:127.0.0.1'; -=============Test of '::FFFF:127.0.0.1/96' ======================== diff --git a/mysql-test/r/ipv6_win.result b/mysql-test/r/ipv6_win.result deleted file mode 100644 index 8082e8aa25e..00000000000 --- a/mysql-test/r/ipv6_win.result +++ /dev/null @@ -1,88 +0,0 @@ -=============Test of '::1' ======================================== -mysqld is alive -CREATE USER testuser@'::1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'::1'; -SHOW GRANTS FOR testuser@'::1'; -Grants for testuser@::1 -GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1' -SET @nip= inet_aton('::1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@::1 -SELECT current_user(); -current_user() -root@::1 -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'::1'; -RENAME USER testuser@'::1' to testuser1@'::1'; -SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@::1 -DROP USER testuser1@'::1'; -=============Test of '::1/128' ==================================== -=============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ==== -mysqld is alive -CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '1234'; -GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001'; -SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001'; -Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001 -GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' -SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@::1 -SELECT current_user(); -current_user() -root@::1 -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:0000:0000:0001'; -RENAME USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' to testuser1@'0000:0000:0000:0000:0000:0000:0000:0001'; -SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:0000:0000:0001' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@::1 -DROP USER testuser1@'0000:0000:0000:0000:0000:0000:0000:0001'; -=============Test of '0:0:0:0:0:0:0:1' ============================ -mysqld is alive -CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234'; -GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1'; -SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1'; -Grants for testuser@0:0:0:0:0:0:0:1 -GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1' -SET @nip= inet_aton('0:0:0:0:0:0:0:1'); -SELECT @nip; -@nip -NULL -SELECT inet_ntoa(@nip); -inet_ntoa(@nip) -NULL -SELECT USER(); -USER() -root@::1 -SELECT current_user(); -current_user() -root@::1 -SHOW PROCESSLIST; -REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:0:0:1'; -RENAME USER testuser@'0:0:0:0:0:0:0:1' to testuser1@'0:0:0:0:0:0:0:1'; -SET PASSWORD FOR testuser1@'0:0:0:0:0:0:0:1' = PASSWORD ('9876'); -SELECT USER(); -USER() -root@::1 -DROP USER testuser1@'0:0:0:0:0:0:0:1'; diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix.result b/mysql-test/suite/rpl/r/rpl_ip_mix.result index 11aa5a46cfa..ddd7a008a97 100644 --- a/mysql-test/suite/rpl/r/rpl_ip_mix.result +++ b/mysql-test/suite/rpl/r/rpl_ip_mix.result @@ -46,102 +46,6 @@ Master-Host: 0:0:0:0:0:0:0:1 disconnect slave; disconnect master; connection default; -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0:0:0:0:0:0:1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ########################### -connect (master,0:0:0:0:0:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 127.0.0.1 -change master to master_host='0:0:0:0:0:FFFF:127.0.0.1'; -Master-Host: 0:0:0:0:0:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ########################### -connect (master,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0:0:0:0:FFFF:127.0.0.1 -change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ########################### -connect (master,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 -change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1'; -Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0::0000:FFFF:127.0.0.1 ########################### -connect (master,0::0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 -change master to master_host='0::0000:FFFF:127.0.0.1'; -Master-Host: 0::0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::FFFF:127.0.0.1 ########################### -connect (master,::FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0::0000:FFFF:127.0.0.1 -change master to master_host='::FFFF:127.0.0.1'; -Master-Host: ::FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; #################### IP: ::1 mix ####################### connect (master,::1,root,,test,MASTER_MYPORT); connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); @@ -152,11 +56,11 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # connection slave; reset slave; -Master-Host: ::FFFF:127.0.0.1 +Master-Host: 0:0:0:0:0:0:0:1 change master to master_host='::1'; Master-Host: ::1 -change master to master_host='::FFFF:127.0.0.1'; -Master-Host: ::FFFF:127.0.0.1 +change master to master_host='127.0.0.1'; +Master-Host: 127.0.0.1 change master to master_host='0:0:0:0:0:0:0:1'; Master-Host: 0:0:0:0:0:0:0:1 disconnect slave; diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix2.result b/mysql-test/suite/rpl/r/rpl_ip_mix2.result index e5cc3e1621d..e1011bf85ee 100644 --- a/mysql-test/suite/rpl/r/rpl_ip_mix2.result +++ b/mysql-test/suite/rpl/r/rpl_ip_mix2.result @@ -14,22 +14,6 @@ Master-Host: ::1 disconnect slave; disconnect master; connection default; -#################### IP: ::1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,::1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: ::1 -change master to master_host='::1'; -Master-Host: ::1 -disconnect slave; -disconnect master; -connection default; #################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ########################### connect (master,127.0.0.1,root,,test,MASTER_MYPORT); connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT); @@ -62,102 +46,6 @@ Master-Host: 0:0:0:0:0:0:0:1 disconnect slave; disconnect master; connection default; -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0:0:0:0:0:0:1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0:0:0:0:0:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 127.0.0.1 -change master to master_host='0:0:0:0:0:FFFF:127.0.0.1'; -Master-Host: 0:0:0:0:0:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0:0:0:0:FFFF:127.0.0.1 -change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 -change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1'; -Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0::0000:FFFF:127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0::0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 -change master to master_host='0::0000:FFFF:127.0.0.1'; -Master-Host: 0::0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::FFFF:127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,::FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0::0000:FFFF:127.0.0.1 -change master to master_host='::FFFF:127.0.0.1'; -Master-Host: ::FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; #################### IP: ::1 mix ####################### connect (master,127.0.0.1,root,,test,MASTER_MYPORT); connect (slave,::1,root,,test,SLAVE_MYPORT); @@ -168,11 +56,11 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # connection slave; reset slave; -Master-Host: ::FFFF:127.0.0.1 +Master-Host: 0:0:0:0:0:0:0:1 change master to master_host='::1'; Master-Host: ::1 -change master to master_host='::FFFF:127.0.0.1'; -Master-Host: ::FFFF:127.0.0.1 +change master to master_host='127.0.0.1'; +Master-Host: 127.0.0.1 change master to master_host='0:0:0:0:0:0:0:1'; Master-Host: 0:0:0:0:0:0:0:1 disconnect slave; diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix2_win.result b/mysql-test/suite/rpl/r/rpl_ip_mix2_win.result deleted file mode 100644 index c7cec70ed6c..00000000000 --- a/mysql-test/suite/rpl/r/rpl_ip_mix2_win.result +++ /dev/null @@ -1,84 +0,0 @@ -#################### IP: ::1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,::1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: No such row -change master to master_host='::1'; -Master-Host: ::1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: ::1 -change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001'; -Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0:0:0:0:0:0:1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0:0:0:0:0:0:1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::1 mix ####################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,::1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 127.0.0.1 -change master to master_host='::1'; -Master-Host: ::1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix_win.result b/mysql-test/suite/rpl/r/rpl_ip_mix_win.result deleted file mode 100644 index a1d11e109e5..00000000000 --- a/mysql-test/suite/rpl/r/rpl_ip_mix_win.result +++ /dev/null @@ -1,84 +0,0 @@ -#################### IP: ::1 ########################### -connect (master,::1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: No such row -change master to master_host='::1'; -Master-Host: ::1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ########################### -connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: ::1 -change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001'; -Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0:0:0:0:0:0:1 ########################### -connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 0:0:0:0:0:0:0:1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::1 mix ####################### -connect (master,::1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 127.0.0.1 -change master to master_host='::1'; -Master-Host: ::1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result index 4168cff1e97..0393cfa483c 100644 --- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result +++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result @@ -88,7 +88,7 @@ Master-Host: ::FFFF:127.0.0.1 disconnect slave; disconnect master; connection default; -#################### IP: ::1 ########################### +#################### IP: ::FFFF:127.0.0.1 ########################### connect (master,127.0.0.1,root,,test,MASTER_MYPORT); connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); connection master; @@ -99,12 +99,12 @@ master-bin.000001 # connection slave; reset slave; Master-Host: ::FFFF:127.0.0.1 -change master to master_host='::1'; -Master-Host: ::1 change master to master_host='::FFFF:127.0.0.1'; Master-Host: ::FFFF:127.0.0.1 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 +change master to master_host='127.0.0.1'; +Master-Host: 127.0.0.1 +change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1'; +Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 disconnect slave; disconnect master; connection default; diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6_win.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6_win.result deleted file mode 100644 index a1e48ea6610..00000000000 --- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6_win.result +++ /dev/null @@ -1,35 +0,0 @@ -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 127.0.0.1 -change master to master_host='::1'; -Master-Host: ::1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result index f46e60548a6..6ae946d197b 100644 --- a/mysql-test/suite/rpl/r/rpl_ipv6.result +++ b/mysql-test/suite/rpl/r/rpl_ipv6.result @@ -43,96 +43,6 @@ Master-Host: 0:0:0:0:0:0:0:1 disconnect slave; disconnect master; connection default; -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ########################### -connect (master,0:0:0:0:0:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0:0:0:0:0:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='0:0:0:0:0:FFFF:127.0.0.1'; -Master-Host: 0:0:0:0:0:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ########################### -connect (master,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ########################### -connect (master,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1'; -Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0::0000:FFFF:127.0.0.1 ########################### -connect (master,0::0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,0::0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='0::0000:FFFF:127.0.0.1'; -Master-Host: 0::0000:FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::FFFF:127.0.0.1 ########################### -connect (master,::FFFF:127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,::FFFF:127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='::FFFF:127.0.0.1'; -Master-Host: ::FFFF:127.0.0.1 -disconnect slave; -disconnect master; -connection default; #################### IP: ::1 mix ####################### connect (master,127.0.0.1,root,,test,MASTER_MYPORT); connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); @@ -143,11 +53,11 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # connection slave; reset slave; -Master-Host: ::FFFF:127.0.0.1 +Master-Host: 0:0:0:0:0:0:0:1 change master to master_host='::1'; Master-Host: ::1 -change master to master_host='::FFFF:127.0.0.1'; -Master-Host: ::FFFF:127.0.0.1 +change master to master_host='127.0.0.1'; +Master-Host: 127.0.0.1 change master to master_host='0:0:0:0:0:0:0:1'; Master-Host: 0:0:0:0:0:0:0:1 disconnect slave; diff --git a/mysql-test/suite/rpl/r/rpl_ipv6_win.result b/mysql-test/suite/rpl/r/rpl_ipv6_win.result deleted file mode 100644 index 79dc8422161..00000000000 --- a/mysql-test/suite/rpl/r/rpl_ipv6_win.result +++ /dev/null @@ -1,80 +0,0 @@ -#################### IP: ::1 ########################### -connect (master,::1,root,,test,MASTER_MYPORT); -connect (slave,::1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='::1'; -Master-Host: ::1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ########################### -connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT); -connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001'; -Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001 -disconnect slave; -disconnect master; -connection default; -#################### IP: 0:0:0:0:0:0:0:1 ########################### -connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT); -connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; -#################### IP: 127.0.0.1 ########################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -disconnect slave; -disconnect master; -connection default; -#################### IP: ::1 mix ####################### -connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connection master; -reset master; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 # -connection slave; -reset slave; -Master-Host: 127.0.0.1 -change master to master_host='::1'; -Master-Host: ::1 -change master to master_host='127.0.0.1'; -Master-Host: 127.0.0.1 -change master to master_host='0:0:0:0:0:0:0:1'; -Master-Host: 0:0:0:0:0:0:0:1 -disconnect slave; -disconnect master; -connection default; diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.test b/mysql-test/suite/rpl/t/rpl_ip_mix.test index 68aa2fc87a9..0852b3f4ff7 100644 --- a/mysql-test/suite/rpl/t/rpl_ip_mix.test +++ b/mysql-test/suite/rpl/t/rpl_ip_mix.test @@ -7,8 +7,6 @@ # (see corresponding cnf file) # --source include/check_ipv6.inc -# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1 ---source include/not_windows.inc --source include/have_log_bin.inc let $IPv6= ::1; @@ -27,38 +25,6 @@ let $IPv6= 0:0:0:0:0:0:0:1; --echo #################### IP: $IPv6 ########################### --source include/rpl_ip_mix.inc -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= 0::0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ip_mix.inc - -let $IPv6= ::FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -#let $IPv6= ::FFFF:127.0.0.1/96; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ip_mix.inc - let $IPv6= ::1; --echo #################### IP: $IPv6 mix ####################### --echo connect (master,$IPv6,root,,test,MASTER_MYPORT); @@ -78,7 +44,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); eval change master to master_host='$IPv6'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host -eval change master to master_host='::FFFF:127.0.0.1'; +eval change master to master_host='127.0.0.1'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host eval change master to master_host='0:0:0:0:0:0:0:1'; diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.test b/mysql-test/suite/rpl/t/rpl_ip_mix2.test index d6435d710c1..11c648dece5 100644 --- a/mysql-test/suite/rpl/t/rpl_ip_mix2.test +++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.test @@ -19,14 +19,8 @@ disconnect checkcon123456789; --enable_abort_on_error --enable_query_log # end check - -# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1 ---source include/not_windows.inc --source include/have_log_bin.inc -let $IPv6= ::1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc let $IPv6= ::1; --echo #################### IP: $IPv6 ########################### --source include/rpl_ip_mix2.inc @@ -43,38 +37,6 @@ let $IPv6= 0:0:0:0:0:0:0:1; --echo #################### IP: $IPv6 ########################### --source include/rpl_ip_mix2.inc -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= 0::0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ip_mix2.inc - -let $IPv6= ::FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -#let $IPv6= ::FFFF:127.0.0.1/96; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ip_mix2.inc - let $IPv6= ::1; --echo #################### IP: $IPv6 mix ####################### --echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT); @@ -94,7 +56,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); eval change master to master_host='$IPv6'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host -eval change master to master_host='::FFFF:127.0.0.1'; +eval change master to master_host='127.0.0.1'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host eval change master to master_host='0:0:0:0:0:0:0:1'; diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2_win.cnf b/mysql-test/suite/rpl/t/rpl_ip_mix2_win.cnf deleted file mode 100644 index 306df437bcc..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ip_mix2_win.cnf +++ /dev/null @@ -1,56 +0,0 @@ -# Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf - -[mysqld.1] - -# Run the master.sh script before starting this process -#!run-master-sh - -log-bin= master-bin - -loose-innodb - -skip-name-resolve -bind-address= 0.0.0.0 - - -[mysqld.2] -# Run the slave.sh script before starting this process -#!run-slave-sh - -# Append -slave.opt file to the list of argument used when -# starting the mysqld -#!use-slave-opt - -log-bin= slave-bin -relay-log= slave-relay-bin - -init-rpl-role= slave -log-slave-updates -master-retry-count= 10 - -# Values reported by slave when it connect to master -# and shows up in SHOW SLAVE STATUS; -report-host= localhost -report-port= @mysqld.2.port -report-user= root - -skip-slave-start -skip-name-resolve -bind-address= :: - -# Directory where slaves find the dumps generated by "load data" -# on the server. The path need to have constant length otherwise -# test results will vary, thus a relative path is used. -slave-load-tmpdir= ../../tmp - -loose-innodb - -[ENV] -MASTER_MYPORT= @mysqld.1.port -MASTER_MYSOCK= @mysqld.1.socket - -SLAVE_MYPORT= @mysqld.2.port -SLAVE_MYSOCK= @mysqld.2.socket - diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2_win.test b/mysql-test/suite/rpl/t/rpl_ip_mix2_win.test deleted file mode 100644 index f9a2022ddd4..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ip_mix2_win.test +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2009 SUN Microsystems -# All rights reserved. Use is subject to license terms. -# Author: Horst Hunger -# Nov. 19, 2009 -# Test of ipv6 format, especially "change master host=..." -# Options: --skip-name-resolve, master: --bind-address=0.0.0.0, slave: --bind-address=:: -# (see corresponding cnf file) -# -# Check if ipv6 is available. If not, server is crashing (see BUG#48915). ---disable_query_log ---disable_abort_on_error -connect (checkcon123456789,::1,root,,test,$SLAVE_MYPORT); -if($mysql_errno) -{ -skip wrong IP for slave; -} -connection default; -disconnect checkcon123456789; ---enable_abort_on_error ---enable_query_log -# end check - -# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1 ---source include/windows.inc ---source include/have_log_bin.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= ::1/128; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ip_mix2.inc - -let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= 0:0:0:0:0:0:0:1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix2.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 mix ####################### ---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (master,127.0.0.1,root,,test,$MASTER_MYPORT); ---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT); -connect (slave,$IPv6,root,,test,$SLAVE_MYPORT); ---echo connection master; -connection master; -reset master; -source include/show_master_status.inc; -save_master_pos; ---echo connection slave; -connection slave; -reset slave; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='$IPv6'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='127.0.0.1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='0:0:0:0:0:0:0:1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host ---echo disconnect slave; -disconnect slave; ---echo disconnect master; -disconnect master; ---echo connection default; -connection default; ---exit diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix_win.cnf b/mysql-test/suite/rpl/t/rpl_ip_mix_win.cnf deleted file mode 100644 index 00e2637d822..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ip_mix_win.cnf +++ /dev/null @@ -1,56 +0,0 @@ -# Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf - -[mysqld.1] - -# Run the master.sh script before starting this process -#!run-master-sh - -log-bin= master-bin - -loose-innodb - -skip-name-resolve -bind-address= :: - - -[mysqld.2] -# Run the slave.sh script before starting this process -#!run-slave-sh - -# Append -slave.opt file to the list of argument used when -# starting the mysqld -#!use-slave-opt - -log-bin= slave-bin -relay-log= slave-relay-bin - -init-rpl-role= slave -log-slave-updates -master-retry-count= 10 - -# Values reported by slave when it connect to master -# and shows up in SHOW SLAVE STATUS; -report-host= localhost -report-port= @mysqld.2.port -report-user= root - -skip-slave-start -skip-name-resolve -bind-address= 0.0.0.0 - -# Directory where slaves find the dumps generated by "load data" -# on the server. The path need to have constant length otherwise -# test results will vary, thus a relative path is used. -slave-load-tmpdir= ../../tmp - -loose-innodb - -[ENV] -MASTER_MYPORT= @mysqld.1.port -MASTER_MYSOCK= @mysqld.1.socket - -SLAVE_MYPORT= @mysqld.2.port -SLAVE_MYSOCK= @mysqld.2.socket - diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix_win.test b/mysql-test/suite/rpl/t/rpl_ip_mix_win.test deleted file mode 100644 index 7d78f71bd1b..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ip_mix_win.test +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2009 SUN Microsystems -# All rights reserved. Use is subject to license terms. -# Author: Horst Hunger -# Nov. 19, 2009 -# Test of ipv6 format, especially "change master host=..." -# Options: --skip-name-resolve, master: --bind-address=::, slave: --bind-address=0.0.0.0 -# (see corresponding cnf file) -# ---source include/check_ipv6.inc -# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1 ---source include/windows.inc ---source include/have_log_bin.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= ::1/128; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ip_mix.inc - -let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= 0:0:0:0:0:0:0:1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ip_mix.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 mix ####################### ---echo connect (master,$IPv6,root,,test,MASTER_MYPORT); -connect (master,$IPv6,root,,test,$MASTER_MYPORT); ---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT); ---echo connection master; -connection master; -reset master; -source include/show_master_status.inc; -save_master_pos; ---echo connection slave; -connection slave; -reset slave; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='$IPv6'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='127.0.0.1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='0:0:0:0:0:0:0:1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host ---echo disconnect slave; -disconnect slave; ---echo disconnect master; -disconnect master; ---echo connection default; -connection default; ---exit diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test index f4e5ad6af7b..ecd5a754fdc 100644 --- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test +++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test @@ -6,22 +6,7 @@ # Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding cnf file) # for master and slave # -# Check if ipv4 is available. ---disable_query_log ---disable_abort_on_error -connect (checkcon123456789,127.0.0.1,root,,test); -if($mysql_errno) -{ -skip wrong IP; -} -connection default; -disconnect checkcon123456789; ---enable_abort_on_error ---enable_query_log -# end check - -# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1 ---source include/not_windows.inc +--source include/have_ipv4_mapped.inc --source include/have_log_bin.inc let $IPv6= 127.0.0.1; @@ -56,7 +41,7 @@ let $IPv6= ::FFFF:127.0.0.1; #--echo #################### IP: $IPv6 ########################### #--source include/rpl_ipv6.inc -let $IPv6= ::1; +let $IPv6= ::FFFF:127.0.0.1; --echo #################### IP: $IPv6 ########################### --echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT); connect (master,127.0.0.1,root,,test,$MASTER_MYPORT); @@ -75,10 +60,10 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); eval change master to master_host='$IPv6'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host -eval change master to master_host='::FFFF:127.0.0.1'; +eval change master to master_host='127.0.0.1'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host -eval change master to master_host='0:0:0:0:0:0:0:1'; +eval change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host --echo disconnect slave; diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.cnf b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.cnf deleted file mode 100644 index b646a4088ff..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.cnf +++ /dev/null @@ -1,56 +0,0 @@ -# Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf - -[mysqld.1] - -# Run the master.sh script before starting this process -#!run-master-sh - -log-bin= master-bin - -loose-innodb - -skip-name-resolve -bind-address= 0.0.0.0 - - -[mysqld.2] -# Run the slave.sh script before starting this process -#!run-slave-sh - -# Append -slave.opt file to the list of argument used when -# starting the mysqld -#!use-slave-opt - -log-bin= slave-bin -relay-log= slave-relay-bin - -init-rpl-role= slave -log-slave-updates -master-retry-count= 10 - -# Values reported by slave when it connect to master -# and shows up in SHOW SLAVE STATUS; -report-host= localhost -report-port= @mysqld.2.port -report-user= root - -skip-slave-start -skip-name-resolve -bind-address= 0.0.0.0 - -# Directory where slaves find the dumps generated by "load data" -# on the server. The path need to have constant length otherwise -# test results will vary, thus a relative path is used. -slave-load-tmpdir= ../../tmp - -loose-innodb - -[ENV] -MASTER_MYPORT= @mysqld.1.port -MASTER_MYSOCK= @mysqld.1.socket - -SLAVE_MYPORT= @mysqld.2.port -SLAVE_MYSOCK= @mysqld.2.socket - diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.test deleted file mode 100644 index db786536c2d..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6_win.test +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2009 SUN Microsystems -# All rights reserved. Use is subject to license terms. -# Author: Horst Hunger -# Nov. 19, 2009 -# Test of ipv4 (127.0.0.1) in ipv6 format, especially "change master host=..." -# Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding cnf file) -# for master and slave -# -# Check if ipv4 is available. ---disable_query_log ---disable_abort_on_error -connect (checkcon123456789,127.0.0.1,root,,test); -if($mysql_errno) -{ -skip wrong IP; -} -connection default; -disconnect checkcon123456789; ---enable_abort_on_error ---enable_query_log -# end check - -# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1 ---source include/windows.inc ---source include/have_log_bin.inc - -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 ########################### ---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (master,127.0.0.1,root,,test,$MASTER_MYPORT); ---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT); ---echo connection master; -connection master; -reset master; -source include/show_master_status.inc; -save_master_pos; ---echo connection slave; -connection slave; -reset slave; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='$IPv6'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='127.0.0.1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='0:0:0:0:0:0:0:1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host ---echo disconnect slave; -disconnect slave; ---echo disconnect master; -disconnect master; ---echo connection default; -connection default; ---exit - diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv6.test index 71fedcb4208..3eceedfd7a4 100644 --- a/mysql-test/suite/rpl/t/rpl_ipv6.test +++ b/mysql-test/suite/rpl/t/rpl_ipv6.test @@ -27,38 +27,6 @@ let $IPv6= 0:0:0:0:0:0:0:1; --echo #################### IP: $IPv6 ########################### --source include/rpl_ipv6.inc -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= 0::0000:FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ipv6.inc - -let $IPv6= ::FFFF:127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -#let $IPv6= ::FFFF:127.0.0.1/96; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ipv6.inc - let $IPv6= ::1; --echo #################### IP: $IPv6 mix ####################### --echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT); @@ -78,7 +46,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); eval change master to master_host='$IPv6'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host -eval change master to master_host='::FFFF:127.0.0.1'; +eval change master to master_host='127.0.0.1'; let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host eval change master to master_host='0:0:0:0:0:0:0:1'; diff --git a/mysql-test/suite/rpl/t/rpl_ipv6_win.cnf b/mysql-test/suite/rpl/t/rpl_ipv6_win.cnf deleted file mode 100644 index c657e7c5115..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ipv6_win.cnf +++ /dev/null @@ -1,56 +0,0 @@ -# Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf - -[mysqld.1] - -# Run the master.sh script before starting this process -#!run-master-sh - -log-bin= master-bin - -loose-innodb - -skip-name-resolve -bind-address= :: - - -[mysqld.2] -# Run the slave.sh script before starting this process -#!run-slave-sh - -# Append -slave.opt file to the list of argument used when -# starting the mysqld -#!use-slave-opt - -log-bin= slave-bin -relay-log= slave-relay-bin - -init-rpl-role= slave -log-slave-updates -master-retry-count= 10 - -# Values reported by slave when it connect to master -# and shows up in SHOW SLAVE STATUS; -report-host= localhost -report-port= @mysqld.2.port -report-user= root - -skip-slave-start -skip-name-resolve -bind-address= :: - -# Directory where slaves find the dumps generated by "load data" -# on the server. The path need to have constant length otherwise -# test results will vary, thus a relative path is used. -slave-load-tmpdir= ../../tmp - -loose-innodb - -[ENV] -MASTER_MYPORT= @mysqld.1.port -MASTER_MYSOCK= @mysqld.1.socket - -SLAVE_MYPORT= @mysqld.2.port -SLAVE_MYSOCK= @mysqld.2.socket - diff --git a/mysql-test/suite/rpl/t/rpl_ipv6_win.test b/mysql-test/suite/rpl/t/rpl_ipv6_win.test deleted file mode 100644 index 7c9d437541a..00000000000 --- a/mysql-test/suite/rpl/t/rpl_ipv6_win.test +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2009 SUN Microsystems -# All rights reserved. Use is subject to license terms. -# Author: Horst Hunger -# Nov. 19, 2009 -# Test of ipv6 format, especially "change master host=..." -# Options: --skip-name-resolve, --bind-address=:: (see corresponding cnf file) -# for master and slave. -# ---source include/check_ipv6.inc -# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1 ---source include/windows.inc ---source include/have_log_bin.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= ::1/128; -#--echo #################### IP: $IPv6 ########################### -#--source include/rpl_ipv6.inc - -let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= 0:0:0:0:0:0:0:1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= 127.0.0.1; ---echo #################### IP: $IPv6 ########################### ---source include/rpl_ipv6.inc - -let $IPv6= ::1; ---echo #################### IP: $IPv6 mix ####################### ---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT); -connect (master,127.0.0.1,root,,test,$MASTER_MYPORT); ---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT); -connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT); ---echo connection master; -connection master; -reset master; -source include/show_master_status.inc; -save_master_pos; ---echo connection slave; -connection slave; -reset slave; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='$IPv6'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='127.0.0.1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host -eval change master to master_host='0:0:0:0:0:0:0:1'; -let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); ---echo Master-Host: $master_host ---echo disconnect slave; -disconnect slave; ---echo disconnect master; -disconnect master; ---echo connection default; -connection default; ---exit diff --git a/mysql-test/t/ipv4_as_ipv6.test b/mysql-test/t/ipv4_as_ipv6.test index 4f4e68e8bfc..ace3c286643 100644 --- a/mysql-test/t/ipv4_as_ipv6.test +++ b/mysql-test/t/ipv4_as_ipv6.test @@ -5,8 +5,7 @@ # Test of ipv4 (127.0.0.1) in ipv6 format # Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding opt file). # -# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1 ---source include/not_windows.inc +--source include/have_ipv4_mapped.inc # Can't be tested with embedded server --source include/not_embedded.inc diff --git a/mysql-test/t/ipv4_as_ipv6_win-master.opt b/mysql-test/t/ipv4_as_ipv6_win-master.opt deleted file mode 100644 index f55a8e9209d..00000000000 --- a/mysql-test/t/ipv4_as_ipv6_win-master.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-name-resolve --bind-address=0.0.0.0 diff --git a/mysql-test/t/ipv4_as_ipv6_win.test b/mysql-test/t/ipv4_as_ipv6_win.test deleted file mode 100644 index 04f908a119d..00000000000 --- a/mysql-test/t/ipv4_as_ipv6_win.test +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2009 SUN Microsystems -# All rights reserved. Use is subject to license terms. -# Author: Horst Hunger -# Nov. 19, 2009 -# Test of ipv4 (127.0.0.1) in ipv6 format -# Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding opt file). -# -# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1 ---source include/windows.inc -# Can't be tested with embedded server ---source include/not_embedded.inc - -# Save the initial number of concurrent sessions ---source include/count_sessions.inc - -echo =============Test of '127.0.0.1' (IPv4) ===========================; -let $IPv6= 127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '::1' ========================; -let $IPv6= ::1; ---echo connect (con1, $IPv6, root, , test, MASTER_MYPORT); ---disable_query_log ---error 2003,2006 -connect (con1, $IPv6, root, , test, $MASTER_MYPORT); ---enable_query_log -connection default; - -# Wait till all disconnects are completed ---source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/ipv6.test b/mysql-test/t/ipv6.test index a1515e9d533..5c08cde3746 100644 --- a/mysql-test/t/ipv6.test +++ b/mysql-test/t/ipv6.test @@ -6,9 +6,6 @@ # Options: --skip-name-resolve, --bind-address=:: (see corresponding opt file). # --source include/check_ipv6.inc - -# Can't be tested with windows due to the mixed format like 0:0:0:0:0:FFFF:127.0.0.1 ---source include/not_windows.inc # Can't be tested with embedded server --source include/not_embedded.inc @@ -35,45 +32,5 @@ let $IPv6= 0:0:0:0:0:0:0:1; --source include/ipv6_clients.inc --source include/ipv6.inc -echo =============Test of '127.0.0.1' (IPv4) ===========================; -let $IPv6= 127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================; -let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====; -let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====; -let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '0::0000:FFFF:127.0.0.1' ====; -let $IPv6= 0::0000:FFFF:127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================; -let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96; -#--source include/ipv6_clients.inc -#--source include/ipv6.inc - -echo =============Test of '::FFFF:127.0.0.1' ===========================; -let $IPv6= ::FFFF:127.0.0.1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '::FFFF:127.0.0.1/96' ========================; -let $IPv6= ::FFFF:127.0.0.1/96; -#--source include/ipv6_clients.inc -#--source include/ipv6.inc - # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/ipv6_win-master.opt b/mysql-test/t/ipv6_win-master.opt deleted file mode 100644 index d705811808c..00000000000 --- a/mysql-test/t/ipv6_win-master.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-name-resolve --bind-address=:: diff --git a/mysql-test/t/ipv6_win.test b/mysql-test/t/ipv6_win.test deleted file mode 100644 index 86d867cc448..00000000000 --- a/mysql-test/t/ipv6_win.test +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2009 SUN Microsystems -# All rights reserved. Use is subject to license terms. -# Author: Horst Hunger -# Nov. 19, 2009 -# Test of ipv6 format -# Options: --skip-name-resolve, --bind-address=:: (see corresponding opt file). -# ---source include/check_ipv6.inc - -# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1 ---source include/windows.inc -# Can't be tested with embedded server ---source include/not_embedded.inc - -# Save the initial number of concurrent sessions ---source include/count_sessions.inc - -echo =============Test of '::1' ========================================; -let $IPv6= ::1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '::1/128' ====================================; -let $IPv6= ::1/128; -#--source include/ipv6_clients.inc -#--source include/ipv6.inc - -echo =============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====; -let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -echo =============Test of '0:0:0:0:0:0:0:1' ============================; -let $IPv6= 0:0:0:0:0:0:0:1; ---source include/ipv6_clients.inc ---source include/ipv6.inc - -# Wait till all disconnects are completed ---source include/wait_until_count_sessions.inc From 8d240586b55d8ba1aa8cb7ec67b085d86cb5a32a Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 29 Jan 2010 15:55:35 +0200 Subject: [PATCH 29/54] Bug #50192 Strange effect in replication test, trigger, auto_increment The auto-inc unsafe warning makes sense even though it's just one auto-inc table could be involved via a trigger or a stored function. However its content was not updated by bug@45677 fixes continuing to mention two tables whereas the fixes refined semantics of replication of auto_increment in stored routine. Fixed with updating the error message, renaming the error and an internal unsafe-condition constants. A documentation notice ====================== Inserting into an autoincrement column in a stored function or a trigger is unsafe for replication. Even with just one autoincrement column, if the routine is invoked more than once slave is not guaranteed to execute the statement graph same way as the master. And since it's impossible to estimate how many times a routine can be invoked at the query pre-execution phase (see lock_tables), the statement is marked pessimistically unsafe. mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result: results updated to include the expected unsafe warning. mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test: regression test for bug#50192 to diplaying the unsafe warning comes out to the user warning stack. sql/share/errmsg-utf8.txt: Updating the auto-inc unsafe message to correspond to bug@45677 fixes' new sematics. sql/share/errmsg.txt: Updating the auto-inc unsafe message to correspond to bug@45677 fixes' new sematics. sql/sql_base.cc: changing a symbolic name to correspond to updated by bug@45677 fixes new sematics. sql/sql_lex.cc: changing a symbolic name to correspond to updated by bug@45677 fixes new sematics. sql/sql_lex.h: changing a symbolic name to correspond to updated by bug@45677 fixes new sematics and description comments. --- .../binlog/r/binlog_stm_unsafe_warning.result | 27 ++++++++++++++++ .../binlog/t/binlog_stm_unsafe_warning.test | 32 +++++++++++++++++++ sql/share/errmsg-utf8.txt | 4 +-- sql/share/errmsg.txt | 4 +-- sql/sql_base.cc | 2 +- sql/sql_lex.cc | 2 +- sql/sql_lex.h | 14 ++++---- 7 files changed, 73 insertions(+), 12 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index c2445aa1d1a..e8fd7b82bc4 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -1,5 +1,6 @@ call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. .*"); call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. .*"); +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column"); ### NOT filtered database => assertion: warnings ARE shown DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a int, b int, primary key (a)); @@ -50,3 +51,29 @@ SET GLOBAL log_warnings = @old_log_warnings; # Count the number of times the "Unsafe" message was printed # to the error log. Occurrences: 1 +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int auto_increment primary key, b int); +CREATE TRIGGER tr_bug50192 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 (b) VALUES (1); +CREATE FUNCTION sf_bug50192() RETURNS INTEGER +BEGIN +INSERT INTO t2(b) VALUES(2); +RETURN 1; +END | +INSERT INTO t1 VALUES (0); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. +SHOW WARNINGS; +Level Code Message +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. +SELECT sf_bug50192(); +sf_bug50192() +1 +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. +SHOW WARNINGS; +Level Code Message +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. +DROP FUNCTION sf_bug50192; +DROP TRIGGER tr_bug50192; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test index 35235ce951a..874bb015a07 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test +++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test @@ -27,6 +27,7 @@ -- source include/have_binlog_format_statement.inc call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. .*"); call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. .*"); +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column"); -- echo ### NOT filtered database => assertion: warnings ARE shown @@ -117,3 +118,34 @@ perl; print "Occurrences: $count\n"; close(FILE); EOF + +# bug#50192: diplaying the unsafe warning comes out to the user warning stack + +-- disable_warnings +DROP TABLE IF EXISTS t1, t2; +-- enable_warnings + +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int auto_increment primary key, b int); +CREATE TRIGGER tr_bug50192 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 (b) VALUES (1); + +DELIMITER |; + +CREATE FUNCTION sf_bug50192() RETURNS INTEGER +BEGIN + INSERT INTO t2(b) VALUES(2); + RETURN 1; +END | + +DELIMITER ;| + +INSERT INTO t1 VALUES (0); +SHOW WARNINGS; +SELECT sf_bug50192(); +SHOW WARNINGS; + +# cleanup + +DROP FUNCTION sf_bug50192; +DROP TRIGGER tr_bug50192; +DROP TABLE t1, t2; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 92c86cf6e00..f7094e8734d 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6280,8 +6280,8 @@ ER_BINLOG_UNSAFE_INSERT_DELAYED eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted." ER_BINLOG_UNSAFE_SYSTEM_TABLE eng "Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave." -ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS - eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave." +ER_BINLOG_UNSAFE_AUTOINC_COLUMNS + eng "Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically." ER_BINLOG_UNSAFE_UDF eng "Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave." ER_BINLOG_UNSAFE_SYSTEM_VARIABLE diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 31e630d5fea..60be5723559 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6221,8 +6221,8 @@ ER_BINLOG_UNSAFE_INSERT_DELAYED eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted." ER_BINLOG_UNSAFE_SYSTEM_TABLE eng "Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave." -ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS - eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave." +ER_BINLOG_UNSAFE_AUTOINC_COLUMNS + eng "Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically." ER_BINLOG_UNSAFE_UDF eng "Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave." ER_BINLOG_UNSAFE_SYSTEM_VARIABLE diff --git a/sql/sql_base.cc b/sql/sql_base.cc index eb59600b360..e7f014d39a5 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5181,7 +5181,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables && has_write_table_with_auto_increment(thd->lex->first_not_own_table())) { - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_TWO_AUTOINC_COLUMNS); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS); thd->set_current_stmt_binlog_format_row_if_mixed(); } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 0d423ba85eb..6da734592dc 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -48,7 +48,7 @@ Query_tables_list::binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT] = ER_BINLOG_UNSAFE_LIMIT, ER_BINLOG_UNSAFE_INSERT_DELAYED, ER_BINLOG_UNSAFE_SYSTEM_TABLE, - ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS, + ER_BINLOG_UNSAFE_AUTOINC_COLUMNS, ER_BINLOG_UNSAFE_UDF, ER_BINLOG_UNSAFE_SYSTEM_VARIABLE, ER_BINLOG_UNSAFE_SYSTEM_FUNCTION, diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 800a16cf2b6..923e924dfbc 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1101,13 +1101,15 @@ public: */ BINLOG_STMT_UNSAFE_SYSTEM_TABLE, /** - Update of two autoincrement columns is unsafe. With one - autoincrement column, we store the counter in the binlog so that - slave can restore the correct value. But we can only store one - such counter per statement, so updating more than one - autoincrement column is not safe. + Inserting into an autoincrement column in a stored routine is unsafe. + Even with just one autoincrement column, if the routine is invoked more than + once slave is not guaranteed to execute the statement graph same way as + the master. + And since it's impossible to estimate how many times a routine can be invoked at + the query pre-execution phase (see lock_tables), the statement is marked + pessimistically unsafe. */ - BINLOG_STMT_UNSAFE_TWO_AUTOINC_COLUMNS, + BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS, /** Using a UDF (user-defined function) is unsafe. */ From a1bfae20cb3e9cc8919bf4902865314d1bf9d6f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jan 2010 02:26:51 +0800 Subject: [PATCH 30/54] BUG#50157 Assertion !active_tranxs_->is_tranx_end_pos(..) in ReplSemiSyncMaster::commitTrx The root cause of the crash is that a TranxNode is freed before it is used. A TranxNode is allocated and inserted into the active list each time a log event is written and flushed into the binlog file. The memory for TranxNode is allocated with thd_alloc and will be freed at the end of the statement. The after_commit/after_rollback callback was supposed to be called before the end of each statement and remove the node from the active list. However this assumption is not correct in all cases(e.g. call 'CREATE TEMPORARY TABLE myisam_t SELECT * FROM innodb_t' in a transaction and delete all temporary tables automatically when a session closed), and can cause the memory allocated for TranxNode be freed before it was removed from the active list. So The TranxNode pointer in the active list would become a wild pointer and cause the crash. After this patch, We have a class called a TranxNodeAllocate which manages the memory for allocating and freeing TranxNode. It uses my_malloc to allocate memory. sql/rpl_handler.cc: params are not initialized. --- mysql-test/suite/rpl/r/rpl_semi_sync.result | 31 ++- mysql-test/suite/rpl/t/rpl_semi_sync.test | 33 ++- plugin/semisync/semisync_master.cc | 25 +- plugin/semisync/semisync_master.h | 284 ++++++++++++++++++-- sql/rpl_handler.cc | 10 +- 5 files changed, 335 insertions(+), 48 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index 1e220b28d78..74eb14d33e0 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -120,8 +120,27 @@ min(a) select max(a) from t1; max(a) 300 + +# BUG#50157 +# semi-sync replication crashes when replicating a transaction which +# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ; +[ on master ] +SET SESSION AUTOCOMMIT= 0; +CREATE TABLE t2(c1 INT) ENGINE=innodb; +BEGIN; + +# Even though it is in a transaction, this statement is binlogged into binlog +# file immediately. +CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1; + +# These statements will not be binlogged until the transaction is committed +INSERT INTO t2 VALUES(11); +INSERT INTO t2 VALUES(22); +COMMIT; +DROP TABLE t2, t3; +SET SESSION AUTOCOMMIT= 1; # -# Test semi-sync master will switch OFF after one transacton +# Test semi-sync master will switch OFF after one transaction # timeout waiting for slave reply. # include/stop_slave.inc @@ -135,7 +154,7 @@ Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value -Rpl_semi_sync_master_yes_tx 301 +Rpl_semi_sync_master_yes_tx 304 show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 1 @@ -150,7 +169,7 @@ Variable_name Value Rpl_semi_sync_master_no_tx 1 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value -Rpl_semi_sync_master_yes_tx 301 +Rpl_semi_sync_master_yes_tx 304 insert into t1 values (100); [ master status should be OFF ] show status like 'Rpl_semi_sync_master_status'; @@ -161,7 +180,7 @@ Variable_name Value Rpl_semi_sync_master_no_tx 302 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value -Rpl_semi_sync_master_yes_tx 301 +Rpl_semi_sync_master_yes_tx 304 # # Test semi-sync status on master will be ON again when slave catches up # @@ -194,7 +213,7 @@ Variable_name Value Rpl_semi_sync_master_no_tx 302 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value -Rpl_semi_sync_master_yes_tx 301 +Rpl_semi_sync_master_yes_tx 304 show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 1 @@ -213,7 +232,7 @@ Variable_name Value Rpl_semi_sync_master_no_tx 302 SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx'; Variable_name Value -Rpl_semi_sync_master_yes_tx 302 +Rpl_semi_sync_master_yes_tx 305 FLUSH NO_WRITE_TO_BINLOG STATUS; [ Semi-sync master status variables after FLUSH STATUS ] SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx'; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index 4900acc1e91..b04541aba21 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -11,6 +11,7 @@ disable_query_log; connection master; call mtr.add_suppression("Timeout waiting for reply of binlog"); call mtr.add_suppression("Read semi-sync reply"); +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT."); connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); @@ -193,8 +194,38 @@ select count(distinct a) from t1; select min(a) from t1; select max(a) from t1; +--echo +--echo # BUG#50157 +--echo # semi-sync replication crashes when replicating a transaction which +--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ; + +connection master; +echo [ on master ]; +SET SESSION AUTOCOMMIT= 0; +CREATE TABLE t2(c1 INT) ENGINE=innodb; +sync_slave_with_master; + +connection master; +BEGIN; +--echo +--echo # Even though it is in a transaction, this statement is binlogged into binlog +--echo # file immediately. +--disable_warnings +CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1; +--enable_warnings +--echo +--echo # These statements will not be binlogged until the transaction is committed +INSERT INTO t2 VALUES(11); +INSERT INTO t2 VALUES(22); +COMMIT; + +DROP TABLE t2, t3; +SET SESSION AUTOCOMMIT= 1; +sync_slave_with_master; + + --echo # ---echo # Test semi-sync master will switch OFF after one transacton +--echo # Test semi-sync master will switch OFF after one transaction --echo # timeout waiting for slave reply. --echo # connection slave; diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index c2e329e1fe4..bbbc2a669c4 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -65,7 +65,7 @@ static int gettimeofday(struct timeval *tv, void *tz) ActiveTranx::ActiveTranx(pthread_mutex_t *lock, unsigned long trace_level) - : Trace(trace_level), + : Trace(trace_level), allocator_(max_connections), num_entries_(max_connections << 1), /* Transaction hash table size * is set to double the size * of max_connections */ @@ -115,25 +115,6 @@ unsigned int ActiveTranx::get_hash_value(const char *log_file_name, return (hash1 + hash2) % num_entries_; } -ActiveTranx::TranxNode* ActiveTranx::alloc_tranx_node() -{ - MYSQL_THD thd= (MYSQL_THD)current_thd; - /* The memory allocated for TranxNode will be automatically freed at - the end of the command of current THD. And because - ha_autocommit_or_rollback() will always be called before that, so - we are sure that the node will be removed from the active list - before it get freed. */ - TranxNode *trx_node = (TranxNode *)thd_alloc(thd, sizeof(TranxNode)); - if (trx_node) - { - trx_node->log_name_[0] = '\0'; - trx_node->log_pos_= 0; - trx_node->next_= 0; - trx_node->hash_next_= 0; - } - return trx_node; -} - int ActiveTranx::compare(const char *log_file_name1, my_off_t log_file_pos1, const char *log_file_name2, my_off_t log_file_pos2) { @@ -159,7 +140,7 @@ int ActiveTranx::insert_tranx_node(const char *log_file_name, function_enter(kWho); - ins_node = alloc_tranx_node(); + ins_node = allocator_.allocate_node(); if (!ins_node) { sql_print_error("%s: transaction node allocation failed for: (%s, %lu)", @@ -271,6 +252,7 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name, /* Clear the hash table. */ memset(trx_htb_, 0, num_entries_ * sizeof(TranxNode *)); + allocator_.free_all_nodes(); /* Clear the active transaction list. */ if (trx_front_ != NULL) @@ -311,6 +293,7 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name, } trx_front_ = new_front; + allocator_.free_nodes_before(trx_front_); if (trace_level_ & kTraceDetail) sql_print_information("%s: cleared %d nodes back until pos (%s, %lu)", diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h index bfb1cb74cd0..982a7f77a59 100644 --- a/plugin/semisync/semisync_master.h +++ b/plugin/semisync/semisync_master.h @@ -20,6 +20,267 @@ #include "semisync.h" +struct TranxNode { + char log_name_[FN_REFLEN]; + my_off_t log_pos_; + struct TranxNode *next_; /* the next node in the sorted list */ + struct TranxNode *hash_next_; /* the next node during hash collision */ +}; + +/** + @class TranxNodeAllocator + + This class provides memory allocating and freeing methods for + TranxNode. The main target is performance. + + @section ALLOCATE How to allocate a node + The pointer of the first node after 'last_node' in current_block is + returned. current_block will move to the next free Block when all nodes of + it are in use. A new Block is allocated and is put into the rear of the + Block link table if no Block is free. + + The list starts up empty (ie, there is no allocated Block). + + After some nodes are freed, there probably are some free nodes before + the sequence of the allocated nodes, but we do not reuse it. It is better + to keep the allocated nodes are in the sequence, for it is more efficient + for allocating and freeing TranxNode. + + @section FREENODE How to free nodes + There are two methods for freeing nodes. They are free_all_nodes and + free_nodes_before. + + 'A Block is free' means all of its nodes are free. + @subsection free_nodes_before + As all allocated nodes are in the sequence, 'Before one node' means all + nodes before given node in the same Block and all Blocks before the Block + which containing the given node. As such, all Blocks before the given one + ('node') are free Block and moved into the rear of the Block link table. + The Block containing the given 'node', however, is not. For at least the + given 'node' is still in use. This will waste at most one Block, but it is + more efficient. + */ +#define BLOCK_TRANX_NODES 16 +class TranxNodeAllocator +{ +public: + /** + @param reserved_nodes + The number of reserved TranxNodes. It is used to set 'reserved_blocks' + which can contain at least 'reserved_nodes' number of TranxNodes. When + freeing memory, we will reserve at least reserved_blocks of Blocks not + freed. + */ + TranxNodeAllocator(uint reserved_nodes) : + reserved_blocks(reserved_nodes/BLOCK_TRANX_NODES + + (reserved_nodes%BLOCK_TRANX_NODES > 1 ? 2 : 1)), + first_block(NULL), last_block(NULL), + current_block(NULL), last_node(-1), block_num(0) {} + + ~TranxNodeAllocator() + { + Block *block= first_block; + while (block != NULL) + { + Block *next= block->next; + free_block(block); + block= next; + } + } + + /** + The pointer of the first node after 'last_node' in current_block is + returned. current_block will move to the next free Block when all nodes of + it are in use. A new Block is allocated and is put into the rear of the + Block link table if no Block is free. + + @return Return a TranxNode *, or NULL if an error occured. + */ + TranxNode *allocate_node() + { + TranxNode *trx_node; + Block *block= current_block; + + if (last_node == BLOCK_TRANX_NODES-1) + { + current_block= current_block->next; + last_node= -1; + } + + if (current_block == NULL && allocate_block()) + { + current_block= block; + if (current_block) + last_node= BLOCK_TRANX_NODES-1; + return NULL; + } + + trx_node= &(current_block->nodes[++last_node]); + trx_node->log_name_[0] = '\0'; + trx_node->log_pos_= 0; + trx_node->next_= 0; + trx_node->hash_next_= 0; + return trx_node; + } + + /** + All nodes are freed. + + @return Return 0, or 1 if an error occured. + */ + int free_all_nodes() + { + current_block= first_block; + last_node= -1; + free_blocks(); + return 0; + } + + /** + All Blocks before the given 'node' are free Block and moved into the rear + of the Block link table. + + @param node All nodes before 'node' will be freed + + @return Return 0, or 1 if an error occured. + */ + int free_nodes_before(TranxNode* node) + { + Block *block; + Block *prev_block; + + block= first_block; + while (block != current_block->next) + { + /* Find the Block containing the given node */ + if (&(block->nodes[0]) <= node && &(block->nodes[BLOCK_TRANX_NODES]) >= node) + { + /* All Blocks before the given node are put into the rear */ + if (first_block != block) + { + last_block->next= first_block; + first_block= block; + last_block= prev_block; + last_block->next= NULL; + free_blocks(); + } + return 0; + } + prev_block= block; + block= block->next; + } + + /* Node does not find should never happen */ + DBUG_ASSERT(0); + return 1; + } + +private: + uint reserved_blocks; + + /** + A sequence memory which contains BLOCK_TRANX_NODES TranxNodes. + + BLOCK_TRANX_NODES The number of TranxNodes which are in a Block. + + next Every Block has a 'next' pointer which points to the next Block. + These linking Blocks constitute a Block link table. + */ + struct Block { + Block *next; + TranxNode nodes[BLOCK_TRANX_NODES]; + }; + + /** + The 'first_block' is the head of the Block link table; + */ + Block *first_block; + /** + The 'last_block' is the rear of the Block link table; + */ + Block *last_block; + + /** + current_block always points the Block in the Block link table in + which the last allocated node is. The Blocks before it are all in use + and the Blocks after it are all free. + */ + Block *current_block; + + /** + It always points to the last node which has been allocated in the + current_block. + */ + int last_node; + + /** + How many Blocks are in the Block link table. + */ + uint block_num; + + /** + Allocate a block and then assign it to current_block. + */ + int allocate_block() + { + Block *block= (Block *)my_malloc(sizeof(Block), MYF(0)); + if (block) + { + block->next= NULL; + + if (first_block == NULL) + first_block= block; + else + last_block->next= block; + + /* New Block is always put into the rear */ + last_block= block; + /* New Block is always the current_block */ + current_block= block; + ++block_num; + return 0; + } + return 1; + } + + /** + Free a given Block. + @param block The Block will be freed. + */ + void free_block(Block *block) + { + my_free(block, MYF(0)); + --block_num; + } + + + /** + If there are some free Blocks and the total number of the Blocks in the + Block link table is larger than the 'reserved_blocks', Some free Blocks + will be freed until the total number of the Blocks is equal to the + 'reserved_blocks' or there is only one free Block behind the + 'current_block'. + */ + void free_blocks() + { + if (current_block == NULL || current_block->next == NULL) + return; + + /* One free Block is always kept behind the current block */ + Block *block= current_block->next->next; + while (block_num > reserved_blocks && block != NULL) + { + Block *next= block->next; + free_block(block); + block= next; + } + current_block->next->next= block; + if (block == NULL) + last_block= current_block->next; + } +}; + + /** This class manages memory for active transaction list. @@ -31,13 +292,8 @@ class ActiveTranx :public Trace { private: - struct TranxNode { - char log_name_[FN_REFLEN]; - my_off_t log_pos_; - struct TranxNode *next_; /* the next node in the sorted list */ - struct TranxNode *hash_next_; /* the next node during hash collision */ - }; + TranxNodeAllocator allocator_; /* These two record the active transaction list in sort order. */ TranxNode *trx_front_, *trx_rear_; @@ -48,24 +304,22 @@ private: inline void assert_lock_owner(); - inline TranxNode* alloc_tranx_node(); - inline unsigned int calc_hash(const unsigned char *key,unsigned int length); unsigned int get_hash_value(const char *log_file_name, my_off_t log_file_pos); int compare(const char *log_file_name1, my_off_t log_file_pos1, - const TranxNode *node2) { + const TranxNode *node2) { return compare(log_file_name1, log_file_pos1, - node2->log_name_, node2->log_pos_); + node2->log_name_, node2->log_pos_); } int compare(const TranxNode *node1, - const char *log_file_name2, my_off_t log_file_pos2) { + const char *log_file_name2, my_off_t log_file_pos2) { return compare(node1->log_name_, node1->log_pos_, - log_file_name2, log_file_pos2); + log_file_name2, log_file_pos2); } int compare(const TranxNode *node1, const TranxNode *node2) { return compare(node1->log_name_, node1->log_pos_, - node2->log_name_, node2->log_pos_); + node2->log_name_, node2->log_pos_); } public: @@ -88,7 +342,7 @@ public: * 0: success; non-zero: error */ int clear_active_tranx_nodes(const char *log_file_name, - my_off_t log_file_pos); + my_off_t log_file_pos); /* Given a position, check to see whether the position is an active * transaction's ending position by probing the hash table. @@ -99,7 +353,7 @@ public: * (file_name, file_position). */ static int compare(const char *log_file_name1, my_off_t log_file_pos1, - const char *log_file_name2, my_off_t log_file_pos2); + const char *log_file_name2, my_off_t log_file_pos2); }; diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc index c4b55e3d068..b347b7c751d 100644 --- a/sql/rpl_handler.cc +++ b/sql/rpl_handler.cc @@ -190,8 +190,8 @@ int Trans_delegate::after_commit(THD *thd, bool all) { Trans_param param; bool is_real_trans= (all || thd->transaction.all.ha_list == 0); - if (is_real_trans) - param.flags |= TRANS_IS_REAL_TRANS; + + param.flags = is_real_trans ? TRANS_IS_REAL_TRANS : 0; Trans_binlog_info *log_info= my_pthread_getspecific_ptr(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO); @@ -218,8 +218,8 @@ int Trans_delegate::after_rollback(THD *thd, bool all) { Trans_param param; bool is_real_trans= (all || thd->transaction.all.ha_list == 0); - if (is_real_trans) - param.flags |= TRANS_IS_REAL_TRANS; + + param.flags = is_real_trans ? TRANS_IS_REAL_TRANS : 0; Trans_binlog_info *log_info= my_pthread_getspecific_ptr(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO); @@ -228,7 +228,7 @@ int Trans_delegate::after_rollback(THD *thd, bool all) param.log_pos= log_info ? log_info->log_pos : 0; int ret= 0; - FOREACH_OBSERVER(ret, after_commit, thd, (¶m)); + FOREACH_OBSERVER(ret, after_rollback, thd, (¶m)); /* This is the end of a real transaction or autocommit statement, we From 219422f346e797d4a2a17191ef86a26c5fb35dcc Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 2 Feb 2010 16:28:59 +0100 Subject: [PATCH 31/54] Spec file for "generic" RPMs: Cleanup, formatting improvements, vendor is Sun (since MySQL AB was bought). Backport the change so that RPM doesn't magically create a dependency on "Perl-DBI". --- support-files/mysql.spec.sh | 283 +++++++++++++++++++++++------------- 1 file changed, 185 insertions(+), 98 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 98f715da94d..cf86a1be38e 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -14,36 +14,23 @@ # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston # MA 02110-1301 USA. -%define mysql_version @VERSION@ -%define mysql_vendor MySQL AB +############################################################################## +# Some common macro definitions +############################################################################## -# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x) -# to enable static linking (off by default) -%{?_with_static:%define STATIC_BUILD 1} -%{!?_with_static:%define STATIC_BUILD 0} +# NOTE: "vendor" is used in upgrade/downgrade check, so you can't +# change these, has to be exactly as is. +%define mysql_old_vendor MySQL AB +%define mysql_vendor Sun Microsystems, Inc. -# use "rpmbuild --with yassl" or "rpm --define '_with_yassl 1'" (for RPM 3.x) -# to build with yaSSL support (off by default) -%{?_with_yassl:%define YASSL_BUILD 1} -%{!?_with_yassl:%define YASSL_BUILD 0} - -%if %{STATIC_BUILD} -%define release 1 -%else -%define release 1.glibc23 -%endif -%define license GPL -%define mysqld_user mysql -%define mysqld_group mysql -%define server_suffix -community -%define mysqldatadir /var/lib/mysql - -# We don't package all files installed into the build root by intention - -# See BUG#998 for details. -%define _unpackaged_files_terminate_build 0 +%define mysql_version @VERSION@ +%define mysqld_user mysql +%define mysqld_group mysql +%define mysqldatadir /var/lib/mysql %define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com +# ------------------------------------------------------------------------------ # On SuSE 9 no separate "debuginfo" package is built. To enable basic # debugging on that platform, we don't strip binaries on SuSE 9. We # disable the strip of binaries by redefining the RPM macro @@ -58,18 +45,68 @@ # http://www.redhat.com/archives/rpm-list/2003-February/msg00275.html # http://www.redhat.com/archives/rhl-devel-list/2004-January/msg01546.html # http://lists.opensuse.org/archive/opensuse-commit/2006-May/1171.html - +# ------------------------------------------------------------------------------ %define __os_install_post /usr/lib/rpm/brp-compress -Name: MySQL +# ------------------------------------------------------------------------------ +# We don't package all files installed into the build root by intention - +# See BUG#998 for details. +# ------------------------------------------------------------------------------ +%define _unpackaged_files_terminate_build 0 + +# ------------------------------------------------------------------------------ +# RPM build tools now automatically detects Perl module dependencies. This +# detection gives problems as it is broken in some versions, and it also +# give unwanted dependencies from mandatory scripts in our package. +# Might not be possible to disable in all RPM tool versions, but here we +# try. We keep the "AutoReqProv: no" for the "test" sub package, as disabling +# here might fail, and that package has the most problems. +# See http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides +# http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html +# ------------------------------------------------------------------------------ +%undefine __perl_provides +%undefine __perl_requires + +############################################################################## +# Command line handling +############################################################################## + +# ---------------------------------------------------------------------- +# use "rpmbuild --with yassl" or "rpm --define '_with_yassl 1'" (for RPM 3.x) +# to build with yaSSL support (off by default) +# ---------------------------------------------------------------------- +%{?_with_yassl:%define YASSL_BUILD 1} +%{!?_with_yassl:%define YASSL_BUILD 0} + +# ------------------------------------------------------------------------------ +# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x) +# to enable static linking (off by default) +%{?_with_static:%define STATIC_BUILD 1} +%{!?_with_static:%define STATIC_BUILD 0} + +%if %{STATIC_BUILD} +%define release 1 +%else +%define release 1.glibc23 +%endif + +%define license GPL +%define server_suffix -community +%define src_dir mysql-%{mysql_version} + +############################################################################## +# Main spec file section +############################################################################## + +Name: MySQL Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases Version: @MYSQL_U_SCORE_VERSION@ Release: %{release} License: %{license} -Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz +Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz URL: http://www.mysql.com/ -Packager: MySQL Production Engineering Team +Packager: Sun Microsystems, Inc. Product Engineering Team Vendor: %{mysql_vendor} Provides: msqlormysql MySQL-server mysql BuildRequires: ncurses-devel @@ -85,7 +122,7 @@ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. MySQL is a trademark of -MySQL AB. +Sun Microsystems, Inc. Copyright (C) 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. This software comes with ABSOLUTELY NO WARRANTY. This is free software, @@ -95,6 +132,10 @@ The MySQL web site (http://www.mysql.com/) provides the latest news and information about the MySQL software. Also please see the documentation and the manual for more information. +############################################################################## +# Sub package definition +############################################################################## + %package server Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases @@ -107,7 +148,7 @@ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. MySQL is a trademark of -MySQL AB. +Sun Microsystems, Inc. Copyright (C) 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. This software comes with ABSOLUTELY NO WARRANTY. This is free software, @@ -117,11 +158,14 @@ The MySQL web site (http://www.mysql.com/) provides the latest news and information about the MySQL software. Also please see the documentation and the manual for more information. -This package includes the MySQL server binary (incl. InnoDB) as well -as related utilities to run and administrate a MySQL server. +This package includes the MySQL server binary +(configured including InnoDB) +as well as related utilities to run and administer a MySQL server. If you want to access and work with the database, you have to install -the package "MySQL-client" as well! +package "MySQL-client" as well! + +# ------------------------------------------------------------------------------ %package client Summary: MySQL - Client @@ -134,6 +178,8 @@ This package contains the standard MySQL clients and administration tools. %{see_base} +# ------------------------------------------------------------------------------ + %package ndb-storage Summary: MySQL - ndbcluster storage engine Group: Applications/Databases @@ -145,6 +191,8 @@ computers that should store ndbcluster table data. %{see_base} +# ------------------------------------------------------------------------------ + %package ndb-management Summary: MySQL - ndbcluster storage engine management Group: Applications/Databases @@ -156,6 +204,8 @@ one computer in the cluster. %{see_base} +# ------------------------------------------------------------------------------ + %package ndb-tools Summary: MySQL - ndbcluster storage engine basic tools Group: Applications/Databases @@ -165,6 +215,8 @@ This package contains ndbcluster storage engine basic tools. %{see_base} +# ------------------------------------------------------------------------------ + %package ndb-extra Summary: MySQL - ndbcluster storage engine extra tools Group: Applications/Databases @@ -175,6 +227,8 @@ They should be used with caution. %{see_base} +# ------------------------------------------------------------------------------ + %package bench Requires: %{name}-client perl-DBI perl Summary: MySQL - Benchmarks and test system @@ -188,6 +242,8 @@ This package contains MySQL benchmark scripts and data. %{see_base} +# ------------------------------------------------------------------------------ + %package devel Summary: MySQL - Development header files and libraries Group: Applications/Databases @@ -200,6 +256,8 @@ necessary to develop MySQL client applications. %{see_base} +# ------------------------------------------------------------------------------ + %package shared Summary: MySQL - Shared libraries Group: Applications/Databases @@ -230,7 +288,11 @@ languages and applications need to dynamically load and use MySQL. #%{see_base} %prep -%setup -n mysql-%{mysql_version} +%setup -n %{src_dir} + +############################################################################## +# The actual build +############################################################################## %build @@ -238,8 +300,8 @@ BuildMySQL() { # The --enable-assembler simply does nothing on systems that does not # support assembler speedups. sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ - CC=\"${CC:-$MYSQL_BUILD_CC}\" \ - CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \ + CC=\"${MYSQL_BUILD_CC:-$CC}\" \ + CXX=\"${MYSQL_BUILD_CXX:-$CXX}\" \ CFLAGS=\"$CFLAGS\" \ CXXFLAGS=\"$CXXFLAGS\" \ LDFLAGS=\"$MYSQL_BUILD_LDFLAGS\" \ @@ -247,25 +309,25 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ $* \ --enable-assembler \ --enable-local-infile \ - --with-mysqld-user=%{mysqld_user} \ - --with-unix-socket-path=/var/lib/mysql/mysql.sock \ + --with-mysqld-user=%{mysqld_user} \ + --with-unix-socket-path=/var/lib/mysql/mysql.sock \ --with-pic \ - --prefix=/ \ + --prefix=/ \ %if %{YASSL_BUILD} --with-yassl \ %endif - --exec-prefix=%{_exec_prefix} \ - --libexecdir=%{_sbindir} \ - --libdir=%{_libdir} \ - --sysconfdir=%{_sysconfdir} \ - --datadir=%{_datadir} \ - --localstatedir=%{mysqldatadir} \ - --infodir=%{_infodir} \ - --includedir=%{_includedir} \ - --mandir=%{_mandir} \ + --exec-prefix=%{_exec_prefix} \ + --libexecdir=%{_sbindir} \ + --libdir=%{_libdir} \ + --sysconfdir=%{_sysconfdir} \ + --datadir=%{_datadir} \ + --localstatedir=%{mysqldatadir} \ + --infodir=%{_infodir} \ + --includedir=%{_includedir} \ + --mandir=%{_mandir} \ --enable-thread-safe-client \ --enable-community-features \ - --enable-profiling \ + --enable-profiling \ --with-readline ; \ # Add this for more debugging support # --with-debug @@ -274,6 +336,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ # benchdir does not fit in above model. Maybe a separate bench distribution make benchdir_root=$RPM_BUILD_ROOT/usr/share/ } +# end of function definition "BuildMySQL" # Use our own copy of glibc @@ -287,7 +350,7 @@ fi # Use the build root for temporary storage of the shared libraries. RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} +MBD=$RPM_BUILD_DIR/%{src_dir} # Clean up the BuildRoot first [ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR; @@ -301,10 +364,8 @@ export PATH # Use gcc for C and C++ code (to avoid a dependency on libstdc++ and # including exceptions into the code -if [ -z "$CXX" -a -z "$CC" ] -then - export CC="gcc" - export CXX="gcc" +if [ -z "$CXX" -a -z "$CC" ] ; then + export CC="gcc" CXX="gcc" fi # Prepare compiler flags @@ -393,7 +454,7 @@ make test-bt %install RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} +MBD=$RPM_BUILD_DIR/%{src_dir} # Ensure that needed directories exists install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} @@ -417,7 +478,6 @@ install -s -m 755 $MBD/sql/mysqld-debug $RBR%{_sbindir}/mysqld-debug (cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar) # install symbol files ( for stack trace resolution) -# install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym install -m 644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym install -m 644 $MBD/sql/mysqld-debug.sym $RBR%{_libdir}/mysql/mysqld-debug.sym @@ -431,7 +491,7 @@ install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql # Create a symlink "rcmysql", pointing to the init.script. SuSE users # will appreciate that, as all services usually offer this. -ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql +ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql # Create symbolic compatibility link safe_mysqld -> mysqld_safe # (safe_mysqld will be gone in MySQL 4.1) @@ -451,6 +511,7 @@ installed=`rpm -q --whatprovides mysql-server 2> /dev/null` if [ $? -eq 0 -a -n "$installed" ]; then vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1` version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1` + myoldvendor='%{mysql_old_vendor}' myvendor='%{mysql_vendor}' myversion='%{mysql_version}' @@ -462,12 +523,12 @@ if [ $? -eq 0 -a -n "$installed" ]; then [ -z "$new_family" ] && new_family="" error_text= - if [ "$vendor" != "$myvendor" ]; then + if [ "$vendor" != "$myoldvendor" -a "$vendor" != "$myvendor" ]; then error_text="$error_text The current MySQL server package is provided by a different -vendor ($vendor) than $myvendor. Some files may be installed -to different locations, including log files and the service -startup script in %{_sysconfdir}/init.d/. +vendor ($vendor) than $myoldvendor or $myvendor. +Some files may be installed to different locations, including log +files and the service startup script in %{_sysconfdir}/init.d/. " fi @@ -511,58 +572,70 @@ HERE fi # Shut down a previously installed server first -if test -x %{_sysconfdir}/init.d/mysql -then - %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 - echo "Giving mysqld a couple of seconds to exit nicely" - sleep 5 -elif test -x %{_sysconfdir}/rc.d/init.d/mysql -then - %{_sysconfdir}/rc.d/init.d/mysql stop > /dev/null 2>&1 - echo "Giving mysqld a couple of seconds to exit nicely" - sleep 5 +if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 + echo "Giving mysqld 5 seconds to exit nicely" + sleep 5 +elif [ -x %{_sysconfdir}/rc.d/init.d/mysql ] ; then + %{_sysconfdir}/rc.d/init.d/mysql stop > /dev/null 2>&1 + echo "Giving mysqld 5 seconds to exit nicely" + sleep 5 fi %post server mysql_datadir=%{mysqldatadir} +# ---------------------------------------------------------------------- # Create data directory if needed -if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi -if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi -if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi +# ---------------------------------------------------------------------- +if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi +if [ ! -d $mysql_datadir/mysql ] ; then mkdir $mysql_datadir/mysql; fi +if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi +# ---------------------------------------------------------------------- # Make MySQL start/shutdown automatically when the machine does it. +# ---------------------------------------------------------------------- # use insserv for older SuSE Linux versions -if test -x /sbin/insserv -then +if [ -x /sbin/insserv ] ; then /sbin/insserv %{_sysconfdir}/init.d/mysql # use chkconfig on Red Hat and newer SuSE releases -elif test -x /sbin/chkconfig -then +elif [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add mysql fi +# ---------------------------------------------------------------------- # Create a MySQL user and group. Do not report any problems if it already # exists. +# ---------------------------------------------------------------------- groupadd -r %{mysqld_group} 2> /dev/null || true useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true # The user may already exist, make sure it has the proper group nevertheless (BUG#12823) usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true +# ---------------------------------------------------------------------- # Change permissions so that the user that will run the MySQL daemon # owns all database files. +# ---------------------------------------------------------------------- chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir +# ---------------------------------------------------------------------- # Initiate databases if needed +# ---------------------------------------------------------------------- %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} +# ---------------------------------------------------------------------- # Upgrade databases if needed would go here - but it cannot be automated yet +# ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- # Change permissions again to fix any new files. +# ---------------------------------------------------------------------- chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir +# ---------------------------------------------------------------------- # Fix permissions for the permission database so that only the user # can read them. +# ---------------------------------------------------------------------- chmod -R og-rw $mysql_datadir/mysql # Restart in the same way that mysqld will be started normally. @@ -578,33 +651,34 @@ mysql_clusterdir=/var/lib/mysql-cluster if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi %preun server -if test $1 = 0 -then - # Stop MySQL before uninstalling it - if test -x %{_sysconfdir}/init.d/mysql - then - %{_sysconfdir}/init.d/mysql stop > /dev/null - - # Remove autostart of mysql - # for older SuSE Linux versions - if test -x /sbin/insserv - then - /sbin/insserv -r %{_sysconfdir}/init.d/mysql - # use chkconfig on Red Hat and newer SuSE releases - elif test -x /sbin/chkconfig - then - /sbin/chkconfig --del mysql - fi - fi +if [ $1 = 0 ] ; then + # Stop MySQL before uninstalling it + if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql stop > /dev/null + # Remove autostart of MySQL + # For older SuSE Linux versions + if [ -x /sbin/insserv ] ; then + /sbin/insserv -r %{_sysconfdir}/init.d/mysql + # use chkconfig on Red Hat and newer SuSE releases + elif [ -x /sbin/chkconfig ] ; then + /sbin/chkconfig --del mysql + fi + fi fi # We do not remove the mysql user since it may still own a lot of # database files. -# Clean up the BuildRoot +# ---------------------------------------------------------------------- +# Clean up the BuildRoot after build is done +# ---------------------------------------------------------------------- %clean [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; +############################################################################## +# Files section +############################################################################## + %files server %defattr(-,root,root,0755) @@ -818,6 +892,19 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Mon Feb 01 2010 Joerg Bruehe + +- Formatting changes: + Have a consistent structure of separator lines and of indentation + (8 leading blanks => tab). +- Add the "old vendor" (= "MySQL AB") and expand the upgrade check + so that "MySQL" packages can be upgraded by "Sun" ones. + This fixes bug#45534, with its duplicates #42953 and #46174. +- Backport the fix that prevents RPM from requiring "perl-DBI". +- Introduce the variable "src_dir". +- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence + over "CC" ("CXX"). + * Mon Jan 11 2010 Joerg Bruehe - Change RPM file naming: From a835c80dec57666307f7f70b07cb0c706bdab3f2 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 2 Feb 2010 17:53:52 +0100 Subject: [PATCH 32/54] Cleanup in the RPM spec file: Get rid of trailing blanks. --- support-files/mysql.spec.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index cf86a1be38e..6baa19dc934 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1,14 +1,14 @@ # Copyright (C) 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. -# +# # 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 # the Free Software Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston @@ -55,7 +55,7 @@ %define _unpackaged_files_terminate_build 0 # ------------------------------------------------------------------------------ -# RPM build tools now automatically detects Perl module dependencies. This +# RPM build tools now automatically detects Perl module dependencies. This # detection gives problems as it is broken in some versions, and it also # give unwanted dependencies from mandatory scripts in our package. # Might not be possible to disable in all RPM tool versions, but here we @@ -174,7 +174,7 @@ Obsoletes: mysql-client Provides: mysql-client %description client -This package contains the standard MySQL clients and administration tools. +This package contains the standard MySQL clients and administration tools. %{see_base} @@ -185,8 +185,8 @@ Summary: MySQL - ndbcluster storage engine Group: Applications/Databases %description ndb-storage -This package contains the ndbcluster storage engine. -It is necessary to have this package installed on all +This package contains the ndbcluster storage engine. +It is necessary to have this package installed on all computers that should store ndbcluster table data. %{see_base} @@ -199,7 +199,7 @@ Group: Applications/Databases %description ndb-management This package contains ndbcluster storage engine management. -It is necessary to have this package installed on at least +It is necessary to have this package installed on at least one computer in the cluster. %{see_base} @@ -465,7 +465,7 @@ install -d $RBR%{_libdir} install -d $RBR%{_mandir} install -d $RBR%{_sbindir} -# Install all binaries stripped +# Install all binaries stripped make install-strip DESTDIR=$RBR benchdir_root=%{_datadir} # Install the ndb binaries @@ -608,7 +608,7 @@ fi # exists. # ---------------------------------------------------------------------- groupadd -r %{mysqld_group} 2> /dev/null || true -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true +useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true # The user may already exist, make sure it has the proper group nevertheless (BUG#12823) usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true @@ -682,7 +682,7 @@ fi %files server %defattr(-,root,root,0755) -%doc COPYING README +%doc COPYING README %doc support-files/my-*.cnf %doc support-files/ndb-*.ini @@ -983,7 +983,7 @@ fi * Thu Nov 16 2006 Joerg Bruehe -- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) +- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading (bug#22081). @@ -1066,8 +1066,8 @@ fi * Mon Dec 05 2005 Joerg Bruehe -- Avoid using the "bundled" zlib on "shared" builds: - As it is not installed (on the build system), this gives dependency +- Avoid using the "bundled" zlib on "shared" builds: + As it is not installed (on the build system), this gives dependency problems with "libtool" causing the build to fail. (Change was done on Nov 11, but left uncommented.) @@ -1253,7 +1253,7 @@ fi * Thu Feb 12 2004 Lenz Grimmer -- when using gcc, _always_ use CXX=gcc +- when using gcc, _always_ use CXX=gcc - replaced Copyright with License field (Copyright is obsolete) * Tue Feb 03 2004 Lenz Grimmer @@ -1343,7 +1343,7 @@ fi * Wed Nov 27 2002 Lenz Grimmer -- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of +- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of Linux distributions now support this scheme as proposed by the LSB either directly or via a compatibility symlink) - Use new "restart" init script action instead of starting and stopping @@ -1358,7 +1358,7 @@ fi (mixing 3.23 and 4.0 packages) * Fri Aug 09 2002 Lenz Grimmer - + - Turn off OpenSSL in MySQL-Max for now until it works properly again - enable RAID for the Max binary instead - added compatibility link: safe_mysqld -> mysqld_safe to ease the From 55aab082a957e3f20e94f791dbe44750b4b465c8 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 3 Feb 2010 16:56:17 +0000 Subject: [PATCH 33/54] BUG#50364: FLUSH LOGS crashes the server (rpl.rpl_heartbeat_basic fails in PB sporadically) The IO thread can concurrently access the relay log IO_CACHE while another thread is performing an FLUSH LOGS procedure. FLUSH LOGS closes and reopens the relay log and while doing so it (re)initializes its IO_CACHE. During this procedure the IO_CACHE mutex is also reinitialized, which can cause problems if some other thread (namely the IO THREAD) is concurrently accessing it at the time . This patch fixes the problem by extending the interface of the flush_master_info function to also include a second paramater, "need_relay_log_lock", stating whether the thread should grab the relay log lock or not before actually flushing the relay log. Also, IO thread now calls flush_master_info with this flag set when it flushes master info with in the event read_event loop. Finally, we also increase loop time in rpl_heartbeat_basic test case, so that the number of calls to flush logs doubles, stressing this part of the code a little more. mysql-test/suite/rpl/t/rpl_heartbeat_basic.test: Doubled the number of iterations on the FLUSH LOGS loop by doubling the time available to perform all iterations. sql/repl_failsafe.cc: Updating flush_master_info call so that it uses two parameters instead of one. sql/rpl_mi.cc: Updating flush_master_info call so that it uses two parameters instead of one. sql/rpl_mi.h: Changed flush_master_info interface. Now takes a second parameter instead of just one. The second parameter is: need_lock_relay_log. sql/rpl_rli.cc: Small fix in comment. sql/slave.cc: Updating flush_master_info call so that it uses two parameters instead of one. sql/sql_repl.cc: Updating flush_master_info call so that it uses two parameters instead of one. --- .../suite/rpl/t/rpl_heartbeat_basic.test | 2 +- sql/repl_failsafe.cc | 2 +- sql/rpl_mi.cc | 19 ++++++++++++++++--- sql/rpl_mi.h | 4 +++- sql/rpl_rli.cc | 2 +- sql/slave.cc | 4 ++-- sql/sql_repl.cc | 2 +- 7 files changed, 25 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index 10d327eece0..d371d5916c2 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -382,7 +382,7 @@ let $slave_param_comparison= =; let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); # Flush logs every 0.1 second during 5 sec --disable_query_log -let $i=50; +let $i=100; while ($i) { FLUSH LOGS; dec $i; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 7a941b1d99b..275571c2158 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -977,7 +977,7 @@ bool load_master_data(THD* thd) host was specified; there could have been a problem when replication started, which led to relay log's IO_CACHE to not be inited. */ - if (flush_master_info(active_mi, 0)) + if (flush_master_info(active_mi, FALSE, FALSE)) sql_print_error("Failed to flush master info file"); } mysql_free_result(master_status_res); diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index e83e0ad0ba9..28b0af441f8 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -387,7 +387,7 @@ file '%s')", fname); mi->rli.is_relay_log_recovery= FALSE; // now change cache READ -> WRITE - must do this before flush_master_info reinit_io_cache(&mi->file, WRITE_CACHE, 0L, 0, 1); - if ((error=test(flush_master_info(mi, 1)))) + if ((error=test(flush_master_info(mi, TRUE, TRUE)))) sql_print_error("Failed to flush master info file"); pthread_mutex_unlock(&mi->data_lock); DBUG_RETURN(error); @@ -413,7 +413,9 @@ err: 1 - flush master info failed 0 - all ok */ -int flush_master_info(Master_info* mi, bool flush_relay_log_cache) +int flush_master_info(Master_info* mi, + bool flush_relay_log_cache, + bool need_lock_relay_log) { IO_CACHE* file = &mi->file; char lbuf[22]; @@ -436,8 +438,19 @@ int flush_master_info(Master_info* mi, bool flush_relay_log_cache) */ if (flush_relay_log_cache) { + pthread_mutex_t *log_lock= mi->rli.relay_log.get_log_lock(); IO_CACHE *log_file= mi->rli.relay_log.get_log_file(); - if (flush_io_cache(log_file)) + + if (need_lock_relay_log) + pthread_mutex_lock(log_lock); + + safe_mutex_assert_owner(log_lock); + err= flush_io_cache(log_file); + + if (need_lock_relay_log) + pthread_mutex_unlock(log_lock); + + if (err) DBUG_RETURN(2); } diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index f822a6bc1b1..363c8d4e0b3 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -120,7 +120,9 @@ int init_master_info(Master_info* mi, const char* master_info_fname, bool abort_if_no_master_info_file, int thread_mask); void end_master_info(Master_info* mi); -int flush_master_info(Master_info* mi, bool flush_relay_log_cache); +int flush_master_info(Master_info* mi, + bool flush_relay_log_cache, + bool need_lock_relay_log); int change_master_server_id_cmp(ulong *id1, ulong *id2); #endif /* HAVE_REPLICATION */ diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 4bbafa0253a..fa979fe9a21 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -121,7 +121,7 @@ int init_relay_log_info(Relay_log_info* rli, /* The relay log will now be opened, as a SEQ_READ_APPEND IO_CACHE. Note that the I/O thread flushes it to disk after writing every - event, in flush_master_info(mi, 1). + event, in flush_master_info(mi, 1, ?). */ /* diff --git a/sql/slave.cc b/sql/slave.cc index 27f87d18800..3678c2497de 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1726,7 +1726,7 @@ static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi) " to the relay log, SHOW SLAVE STATUS may be" " inaccurate"); rli->relay_log.harvest_bytes_written(&rli->log_space_total); - if (flush_master_info(mi, 1)) + if (flush_master_info(mi, TRUE, FALSE)) sql_print_error("Failed to flush master info file"); delete ev; } @@ -3047,7 +3047,7 @@ Stopping slave I/O thread due to out-of-memory error from master"); goto err; } - if (flush_master_info(mi, 1)) + if (flush_master_info(mi, TRUE, TRUE)) { sql_print_error("Failed to flush master info file"); goto err; diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 4e5ce08ab5d..d28a336e5d2 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1532,7 +1532,7 @@ bool change_master(THD* thd, Master_info* mi) Relay log's IO_CACHE may not be inited, if rli->inited==0 (server was never a slave before). */ - if (flush_master_info(mi, 0)) + if (flush_master_info(mi, FALSE, FALSE)) { my_error(ER_RELAY_LOG_INIT, MYF(0), "Failed to flush master info file"); ret= TRUE; From e9da37b6e77fee90f3925fedc722967d09ba8d64 Mon Sep 17 00:00:00 2001 From: Omer BarNir Date: Wed, 3 Feb 2010 09:11:16 -0800 Subject: [PATCH 34/54] Fixes to PB failiurs mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result: Uodated result file mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test: Added code to explain the failiure mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test: Added code to handle diff result outpt in windows (dll vs. so) mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test: Added code to handle diff result outpt in windows (dll vs. so) mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test: Added code to handle diff result outpt in windows (dll vs. so) mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test: Added code to handle diff result outpt in windows (dll vs. so) mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test: Added code to handle diff result outpt in windows (dll vs. so) mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test: Added code to handle diff result outpt in windows (dll vs. so) --- mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result | 7 +++++-- mysql-test/suite/sys_vars/t/all_vars.test | 3 +++ mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test | 3 ++- .../sys_vars/t/rpl_semi_sync_master_enabled_basic.test | 2 ++ .../sys_vars/t/rpl_semi_sync_master_timeout_basic.test | 2 ++ .../sys_vars/t/rpl_semi_sync_master_trace_level_basic.test | 2 ++ .../t/rpl_semi_sync_master_wait_no_slave_basic.test | 2 ++ .../sys_vars/t/rpl_semi_sync_slave_enabled_basic.test | 2 ++ .../sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test | 2 ++ 9 files changed, 22 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result index 6b0a8899560..4457d2a0075 100644 --- a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result +++ b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result @@ -1,8 +1,11 @@ select @@global.pseudo_thread_id; ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable -select @@session.pseudo_thread_id between 1 and 1000; -@@session.pseudo_thread_id between 1 and 1000 +select @@session.pseudo_thread_id between 1 and 10000; +@@session.pseudo_thread_id between 1 and 10000 1 +select @@session.pseudo_thread_id; +@@session.pseudo_thread_id +2 should be empty show global variables like 'pseudo_thread_id'; Variable_name Value diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test index 0e831319898..e9e7e16687a 100644 --- a/mysql-test/suite/sys_vars/t/all_vars.test +++ b/mysql-test/suite/sys_vars/t/all_vars.test @@ -24,7 +24,10 @@ if (`SELECT @@have_dynamic_loading = 'YES' AND LENGTH('$SEMISYNC_MASTER_PLUGIN') > 0`) { --disable_query_log + # The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' + --replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; + --replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; --enable_query_log } diff --git a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test index 0722b42099d..4f5e7bcf23e 100644 --- a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test +++ b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test @@ -10,7 +10,8 @@ select @@global.pseudo_thread_id; # Check the variable has a valid numeric value (assumed to be less then 10000) -select @@session.pseudo_thread_id between 1 and 1000; +select @@session.pseudo_thread_id between 1 and 10000; +select @@session.pseudo_thread_id; --echo should be empty show global variables like 'pseudo_thread_id'; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test index 5aea6e165ea..749695e035c 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test @@ -6,6 +6,8 @@ # # source include/have_semisync_plugin.inc; +# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' +--replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; select @@global.rpl_semi_sync_master_enabled; SET @start_global_value = @@global.rpl_semi_sync_master_enabled; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test index 6c4aae8e3bf..16389c23d54 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test @@ -5,6 +5,8 @@ # 2010-01-21 OBN - Added # source include/have_semisync_plugin.inc; +# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' +--replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; select @@global.rpl_semi_sync_master_timeout; SET @start_global_value = @@global.rpl_semi_sync_master_timeout; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test index c37248ffa9a..c23aa1da688 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test @@ -5,6 +5,8 @@ # 2010-01-21 OBN - Added # source include/have_semisync_plugin.inc; +# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' +--replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; select @@global.rpl_semi_sync_master_trace_level; SET @start_global_value = @@global.rpl_semi_sync_master_trace_level; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test index a90024b8961..9686a0e0d9a 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test @@ -6,6 +6,8 @@ # # source include/have_semisync_plugin.inc; +# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' +--replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; select @@global.rpl_semi_sync_master_wait_no_slave; SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test index 5dca63d5e2d..0bb16cfd38e 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test @@ -6,6 +6,8 @@ # # source include/have_semisync_plugin.inc; +# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' +--replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; select @@global.rpl_semi_sync_slave_enabled; SET @start_global_value = @@global.rpl_semi_sync_slave_enabled; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test index afac5244eb2..2bdf09f2a7f 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test @@ -5,6 +5,8 @@ # 2010-01-21 OBN - Added # source include/have_semisync_plugin.inc; +# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' +--replace_regex /\.dll/.so/ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; select @@global.rpl_semi_sync_slave_trace_level; SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level; From 6b591359855c4471fa13e11dc297cd90ae5fc552 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 4 Feb 2010 01:20:42 +0000 Subject: [PATCH 35/54] Fixes result file for binlog_stm_mix_innodb_myisam which was left unchanged on patch for BUG#50192. --- .../binlog/r/binlog_stm_mix_innodb_myisam.result | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index c8c0f071046..9d25b97691f 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -519,10 +519,10 @@ end| reset master; insert into t2 values (bug27417(1)); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. insert into t2 select bug27417(2); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. reset master; insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -542,7 +542,7 @@ count(*) 2 delete from t2 where a=bug27417(3); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. select count(*) from t2 /* nothing got deleted */; count(*) 2 @@ -559,7 +559,7 @@ count(*) delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; affected rows: 0 Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. select count(*) from t1 /* must be 7 */; count(*) 7 @@ -783,10 +783,10 @@ end| reset master; insert into t2 values (bug27417(1)); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. insert into t2 select bug27417(2); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. reset master; insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -805,7 +805,7 @@ count(*) 2 delete from t2 where a=bug27417(3); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. select count(*) from t2 /* nothing got deleted */; count(*) 2 @@ -821,7 +821,7 @@ count(*) delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; affected rows: 0 Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement invokes a trigger or a stored function that inserts into AUTO_INCREMENT column which is unsafe to binlog in STATEMENT format because slave may execute it non-deterministically. select count(*) from t1 /* must be 7 */; count(*) 7 From 6ad93ebbb675f9f15505ae89db454792b6846d22 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Thu, 4 Feb 2010 12:14:32 +0800 Subject: [PATCH 36/54] Bug#49894 shifted MYSQL_REPLICATION_PLUGIN number The number for MYSQL_REPLICATION_PLUGIN was shifted when backporting because MYSQL_AUDIT_PLUGIN was not backported. This problem is fixed by backporting only the number of audit plugin and print an error when trying to load audit plugins. Note that replication plugins compiled against old MYSQL_REPLICATION_PLUGIN number will also be recognized as audit plugin and be rejected. include/mysql/plugin.h: backporting the number of audit plugin (MYSQL_AUDIT_PLUGIN) sql/sql_plugin.cc: backporting the number of audit plugin (MYSQL_AUDIT_PLUGIN) print an error when trying to load audit plugins --- include/mysql/plugin.h | 5 +++-- sql/sql_plugin.cc | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 45d0234cb67..98b1cec0641 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -80,8 +80,9 @@ typedef struct st_mysql_xid MYSQL_XID; #define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ #define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ #define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ -#define MYSQL_REPLICATION_PLUGIN 5 /* The replication plugin type */ -#define MYSQL_MAX_PLUGIN_TYPE_NUM 6 /* The number of plugin types */ +#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ +#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ +#define MYSQL_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */ /* We use the following strings to define licenses for plugins */ #define PLUGIN_LICENSE_PROPRIETARY 0 diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 8cf8c4cb81f..c977a30b37b 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -47,6 +47,7 @@ const LEX_STRING plugin_type_names[MYSQL_MAX_PLUGIN_TYPE_NUM]= { C_STRING_WITH_LEN("FTPARSER") }, { C_STRING_WITH_LEN("DAEMON") }, { C_STRING_WITH_LEN("INFORMATION SCHEMA") }, + { C_STRING_WITH_LEN("AUDIT") }, { C_STRING_WITH_LEN("REPLICATION") }, }; @@ -87,6 +88,7 @@ static int min_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]= MYSQL_FTPARSER_INTERFACE_VERSION, MYSQL_DAEMON_INTERFACE_VERSION, MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION, + 0x0000, /* place holder for audit plugin */ MYSQL_REPLICATION_INTERFACE_VERSION, }; static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]= @@ -96,6 +98,7 @@ static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]= MYSQL_FTPARSER_INTERFACE_VERSION, MYSQL_DAEMON_INTERFACE_VERSION, MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION, + 0x0000, /* place holder for audit plugin */ MYSQL_REPLICATION_INTERFACE_VERSION, }; @@ -738,6 +741,14 @@ static bool plugin_add(MEM_ROOT *tmp_root, name_len)) { struct st_plugin_int *tmp_plugin_ptr; + + if (plugin->type == MYSQL_AUDIT_PLUGIN) + { + /* Bug#49894 */ + sql_print_error("Plugin type 'AUDIT' not supported by this server."); + goto err; + } + if (*(int*)plugin->info < min_plugin_info_interface_version[plugin->type] || ((*(int*)plugin->info) >> 8) > From eadf1586b8d519c22a9c038cdda16b212e33021a Mon Sep 17 00:00:00 2001 From: Omer BarNir Date: Thu, 4 Feb 2010 12:14:51 -0800 Subject: [PATCH 37/54] Corrections to pseudi_thread_id_basic test (WL4738) mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result: Updated result file mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test: Removed specific thread_id result vaue used for debuging PB2 issue --- mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result | 3 --- mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test | 1 - 2 files changed, 4 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result index 4457d2a0075..ee6169a9e35 100644 --- a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result +++ b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result @@ -3,9 +3,6 @@ ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable select @@session.pseudo_thread_id between 1 and 10000; @@session.pseudo_thread_id between 1 and 10000 1 -select @@session.pseudo_thread_id; -@@session.pseudo_thread_id -2 should be empty show global variables like 'pseudo_thread_id'; Variable_name Value diff --git a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test index 4f5e7bcf23e..fef3e906869 100644 --- a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test +++ b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test @@ -11,7 +11,6 @@ select @@global.pseudo_thread_id; # Check the variable has a valid numeric value (assumed to be less then 10000) select @@session.pseudo_thread_id between 1 and 10000; -select @@session.pseudo_thread_id; --echo should be empty show global variables like 'pseudo_thread_id'; From e6cba2be35506bce8b0655f6081ef3508464bbf9 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 5 Feb 2010 13:57:15 +0100 Subject: [PATCH 38/54] Bug#50057: 'SHOW PROFILE CPU' port for Windows. Patch contributed by Alex Budovski. --- sql/sql_profile.cc | 43 +++++++++++++++++++++++++++++++++++++++++++ sql/sql_profile.h | 2 ++ 2 files changed, 45 insertions(+) diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index 84ee0768b25..f8c11cb71b9 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -134,6 +134,26 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table) #define RUSAGE_USEC(tv) ((tv).tv_sec*1000*1000 + (tv).tv_usec) #define RUSAGE_DIFF_USEC(tv1, tv2) (RUSAGE_USEC((tv1))-RUSAGE_USEC((tv2))) +#ifdef _WIN32 +static ULONGLONG FileTimeToQuadWord(FILETIME *ft) +{ + // Overlay FILETIME onto a ULONGLONG. + union { + ULONGLONG qwTime; + FILETIME ft; + } u; + + u.ft = *ft; + return u.qwTime; +} + + +// Get time difference between to FILETIME objects in seconds. +static double GetTimeDiffInSeconds(FILETIME *a, FILETIME *b) +{ + return ((FileTimeToQuadWord(a) - FileTimeToQuadWord(b)) / 1e7); +} +#endif PROF_MEASUREMENT::PROF_MEASUREMENT(QUERY_PROFILE *profile_arg, const char *status_arg) @@ -224,6 +244,12 @@ void PROF_MEASUREMENT::collect() time_usecs= (double) my_getsystime() / 10.0; /* 1 sec was 1e7, now is 1e6 */ #ifdef HAVE_GETRUSAGE getrusage(RUSAGE_SELF, &rusage); +#elif defined(_WIN32) + FILETIME ftDummy; + // NOTE: Get{Process|Thread}Times has a granularity of the clock interval, + // which is typically ~15ms. So intervals shorter than that will not be + // measurable by this function. + GetProcessTimes(GetCurrentProcess(), &ftDummy, &ftDummy, &ftKernel, &ftUser); #endif } @@ -589,6 +615,23 @@ int PROFILING::fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond) (1000.0*1000), &cpu_stime_decimal); + table->field[4]->store_decimal(&cpu_utime_decimal); + table->field[5]->store_decimal(&cpu_stime_decimal); + table->field[4]->set_notnull(); + table->field[5]->set_notnull(); +#elif defined(_WIN32) + my_decimal cpu_utime_decimal, cpu_stime_decimal; + + double2my_decimal(E_DEC_FATAL_ERROR, + GetTimeDiffInSeconds(&entry->ftUser, + &previous->ftUser), + &cpu_utime_decimal); + double2my_decimal(E_DEC_FATAL_ERROR, + GetTimeDiffInSeconds(&entry->ftKernel, + &previous->ftKernel), + &cpu_stime_decimal); + + // Store the result. table->field[4]->store_decimal(&cpu_utime_decimal); table->field[5]->store_decimal(&cpu_stime_decimal); table->field[4]->set_notnull(); diff --git a/sql/sql_profile.h b/sql/sql_profile.h index bffe1cb576b..31e2f1a7c50 100644 --- a/sql/sql_profile.h +++ b/sql/sql_profile.h @@ -173,6 +173,8 @@ private: char *status; #ifdef HAVE_GETRUSAGE struct rusage rusage; +#elif defined(_WIN32) + FILETIME ftKernel, ftUser; #endif char *function; From a129a22873ded2ea52b454ff321c33d80f94fb97 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 5 Feb 2010 17:31:34 +0100 Subject: [PATCH 39/54] Bug#50057: SHOW PROFILE CPU for Windows On QA request, adding test that causes new code to be called. Even if we cannot validate the result, this will at least increase the code coverage. --- mysql-test/r/show_profile.result | 10 ++++++++++ mysql-test/t/show_profile.test | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 mysql-test/r/show_profile.result create mode 100644 mysql-test/t/show_profile.test diff --git a/mysql-test/r/show_profile.result b/mysql-test/r/show_profile.result new file mode 100644 index 00000000000..67a07f6cfc9 --- /dev/null +++ b/mysql-test/r/show_profile.result @@ -0,0 +1,10 @@ +SET profiling = 1; +SELECT 1; +1 +1 +SHOW PROFILES; +Query_ID Duration Query +1 # SELECT 1 +SHOW PROFILE FOR QUERY 1; +SHOW PROFILE CPU FOR QUERY 1; +SET profiling = 0; diff --git a/mysql-test/t/show_profile.test b/mysql-test/t/show_profile.test new file mode 100644 index 00000000000..c20b29c40bf --- /dev/null +++ b/mysql-test/t/show_profile.test @@ -0,0 +1,18 @@ +# +# Test for show profiles +# No meaningful check is possible. +# So it only checks that SET profiling is possible and +# that SHOW PROFILES, SHOW PROFILE FOR QUERY and SHOW PROFILE CPU FOR QUERY +# do not cause syntax errors. It also increases code coverage for sql_profile.cc + +--source include/have_profiling.inc +SET profiling = 1; +SELECT 1; +--replace_column 2 # +SHOW PROFILES; +--disable_result_log +SHOW PROFILE FOR QUERY 1; +SHOW PROFILE CPU FOR QUERY 1; +--enable_result_log +SET profiling = 0; + From 2d58a95bb9cc721492361fcb275f0b6ecf110ed6 Mon Sep 17 00:00:00 2001 From: "Horst.Hunger" Date: Mon, 8 Feb 2010 11:43:56 +0100 Subject: [PATCH 40/54] Patch to fix bug#50981. Replace now the result ::1 by localhost for Windows. Both is valid. --- mysql-test/include/ipv6.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/include/ipv6.inc b/mysql-test/include/ipv6.inc index 378733dd03a..3d8fdcfbc3c 100644 --- a/mysql-test/include/ipv6.inc +++ b/mysql-test/include/ipv6.inc @@ -6,7 +6,9 @@ eval SET @nip= inet_aton('$IPv6'); SELECT @nip; SELECT inet_ntoa(@nip); # delivers a wrong value, see bug#34037 +--replace_result ::1 localhost SELECT USER(); +--replace_result ::1 localhost SELECT current_user(); --disable_result_log SHOW PROCESSLIST; @@ -17,6 +19,7 @@ disconnect con1; eval REVOKE ALL ON test.* FROM testuser@'$IPv6'; eval RENAME USER testuser@'$IPv6' to testuser1@'$IPv6'; eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876'); +--replace_result ::1 localhost SELECT USER(); eval DROP USER testuser1@'$IPv6'; From 06df9b073d072307adb5ae3334cc3ccb2df24e32 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 9 Feb 2010 17:22:31 +0000 Subject: [PATCH 41/54] BUG#51021: current_stmt_binlog_row_based not removed in next-mr As part of BUG@39934 fix, the public: - THD::current_stmt_binlog_row_based variable had been removed and replaced by a private variable: - THD::current_stmt_binlog_format. THD was refactored and some modifiers and accessors were implemented for the new variable. However, due to a bad merge, the THD::current_stmt_binlog_row_based variable is back as a public member of THD. This in itself is already potentially harmful. What's even worse is that while merging some more patches and resolving conflicts, the variable started being used again, which is obviously wrong. To fix this we: 1. remove the extraneous variable from sql_class.h 2. revert a bad merge for BUG#49132 3. merge BUG#49132 properly again (actually, making use of the cset used to merge the original patch to mysql-pe). --- .../r/binlog_row_mix_innodb_myisam.result | 44 ++++++++-- sql/event_db_repository.cc | 7 +- sql/events.cc | 24 +++--- sql/sp.cc | 21 +++-- sql/sql_acl.cc | 86 +++++++++++-------- sql/sql_class.h | 1 - sql/sql_udf.cc | 26 +++--- 7 files changed, 135 insertions(+), 74 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index e0cb1b695be..d59e84c1e1e 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -744,8 +744,9 @@ ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=3 -master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2)) +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 3 */; count(*) @@ -761,8 +762,9 @@ count(*) show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=4 -master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3) +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 5 */; count(*) @@ -784,6 +786,10 @@ insert into t2 values (bug27417(1)); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 1 */; count(*) 1 @@ -795,6 +801,10 @@ insert into t2 select bug27417(1) union select bug27417(2); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 2 */; count(*) 2 @@ -806,8 +816,11 @@ ERROR 23000: Duplicate entry '4' for key 'b' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=4 -master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1) +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Update_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 2 */; count(*) @@ -821,6 +834,10 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 4 */; count(*) 4 @@ -834,7 +851,7 @@ UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' select count(*) from t1 /* must be 1 */; count(*) -1 +2 drop table t4; delete from t1; delete from t2; @@ -848,6 +865,11 @@ delete from t2; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 1 */; count(*) 1 @@ -864,6 +886,10 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 1 */; count(*) 1 @@ -881,6 +907,10 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; drop function bug27417; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index fd2c5a556a8..50e556af84f 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -1053,8 +1053,8 @@ update_timing_fields_for_event(THD *thd, Turn off row binlogging of event timing updates. These are not used for RBR of events replicated to the slave. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); DBUG_ASSERT(thd->security_ctx->master_access & SUPER_ACL); @@ -1097,7 +1097,8 @@ end: if (table) close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(test(ret)); } diff --git a/sql/events.cc b/sql/events.cc index 73f3427607d..b5855401368 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -335,8 +335,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for CREATE EVENT command. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); mysql_mutex_lock(&LOCK_event_metadata); @@ -377,7 +377,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, sql_print_error("Event Error: An error occurred while creating query string, " "before writing it into binary log."); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); } /* If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER @@ -387,7 +388,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, } mysql_mutex_unlock(&LOCK_event_metadata); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } @@ -471,8 +473,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for UPDATE EVENT command. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); mysql_mutex_lock(&LOCK_event_metadata); @@ -509,7 +511,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, } mysql_mutex_unlock(&LOCK_event_metadata); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } @@ -570,8 +573,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for DROP EVENT command. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); mysql_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ @@ -585,7 +588,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) } mysql_mutex_unlock(&LOCK_event_metadata); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } diff --git a/sql/sp.cc b/sql/sp.cc index cbc0d003c9f..de379e7e725 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -927,8 +927,8 @@ sp_create_routine(THD *thd, int type, sp_head *sp) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); saved_count_cuted_fields= thd->count_cuted_fields; thd->count_cuted_fields= CHECK_FIELD_WARN; @@ -1136,7 +1136,8 @@ done: close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } @@ -1174,8 +1175,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); if (!(table= open_proc_table_for_update(thd))) DBUG_RETURN(SP_OPEN_TABLE_FAILED); @@ -1194,7 +1195,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name) close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } @@ -1233,8 +1235,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); if (!(table= open_proc_table_for_update(thd))) DBUG_RETURN(SP_OPEN_TABLE_FAILED); @@ -1269,7 +1271,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 012542a9467..f0499cb3a5b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3119,8 +3119,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); #ifdef HAVE_REPLICATION /* @@ -3137,7 +3137,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(FALSE); } } @@ -3153,7 +3154,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, { // Should never happen close_thread_tables(thd); /* purecov: deadcode */ /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); /* purecov: deadcode */ } @@ -3281,7 +3283,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, /* Tables are automatically closed */ thd->lex->restore_backup_query_tables_list(&backup); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); } @@ -3346,8 +3349,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); #ifdef HAVE_REPLICATION /* @@ -3364,7 +3367,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(FALSE); } } @@ -3374,7 +3378,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, { // Should never happen close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); } @@ -3452,7 +3457,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, mysql_rwlock_unlock(&LOCK_grant); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); /* Tables are automatically closed */ DBUG_RETURN(result); @@ -3496,8 +3502,8 @@ bool mysql_grant(THD *thd, const char *db, List &list, row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); #ifdef HAVE_REPLICATION /* @@ -3514,7 +3520,8 @@ bool mysql_grant(THD *thd, const char *db, List &list, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(FALSE); } } @@ -3524,7 +3531,8 @@ bool mysql_grant(THD *thd, const char *db, List &list, { // This should never happen close_thread_tables(thd); /* purecov: deadcode */ /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); /* purecov: deadcode */ } @@ -3585,7 +3593,8 @@ bool mysql_grant(THD *thd, const char *db, List &list, if (!result) my_ok(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); } @@ -5797,14 +5806,15 @@ bool mysql_create_user(THD *thd, List &list) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); /* CREATE USER may be skipped on replication client. */ if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); } @@ -5850,7 +5860,8 @@ bool mysql_create_user(THD *thd, List &list) mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); } @@ -5885,14 +5896,15 @@ bool mysql_drop_user(THD *thd, List &list) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); /* DROP USER may be skipped on replication client. */ if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); } @@ -5932,7 +5944,8 @@ bool mysql_drop_user(THD *thd, List &list) close_thread_tables(thd); thd->variables.sql_mode= old_sql_mode; /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); } @@ -5967,14 +5980,15 @@ bool mysql_rename_user(THD *thd, List &list) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); /* RENAME USER may be skipped on replication client. */ if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); } @@ -6024,7 +6038,8 @@ bool mysql_rename_user(THD *thd, List &list) mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); } @@ -6057,13 +6072,14 @@ bool mysql_revoke_all(THD *thd, List &list) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); } @@ -6219,7 +6235,8 @@ bool mysql_revoke_all(THD *thd, List &list) if (result && !binlog_error) my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0)); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result || binlog_error); } @@ -6328,8 +6345,8 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); /* Remove procedure access */ do @@ -6366,7 +6383,8 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, thd->pop_internal_handler(); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(error_handler.has_errors()); } diff --git a/sql/sql_class.h b/sql/sql_class.h index 7bebc639c37..7e17480e780 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1723,7 +1723,6 @@ public: bool slave_thread, one_shot_set; /* tells if current statement should binlog row-based(1) or stmt-based(0) */ - bool current_stmt_binlog_row_based; bool locked, some_tables_deleted; bool last_cuted_field; bool no_errors, password; diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index d0e446fb157..10ef34e0b3a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -461,8 +461,8 @@ int mysql_create_function(THD *thd,udf_func *udf) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for CREATE FUNCTION command. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); mysql_rwlock_wrlock(&THR_LOCK_udf); if ((my_hash_search(&udf_hash,(uchar*) udf->name.str, udf->name.length))) @@ -533,11 +533,13 @@ int mysql_create_function(THD *thd,udf_func *udf) if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); } /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(0); err: @@ -545,7 +547,8 @@ int mysql_create_function(THD *thd,udf_func *udf) dlclose(dl); mysql_rwlock_unlock(&THR_LOCK_udf); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); } @@ -573,8 +576,8 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for DROP FUNCTION command. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); mysql_rwlock_wrlock(&THR_LOCK_udf); if (!(udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) udf_name->str, @@ -617,16 +620,19 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) { /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); } /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(0); err: mysql_rwlock_unlock(&THR_LOCK_udf); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); } From d142fca3bddace488b99b91e35991a8dbde57b98 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 10 Feb 2010 00:05:45 +0000 Subject: [PATCH 42/54] Post-push fix: float/double to string conversions and vice versa changed in mysql-next-mr (see: WL@2934). Thence, we need to update the result file for rpl_stm_user_variables test case. --- .../suite/rpl/r/rpl_stm_user_variables.result | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result index 7943268e30a..5e758fc02f3 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result +++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result @@ -36,9 +36,9 @@ usmallint 65535 umediumint 16777215 uinteger 4294967295 ubigint 18446744073709551615 -double 1.84467440737096e+19 -float 1.84467e+19 -real 18446744073709551616.00 +double 1.8446744073709552e19 +float 1.84467e19 +real 18446744073709552000.00 decimal 18446744073709551615.00 #### [ on slave ] SELECT * FROM t1; @@ -52,9 +52,9 @@ usmallint 65535 umediumint 16777215 uinteger 4294967295 ubigint 18446744073709551615 -double 1.84467440737096e+19 -float 1.84467e+19 -real 18446744073709551616.00 +double 1.8446744073709552e19 +float 1.84467e19 +real 18446744073709552000.00 decimal 18446744073709551615.00 ######################################### ## assertion: master and slave tables are in sync @@ -88,9 +88,9 @@ usmallint 65535 umediumint 16777215 uinteger 4294967295 ubigint 18446744073709551615 -double 1.84467440737096e+19 -float 1.84467e+19 -real 18446744073709551616.00 +double 1.8446744073709552e19 +float 1.84467e19 +real 18446744073709552000.00 decimal 18446744073709551615.00 #### [ on slave ] SELECT * FROM t1; @@ -104,9 +104,9 @@ usmallint 65535 umediumint 16777215 uinteger 4294967295 ubigint 18446744073709551615 -double 1.84467440737096e+19 -float 1.84467e+19 -real 18446744073709551616.00 +double 1.8446744073709552e19 +float 1.84467e19 +real 18446744073709552000.00 decimal 18446744073709551615.00 ######################################### ## assertion: master and slave tables are in sync @@ -128,9 +128,9 @@ usmallint 0 umediumint 0 uinteger 0 ubigint 0 -double -9.22337203685478e+18 -float -9.22337e+18 -real -9223372036854775808.00 +double -9.223372036854776e18 +float -9.22337e18 +real -9223372036854776000.00 decimal -9223372036854775808.00 #### [ on slave ] SELECT * FROM t1; @@ -144,9 +144,9 @@ usmallint 0 umediumint 0 uinteger 0 ubigint 0 -double -9.22337203685478e+18 -float -9.22337e+18 -real -9223372036854775808.00 +double -9.223372036854776e18 +float -9.22337e18 +real -9223372036854776000.00 decimal -9223372036854775808.00 ######################################### ## assertion: master and slave tables are in sync @@ -180,9 +180,9 @@ usmallint 0 umediumint 0 uinteger 0 ubigint 0 -double -9.22337203685478e+18 -float -9.22337e+18 -real -9223372036854775808.00 +double -9.223372036854776e18 +float -9.22337e18 +real -9223372036854776000.00 decimal -9223372036854775808.00 #### [ on slave ] SELECT * FROM t1; @@ -196,9 +196,9 @@ usmallint 0 umediumint 0 uinteger 0 ubigint 0 -double -9.22337203685478e+18 -float -9.22337e+18 -real -9223372036854775808.00 +double -9.223372036854776e18 +float -9.22337e18 +real -9223372036854776000.00 decimal -9223372036854775808.00 ######################################### ## assertion: master and slave tables are in sync From dca6700620d5f4b325c3aadbbf5ab30c5b888a8c Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Wed, 10 Feb 2010 10:47:14 +0100 Subject: [PATCH 43/54] Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table Problem was that in mysql-trunk the ER() macro is now dependent on current_thd and the innodb monitor thread has no binding to that thd object. This cause the crash because of bad derefencing. Solution was to add a new macro which take the thd as an argument (which the innodb thread uses for the call). (Updated according to reviewers comments, i.e. added ER_THD_OR_DEFAULT and moved test to suite parts.) mysql-test/suite/parts/r/partition_innodb_status_file.result: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table New test result file mysql-test/suite/parts/t/partition_innodb_status_file-master.opt: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table New test opt file mysql-test/suite/parts/t/partition_innodb_status_file.test: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table New test. Note that the innodb monitor thread only runs every 15 seconds, so this test will take at least 15 seconds, so I have moved it to the parts suite. sql/sql_table.cc: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table Using thd safe ER macro. sql/unireg.h: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table Added ER macros for use with specified thd pointer. --- .../r/partition_innodb_status_file.result | 14 +++++++++++++ .../t/partition_innodb_status_file-master.opt | 1 + .../parts/t/partition_innodb_status_file.test | 20 +++++++++++++++++++ sql/sql_table.cc | 17 ++++++++++------ sql/unireg.h | 3 +++ 5 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 mysql-test/suite/parts/r/partition_innodb_status_file.result create mode 100644 mysql-test/suite/parts/t/partition_innodb_status_file-master.opt create mode 100644 mysql-test/suite/parts/t/partition_innodb_status_file.test diff --git a/mysql-test/suite/parts/r/partition_innodb_status_file.result b/mysql-test/suite/parts/r/partition_innodb_status_file.result new file mode 100644 index 00000000000..29b5a3b3766 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_innodb_status_file.result @@ -0,0 +1,14 @@ +CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a); +INSERT INTO t1 VALUES (0), (1), (2); +START TRANSACTION; +UPDATE t1 SET a = 5 WHERE a = 1; +# Connection con1 +# InnoDB lock timeout and monitor thread runs every 15 seconds +SET innodb_lock_wait_timeout = 20; +START TRANSACTION; +UPDATE t1 SET a = 3 WHERE a = 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +COMMIT; +# Connection default +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/parts/t/partition_innodb_status_file-master.opt b/mysql-test/suite/parts/t/partition_innodb_status_file-master.opt new file mode 100644 index 00000000000..779962e8fca --- /dev/null +++ b/mysql-test/suite/parts/t/partition_innodb_status_file-master.opt @@ -0,0 +1 @@ +--innodb-status-file=1 diff --git a/mysql-test/suite/parts/t/partition_innodb_status_file.test b/mysql-test/suite/parts/t/partition_innodb_status_file.test new file mode 100644 index 00000000000..f066ce5d485 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_innodb_status_file.test @@ -0,0 +1,20 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a); +INSERT INTO t1 VALUES (0), (1), (2); +START TRANSACTION; +UPDATE t1 SET a = 5 WHERE a = 1; +connect (con1, localhost, root,,); +--echo # Connection con1 +--echo # InnoDB lock timeout and monitor thread runs every 15 seconds +SET innodb_lock_wait_timeout = 20; +START TRANSACTION; +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET a = 3 WHERE a = 1; +COMMIT; +disconnect con1; +connection default; +--echo # Connection default +COMMIT; +DROP TABLE t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b17edbdd234..6006c818725 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -291,7 +291,8 @@ uint explain_filename(THD* thd, { if (explain_mode == EXPLAIN_ALL_VERBOSE) { - to_p= strnmov(to_p, ER(ER_DATABASE_NAME), end_p - to_p); + to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_DATABASE_NAME), + end_p - to_p); *(to_p++)= ' '; to_p= add_identifier(thd, to_p, end_p, db_name, db_name_len); to_p= strnmov(to_p, ", ", end_p - to_p); @@ -304,7 +305,7 @@ uint explain_filename(THD* thd, } if (explain_mode == EXPLAIN_ALL_VERBOSE) { - to_p= strnmov(to_p, ER(ER_TABLE_NAME), end_p - to_p); + to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TABLE_NAME), end_p - to_p); *(to_p++)= ' '; to_p= add_identifier(thd, to_p, end_p, table_name, table_name_len); } @@ -321,18 +322,22 @@ uint explain_filename(THD* thd, if (name_type != NORMAL) { if (name_type == TEMP) - to_p= strnmov(to_p, ER(ER_TEMPORARY_NAME), end_p - to_p); + to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME), + end_p - to_p); else - to_p= strnmov(to_p, ER(ER_RENAMED_NAME), end_p - to_p); + to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_RENAMED_NAME), + end_p - to_p); to_p= strnmov(to_p, " ", end_p - to_p); } - to_p= strnmov(to_p, ER(ER_PARTITION_NAME), end_p - to_p); + to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_PARTITION_NAME), + end_p - to_p); *(to_p++)= ' '; to_p= add_identifier(thd, to_p, end_p, part_name, part_name_len); if (subpart_name) { to_p= strnmov(to_p, ", ", end_p - to_p); - to_p= strnmov(to_p, ER(ER_SUBPARTITION_NAME), end_p - to_p); + to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_SUBPARTITION_NAME), + end_p - to_p); *(to_p++)= ' '; to_p= add_identifier(thd, to_p, end_p, subpart_name, subpart_name_len); } diff --git a/sql/unireg.h b/sql/unireg.h index a390b755772..e915b234a6b 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -46,6 +46,9 @@ #define ER(X) CURRENT_THD_ERRMSGS[(X) - ER_ERROR_FIRST] #define ER_DEFAULT(X) DEFAULT_ERRMSGS[(X) - ER_ERROR_FIRST] #define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code") +#define ER_THD(thd,X) ((thd)->variables.lc_messages->errmsgs->errmsgs[(X) - \ + ER_ERROR_FIRST]) +#define ER_THD_OR_DEFAULT(thd,X) ((thd) ? ER_THD(thd, X) : ER_DEFAULT(X)) #define ERRMAPP 1 /* Errormap f|r my_error */ From 5df69267c25d093fb1a87b3e9952812a66f0f687 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 10 Feb 2010 12:12:55 +0000 Subject: [PATCH 44/54] BUG#50984: check_testcase fails for rpl_tmp_table_and_DDL We found that there are some tests that are not cleaning up properly: 1. rpl_tmp_table_and_DDL 2. rpl_do_grant 3. rpl_sync For #1 and #2 we found that the slave would not, for some cases, replicate all the instructions the master processed in the cleanup section. We fix these by deploying some synchronization commands in the test cases so that slave processes all clean up instructions. As for #3, this is tracked as part of another bug (BUG@50442). --- mysql-test/suite/rpl/r/rpl_do_grant.result | 10 +++++++--- mysql-test/suite/rpl/t/rpl_do_grant.test | 18 ++++++++++++++---- .../suite/rpl/t/rpl_tmp_table_and_DDL.test | 1 + 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index 65c60acc651..9eecc1bab3f 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -89,6 +89,7 @@ show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' +call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); DROP DATABASE IF EXISTS bug42217_db; CREATE DATABASE bug42217_db; GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost' @@ -166,9 +167,12 @@ DROP FUNCTION upgrade_del_func; DROP FUNCTION upgrade_alter_func; DROP DATABASE bug42217_db; DROP USER 'create_rout_db'@'localhost'; -call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); -USE mtr; -call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; ######## BUG#49119 ####### ### i) test case from the 'how to repeat section' stop slave; diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index d6a06f43d18..df61b6847c9 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -120,6 +120,9 @@ show grants for rpl_do_grant2@localhost; # BUG42217 mysql.procs_priv does not get replicated ##################################################### connection master; +call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); +sync_slave_with_master; +connection master; --disable_warnings DROP DATABASE IF EXISTS bug42217_db; @@ -209,12 +212,19 @@ USE bug42217_db; DROP FUNCTION upgrade_del_func; DROP FUNCTION upgrade_alter_func; DROP DATABASE bug42217_db; +-- sync_slave_with_master +-- connection master + +# user was already dropped in the slave before +# so no need to wait for the slave to replicate +# this statement (if it did and we later synced +# the slave it would end up in an error anyway) DROP USER 'create_rout_db'@'localhost'; -call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); -connection slave; -USE mtr; -call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); +# finish entire clean up (remove binlogs) +# so that we leave a pristine environment for the +# following tests +-- source include/master-slave-reset.inc # BUG#49119: Master crashes when executing 'REVOKE ... ON # {PROCEDURE|FUNCTION} FROM ...' diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index 56924a2efe9..b3efb578b68 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -10,4 +10,5 @@ source include/have_binlog_format_row.inc; LET $ENGINE_TYPE= MyISAM; source extra/rpl_tests/rpl_tmp_table_and_DDL.test; +sync_slave_with_master; From 563ba7db9b09618c277634fa9431db65414ba942 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 10 Feb 2010 16:01:31 +0000 Subject: [PATCH 45/54] BUG#51021: current_stmt_binlog_row_based not removed in next-mr Deployed DBUG_ASSERT before the conditional binlog format restore. --- sql/event_db_repository.cc | 1 + sql/events.cc | 4 ++++ sql/sp.cc | 3 +++ sql/sql_acl.cc | 18 ++++++++++++++++++ sql/sql_udf.cc | 6 ++++++ 5 files changed, 32 insertions(+) diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 50e556af84f..ff74dd0ab84 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -1097,6 +1097,7 @@ end: if (table) close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); diff --git a/sql/events.cc b/sql/events.cc index b5855401368..340ef8c7bd2 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -377,6 +377,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, sql_print_error("Event Error: An error occurred while creating query string, " "before writing it into binary log."); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); @@ -388,6 +389,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, } mysql_mutex_unlock(&LOCK_event_metadata); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); @@ -511,6 +513,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, } mysql_mutex_unlock(&LOCK_event_metadata); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); @@ -588,6 +591,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) } mysql_mutex_unlock(&LOCK_event_metadata); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); diff --git a/sql/sp.cc b/sql/sp.cc index de379e7e725..aae825c6c0d 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1136,6 +1136,7 @@ done: close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); @@ -1195,6 +1196,7 @@ sp_drop_routine(THD *thd, int type, sp_name *name) close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); @@ -1271,6 +1273,7 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f0499cb3a5b..334d6474169 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3137,6 +3137,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(FALSE); @@ -3154,6 +3155,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, { // Should never happen close_thread_tables(thd); /* purecov: deadcode */ /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); /* purecov: deadcode */ @@ -3283,6 +3285,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, /* Tables are automatically closed */ thd->lex->restore_backup_query_tables_list(&backup); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); @@ -3367,6 +3370,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(FALSE); @@ -3378,6 +3382,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, { // Should never happen close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); @@ -3457,6 +3462,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, mysql_rwlock_unlock(&LOCK_grant); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); @@ -3520,6 +3526,7 @@ bool mysql_grant(THD *thd, const char *db, List &list, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(FALSE); @@ -3531,6 +3538,7 @@ bool mysql_grant(THD *thd, const char *db, List &list, { // This should never happen close_thread_tables(thd); /* purecov: deadcode */ /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(TRUE); /* purecov: deadcode */ @@ -3593,6 +3601,7 @@ bool mysql_grant(THD *thd, const char *db, List &list, if (!result) my_ok(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); @@ -5813,6 +5822,7 @@ bool mysql_create_user(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); @@ -5860,6 +5870,7 @@ bool mysql_create_user(THD *thd, List &list) mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); @@ -5903,6 +5914,7 @@ bool mysql_drop_user(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); @@ -5944,6 +5956,7 @@ bool mysql_drop_user(THD *thd, List &list) close_thread_tables(thd); thd->variables.sql_mode= old_sql_mode; /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); @@ -5987,6 +6000,7 @@ bool mysql_rename_user(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); @@ -6038,6 +6052,7 @@ bool mysql_rename_user(THD *thd, List &list) mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result); @@ -6078,6 +6093,7 @@ bool mysql_revoke_all(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(result != 1); @@ -6235,6 +6251,7 @@ bool mysql_revoke_all(THD *thd, List &list) if (result && !binlog_error) my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0)); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); @@ -6383,6 +6400,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, thd->pop_internal_handler(); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 10ef34e0b3a..80c4791ab21 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -533,11 +533,13 @@ int mysql_create_function(THD *thd,udf_func *udf) if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); } /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(0); @@ -547,6 +549,7 @@ int mysql_create_function(THD *thd,udf_func *udf) dlclose(dl); mysql_rwlock_unlock(&THR_LOCK_udf); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); @@ -620,17 +623,20 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) { /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); } /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(0); err: mysql_rwlock_unlock(&THR_LOCK_udf); /* Restore the state of binlog format */ + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(1); From 87a589f83af4561e4b91f9f223197e6482324ab2 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 10 Feb 2010 21:57:07 +0000 Subject: [PATCH 46/54] BUG#51021: current_stmt_binlog_row_based not removed in next-mr A closely related problem, hardly worth a new bug report: Removed a spurious call to: thd->set_current_stmt_binlog_format_row_if_mixed() in sql_base.cc:lock_tables(). --- sql/sql_base.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index eb59600b360..ff330d1b5bb 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5180,10 +5180,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) */ if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables && has_write_table_with_auto_increment(thd->lex->first_not_own_table())) - { thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_TWO_AUTOINC_COLUMNS); - thd->set_current_stmt_binlog_format_row_if_mixed(); - } } DEBUG_SYNC(thd, "before_lock_tables_takes_lock"); From 93cd02bc82bfe48bad5c3d4daf3331207f3445a3 Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Thu, 11 Feb 2010 18:02:41 +0100 Subject: [PATCH 47/54] Bug#50542 5.5.x doesn't check length of key prefixes: corruption and crash results An index creation statement where the index key is larger/wider than the column it references should throw an error. A statement like: CREATE TABLE t1 (a CHAR(1), PRIMARY KEY (A(255))) did not error, but a segmentation fault followed when an insertion was attempted on the table The partial key validiation clause has been restructured to (hopefully) better document which uses of partial keys are valid. --- mysql-test/r/alter_table.result | 12 ++++++++++++ mysql-test/t/alter_table.test | 28 ++++++++++++++++++++++++++++ sql/sql_table.cc | 29 ++++++++++++++--------------- 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index db80e9d2eea..7e14c3a9b23 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1354,3 +1354,15 @@ DROP i, ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = 1; DROP TABLE t1; +CREATE TABLE t1 (a CHAR(1), PRIMARY KEY (a(255))); +ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys +CREATE TABLE t1 (a CHAR(1)); +ALTER TABLE t1 ADD PRIMARY KEY (a(20)); +ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys +ALTER TABLE t1 ADD KEY (a(20)); +ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys +CREATE UNIQUE INDEX i1 ON t1 (a(20)); +ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys +CREATE INDEX i2 ON t1 (a(20)); +ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys +DROP TABLE t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 2bfe6dbaa62..54c662bccf2 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1089,3 +1089,31 @@ ALTER TABLE t1 ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = 1; DROP TABLE t1; + + +# +# Bug#50542 5.5.x doesn't check length of key prefixes: +# corruption and crash results +# +# This case is related to Bug#31031 (above) +# A statement where the index key is larger/wider than +# the column type, should cause an error +# +--error ER_WRONG_SUB_KEY +CREATE TABLE t1 (a CHAR(1), PRIMARY KEY (a(255))); + +# Test other variants of creating indices +CREATE TABLE t1 (a CHAR(1)); +# ALTER TABLE +--error ER_WRONG_SUB_KEY +ALTER TABLE t1 ADD PRIMARY KEY (a(20)); +--error ER_WRONG_SUB_KEY +ALTER TABLE t1 ADD KEY (a(20)); +# CREATE INDEX +--error ER_WRONG_SUB_KEY +CREATE UNIQUE INDEX i1 ON t1 (a(20)); +--error ER_WRONG_SUB_KEY +CREATE INDEX i2 ON t1 (a(20)); +# cleanup +DROP TABLE t1; + diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6006c818725..04bd2d4c976 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3292,22 +3292,21 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } } + // Catch invalid use of partial keys else if (!f_is_geom(sql_field->pack_flag) && - ((column->length > length && - !Field::type_can_have_key_part (sql_field->sql_type)) || - ((f_is_packed(sql_field->pack_flag) || - ((file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS) && - (key_info->flags & HA_NOSAME))) && - column->length != length))) - { - /* Catch invalid uses of partial keys. - A key is identified as 'partial' if column->length != length. - A partial key is invalid if they data type does - not allow it, or the field is packed (as in MyISAM), - or the storage engine doesn't allow prefixed search and - the key is primary key. - */ - + // is the key partial? + column->length != length && + // is prefix length bigger than field length? + (column->length > length || + // can the field have a partial key? + !Field::type_can_have_key_part (sql_field->sql_type) || + // a packed field can't be used in a partial key + f_is_packed(sql_field->pack_flag) || + // does the storage engine allow prefixed search? + ((file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS) && + // and is this a 'unique' key? + (key_info->flags & HA_NOSAME)))) + { my_message(ER_WRONG_SUB_KEY, ER(ER_WRONG_SUB_KEY), MYF(0)); DBUG_RETURN(TRUE); } From 203793514d4e5035691bb750256532b8ecf0b6da Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Thu, 11 Feb 2010 18:25:34 +0100 Subject: [PATCH 48/54] Bug#50574 5.5.x allows spatial indexes on non-spatial columns, causing crashes! Adding a SPATIAL INDEX on a non-geometrical column caused a segmentation fault when the table was subsequently inserted into. A test was added in mysql_prepare_create_table to explicitly check whether non-geometrical columns are used in a spatial index, and throw an error if so. mysql-test/t/gis.test: Added test cases to verify that only geometrical columns can get a spatial index. In addition, verify that only a single geom. column can participate in a spatial index. --- mysql-test/r/gis.result | 30 ++++++++++++++++++++++++++ mysql-test/t/gis.test | 45 +++++++++++++++++++++++++++++++++++++++ sql/share/errmsg-utf8.txt | 2 ++ sql/sql_table.cc | 16 ++++++++++---- 4 files changed, 89 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 3e28227d542..ac808daae92 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1058,3 +1058,33 @@ SELECT Polygon(12345123,''); Polygon(12345123,'') NULL End of 5.1 tests +CREATE TABLE t1( +col0 BINARY NOT NULL, +col2 TIMESTAMP, +SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; +ERROR 42000: A SPATIAL index may only contain a geometrical type column +CREATE TABLE t1 ( +col0 BINARY NOT NULL, +col2 TIMESTAMP +) ENGINE=MyISAM; +CREATE SPATIAL INDEX idx0 ON t1(col0); +ERROR 42000: A SPATIAL index may only contain a geometrical type column +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); +ERROR 42000: A SPATIAL index may only contain a geometrical type column +CREATE TABLE t2 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 POINT +); +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t3 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 LINESTRING, +SPATIAL INDEX i1 (col1, col2) +); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index bc0695aaa93..c5c6a94057a 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -723,3 +723,48 @@ SELECT Polygon(1234512,''); SELECT Polygon(12345123,''); --echo End of 5.1 tests + +# +# Bug #50574 5.5.x allows spatial indexes on non-spatial +# columns, causing crashes! +# +--error ER_SPATIAL_MUST_HAVE_GEOM_COL +CREATE TABLE t1( + col0 BINARY NOT NULL, + col2 TIMESTAMP, + SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; + +# Test other ways to add indices +CREATE TABLE t1 ( + col0 BINARY NOT NULL, + col2 TIMESTAMP +) ENGINE=MyISAM; + +--error ER_SPATIAL_MUST_HAVE_GEOM_COL +CREATE SPATIAL INDEX idx0 ON t1(col0); + +--error ER_SPATIAL_MUST_HAVE_GEOM_COL +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); + +CREATE TABLE t2 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 POINT +); + +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); + +--error ER_WRONG_ARGUMENTS +CREATE TABLE t3 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 LINESTRING, + SPATIAL INDEX i1 (col1, col2) +); + +# cleanup +DROP TABLE t1; +DROP TABLE t2; + diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index db99890235a..d4f3cce805f 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6260,3 +6260,5 @@ ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD eng "Field '%-.192s' is of a not allowed type for this type of partitioning" ER_PARTITION_FIELDS_TOO_LONG eng "The total length of the partitioning fields is too large" +ER_SPATIAL_MUST_HAVE_GEOM_COL 42000 + eng "A SPATIAL index may only contain a geometrical type column" diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 04bd2d4c976..e89edb4fcfe 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3193,11 +3193,19 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, { column->length*= sql_field->charset->mbmaxlen; - if (key->type == Key::SPATIAL && column->length) + if (key->type == Key::SPATIAL) { - my_error(ER_WRONG_SUB_KEY, MYF(0)); - DBUG_RETURN(TRUE); - } + if (column->length) + { + my_error(ER_WRONG_SUB_KEY, MYF(0)); + DBUG_RETURN(TRUE); + } + if (!f_is_geom(sql_field->pack_flag)) + { + my_error(ER_SPATIAL_MUST_HAVE_GEOM_COL, MYF(0)); + DBUG_RETURN(TRUE); + } + } if (f_is_blob(sql_field->pack_flag) || (f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL)) From 97afccae53a5fda90311f57d328924d736279414 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Feb 2010 12:04:57 +0800 Subject: [PATCH 49/54] Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with --slave-load-tm The MDL_SHARED lock was introduced for an object in 5.4, but the 'TABLE_LIST' object was not initialized with the MDL_SHARED lock when applying event with LOAD DATA INFILE into table. So the failure is caused when checking the MDL_SHARED lock for the object. To fix the problem, the 'TABLE_LIST' object was initialized with the MDL_SHARED lock when applying event with LOAD DATA INFILE into table. mysql-test/suite/rpl/t/disabled.def: Got rid of the line for enabling 'rpl_cross_version' test. --- mysql-test/suite/rpl/t/disabled.def | 1 - mysql-test/suite/rpl/t/rpl_cross_version-master.opt | 2 +- sql/log_event.cc | 5 +---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 446c233c8a9..a0c57b205ec 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,5 +12,4 @@ rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2 -rpl_cross_version : BUG#43913 2009-10-22 luis rpl_cross_version fails with symptom in described in bug report rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt index 0ea05290c11..815a8f81d32 100644 --- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt +++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt @@ -1 +1 @@ ---replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR +--replicate-same-server-id --relay-log=slave-relay-bin diff --git a/sql/log_event.cc b/sql/log_event.cc index b6c84dd95f4..fbfffb592bf 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4634,10 +4634,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli, thd->warning_info->opt_clear_warning_info(thd->query_id); TABLE_LIST tables; - bzero((char*) &tables,sizeof(tables)); - tables.db= thd->strmake(thd->db, thd->db_length); - tables.alias = tables.table_name = (char*) table_name; - tables.lock_type = TL_WRITE; + tables.init_one_table(thd->db, table_name, TL_WRITE); tables.updating= 1; // the table will be opened in mysql_load From 3e0f70d2cc0d233f0be615532ed3a5254930ad17 Mon Sep 17 00:00:00 2001 From: Evgeny Potemkin Date: Fri, 12 Feb 2010 11:51:52 +0300 Subject: [PATCH 50/54] Bug#50539: Wrong result when loose index scan is used for an aggregate function with distinct. Loose index scan is used to find MIN/MAX values using appropriate index and thus allow to avoid grouping. For each found row it updates non-aggregated fields with values from row with found MIN/MAX value. Without loose index scan non-aggregated fields are copied by end_send_group function. With loose index scan there is no need in end_send_group and end_send is used instead. Non-aggregated fields still need to be copied and this was wrongly implemented in QUICK_GROUP_MIN_MAX_SELECT::get_next. WL#3220 added a case when loose index scan can be used with end_send_group to optimize calculation of aggregate functions with distinct. In this case the row found by QUICK_GROUP_MIN_MAX_SELECT::get_next might belong to a next group and copying it will produce wrong result. Update of non-aggregated fields is moved to the end_send function from QUICK_GROUP_MIN_MAX_SELECT::get_next. mysql-test/r/group_min_max.result: Added a test case for the bug#50539. mysql-test/t/group_min_max.test: Added a test case for the bug#50539. sql/opt_range.cc: Bug#50539: Wrong result when loose index scan is used for an aggregate function with distinct. Update of non-aggregated fields is moved to the end_send function from QUICK_GROUP_MIN_MAX_SELECT::get_next. sql/sql_select.cc: Bug#50539: Wrong result when loose index scan is used for an aggregate function with distinct. Update of non-aggregated fields is moved to the end_send function from QUICK_GROUP_MIN_MAX_SELECT::get_next. --- mysql-test/r/group_min_max.result | 27 ++++++++++++++++++++++++--- mysql-test/t/group_min_max.test | 19 +++++++++++++++++++ sql/opt_range.cc | 12 +----------- sql/sql_select.cc | 6 ++++++ 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index ba1c2a79ad9..94069d0559c 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2686,7 +2686,7 @@ a c COUNT(DISTINCT c, a, b) 1 1 1 1 1 1 1 1 1 -2 1 1 +1 1 1 2 1 1 2 1 1 2 1 1 @@ -2714,7 +2714,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a; a COUNT(DISTINCT b) SUM(DISTINCT b) -2 8 36 +1 8 36 2 8 36 EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra @@ -2761,7 +2761,7 @@ SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c; 126 126 126 -168 +126 168 168 168 @@ -2779,3 +2779,24 @@ SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a; 10 DROP TABLE t1,t2; # end of WL#3220 tests +# +# Bug#50539: Wrong result when loose index scan is used for an aggregate +# function with distinct +# +CREATE TABLE t1 ( +f1 int(11) NOT NULL DEFAULT '0', +f2 char(1) NOT NULL DEFAULT '', +PRIMARY KEY (f1,f2) +) ; +insert into t1 values(1,'A'),(1 , 'B'), (1, 'C'), (2, 'A'), +(3, 'A'), (3, 'B'), (3, 'C'), (3, 'D'); +SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; +f1 COUNT(DISTINCT f2) +1 3 +2 1 +3 4 +explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL PRIMARY 5 NULL 9 Using index for group-by (scanning) +drop table t1; +# End of test#50539. diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index 0e6fef9b855..1e7f28d5916 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -1166,3 +1166,22 @@ SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a; DROP TABLE t1,t2; --echo # end of WL#3220 tests + +--echo # +--echo # Bug#50539: Wrong result when loose index scan is used for an aggregate +--echo # function with distinct +--echo # +CREATE TABLE t1 ( + f1 int(11) NOT NULL DEFAULT '0', + f2 char(1) NOT NULL DEFAULT '', + PRIMARY KEY (f1,f2) +) ; +insert into t1 values(1,'A'),(1 , 'B'), (1, 'C'), (2, 'A'), +(3, 'A'), (3, 'B'), (3, 'C'), (3, 'D'); + +SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; +explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; + +drop table t1; +--echo # End of test#50539. + diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ac5b1f575de..5c64a6a64ee 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -10959,17 +10959,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::get_next() } while ((result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE) && is_last_prefix != 0); - if (result == 0) - { - /* - Partially mimic the behavior of end_select_send. Copy the - field data from Item_field::field into Item_field::result_field - of each non-aggregated field (the group fields, and optionally - other fields in non-ANSI SQL mode). - */ - copy_fields(&join->tmp_table_param); - } - else if (result == HA_ERR_KEY_NOT_FOUND) + if (result == HA_ERR_KEY_NOT_FOUND) result= HA_ERR_END_OF_FILE; DBUG_RETURN(result); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7119650a7a6..e09bd6cab5d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12255,6 +12255,12 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), if (!end_of_records) { int error; + if (join->tables && + join->join_tab->is_using_loose_index_scan()) + { + /* Copy non-aggregated fields when loose index scan is used. */ + copy_fields(&join->tmp_table_param); + } if (join->having && join->having->val_int() == 0) DBUG_RETURN(NESTED_LOOP_OK); // Didn't match having error=0; From 18c613a48b6fcf3a8c963c82b42b1d7d9170caad Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 12 Feb 2010 13:13:12 +0300 Subject: [PATCH 51/54] Fix tree name. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 55da30ab626..e9ae26ca793 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.1-rpl-merge" +tree_name = "mysql-5.5-next-mr" From b7302312fed703dd09fa9cf912614b91b3eb4481 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 12 Feb 2010 17:23:22 +0100 Subject: [PATCH 52/54] Correction: The "release" setting had got lost in the RPM spec file. --- support-files/mysql.spec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index a34b882674c..905919f053a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -118,6 +118,8 @@ %define NORMAL_TEST_MODE test-bt %define DEBUG_TEST_MODE test-bt-debug +%define release 1.glibc23 + %define mysql_license GPL %define src_dir mysql-%{mysql_version} From c142ef4679b4a8f73e41fee644a982869a07464c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Feb 2010 20:17:53 +0100 Subject: [PATCH 53/54] Raise version number after cloning 5.5.2-m2 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e50f2897781..4f745886438 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_PREREQ(2.59) # Remember to also update version.c in ndb. # When changing major version number please also check switch statement # in client/mysqlbinlog.cc:check_master_version(). -AC_INIT([MySQL Server], [5.5.2-m2], [], [mysql]) +AC_INIT([MySQL Server], [5.5.3-m2], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM # USTAR format gives us the possibility to store longer path names in From 1b9f84bf01ad421df06e0d229c0b2de4ea8983cd Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Sun, 14 Feb 2010 13:22:03 +0300 Subject: [PATCH 54/54] Fix tree name. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 08ca040642e..f33ccdf6753 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.5-trunk-bugfixing" +tree_name = "mysql-5.5-trunk"