From d8c838c27af0a5e07754d12360cad0c842c857e3 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 16:34:02 +0200 Subject: BUG#37733: rpl.rpl_flushlog_loop 'row' fails sporadically on pushbuild BUG#37884: rpl_row_basic_2myisam and rpl_row_basic_3innodb fail sporadically in pushbuild These have been fixed in 5.1-rpl. Re-applying fix for BUG#37884 in 5.1-bugteam, and disabling rpl_flushlog_loop for BUG#37733 in 5.1-bugteam. mysql-test/extra/rpl_tests/rpl_row_basic.test: Missing sync_slave_with_master added. mysql-test/suite/rpl/t/disabled.def: Disabling rpl_flushlog_loop until the fixed version gets merged from 5.1-rpl --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/extra') diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 4be7ad54cb3..f609b644726 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -354,6 +354,7 @@ CREATE TABLE t7 (i INT NOT NULL, 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; @@ -363,6 +364,7 @@ source include/diff_tables.inc; 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; @@ -387,6 +389,7 @@ source include/wait_for_slave_to_start.inc; 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; @@ -426,6 +429,7 @@ source include/wait_for_slave_to_start.inc; 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; -- cgit v1.2.1 From 159505f82bce7914a8d0b56337454bbb46478658 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 18:56:39 +0200 Subject: 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. mysql-test/extra/binlog_tests/binlog_insert_delayed.test: - Added FLUSH TABLES, so that SHOW BINLOG EVENTS becomes deterministic. - Added comments. - Removed unnecessary 'set @@session.auto_increment_increment' statements. - Removed unnecessary check that the number of rows inserted to the table is 11. mysql-test/suite/binlog/r/binlog_stm_binlog.result: updated result file --- .../extra/binlog_tests/binlog_insert_delayed.test | 56 +++++++++++++++------- 1 file changed, 40 insertions(+), 16 deletions(-) (limited to 'mysql-test/extra') 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 -insert delayed into t1 values (207); -let $count=1; -# use this macro instead of sleeps. +let $table=t1; +let $count=0; +insert delayed into t1 values (207); +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; -- cgit v1.2.1 From 44d0fcddf1fa63510dfddc80c4bf4f224839d006 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Tue, 12 Aug 2008 17:09:36 +0800 Subject: 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 +++++++++++++++++---------- 1 file changed, 44 insertions(+), 24 deletions(-) (limited to 'mysql-test/extra') 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; -- cgit v1.2.1 From 193a8f973598d573ab8cc633f143fd1dfa4195bf Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Thu, 14 Aug 2008 16:27:28 +0800 Subject: fix after merge mysql-test/extra/rpl_tests/rpl_row_basic.test: remove extra sync_slave_with_master --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 8 -------- 1 file changed, 8 deletions(-) (limited to 'mysql-test/extra') 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; -- cgit v1.2.1