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