From e77957eecb5c24d60b2633e6624cd894016f11fc Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Thu, 17 Jul 2008 18:26:59 +0200 Subject: [PATCH 01/14] BUG#38170: rpl_variables failed on pushbuild: could not sync with master Problem: the test set @@global.init_slave to garbage at a time which was not guaranteed to be after the time when the slave's SQL thread used it. That would cause the slave's SQL thread to stop in rare cases. Fix: The test does not care about the value of @@global.init_slave, except that it should be different on master and slave. Hence, we set @@global.init_slave to something that is valid SQL. --- mysql-test/suite/rpl/r/rpl_variables.result | 26 ++++++++++----------- mysql-test/suite/rpl/t/rpl_variables.test | 22 ++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result index 73354666b7a..902340f0219 100644 --- a/mysql-test/suite/rpl/r/rpl_variables.result +++ b/mysql-test/suite/rpl/r/rpl_variables.result @@ -45,7 +45,7 @@ RESET SLAVE; RESET MASTER; START SLAVE; [on slave] -SET @@global.init_slave = 'ant'; +SET @@global.init_slave = 'SELECT 1'; [on master] CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY, truth BOOLEAN, @@ -66,9 +66,9 @@ SET @@global.sync_binlog = 2000000; INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); SET @@global.slave_exec_mode = 'IDEMPOTENT'; INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode); @@ -140,9 +140,9 @@ INSERT INTO tproc(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO tproc(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tproc(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tproc(text) VALUES (@@global.init_slave); # enumeration SET @@global.slave_exec_mode = 'IDEMPOTENT'; @@ -226,9 +226,9 @@ INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); # enumeration SET @@global.slave_exec_mode = 'IDEMPOTENT'; @@ -316,9 +316,9 @@ INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); # enumeration SET @@global.slave_exec_mode = 'IDEMPOTENT'; @@ -395,9 +395,9 @@ PREPARE p5 FROM 'SET @@global.sync_binlog = 2000000'; PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000'; PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; -PREPARE p9 FROM 'SET @@global.init_slave = \'bison\''; +PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\''; PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; -PREPARE p11 FROM 'SET @@global.init_slave = \'cat\''; +PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\''; PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\''; PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)'; @@ -522,8 +522,8 @@ id truth num text 2 0 NULL NULL 3 NULL 2000000 NULL 4 NULL 3000000 NULL -5 NULL NULL bison -6 NULL NULL cat +5 NULL NULL SELECT 2 +6 NULL NULL SELECT 3 7 NULL NULL IDEMPOTENT 8 NULL NULL STRICT 9 1 NULL NULL diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test index 3669e14c5df..6c3b3ab6d8a 100644 --- a/mysql-test/suite/rpl/t/rpl_variables.test +++ b/mysql-test/suite/rpl/t/rpl_variables.test @@ -117,7 +117,7 @@ source include/reset_master_and_slave.inc; # above, but can't because it affects how the slave works. --echo [on slave] connection slave; -SET @@global.init_slave = 'ant'; +SET @@global.init_slave = 'SELECT 1'; --echo [on master] @@ -154,9 +154,9 @@ SET @@global.sync_binlog = 3000000; INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); # enumeration @@ -258,9 +258,9 @@ BEGIN INSERT INTO tproc(num) VALUES (@@global.sync_binlog); # string - SET @@global.init_slave = 'bison'; + SET @@global.init_slave = 'SELECT 2'; INSERT INTO tproc(text) VALUES (@@global.init_slave); - SET @@global.init_slave = 'cat'; + SET @@global.init_slave = 'SELECT 3'; INSERT INTO tproc(text) VALUES (@@global.init_slave); # enumeration @@ -367,9 +367,9 @@ BEGIN INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); # string - SET @@global.init_slave = 'bison'; + SET @@global.init_slave = 'SELECT 2'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); - SET @@global.init_slave = 'cat'; + SET @@global.init_slave = 'SELECT 3'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); # enumeration @@ -478,9 +478,9 @@ BEGIN INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); # string - SET @@global.init_slave = 'bison'; + SET @@global.init_slave = 'SELECT 2'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); - SET @@global.init_slave = 'cat'; + SET @@global.init_slave = 'SELECT 3'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); # enumeration @@ -581,9 +581,9 @@ PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000'; PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; # string -PREPARE p9 FROM 'SET @@global.init_slave = \'bison\''; +PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\''; PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; -PREPARE p11 FROM 'SET @@global.init_slave = \'cat\''; +PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\''; PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; # enumeration From e5d1324d80a569fecf34088d07a76d058148fc76 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Fri, 18 Jul 2008 13:34:19 +0200 Subject: [PATCH 02/14] BUG#38178: rpl_loaddata_map fails sporadically in pushbuild Problem: master binlog has 'create table t1'. Master binlog was removed before slave could replicate it. In test's cleanup code, master did 'drop table t1', which caused slave sql thread to stop with an error since slave sql thread did not know about t1. Fix: t1 is just an auxiliary construction, only needed on master. Hence, we turn off binlogging before t1 is created, drop t1 as soon as we don't need it anymore, and then turn on binlogging again. --- mysql-test/include/show_binlog_events.inc | 4 +- .../suite/rpl/r/rpl_loaddata_map.result | 21 +++++---- mysql-test/suite/rpl/t/rpl_loaddata_map.test | 47 +++++++++++++------ 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index a80dc75df7d..68f913a16a3 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -4,7 +4,7 @@ if (!$binlog_start) { let $binlog_start=106; } ---replace_result $binlog_start +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start --replace_column 2 # 4 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ --eval show binlog events from $binlog_start diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result index 7078389c987..901f3352b44 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result @@ -4,6 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +==== Create a big file ==== +==== Load our big file into a table ==== create table t2 (id int not null primary key auto_increment); select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; @@session.read_buffer_size - @@session.max_allowed_packet > 0 @@ -12,15 +14,18 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2; select count(*) from t2 /* 5 000 */; count(*) 5000 -show binlog events in 'master-bin.000002' from ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # use `test`; create table t2 (id int not null primary key auto_increment) -master-bin.000002 # Begin_load_query # # ;file_id=#;block_len=# -master-bin.000002 # Append_block # # ;file_id=#;block_len=# -master-bin.000002 # Append_block # # ;file_id=#;block_len=# -master-bin.000002 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# +master-bin.000001 # Query # # use `test`; create table t2 (id int not null primary key auto_increment) +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Append_block # # ;file_id=#;block_len=# +master-bin.000001 # Append_block # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# +==== Verify results on slave ==== +[on slave] select count(*) from t2 /* 5 000 */; count(*) 5000 -drop table t1, t2; -end of the tests +==== Clean up ==== +[on master] +drop table t2; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-test/suite/rpl/t/rpl_loaddata_map.test index 6a8378c8fdc..ddee9e7e989 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test @@ -1,7 +1,16 @@ +# ==== Purpose ==== # # check replication of load data with the server parameters subjected to # read_buffer_size > max_allowed_packet # +# ==== Implementation ==== +# +# Insert many rows into t1, write t1 to file. +# Load the file into t2. +# See that t2 came out as expected on slave. +# +# ==== Related Bugs ==== +# # BUG#30435 loading large LOAD DATA INFILE breaks slave with # read_buffer_size set on master # BUG#33413 show binlog events fails if binlog has event size of close @@ -9,10 +18,17 @@ source include/have_binlog_format_mixed_or_statement.inc; source include/master-slave.inc; -source include/have_innodb.inc; -source include/have_binlog_format_mixed_or_statement.inc; + + +--echo ==== Create a big file ==== + +# We turn off binlogging to avoid too much noise in the binlog. t1 is +# just an auxiliary construction anyways, it is not needed on the +# slave. --disable_query_log +SET @@sql_log_bin= 0; + let $rows= 5000; create table t1 (id int not null primary key auto_increment); @@ -22,10 +38,13 @@ while($rows) dec $rows; } eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1; -flush logs; + +DROP TABLE t1; +SET @@sql_log_bin= 1; --enable_query_log -connection master; + +--echo ==== Load our big file into a table ==== create table t2 (id int not null primary key auto_increment); select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; @@ -34,21 +53,21 @@ select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2; select count(*) from t2 /* 5 000 */; -# the binglog will show fragmented Append_block events ---let $binlog_start=106 ---replace_column 2 # 4 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start ---eval show binlog events in 'master-bin.000002' from $binlog_start +# the binlog will show fragmented Append_block events +source include/show_binlog_events.inc; +--echo ==== Verify results on slave ==== + +--echo [on slave] sync_slave_with_master; -#connection slave; select count(*) from t2 /* 5 000 */; + +--echo ==== Clean up ==== + +--echo [on master] connection master; -drop table t1, t2; +drop table t2; sync_slave_with_master; remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt; - ---echo end of the tests From 38376746e3f2bd5775aced5a952ad6a912ebd4ec Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Fri, 18 Jul 2008 15:07:14 +0200 Subject: [PATCH 03/14] BUG#38077: rpl_incident At line 22: query 'SELECT * ...' Table 'test.t1' doesn't exist This is not a fix to the bug. It only adds debug info, so that we can analyze the bug better next time it happens. Please revert the patch after the bug is fixed. --- mysql-test/suite/rpl/t/rpl_incident.test | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index 507cd0e0798..e99b88899bf 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -19,6 +19,37 @@ connection slave; # The 4 should not be inserted into the table, since the incident log # event should have stop the slave. --echo **** On Slave **** +#### BEGIN DEBUG INFO ADDED BY SVEN 2008-07-18 -- SEE BUG#38077 #### +let $tables= query_get_value(SHOW TABLES, Tables_in_test, 1); +if (`SELECT '$tables' != 't1'`) +{ + --echo **** TEST CASE BUG! PRINTING DEBUG INFO! **** + --echo **** Dear developer, if you see this in the output of a test + --echo **** case run, please add all the information below as a + --echo **** comment to BUG#38077. If it's a pushbuild failure, please + --echo **** include a link to the push page. + --echo **** Thank you! /Sven + SHOW BINLOG EVENTS; + --echo **** master binlog **** + --error 0,1 + --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 + --echo **** slave binlog **** + --error 0,1 + --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/slave-bin.000001 + --echo **** slave status **** + query_vertical SHOW SLAVE STATUS; + --echo **** slave's master status **** + SHOW MASTER STATUS; + --echo **** slave binlog events **** + --echo [on master] + connection master; + --echo **** master status **** + SHOW MASTER STATUS; + --echo **** master binlog events **** + SHOW BINLOG EVENTS; + exit; +} +#### END DEBUG INFO #### SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT From bb945f70a1204990e6bd56554a1d17dfebff26fe Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 12:13:55 +0200 Subject: [PATCH 04/14] BUG#37493: rpl_trunc_temp.test nondeterministic Problem: the test waits for a 'DROP TEMPORARY TABLE' event to appear in the master's binlog, then checks on the slave whether the number of temporary tables has decreased. The slave does not sync, causing a race. Fix: check for the 'DROP TEMPORARY TABLE' event on slave instead of on master. --- mysql-test/suite/rpl/t/rpl_trunc_temp.test | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test index 93308e3eb3f..88ecb7c18b0 100644 --- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test +++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test @@ -1,13 +1,30 @@ -# Requires statement logging +# ==== Purpose ==== +# +# Verify that Slave_open_temp_tables is increased when a temporary +# table is opened on the slave, and decreased when a temporary table +# is closed on the slave, and that it is preserved during 'DELETE FROM +# table' and 'TRUNCATE table'. +# +# ==== Method ==== +# +# Create a temporary table on master, insert rows, and try: +# - delete rows from the table +# - truncate the table +# - drop the table +# +# ==== Related bugs ==== +# +# BUG#17137 Running "truncate table" on temporary table leaves the table open on a slave +# +# Bug in this test: BUG#37493: rpl_trunc_temp.test nondeterministic + + +# Requires statement-based logging since temporary tables are not +# logged in row-based logging -- source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; -# -# Bug#17137 Running "truncate table" on temporary table -# leaves the table open on a slave -# - create temporary table t1 (n int); insert into t1 values(1); sync_slave_with_master; @@ -28,13 +45,10 @@ show status like 'Slave_open_temp_tables'; # Disconnect the master, temp table on slave should dissapear disconnect master; -connection master1; -# Wait until drop of temp tables appers in binlog +connection slave; + +# Wait until drop of temp tables appers in slave's binlog let $wait_binlog_event= DROP; source include/wait_for_binlog_event.inc; -connection slave; show status like 'Slave_open_temp_tables'; - - -# End of 4.1 tests From fc0f24812f9ac23e55489f9c3b97e38c6033aac7 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 18:56:39 +0200 Subject: [PATCH 05/14] BUG#38068: binlog_stm_binlog fails sporadically in pushbuild Problem: binlog_stm_binlog runs INSERT DELAYED queries, and then prints the contents of the binlog. Before checking the contents of the binlog, the test waits until the rows have appeared in the table. However, this is not enough, since INSERT DELAYED does not write rows to the binlog at the same time as it writes them to the table. So there is a race. Fix: Add a FLUSH TABLES before SHOW BINLOG EVENTS. That waits until the insert_delayed thread is done. --- .../binlog_tests/binlog_insert_delayed.test | 56 +++++++++++++------ .../suite/binlog/r/binlog_stm_binlog.result | 4 +- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test index d073c8ef227..c99d0b86be3 100644 --- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -1,17 +1,43 @@ -# Test of binlogging of INSERT_ID with INSERT DELAYED +# ==== Purpose ==== +# +# Verify that INSERT DELAYED in mixed or row mode writes events to the +# binlog, and that AUTO_INCREMENT works correctly. +# +# ==== Method ==== +# +# Insert both single and multiple rows into an autoincrement column, +# both with specified value and with NULL. +# +# With INSERT DELAYED, the rows do not show up in the table +# immediately, so we must do source include/wait_until_rows_count.inc +# between any two INSERT DELAYED statements. Moreover, if mixed or +# row-based logging is used, there is also a delay between when rows +# show up in the table and when they show up in the binlog. To ensure +# that the rows show up in the binlog, we call FLUSH TABLES, which +# waits until the delayed_insert thread has finished. +# +# We cannot read the binlog after executing INSERT DELAYED statements +# that insert multiple rows, because that is nondeterministic. More +# precisely, rows may be written in batches to the binlog, where each +# batch has one Table_map_log_event and one or more +# Write_rows_log_event. The number of rows included in each batch is +# nondeterministic. +# +# ==== Related bugs ==== +# +# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables +# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild + + create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -# First, avoid BUG#20627: -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; -# Verify that only one INSERT_ID event is binlogged. -# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed + let $table=t1; -let $rows_inserted=11; # total number of inserted rows in this test +let $count=0; + insert delayed into t1 values (207); -let $count=1; - -# use this macro instead of sleeps. - +inc $count; --source include/wait_until_rows_count.inc + insert delayed into t1 values (null); inc $count; --source include/wait_until_rows_count.inc @@ -20,9 +46,10 @@ insert delayed into t1 values (300); inc $count; --source include/wait_until_rows_count.inc -# moving binlog check affront of multi-rows queries which work is indeterministic (extra table_maps) -# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably bug#19459 is in -# the way +# It is not enough to wait until all rows have been inserted into the +# table. FLUSH TABLES ensures that they are in the binlog too. See +# comment above. +FLUSH TABLES; source include/show_binlog_events.inc; insert delayed into t1 values (null),(null),(null),(null); @@ -33,8 +60,5 @@ insert delayed into t1 values (null),(null),(400),(null); inc $count; inc $count; inc $count; inc $count; --source include/wait_until_rows_count.inc -#check this assertion about $count calculation ---echo $count == $rows_inserted - select * from t1; drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 20d7281d5cc..ae8c1e11737 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -629,10 +629,10 @@ master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('An master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); +FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) @@ -660,9 +660,9 @@ master-bin.000001 # Query # # use `test`; 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 # # use `test`; COMMIT +master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); -11 == 11 select * from t1; a 207 From 3d5289c2dd28afab9aa640091ef129416b26414e Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 29 Jul 2008 17:36:13 +0200 Subject: [PATCH 06/14] BUG#38068: binlog_stm_binlog fails sporadically in pushbuild Post-push fix: updated some result files that were affected by the previous fix to this bug. --- mysql-test/suite/binlog/r/binlog_killed_simulate.result | 2 +- mysql-test/suite/binlog/r/binlog_row_binlog.result | 4 ++-- mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result | 2 +- .../suite/binlog/r/binlog_statement_insert_delayed.result | 4 ++-- mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result | 4 ++-- mysql-test/suite/rpl/r/rpl_stm_log.result | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_killed_simulate.result b/mysql-test/suite/binlog/r/binlog_killed_simulate.result index c0087316420..66d3a86cd5a 100644 --- a/mysql-test/suite/binlog/r/binlog_killed_simulate.result +++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result @@ -18,7 +18,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "kil ERROR 70100: Query execution was interrupted show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=# select (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index f830b69bf9d..9668c7ce5ea 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1141,10 +1141,10 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `mysql`; COMMIT drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); +FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) @@ -1188,9 +1188,9 @@ master-bin.000001 # Query # # use `test`; 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 # # use `test`; COMMIT +master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); -11 == 11 select * from t1; a 207 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 419aea5b581..7106480663f 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 @@ -926,7 +926,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 3a2dc441632..800bb58e9cc 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -1,8 +1,8 @@ create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); +FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam @@ -10,9 +10,9 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207) master-bin.000001 # Intvar # # INSERT_ID=208 master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) +master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); -11 == 11 select * from t1; a 207 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 60104a64d94..3d71f333852 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 @@ -623,7 +623,7 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # use `test`; ROLLBACK @@ -858,7 +858,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result index 18333f5e5e9..d29b4c92590 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -196,7 +196,7 @@ master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; From 021d7d72f899c0734a086dde71a599af92c63cfe Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Thu, 31 Jul 2008 15:47:57 -0600 Subject: [PATCH 07/14] Cherry-pick InnoDB fixes for Bug#34286, Bug#35352, and Bug#36600 from snapshot innodb-5.0-ss2475. Bug #34286 Assertion failure in thread 2816 in file .\row\row0sel.c line 3500 Since autoinc init performs a MySQL SELECT query to determine the auto-inc value, set prebuilt->sql_stat_start = TRUE so that it is performed like any normal SELECT, regardless of the context in which it was invoked. Bug #35352 If InnoDB crashes with UNDO slots full error the error persists on restart We've added a heuristic that checks the size of the UNDO slots cache lists (insert and upate). If either of cached lists has more than 500 entries then we add any UNDO slots that are freed, to the common free list instead of the cache list, this is to avoid the case where all the free slots end up in only one of the lists on startup after a crash. Tested with test case for 26590 and passes all mysql-test(s). Bug #36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. --- innobase/buf/buf0buf.c | 2 ++ innobase/include/buf0buf.h | 13 +++++---- innobase/include/srv0srv.h | 2 ++ innobase/include/trx0undo.h | 1 + innobase/srv/srv0srv.c | 2 ++ innobase/trx/trx0trx.c | 8 +++--- innobase/trx/trx0undo.c | 29 ++++++++++++++++----- mysql-test/r/innodb-autoinc-optimize.result | 6 +++++ mysql-test/t/innodb-autoinc-optimize.test | 16 ++++++++++++ sql/ha_innodb.cc | 10 ++++++- 10 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 mysql-test/r/innodb-autoinc-optimize.result create mode 100644 mysql-test/t/innodb-autoinc-optimize.test diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 9df48495355..6cfcb0fc724 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -2260,6 +2260,7 @@ buf_print(void) ut_a(buf_validate()); } +#ifdef UNIV_DEBUG /************************************************************************* Returns the number of latched pages in the buffer pool. */ @@ -2290,6 +2291,7 @@ buf_get_latched_pages_number(void) mutex_exit(&(buf_pool->mutex)); return fixed_pages_number; } +#endif /* UNIV_DEBUG */ /************************************************************************* Returns the number of pending buf pool ios. */ diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index 11e5bb39e63..f802ffa6510 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */ void buf_print(void); /*============*/ + +/************************************************************************* +Returns the number of latched pages in the buffer pool. */ + +ulint +buf_get_latched_pages_number(void); +/*==============================*/ #endif /* UNIV_DEBUG */ + /************************************************************************ Prints a page to stderr. */ @@ -503,12 +511,7 @@ void buf_page_print( /*===========*/ byte* read_buf); /* in: a database page */ -/************************************************************************* -Returns the number of latched pages in the buffer pool. */ -ulint -buf_get_latched_pages_number(void); -/*==============================*/ /************************************************************************* Returns the number of pending buf pool ios. */ diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index f379efa98eb..97e9136040d 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -531,7 +531,9 @@ struct export_var_struct{ ulint innodb_buffer_pool_pages_dirty; ulint innodb_buffer_pool_pages_misc; ulint innodb_buffer_pool_pages_free; +#ifdef UNIV_DEBUG ulint innodb_buffer_pool_pages_latched; +#endif /* UNIV_DEBUG */ ulint innodb_buffer_pool_read_requests; ulint innodb_buffer_pool_reads; ulint innodb_buffer_pool_wait_free; diff --git a/innobase/include/trx0undo.h b/innobase/include/trx0undo.h index bd7337e4f90..4f1847aa88c 100644 --- a/innobase/include/trx0undo.h +++ b/innobase/include/trx0undo.h @@ -237,6 +237,7 @@ trx_undo_set_state_at_finish( /*=========================*/ /* out: undo log segment header page, x-latched */ + trx_rseg_t* rseg, /* in: rollback segment memory object */ trx_t* trx, /* in: transaction */ trx_undo_t* undo, /* in: undo log memory copy */ mtr_t* mtr); /* in: mtr */ diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 1227824ef80..431138400b6 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1803,7 +1803,9 @@ srv_export_innodb_status(void) export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU); export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list); export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free); +#ifdef UNIV_DEBUG export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number(); +#endif /* UNIV_DEBUG */ export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size; export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size - UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free); diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index d865c709bf6..70fd73f2488 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -761,8 +761,8 @@ trx_commit_off_kernel( mutex_enter(&(rseg->mutex)); if (trx->insert_undo != NULL) { - trx_undo_set_state_at_finish(trx, trx->insert_undo, - &mtr); + trx_undo_set_state_at_finish( + rseg, trx, trx->insert_undo, &mtr); } undo = trx->update_undo; @@ -777,8 +777,8 @@ trx_commit_off_kernel( because only a single OS thread is allowed to do the transaction commit for this transaction. */ - update_hdr_page = trx_undo_set_state_at_finish(trx, - undo, &mtr); + update_hdr_page = trx_undo_set_state_at_finish( + rseg, trx, undo, &mtr); /* We have to do the cleanup for the update log while holding the rseg mutex because update log headers diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c index 7441dd3f152..251cd355897 100644 --- a/innobase/trx/trx0undo.c +++ b/innobase/trx/trx0undo.c @@ -1724,6 +1724,7 @@ trx_undo_set_state_at_finish( /*=========================*/ /* out: undo log segment header page, x-latched */ + trx_rseg_t* rseg, /* in: rollback segment memory object */ trx_t* trx __attribute__((unused)), /* in: transaction */ trx_undo_t* undo, /* in: undo log memory copy */ mtr_t* mtr) /* in: mtr */ @@ -1732,8 +1733,10 @@ trx_undo_set_state_at_finish( trx_upagef_t* page_hdr; page_t* undo_page; ulint state; - - ut_ad(trx && undo && mtr); + + ut_ad(trx); + ut_ad(undo); + ut_ad(mtr); if (undo->id >= TRX_RSEG_N_SLOTS) { fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", @@ -1747,9 +1750,23 @@ trx_undo_set_state_at_finish( seg_hdr = undo_page + TRX_UNDO_SEG_HDR; page_hdr = undo_page + TRX_UNDO_PAGE_HDR; - if (undo->size == 1 && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE) - < TRX_UNDO_PAGE_REUSE_LIMIT) { - state = TRX_UNDO_CACHED; + if (undo->size == 1 + && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE) + < TRX_UNDO_PAGE_REUSE_LIMIT) { + + /* This is a heuristic to avoid the problem of all UNDO + slots ending up in one of the UNDO lists. Previously if + the server crashed with all the slots in one of the lists, + transactions that required the slots of a different type + would fail for lack of slots. */ + + if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500 + && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) { + + state = TRX_UNDO_CACHED; + } else { + state = TRX_UNDO_TO_FREE; + } } else if (undo->type == TRX_UNDO_INSERT) { @@ -1759,7 +1776,7 @@ trx_undo_set_state_at_finish( } undo->state = state; - + mlog_write_ulint(seg_hdr + TRX_UNDO_STATE, state, MLOG_2BYTES, mtr); return(undo_page); diff --git a/mysql-test/r/innodb-autoinc-optimize.result b/mysql-test/r/innodb-autoinc-optimize.result new file mode 100644 index 00000000000..61739f0713a --- /dev/null +++ b/mysql-test/r/innodb-autoinc-optimize.result @@ -0,0 +1,6 @@ +drop table if exists t1; +create table t1(a int not null auto_increment primary key) engine=innodb; +insert into t1 set a = -1; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK diff --git a/mysql-test/t/innodb-autoinc-optimize.test b/mysql-test/t/innodb-autoinc-optimize.test new file mode 100644 index 00000000000..c7e22a8ff40 --- /dev/null +++ b/mysql-test/t/innodb-autoinc-optimize.test @@ -0,0 +1,16 @@ +-- source include/have_innodb.inc +# embedded server ignores 'delayed', so skip this +-- source include/not_embedded.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Bug 34286 +# +create table t1(a int not null auto_increment primary key) engine=innodb; +insert into t1 set a = -1; +# NOTE: The database needs to be shutdown and restarted (here) for +# the test to work. It's included for reference only. +optimize table t1; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 1be6137460b..1c0f8a6e9b3 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -244,8 +244,10 @@ struct show_var_st innodb_status_variables[]= { (char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG}, {"buffer_pool_pages_free", (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG}, +#ifdef UNIV_DEBUG {"buffer_pool_pages_latched", (char*) &export_vars.innodb_buffer_pool_pages_latched, SHOW_LONG}, +#endif /* UNIV_DEBUG */ {"buffer_pool_pages_misc", (char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG}, {"buffer_pool_pages_total", @@ -4250,7 +4252,7 @@ ha_innobase::rnd_pos( int error; uint keynr = active_index; DBUG_ENTER("rnd_pos"); - DBUG_DUMP("key", (uchar *)pos, ref_length); + DBUG_DUMP("key", (uchar*) pos, ref_length); statistic_increment(current_thd->status_var.ha_read_rnd_count, &LOCK_status); @@ -6882,6 +6884,12 @@ ha_innobase::innobase_read_and_init_auto_inc( from a table when no table has been locked in ::external_lock(). */ prebuilt->trx->n_mysql_tables_in_use++; + /* Since we will perform a MySQL SELECT query to determine the + auto-inc value, set prebuilt->sql_stat_start = TRUE so that it + is performed like any normal SELECT, regardless of the context + we come here. */ + prebuilt->sql_stat_start = TRUE; + error = index_last(table->record[1]); prebuilt->trx->n_mysql_tables_in_use--; From 4ea036f4cb7ed19d1944259fcba0a337443dbc85 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Thu, 7 Aug 2008 18:25:24 -0600 Subject: [PATCH 08/14] Cherry-pick fix for Bug#35220 from innodb-5.0-ss2475 snapshot. Bug#35220: ALTER TABLE too picky on reserved word "foreign" In ALTER TABLE, change the internal parser to search for ``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken with ALTER TABLE ... DROP foreign_col; (This fix is already present in MySQL 5.1 and higher.) --- innobase/dict/dict0dict.c | 2 +- mysql-test/r/innodb_bug35220.result | 1 + mysql-test/t/innodb_bug35220.test | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/innodb_bug35220.result create mode 100644 mysql-test/t/innodb_bug35220.test diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 96c822857df..b8d9f362b06 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -3554,7 +3554,7 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); - if (!success) { + if (!success || !ib_isspace(*ptr)) { goto loop; } diff --git a/mysql-test/r/innodb_bug35220.result b/mysql-test/r/innodb_bug35220.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/r/innodb_bug35220.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/t/innodb_bug35220.test b/mysql-test/t/innodb_bug35220.test new file mode 100644 index 00000000000..26f7d6b1ddd --- /dev/null +++ b/mysql-test/t/innodb_bug35220.test @@ -0,0 +1,16 @@ +# +# Bug#35220 ALTER TABLE too picky on reserved word "foreign" +# http://bugs.mysql.com/35220 +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not produce errors +-- disable_query_log +-- disable_result_log + +CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT); +ALTER TABLE bug35220 DROP foreign_col; +DROP TABLE bug35220; From 87b43cf0df055f15187d1b53d0834a505e39dbb6 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Tue, 12 Aug 2008 17:09:36 +0800 Subject: [PATCH 09/14] Apply tomas's patch to fix rpl_row_basic.test, this can fix BUG#37884, BUG#38369, enable rpl_row_basic_7ndb test --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 68 +++++++++++------- .../suite/rpl/r/rpl_row_basic_2myisam.result | 26 ++++--- .../suite/rpl/r/rpl_row_basic_3innodb.result | 26 ++++--- .../suite/rpl_ndb/r/rpl_row_basic_7ndb.result | 71 ++++++++++++++++++- mysql-test/suite/rpl_ndb/t/disabled.def | 1 - 5 files changed, 146 insertions(+), 46 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 4be7ad54cb3..91894e12726 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -309,52 +309,54 @@ sync_slave_with_master; # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8 connection master; -CREATE TABLE t1 (i INT NOT NULL, - c CHAR(16) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t1 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; -CREATE TABLE t2 (i INT NOT NULL, - c CHAR(16) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t2 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t3 (i INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t3 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t4 (i INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t4 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; -CREATE TABLE t5 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t5 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t6 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t6 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t7 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t7 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; --echo [expecting slave to replicate correctly] connection master; INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t1; let $diff_table_2=slave:test.t1; source include/diff_tables.inc; @@ -364,6 +366,8 @@ connection master; INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t2; let $diff_table_2=slave:test.t2; source include/diff_tables.inc; @@ -379,7 +383,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -388,6 +396,8 @@ connection master; INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t4; let $diff_table_2=slave:test.t4; source include/diff_tables.inc; @@ -403,7 +413,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -418,7 +432,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -427,6 +445,8 @@ connection master; INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t7; let $diff_table_2=slave:test.t7; source include/diff_tables.inc; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index a001a771541..4cb1b037345 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -453,29 +453,29 @@ a b c DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); @@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index b67902f414a..913ca8d4a49 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -453,29 +453,29 @@ a b c DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); @@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result index b1554bec156..c2cbb6885f2 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result @@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; Last_SQL_Error -0 + SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -451,3 +451,72 @@ SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE t1 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +CREATE TABLE t2 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t3 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t4 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +CREATE TABLE t5 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t6 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t7 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +[expecting slave to replicate correctly] +INSERT INTO t1 VALUES (1, "", 1); +INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t1 and slave:test.t1 +[expecting slave to replicate correctly] +INSERT INTO t2 VALUES (1, "", 1); +INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t2 and slave:test.t2 +[expecting slave to stop] +INSERT INTO t3 VALUES (1, "", 1); +INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t4 VALUES (1, "", 1); +INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +Comparing tables master:test.t4 and slave:test.t4 +[expecting slave to stop] +INSERT INTO t5 VALUES (1, "", 1); +INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to stop] +INSERT INTO t6 VALUES (1, "", 1); +INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t7 VALUES (1, "", 1); +INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +Comparing tables master:test.t7 and slave:test.t7 +drop table t1, t2, t3, t4, t5, t6, t7; diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 7010fba26b2..ebc99feeac6 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -12,6 +12,5 @@ rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication. rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication. -rpl_row_basic_7ndb : Bug#38369 rpl_ndb.rpl_row_basic_7ndb fails # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open From 1ae849bbdd5d6f71d329dd841909a83cc09cd76f Mon Sep 17 00:00:00 2001 From: "timothy.smith@sun.com" <> Date: Wed, 13 Aug 2008 11:05:24 +0200 Subject: [PATCH 10/14] Raise version number after cloning 5.0.68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index ab56fc24c71..e302aaa5c4a 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.68) +AM_INIT_AUTOMAKE(mysql, 5.0.69) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=68 +NDB_VERSION_BUILD=69 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From d2c1c3977b0a9180bf66a59a998fcfb01dabecef Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Wed, 13 Aug 2008 12:34:35 +0200 Subject: [PATCH 11/14] Correct the version number to 5.0.70. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e302aaa5c4a..bd993bb5fcf 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.69) +AM_INIT_AUTOMAKE(mysql, 5.0.70) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=69 +NDB_VERSION_BUILD=70 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 35e47b31a283add902d87f36caf4aeaefd0dd098 Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Wed, 13 Aug 2008 23:12:51 +0400 Subject: [PATCH 12/14] Bug#18817, removing --binlog-format option from .opt files --- mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt | 1 - mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt | 1 - mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt | 1 - mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt delete mode 100644 mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt delete mode 100644 mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt diff --git a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt deleted file mode 100644 index 83ed8522e72..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=row diff --git a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt deleted file mode 100644 index 4cb7a31da81..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=statement --log-slave-updates diff --git a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt deleted file mode 100644 index 01cf3e0520f..00000000000 --- a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=mixed diff --git a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test index 4ee6c98d463..5381dff95a3 100644 --- a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test +++ b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test @@ -1,6 +1,6 @@ # Same test as rpl_truncate_7ndb.test, but with mixed mode # This is marked with 'big_test' just because the rpl_truncate_7ndb test is # so slow... - +--source include/have_binlog_format_mixed.inc --source include/big_test.inc --source t/rpl_truncate_7ndb.test From 316e463cc5822e9f6b3920cfb70ff24bd9069282 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Thu, 14 Aug 2008 10:42:10 +0800 Subject: [PATCH 13/14] BUG#38290 valgrind warnings in binlog_base64_flag The problem was because the event allocated in mysql_client_binlog_statement was not freed when an error occured while applying the event. --- sql/sql_binlog.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index a6d0c8c9e9b..7ca7bef3a56 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -208,6 +208,7 @@ void mysql_client_binlog_statement(THD* thd) #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) if (apply_event_and_update_pos(ev, thd, thd->rli_fake, FALSE)) { + delete ev; /* TODO: Maybe a better error message since the BINLOG statement now contains several events. From e2516c53fe61cbef96477b546c7bd82dd13b93f9 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Thu, 14 Aug 2008 16:27:28 +0800 Subject: [PATCH 14/14] fix after merge --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index af7b72e4b34..534842218b9 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -356,8 +356,6 @@ INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); sync_slave_with_master; -sync_slave_with_master; - let $diff_table_1=master:test.t1; let $diff_table_2=slave:test.t1; source include/diff_tables.inc; @@ -368,8 +366,6 @@ INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); sync_slave_with_master; -sync_slave_with_master; - let $diff_table_1=master:test.t2; let $diff_table_2=slave:test.t2; source include/diff_tables.inc; @@ -399,8 +395,6 @@ INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); sync_slave_with_master; -sync_slave_with_master; - let $diff_table_1=master:test.t4; let $diff_table_2=slave:test.t4; source include/diff_tables.inc; @@ -449,8 +443,6 @@ INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); sync_slave_with_master; -sync_slave_with_master; - let $diff_table_1=master:test.t7; let $diff_table_2=slave:test.t7; source include/diff_tables.inc;