diff options
Diffstat (limited to 'mysql-test/suite/rpl_ndb/r')
41 files changed, 198 insertions, 377 deletions
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result index 28ca1ac43b9..eae70ca5a69 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] SET storage_engine=ndb; === NDB -> MYISAM === @@ -805,3 +801,4 @@ TRUNCATE TABLE t1; DROP TABLE IF EXISTS t1; drop table mysql.ndb_apply_status; set @@global.slave_exec_mode= @old_slave_exec_mode; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result index 6babf49dcaa..136aee25fe2 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=NDB; @@ -38,3 +34,4 @@ DROP PROCEDURE test.p1; DROP FUNCTION test.fn1; DROP TABLE test.t1; DROP TABLE test.t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result index 0fcd361da21..5e44591f87e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] *** on slave there should be zero rows *** select count(*) from mysql.ndb_apply_status; count(*) @@ -18,3 +14,4 @@ select count(*) from mysql.ndb_apply_status; count(*) 1 drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result index dd4cc90a75f..c537fb85ad2 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] ***************** Test 1 ************************ CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3; @@ -168,3 +164,4 @@ a 32 42 drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result index d43165e2b5e..6109ea0b742 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0', `nom` char(4) default NULL, `prenom` char(4) default NULL, @@ -140,7 +136,8 @@ set GLOBAL slave_transaction_retries=1; **** On Master **** UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1; **** On Slave **** -Last_SQL_Error = Could not execute Write_rows event on table test.t1; Got temporary error 266 'Time-out in NDB, probably caused by deadlock' from NDB, Error_code: 1297; Lock wait timeout exceeded; try restarting transaction, Error_code: 1205; handler error HA_ERR_LOCK_WAIT_TIMEOUT; the event's master log master-bin.000001, end_log_pos 6834 +include/wait_for_slave_sql_error.inc [errno=1205 ] +Last_SQL_Error = 'Could not execute Write_rows event on table test.t1; Got temporary error 266 'Time-out in NDB, probably caused by deadlock' from NDB, Error_code: 1297; Lock wait timeout exceeded; try restarting transaction, Error_code: 1205; handler error HA_ERR_LOCK_WAIT_TIMEOUT; the event's master log master-bin.000001, end_log_pos 6834' set GLOBAL slave_transaction_retries=10; include/start_slave.inc select * from t1 order by nid; @@ -191,3 +188,4 @@ c1 104 105 DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result index c11de8c27e3..537af85d766 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] create table t1 ( a int not null primary key, b text not null @@ -133,3 +129,4 @@ S testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15 S testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25 S testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35 drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result index 055efffbd6a..4fb33dc4b6b 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; ***** Table Create Section **** @@ -154,3 +150,4 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result index dfbd7a37d8e..7ff7830449f 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result @@ -1,12 +1,6 @@ -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; -RESET MASTER; -CHANGE MASTER TO master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; -START SLAVE; +include/rpl_init.inc [topology=1->2->1] +include/rpl_connect.inc [creating master] +include/rpl_connect.inc [creating slave] CREATE TABLE t1 (a int key, b int) ENGINE=ndb; SHOW TABLES; Tables_in_test @@ -17,11 +11,12 @@ SELECT * FROM t1 ORDER BY a; a b 1 2 2 3 -Checking that both slave threads are running. +include/check_slave_is_running.inc SELECT * FROM t1 ORDER BY a; a b 1 2 2 3 -Checking that both slave threads are running. +include/check_slave_is_running.inc STOP SLAVE; DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result index b7d4a3d76db..75aa37f99f3 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result @@ -1,21 +1,8 @@ -STOP SLAVE; -STOP SLAVE; -STOP SLAVE; -STOP SLAVE; -DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; -RESET MASTER; -DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; -RESET MASTER; -DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; -RESET MASTER; -DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; -RESET MASTER; -RESET SLAVE; -CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_MYPORT,master_user='root'; -START SLAVE; -RESET SLAVE; -CHANGE MASTER TO master_host='127.0.0.1',master_port=SLAVE_MYPORT1,master_user='root'; -START SLAVE; +include/rpl_init.inc [topology=1->2,4->3] +include/rpl_connect.inc [creating master] +include/rpl_connect.inc [creating master1] +include/rpl_connect.inc [creating slave] +include/rpl_connect.inc [creating slave1] *** Check server_id of mysqld servers *** SHOW VARIABLES LIKE "server_id"; @@ -45,20 +32,20 @@ CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, *** Basic testing *** Insert rows via all hosts Check data on both clusters -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] *** Transaction testing *** BEGIN; BEGIN; COMMIT; COMMIT; Check data on both clusters -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] BEGIN; BEGIN; ROLLBACK; ROLLBACK; Check data on both clusters -Comparing tables master:test.t1 and slave:test.t1 -DROP TABLE t1; +include/diff_tables.inc [master:t1, slave:t1] DROP TABLE IF EXISTS t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result index 99438d663bb..f3a4c132ee3 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (a int key, b int) ENGINE=NDB; SHOW TABLES; Tables_in_test @@ -12,9 +8,9 @@ RESET MASTER; INSERT INTO t1 VALUES (1,2); INSERT INTO t1 VALUES (2,3); STOP SLAVE; -CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=SLAVE_PORT,MASTER_USER="root"; +include/rpl_change_topology.inc [new topology=1->2->1] START SLAVE; -Checking that both slave threads are running. +include/check_slave_is_running.inc SELECT * FROM t1 ORDER BY a; a b 1 2 @@ -25,5 +21,6 @@ SELECT * FROM t1 ORDER BY a; a b 1 2 2 3 -Checking that both slave threads are running. +include/check_slave_is_running.inc DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result index 3fc4ca26967..21546ed6524 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (a INT) ENGINE=NDB; begin; insert into t1 values(1); @@ -11,3 +7,4 @@ flush tables with read lock; commit; unlock tables; drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result index a6e2144f532..aa67c678773 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] show variables like 'collation_server'; Variable_name Value collation_server ucs2_unicode_ci @@ -25,3 +21,4 @@ nid nom prenom 1 XYZ1 ABC1 ==== clean up ==== DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result index 6a0c863440e..6fda18ba207 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP TABLE IF EXISTS t1; CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' @@ -70,3 +66,4 @@ drop datafile 'datafile02.dat' engine=ndb; DROP TABLESPACE ts1 ENGINE=NDB; DROP LOGFILE GROUP lg1 ENGINE=NDB; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result index c906f00bd40..acead977487 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] --- Doing pre test cleanup --- DROP TABLE IF EXISTS t1; CREATE LOGFILE GROUP lg1 @@ -788,3 +784,4 @@ drop datafile 'datafile02.dat' engine=ndb; DROP TABLESPACE ts1 ENGINE=NDB; DROP LOGFILE GROUP lg1 ENGINE=NDB; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result index e668b57293e..3ceb66f076a 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] -------- switch to master ------- SET AUTOCOMMIT = 1; @@ -1626,3 +1622,4 @@ use test; -------- switch to master ------- DROP DATABASE mysqltest1; DROP DATABASE mysqltest3; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result index 1cecb030181..5f61e4d7803 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] create table t1 (a int, b int) engine=NDB; insert into t1 values(1,1); select * from t1; @@ -13,3 +9,4 @@ delete from t1; select * from t1; a b drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result index 316f5fc7e31..6171d10657f 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP DATABASE IF EXISTS replica; CREATE DATABASE replica; CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB; @@ -56,3 +52,4 @@ Tables_in_test USE test; DROP TABLE t1, t2; DROP DATABASE IF EXISTS replica; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result index dda2844f6d0..6ac55944e33 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB; CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB; @@ -24,3 +20,4 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY' INSERT INTO t1 VALUES (3, repeat('bad too',1)); ERROR 23000: Duplicate entry '3' for key 'PRIMARY' DROP TABLE IF EXISTS t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index 1a79affabe6..9ae340d713e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); **** Diff Table Def Start **** *** On Slave *** @@ -54,7 +50,8 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -Last_SQL_Error = Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +include/wait_for_slave_sql_error.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.' STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -83,10 +80,8 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3' *** Drop t3 *** DROP TABLE t3; *** Create t4 on slave *** @@ -108,10 +103,8 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3' *** Drop t4 *** DROP TABLE t4; *** Create t5 on slave *** @@ -133,10 +126,8 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246' *** Drop t5 *** DROP TABLE t5; *** Create t6 on slave *** @@ -157,7 +148,8 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** -Last_SQL_Error = Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +include/wait_for_slave_sql_error.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -231,10 +223,8 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5' *** Drop t10 *** DROP TABLE t10; *** Create t11 on slave *** @@ -255,10 +245,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252' *** Drop t11 *** DROP TABLE t11; *** Create t12 on slave *** @@ -468,10 +456,8 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 1; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1060] +Last_SQL_Error = 'Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'' *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); SELECT * FROM t15 ORDER BY c1; @@ -571,9 +557,8 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1535 *** ******************************************** ---source include/wait_for_slave_sql_error_and_skip.inc -Last_SQL_Error = Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2; -include/start_slave.inc +include/wait_for_slave_sql_error_and_skip.inc [errno=1535] +Last_SQL_Error = 'Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2' ** DROP table t17 *** DROP TABLE t17; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result index 7e750f2ce2a..3829d1468fd 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CALL mtr.add_suppression('Statement may not be safe to log in statement format.'); DROP FUNCTION IF EXISTS test.f1; DROP TABLE IF EXISTS test.t1; @@ -28,3 +24,4 @@ ROLLBACK; SET AUTOCOMMIT=1; DROP FUNCTION test.f1; DROP TABLE test.t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result index e2755c04f28..019b8bc4cf0 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ; INSERT INTO t1 VALUES ("row1","will go away",1); SELECT * FROM t1 ORDER BY c3; @@ -32,11 +28,12 @@ SELECT * FROM t1 ORDER BY c3; c1 c2 c3 row3 C 3 row4 D 4 -Checking that both slave threads are running. +include/check_slave_is_running.inc STOP SLAVE; CHANGE MASTER TO master_log_file = 'master-bin.000001', master_log_pos = <the_pos> ; +include/check_slave_no_error.inc START SLAVE; SELECT * FROM t1 ORDER BY c3; c1 c2 c3 @@ -62,5 +59,6 @@ COMMIT; SELECT * FROM t1; c1 c2 c3 row2 new on slave 2 -Checking that both slave threads are running. +include/check_slave_is_running.inc DROP TABLE IF EXISTS t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result index 4c96ccf85ee..9fb019bf6e5 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] SET storage_engine=innodb; --- Doing pre test cleanup --- DROP TABLE IF EXISTS t1; @@ -917,3 +913,4 @@ DELETE FROM t1; --- End test 5 key partition testing --- --- Do Cleanup --- DROP TABLE IF EXISTS t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result index 7c3f331958f..a01841af003 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] create table t1 (a int, unique(a)) engine=ndbcluster; create table t2 (a int, unique(a)) engine=innodb; begin; @@ -101,3 +97,4 @@ select count(*) from t2; count(*) 0 drop table t1,t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result index 030845e89e2..195392ae0c5 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned, @@ -68,3 +64,4 @@ a b 5 5 6 6 drop table t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result index 85ecb13bd66..a20e5d03595 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] include/stop_slave.inc reset master; reset slave; @@ -256,18 +252,13 @@ slave-bin.000002 # Table_map # # table_id: # (mysql.ndb_apply_status) slave-bin.000002 # Write_rows # # table_id: # slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F slave-bin.000002 # Query # # COMMIT -Checking that both slave threads are running. +include/check_slave_is_running.inc show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; -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; +include/rpl_reset.inc create table t1(a int auto_increment primary key, b int); insert into t1 values (NULL, 1); set insert_id=5; @@ -289,3 +280,4 @@ a b 5 1 6 1 drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result index 7caa88a16a1..d8b01dc1f5b 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE tmyisam (a int) ENGINE = MYISAM; CREATE TABLE tinnodb (a int) ENGINE = INNODB; CREATE TABLE tndb (a int) ENGINE = NDB; @@ -477,10 +473,11 @@ a 151 152 [on slave] -Comparing tables master:test.tmyisam and slave:test.tmyisam -Comparing tables master:test.tinnodb and slave:test.tinnodb -Comparing tables master:test.tndb and slave:test.tndb +include/diff_tables.inc [master:tmyisam, slave:tmyisam] +include/diff_tables.inc [master:tinnodb, slave:tinnodb] +include/diff_tables.inc [master:tndb, slave:tndb] ==== Clean up ==== [on master] DROP TABLE tmyisam, tinnodb, tndb; [on slave] +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result index 92fda774da5..3e88f846164 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result @@ -1,10 +1,6 @@ ==== Initialization ==== -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; +include/master-slave.inc +[connection master] ---- setup master ---- CREATE TABLE myisam_innodb (a INT) ENGINE=MYISAM; CREATE TABLE innodb_myisam (a INT) ENGINE=INNODB; @@ -274,13 +270,14 @@ a 34 57 58 -Comparing tables master:test.myisam_innodb and slave:test.myisam_innodb -Comparing tables master:test.innodb_myisam and slave:test.innodb_myisam -Comparing tables master:test.myisam_ndb and slave:test.myisam_ndb -Comparing tables master:test.ndb_myisam and slave:test.ndb_myisam -Comparing tables master:test.innodb_ndb and slave:test.innodb_ndb -Comparing tables master:test.ndb_innodb and slave:test.ndb_innodb +include/diff_tables.inc [master:myisam_innodb, slave:myisam_innodb] +include/diff_tables.inc [master:innodb_myisam, slave:innodb_myisam] +include/diff_tables.inc [master:myisam_ndb, slave:myisam_ndb] +include/diff_tables.inc [master:ndb_myisam, slave:ndb_myisam] +include/diff_tables.inc [master:innodb_ndb, slave:innodb_ndb] +include/diff_tables.inc [master:ndb_innodb, slave:ndb_innodb] ==== Clean up ==== drop table myisam_innodb, innodb_myisam; drop table myisam_ndb, ndb_myisam; drop table innodb_ndb, ndb_innodb; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result index 05524ae1ae3..97463efae94 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ; reset master; SHOW TABLES; @@ -27,11 +23,8 @@ SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ; @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) 106 master-bin.000001 -CHANGE MASTER TO -master_port=<MASTER_PORT1>, -master_log_file = 'MASTER_LOG_FILE', -master_log_pos = MASTER_LOG_POS ; -start slave; +include/rpl_change_topology.inc [new topology=3->2] +include/start_slave.inc INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); DELETE FROM t1 WHERE c3 = 1; UPDATE t1 SET c2="should go away" WHERE c3 = 2; @@ -54,4 +47,4 @@ row4 D 4 row5 E 5 ==== clean up ==== DROP TABLE t1; -STOP SLAVE; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result index 5d00ae6598c..f3142678ff8 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] drop table if exists t1,t2; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, @@ -53,3 +49,4 @@ select * from t1; a 3 drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result index dc4e11c9c9e..d1cc10a930c 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] -------- Test for BUG#9361 -------- CREATE TABLE t1 ( @@ -195,3 +191,4 @@ idpro price nbprice 2 1.0000 2 3 2.0000 1 DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result index eb7d88c812b..d167a85bb8b 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] SET storage_engine=myisam; --- Doing pre test cleanup --- DROP TABLE IF EXISTS t1; @@ -917,3 +913,4 @@ DELETE FROM t1; --- End test 5 key partition testing --- --- Do Cleanup --- DROP TABLE IF EXISTS t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result index 4e28a7e5865..801e1c0a9f2 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP DATABASE IF EXISTS replica; CREATE DATABASE replica; CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB; @@ -52,3 +48,4 @@ Tables_in_test USE test; DROP TABLE t1, t2; DROP DATABASE IF EXISTS replica; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result index 7f75bdedd65..333e943d3ca 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (word CHAR(20) NOT NULL); LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1; LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1; @@ -53,3 +49,4 @@ SELECT n FROM t1; n 3456 DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result index 473cd63169c..b37f55b36a4 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result @@ -1,35 +1,22 @@ -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; -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; +include/master-slave.inc +[connection master] +include/rpl_reset.inc CREATE TABLE t1 (c1 BIT, c2 INT) Engine=NDB; INSERT INTO `t1` VALUES ( 1, 1 ); UPDATE t1 SET c1=NULL where c2=1; -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] DELETE FROM t1 WHERE c2=1 LIMIT 1; -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; -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; +include/rpl_reset.inc CREATE TABLE t1 (c1 CHAR) Engine=NDB; INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; SELECT * FROM t1; c1 w UPDATE t1 SET c1=NULL WHERE c1='w'; -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] DELETE FROM t1 LIMIT 2; -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result index d7922c61b52..e28e438610f 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; @@ -47,3 +43,4 @@ a DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result index 047402f826f..2dd1754745b 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; DROP PROCEDURE IF EXISTS p1; @@ -42,3 +38,4 @@ DROP TABLE t1; DROP TABLE t2; DROP PROCEDURE p1; DROP PROCEDURE p2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result index 367738b21e5..f57becd18fe 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] SET binlog_format = STATEMENT; *** Test 1 *** @@ -123,12 +119,7 @@ master-bin.000002 # Xid 1 <end_pos> COMMIT /* XID */ ** Test 4 ** -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; +include/rpl_reset.inc select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; @@ -142,3 +133,4 @@ master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */ *** DUMP MASTER & SLAVE FOR COMPARE ******** DROP DATABASE tpcb; ****** Do dumps compare ************ +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result index 49d068d5fe4..457933ae5f7 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] STOP SLAVE; CREATE DATABASE ndbsynctest; USE ndbsynctest; @@ -68,7 +64,7 @@ CHANGE MASTER TO master_log_file = 'master-bin.000001', master_log_pos = <the_pos> ; START SLAVE; -Checking that both slave threads are running. +include/check_slave_is_running.inc SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; hex(c1) hex(c2) c3 1 1 row1 @@ -89,3 +85,4 @@ Position File epoch inserts updates deletes schemaops reset slave; select * from mysql.ndb_apply_status; server_id epoch log_name start_pos end_pos +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result index ba5f0dea91c..c6d9e29183e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] DROP TRIGGER test.t1_bi_t2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; @@ -28,3 +24,4 @@ n f DROP TRIGGER test.t1_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; +include/rpl_end.inc 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 04a75bf3479..12f171531b5 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 @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'NDB' ; SELECT * FROM t1; C1 C2 @@ -422,11 +418,7 @@ a b c **** Test for BUG#31552 **** **** On Master **** DELETE FROM t1; -**** Resetting master and slave **** -include/stop_slave.inc -RESET SLAVE; -RESET MASTER; -include/start_slave.inc +include/rpl_reset.inc **** On Master **** INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); **** On Master **** @@ -436,7 +428,7 @@ DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; -Checking that both slave threads are running. +include/check_slave_is_running.inc SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -478,50 +470,44 @@ 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 +include/diff_tables.inc [master:t1, slave: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 +include/diff_tables.inc [master:t2, slave: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; +include/wait_for_slave_sql_error.inc [errno=1535] +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.' +include/rpl_reset.inc [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 +include/diff_tables.inc [master:t4, slave: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; +include/wait_for_slave_sql_error.inc [errno=1535] +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.' +include/rpl_reset.inc [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; +include/wait_for_slave_sql_error.inc [errno=1535] +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.' +include/rpl_reset.inc [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 +include/diff_tables.inc [master:t7, slave:t7] drop table t1, t2, t3, t4, t5, t6, t7; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='NDB' ; INSERT INTO t1 VALUES (1), (2), (3); UPDATE t1 SET a = 10; ERROR 23000: Duplicate entry '10' for key 'PRIMARY' INSERT INTO t1 VALUES (4); -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] drop table t1; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( @@ -575,7 +561,7 @@ ERROR 23000: Duplicate entry '6' for key 'PRIMARY' DELETE FROM t2 WHERE `pk` < 7 LIMIT 1; UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6; *** results: t2 must be consistent **** -Comparing tables master:test.t2 and master:test.t2 +include/diff_tables.inc [master:t2, master:t2] DROP TABLE t1, t2; EOF OF TESTS CREATE TABLE t1 (a int) ENGINE='NDB' ; @@ -591,7 +577,7 @@ UPDATE t1 SET a = 9 WHERE a < 3; INSERT INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] drop table t1; CREATE TABLE t1 (a bit) ENGINE='NDB' ; INSERT IGNORE INTO t1 VALUES (NULL); @@ -633,5 +619,6 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0; UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2; INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; -Comparing tables master:test.t1 and slave:test.t1 +include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result index 14d3baee1b0..dd84fea8258 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -87,3 +83,4 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE t1 +include/rpl_end.inc |