diff options
Diffstat (limited to 'storage/tokudb/mysql-test/rpl')
37 files changed, 825 insertions, 174 deletions
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result index 0e9b750f77d..2348fd0d9d4 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result @@ -1,9 +1,11 @@ include/master-slave.inc [connection master] *** Prepare tables and data *** +connection master; CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=TokuDB; CREATE TABLE t2 (a INT) ENGINE=TokuDB; CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=TokuDB; +connection slave; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -25,6 +27,7 @@ SHOW VARIABLES LIKE 'slave_transaction_retries'; Variable_name Value slave_transaction_retries 2 include/stop_slave.inc +connection master; BEGIN; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2); @@ -32,6 +35,7 @@ INSERT INTO t3 VALUES (3); COMMIT; *** Test deadlock *** +connection slave; BEGIN; SELECT * FROM t1 FOR UPDATE; a @@ -49,6 +53,7 @@ a include/check_slave_is_running.inc *** Test lock wait timeout *** +connection slave; include/stop_slave.inc DELETE FROM t2; CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>; @@ -74,6 +79,7 @@ a include/check_slave_is_running.inc *** Test lock wait timeout and purged relay logs *** +connection slave; SET @my_max_relay_log_size= @@global.max_relay_log_size; SET global max_relay_log_size=0; Warnings: @@ -106,7 +112,9 @@ a include/check_slave_is_running.inc *** Clean up *** +connection master; DROP TABLE t1,t2,t3; +connection slave; SET global max_relay_log_size= @my_max_relay_log_size; End of 5.1 tests include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result index 929f2c54bf1..6ee39039985 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result @@ -12,6 +12,7 @@ include/master-slave.inc ***** Testing more columns on the Master ***** +connection master; CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ f5 FLOAT DEFAULT '2.00', @@ -24,10 +25,12 @@ f11 VARBINARY(64))ENGINE=TokuDB; * Alter Table on Slave and drop columns f5 through f11 * +connection slave; alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; * Insert data in Master then update and delete some rows* +connection master; * Select count and 20 rows from Master * SELECT COUNT(*) FROM t1; @@ -57,6 +60,7 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +connection slave; * Select count and 20 rows from Slave * @@ -90,6 +94,7 @@ include/check_slave_is_running.inc ***** Testing Altering table def scenario ***** +connection master; CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ f5 DOUBLE DEFAULT '2.00', @@ -160,6 +165,7 @@ f35 VARCHAR(257) ** Alter tables on slave and drop columns ** +connection slave; alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop f12; alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; @@ -172,6 +178,7 @@ drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, drop f33, drop f34, drop f35; ** Insert Data into Master ** +connection master; INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: some var char'; INSERT into t2 values (2, 2, 2, 'second', @@ -184,11 +191,11 @@ INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: binary data'; INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', +insert ignore into t31 set f1=1, f2=1, f3=2, f4='second', f9=2.2, f10='seven samurai', f28=222.222, f35='222'; Warnings: Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', +insert ignore into t31 values (1, 1, 3, 'third', /* f5 BIGINT, */ 333333333333333333333333, /* f6 BLOB, */ '3333333333333333333333', /* f7 DATE, */ '2007-07-18', @@ -224,7 +231,7 @@ INSERT into t31 values (1, 1, 3, 'third', Warnings: Warning 1264 Out of range value for column 'f5' at row 1 Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', +insert ignore into t31 values (1, 1, 4, 'fourth', /* f5 BIGINT, */ 333333333333333333333333, /* f6 BLOB, */ '3333333333333333333333', /* f7 DATE, */ '2007-07-18', @@ -333,6 +340,7 @@ Warning 1264 Out of range value for column 'f24' at row 3 ** Sync slave with master ** ** Do selects from tables ** +connection slave; select * from t1 order by f3; f1 f2 f3 f4 2 2 2 second @@ -394,13 +402,14 @@ f1 f2 f3 f4 1 1 4 fourth 1 1 5 fifth 1 1 6 sixth +connection master; ** Do updates master ** update t31 set f5=555555555555555 where f3=6; update t31 set f2=2 where f3=2; update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; +update ignore t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; Warnings: Warning 1048 Column 'f3' cannot be null @@ -411,12 +420,14 @@ delete from t2; delete from t3; delete from t4; delete from t31; +connection slave; select * from t31; f1 f2 f3 f4 ** Check slave status ** include/check_slave_is_running.inc +connection master; **************************************** * columns in master at middle of table * @@ -434,14 +445,17 @@ CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ** Connect to master and create table ** +connection master; CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE=TokuDB; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), @@ -452,11 +466,14 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'' *** Drop t10 *** +connection master; DROP TABLE t10; +connection slave; ********************************************* * More columns in master at middle of table * @@ -470,14 +487,17 @@ CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE=TokuDB; *** Create t11 on Master *** +connection master; CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=TokuDB; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), @@ -488,11 +508,14 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'' *** Drop t11 *** +connection master; DROP TABLE t11; +connection slave; ********************************************* * More columns in master at middle of table * @@ -506,14 +529,17 @@ CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE=TokuDB; *** Create t12 on Master *** +connection master; CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=TokuDB; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), @@ -527,6 +553,7 @@ a hex(b) f c e 3 62316231623162316231623162316231 QA test 1 *** Select on Slave *** +connection slave; SELECT a,hex(b),c FROM t12 ORDER BY a; a hex(b) c 1 62316231623162316231623162316231 Kyle @@ -534,7 +561,9 @@ a hex(b) c 3 62316231623162316231623162316231 QA *** Drop t12 *** +connection master; DROP TABLE t12; +connection slave; **************************************************** * - Alter Master adding columns at middle of table * @@ -549,6 +578,7 @@ CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=TokuDB; *** Create t14 on Master *** +connection master; CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -556,9 +586,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; @@ -575,6 +607,7 @@ c1 c2 c3 hex(c4) c5 c6 c7 3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP *** Select on Slave **** +connection slave; SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; c1 c2 c3 hex(c4) c5 1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle @@ -587,6 +620,7 @@ c1 c2 c3 hex(c4) c5 **************************************************** *** connect to master and drop columns *** +connection master; ALTER TABLE t14 DROP COLUMN c2; ALTER TABLE t14 DROP COLUMN c7; @@ -600,15 +634,18 @@ c1 c3 hex(c4) c5 c6 ************ * Bug30415 * ************ +connection slave; include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' +Last_SQL_Error = 'Error 'Can't DROP COLUMN `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; RESET SLAVE; *** Drop t14 *** DROP TABLE t14; +connection master; DROP TABLE t14; RESET MASTER; +connection slave; START SLAVE; ************************************************* @@ -623,6 +660,7 @@ CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=TokuDB; *** Create t15 on Master *** +connection master; CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -630,9 +668,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); @@ -649,6 +689,7 @@ c1 hex(c4) c5 c6 c7 c2 *** Expect slave to fail with Error 1054 *** ******************************************** +connection slave; include/wait_for_slave_sql_error.inc [errno=1054] Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' STOP SLAVE; @@ -656,8 +697,10 @@ RESET SLAVE; *** Drop t15 *** DROP TABLE t15; +connection master; DROP TABLE t15; RESET MASTER; +connection slave; START SLAVE; ************************************************ @@ -672,6 +715,7 @@ CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=TokuDB; *** Create t16 on Master *** +connection master; CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -679,9 +723,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Create Index and Data Insert *** +connection master; CREATE INDEX part_of_c6 ON t16 (c6); set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); @@ -698,6 +744,7 @@ c1 hex(c4) c5 c6 c7 *** BUG 30434 *** ***************** +connection slave; include/wait_for_slave_sql_error.inc [errno=1072] Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' STOP SLAVE; @@ -705,8 +752,10 @@ RESET SLAVE; *** Drop t16 *** DROP TABLE t16; +connection master; DROP TABLE t16; RESET MASTER; +connection slave; START SLAVE; ***************************************************** @@ -721,6 +770,7 @@ CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=TokuDB; *** Create t17 on Master *** +connection master; CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -728,9 +778,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), @@ -743,6 +795,7 @@ c1 hex(c4) c5 c6 c7 3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP ** Select * from Slave ** +connection slave; SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle @@ -750,6 +803,7 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** Delete from master ** +connection master; DELETE FROM t17 WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; c1 hex(c4) c5 c6 c7 @@ -757,11 +811,14 @@ c1 hex(c4) c5 c6 c7 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP ** Check slave ** +connection slave; SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE +connection master; DROP TABLE t17; +connection slave; ***************************************************** @@ -779,6 +836,7 @@ CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=TokuDB; *** Create t18 on Master *** +connection master; CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -786,9 +844,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), @@ -801,6 +861,7 @@ c1 hex(c4) c5 c6 c7 3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP ** Select * from Slave ** +connection slave; SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle @@ -808,6 +869,7 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +connection master; UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 @@ -816,12 +878,15 @@ c1 hex(c4) c5 c6 c7 3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** +connection slave; SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE 3 62316231623162316231623162316231 TEST +connection master; DROP TABLE t18; +connection slave; ***************************************************** @@ -836,6 +901,7 @@ CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE=TokuDB; *** Create t5 on Master *** +connection master; CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), c6 LONG, c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP @@ -843,9 +909,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), (2,@b1,'JOE',UUID(),DEFAULT), @@ -857,10 +925,14 @@ c1 hex(c4) c5 c6 c7 3 6231623162316231 QA UUID TIME ** Select * from Slave ** +connection slave; SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; c1 hex(c4) c5 1 6231623162316231 Kyle 2 6231623162316231 JOE 3 6231623162316231 QA +connection master; DROP TABLE t5; +connection slave; +connection master; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result index 6212c378f69..8906cf31d74 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result @@ -3,7 +3,7 @@ include/master-slave.inc call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051"); call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677"); **** Diff Table Def Start **** -*** On Slave *** +connection slave; STOP SLAVE; RESET SLAVE; SET @saved_slave_type_conversions = @@slave_type_conversions; @@ -13,12 +13,15 @@ d FLOAT DEFAULT '2.00', e CHAR(4) DEFAULT 'TEST') ENGINE='TokuDB'; *** Create t1 on Master *** +connection master; CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA'); SELECT * FROM t1 ORDER BY a; a b c @@ -26,6 +29,7 @@ a b c 2 1 AUSTIN 3 4 QA *** Select from slave *** +connection slave; SELECT * FROM t1 ORDER BY a; a b c d e 1 2 TEXAS 2 TEST @@ -33,7 +37,9 @@ a b c d e 3 4 QA 2 TEST SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; *** Drop t1 *** +connection master; DROP TABLE t1; +connection slave; *** Create t2 on slave *** STOP SLAVE; RESET SLAVE; @@ -42,10 +48,12 @@ d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') ENGINE='TokuDB'; *** Create t2 on Master *** +connection master; CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='TokuDB'; RESET MASTER; *** Master Data Insert *** +connection master; INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING'); SELECT * FROM t2 ORDER BY a; a b c @@ -53,6 +61,7 @@ a b c 2 1 JOE AUSTIN 3 4 QA TESTING *** Start Slave *** +connection slave; START SLAVE; include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'' @@ -60,10 +69,14 @@ STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; a b c d e +connection master; RESET MASTER; +connection slave; START SLAVE; *** Drop t2 *** +connection master; DROP TABLE t2; +connection slave; *** Create t3 on slave *** STOP SLAVE; RESET SLAVE; @@ -72,22 +85,28 @@ d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') ENGINE='TokuDB'; *** Create t3 on Master *** +connection master; CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1'; set @b1 = concat(@b1,@b1); INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING'); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'' *** Drop t3 *** +connection master; DROP TABLE t3; +connection slave; *** Create t4 on slave *** STOP SLAVE; RESET SLAVE; @@ -96,21 +115,27 @@ d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') ENGINE='TokuDB'; *** Create t4 on Master *** +connection master; CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), (30000.22,4,'QA TESTING'); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'' *** Drop t4 *** +connection master; DROP TABLE t4; +connection slave; *** Create t5 on slave *** STOP SLAVE; RESET SLAVE; @@ -118,45 +143,57 @@ CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT, e DOUBLE, f DECIMAL(8,2))ENGINE='TokuDB'; *** Create t5 on Master *** +connection master; CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT, e BLOB, f FLOAT) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), (2,'JOE',300.01,0,'b2b2',1.0000009); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'' *** Drop t5 *** +connection master; DROP TABLE t5; +connection slave; *** Create t6 on slave *** STOP SLAVE; RESET SLAVE; CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5), c FLOAT, d INT)ENGINE='TokuDB'; *** Create t6 on Master *** +connection master; CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6), c DECIMAL(8,2), d BIT ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), (2,'JOE',300.01,0); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'' *** Drop t6 *** include/rpl_reset.inc +connection master; DROP TABLE t6; +connection slave; **** Diff Table Def End **** **** Extra Colums Start **** *** Create t7 on slave *** @@ -167,12 +204,15 @@ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e CHAR(20) DEFAULT 'Extra Column Testing') ENGINE='TokuDB'; *** Create t7 on Master *** +connection master; CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1'; set @b1 = concat(@b1,@b1); INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); @@ -182,13 +222,16 @@ a b c 2 b1b1 JOE 3 b1b1 QA *** Select from slave *** +connection slave; SELECT * FROM t7 ORDER BY a; a b c d e 1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing 2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing 3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing *** Drop t7 *** +connection master; DROP TABLE t7; +connection slave; *** Create t8 on slave *** STOP SLAVE; RESET SLAVE; @@ -196,17 +239,22 @@ CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5), d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00', e INT)ENGINE='TokuDB'; *** Create t8 on Master *** +connection master; CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); *** Drop t8 *** +connection master; DROP TABLE t8; +connection slave; STOP SLAVE; RESET SLAVE; CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), @@ -218,77 +266,98 @@ g text, h blob not null, i blob) ENGINE='TokuDB'; *** Create t9 on Master *** +connection master; CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); +connection slave; select * from t9; a b c d e f g h i 1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL 2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL 3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL +connection master; DROP TABLE t9; +connection slave; *** Create t10 on slave *** STOP SLAVE; RESET SLAVE; CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', c CHAR(5), e INT DEFAULT '1')ENGINE='TokuDB'; *** Create t10 on Master *** +connection master; CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'' *** Drop t10 *** +connection master; DROP TABLE t10; +connection slave; *** Create t11 on slave *** STOP SLAVE; RESET SLAVE; CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='TokuDB'; *** Create t11 on Master *** +connection master; CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'' *** Drop t11 *** +connection master; DROP TABLE t11; +connection slave; *** Create t12 on slave *** STOP SLAVE; RESET SLAVE; CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='TokuDB'; *** Create t12 on Master *** +connection master; CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); @@ -298,13 +367,16 @@ a b c 2 b1b1b1b1b1b1b1b1 JOE 3 b1b1b1b1b1b1b1b1 QA *** Select on Slave *** +connection slave; SELECT * FROM t12 ORDER BY a; a b f c e 1 b1b1b1b1b1b1b1b1 Kyle test 1 2 b1b1b1b1b1b1b1b1 JOE test 1 3 b1b1b1b1b1b1b1b1 QA test 1 *** Drop t12 *** +connection master; DROP TABLE t12; +connection slave; **** Extra Colums End **** *** BUG 22177 Start *** *** Create t13 on slave *** @@ -315,12 +387,15 @@ d INT DEFAULT '1', e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='TokuDB'; *** Create t13 on Master *** +connection master; CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); @@ -330,13 +405,16 @@ a b c 2 b1b1b1b1b1b1b1b1 JOE 3 b1b1b1b1b1b1b1b1 QA *** Select on Slave **** +connection slave; SELECT * FROM t13 ORDER BY a; a b c d e 1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP *** Drop t13 *** +connection master; DROP TABLE t13; +connection slave; *** 22117 END *** *** Alter Master Table Testing Start *** *** Create t14 on slave *** @@ -347,12 +425,15 @@ c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='TokuDB'; *** Create t14 on Master *** +connection master; CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; set @b1 = 'b1b1b1b1'; @@ -366,6 +447,7 @@ c1 c2 c3 c4 c5 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA *** Select on Slave **** +connection slave; SELECT * FROM t14 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP @@ -379,12 +461,15 @@ c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='TokuDB'; *** Create t14a on Master *** +connection master; CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t14a () VALUES(1,@b1,'Kyle'), @@ -396,6 +481,7 @@ c1 c4 c5 2 b1b1b1b1b1b1b1b1 JOE 3 b1b1b1b1b1b1b1b1 QA *** Select on Slave **** +connection slave; SELECT * FROM t14a ORDER BY c1; c1 c4 c5 c6 c7 1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP @@ -404,11 +490,14 @@ c1 c4 c5 c6 c7 STOP SLAVE; RESET SLAVE; *** Master Drop c5 *** +connection master; ALTER TABLE t14a DROP COLUMN c5; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t14a () VALUES(4,@b1), @@ -423,6 +512,7 @@ c1 c4 5 b1b1b1b1b1b1b1b1 6 b1b1b1b1b1b1b1b1 *** Select on Slave **** +connection slave; SELECT * FROM t14a ORDER BY c1; c1 c4 c5 c6 c7 1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP @@ -431,8 +521,11 @@ c1 c4 c5 c6 c7 4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP 5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP 6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP +connection master; DROP TABLE t14a; +connection slave; *** connect to master and drop columns *** +connection master; ALTER TABLE t14 DROP COLUMN c2; ALTER TABLE t14 DROP COLUMN c4; *** Select from Master *** @@ -442,13 +535,16 @@ c1 c3 c5 2 This Test Should work JOE 3 If is does not, I will open a bug QA *** Select from Slave *** +connection slave; SELECT * FROM t14 ORDER BY c1; c1 c3 c5 c6 c7 1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP 2 This Test Should work JOE 1 CURRENT_TIMESTAMP 3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP *** Drop t14 *** +connection master; DROP TABLE t14; +connection slave; *** Create t15 on slave *** STOP SLAVE; RESET SLAVE; @@ -458,15 +554,18 @@ c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='TokuDB'; *** Create t15 on Master *** +connection master; CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5)) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051"); call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060"); call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535"); *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'), @@ -478,19 +577,23 @@ c1 c2 c3 c4 c5 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA *** Select on Slave **** +connection slave; SELECT * FROM t15 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP *** Add column on master that is a Extra on Slave *** +connection master; ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** +connection slave; 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 **** +connection master; INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); SELECT * FROM t15 ORDER BY c1; c1 c2 c3 c4 c5 c6 @@ -499,6 +602,7 @@ c1 c2 c3 c4 c5 c6 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL 5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 *** Try to select from slave **** +connection slave; SELECT * FROM t15 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP @@ -506,7 +610,9 @@ c1 c2 c3 c4 c5 c6 c7 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP 5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP *** DROP TABLE t15 *** +connection master; DROP TABLE t15; +connection slave; *** Create t16 on slave *** STOP SLAVE; RESET SLAVE; @@ -516,12 +622,15 @@ c6 INT DEFAULT '1', c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP )ENGINE='TokuDB'; *** Create t16 on Master *** +connection master; CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT, c4 BLOB, c5 CHAR(5))ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'), @@ -533,12 +642,14 @@ c1 c2 c3 c4 c5 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA *** Select on Slave **** +connection slave; SELECT * FROM t16 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP *** Add Partition on master *** +connection master; ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4; INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer'); SHOW CREATE TABLE t16; @@ -546,30 +657,33 @@ Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (`c1`) +PARTITIONS 4 *** Show table on Slave **** +connection slave; SHOW CREATE TABLE t16; Table Create Table t16 CREATE TABLE `t16` ( `c1` int(11) NOT NULL, `c2` decimal(8,2) DEFAULT NULL, - `c3` text, - `c4` blob, + `c3` text DEFAULT NULL, + `c4` blob DEFAULT NULL, `c5` char(5) DEFAULT NULL, - `c6` int(11) DEFAULT '1', - `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `c6` int(11) DEFAULT 1, + `c7` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`c1`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (c1) -PARTITIONS 4 */ + PARTITION BY KEY (`c1`) +PARTITIONS 4 *** DROP TABLE t16 *** +connection master; DROP TABLE t16; +connection slave; *** Alter Master End *** *** Create t17 on slave *** STOP SLAVE; @@ -579,18 +693,24 @@ d FLOAT DEFAULT '2.00', e CHAR(5) DEFAULT 'TEST2') ENGINE='TokuDB'; *** Create t17 on Master *** +connection master; CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10) ) ENGINE='TokuDB'; RESET MASTER; *** Start Slave *** +connection slave; START SLAVE; *** Master Data Insert *** +connection master; INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1677 *** ******************************************** +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'' ** DROP table t17 *** +connection master; DROP TABLE t17; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result index c65c61a0a65..66aaaa6b6fa 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +connection master; SET SQL_LOG_BIN= 0; CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL, `c` INT DEFAULT NULL, @@ -12,6 +13,7 @@ CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL, `c` INT DEFAULT NULL, PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; SET SQL_LOG_BIN= 1; +connection slave; CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL, `c` INT DEFAULT NULL, PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; @@ -23,6 +25,7 @@ PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00', PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; ************* EXECUTION WITH INSERTS ************* +connection master; INSERT INTO t1(a,b,c) VALUES (1, null, 1); INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2); INSERT INTO t1(a,b) VALUES (3, null); @@ -40,20 +43,24 @@ INSERT INTO t4(a,b) VALUES (3, null); INSERT INTO t4(a,c) VALUES (4, 4); INSERT INTO t4(a) VALUES (5); ************* SHOWING THE RESULT SETS WITH INSERTS ************* +connection slave; TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] TABLES t2 and t3 must be different. +connection master; SELECT * FROM t3 ORDER BY a; a b 1 NULL 2 1111-11-11 3 NULL +connection slave; SELECT * FROM t3 ORDER BY a; a b c 1 NULL 500 2 1111-11-11 500 3 NULL 500 +connection master; SELECT * FROM t4 ORDER BY a; a b c 1 NULL 1 @@ -61,6 +68,7 @@ a b c 3 NULL NULL 4 NULL 4 5 NULL NULL +connection slave; SELECT * FROM t4 ORDER BY a; a b 1 NULL @@ -69,26 +77,33 @@ a b 4 NULL 5 NULL ************* EXECUTION WITH UPDATES and REPLACES ************* +connection master; DELETE FROM t1; INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1); REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2); UPDATE t1 set b= NULL, c= 300 where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300); ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* +connection slave; TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:t1, slave:t1] ************* CLEANING ************* +connection master; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP TABLE t4; +connection slave; +connection master; SET SQL_LOG_BIN= 0; CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL, PRIMARY KEY (`a`)) ENGINE= TokuDB; SET SQL_LOG_BIN= 1; +connection slave; CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL, PRIMARY KEY (`a`)) ENGINE= TokuDB; ************* EXECUTION WITH INSERTS ************* +connection master; INSERT INTO t1(a,b,c) VALUES (1, null, b'01'); INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01'); INSERT INTO t1(a,b) VALUES (3, null); @@ -96,6 +111,8 @@ INSERT INTO t1(a,c) VALUES (4, b'01'); INSERT INTO t1(a) VALUES (5); ************* SHOWING THE RESULT SETS WITH INSERTS ************* TABLES t1 and t2 must be different. +connection slave; +connection master; SELECT a,b+0,c+0 FROM t1 ORDER BY a; a b+0 c+0 1 NULL 1 @@ -103,6 +120,7 @@ a b+0 c+0 3 NULL NULL 4 NULL 1 5 NULL NULL +connection slave; SELECT a,b+0,c+0 FROM t1 ORDER BY a; a b+0 c+0 1 NULL 1 @@ -111,6 +129,7 @@ a b+0 c+0 4 NULL 1 5 NULL NULL ************* EXECUTION WITH UPDATES and REPLACES ************* +connection master; DELETE FROM t1; INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01'); REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01'); @@ -118,8 +137,11 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00'); ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* TABLES t1 and t2 must be equal otherwise an error will be thrown. +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; ################################################################################ # NULL ---> NOT NULL (STRICT MODE) # UNCOMMENT THIS AFTER FIXING BUG#43992 @@ -127,6 +149,7 @@ DROP TABLE t1; ################################################################################ # NULL ---> NOT NULL (NON-STRICT MODE) ################################################################################ +connection master; SET SQL_LOG_BIN= 0; CREATE TABLE t1(`a` INT NOT NULL, `b` INT, PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; @@ -135,6 +158,7 @@ PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; CREATE TABLE t3(`a` INT NOT NULL, `b` INT, PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; SET SQL_LOG_BIN= 1; +connection slave; CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL, `c` INT NOT NULL, PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; @@ -145,6 +169,7 @@ CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL, `c` INT DEFAULT 500, PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1; ************* EXECUTION WITH INSERTS ************* +connection master; INSERT INTO t1(a) VALUES (1); INSERT INTO t1(a, b) VALUES (2, NULL); INSERT INTO t1(a, b) VALUES (3, 1); @@ -159,26 +184,33 @@ REPLACE INTO t3(a, b) VALUES (5, null); REPLACE INTO t3(a, b) VALUES (3, null); UPDATE t3 SET b = NULL where a = 4; ************* SHOWING THE RESULT SETS ************* +connection master; +connection slave; +connection master; SELECT * FROM t1 ORDER BY a; a b 1 NULL 2 NULL 3 1 +connection slave; SELECT * FROM t1 ORDER BY a; a b c 1 0 0 2 0 0 3 1 0 +connection master; SELECT * FROM t2 ORDER BY a; a b 1 NULL 2 NULL 3 1 +connection slave; SELECT * FROM t2 ORDER BY a; a b c 1 0 NULL 2 0 NULL 3 1 NULL +connection master; SELECT * FROM t3 ORDER BY a; a b 1 NULL @@ -186,6 +218,7 @@ a b 3 NULL 4 NULL 5 NULL +connection slave; SELECT * FROM t3 ORDER BY a; a b c 1 0 500 @@ -193,7 +226,9 @@ a b c 3 0 500 4 0 500 5 0 500 +connection master; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result index e2daa5d1326..97b2b60942d 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result @@ -1,9 +1,15 @@ include/master-slave.inc [connection master] +connection master; +connection slave; call mtr.add_suppression('Slave: Error dropping database'); include/stop_slave.inc start slave; +connection master; +connection slave; stop slave sql_thread; +connection master; +connection slave; insert into test0.benchmark set state='slave is processing load'; start slave sql_thread; use test0; @@ -17,6 +23,7 @@ select ts from test0.benchmark where state like 'slave is supposed to finish wit select ts from test0.benchmark where state like 'slave ends load' into @s_1; select ts from test0.benchmark where state like 'slave is processing load' into @s_0; select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out'; +connection master; include/diff_tables.inc [master:test15.ti_nk, slave:test15.ti_nk] include/diff_tables.inc [master:test15.ti_wk, slave:test15.ti_wk] include/diff_tables.inc [master:test14.ti_nk, slave:test14.ti_nk] @@ -49,4 +56,6 @@ include/diff_tables.inc [master:test1.ti_nk, slave:test1.ti_nk] include/diff_tables.inc [master:test1.ti_wk, slave:test1.ti_wk] include/diff_tables.inc [master:test0.ti_nk, slave:test0.ti_nk] include/diff_tables.inc [master:test0.ti_wk, slave:test0.ti_wk] +connection master; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result index 5935e5ddcbd..a85d2155725 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result @@ -1,6 +1,8 @@ include/master-slave.inc [connection master] +connection master; drop table if exists t; +connection slave; show variables like 'tokudb_rpl_%'; Variable_name Value tokudb_rpl_check_readonly ON @@ -8,17 +10,27 @@ tokudb_rpl_lookup_rows OFF tokudb_rpl_lookup_rows_delay 10000 tokudb_rpl_unique_checks OFF tokudb_rpl_unique_checks_delay 10000 +connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; insert into t values (1); insert into t values (2),(3); insert into t values (4); +connection master; +connection slave; +connection master; include/diff_tables.inc [master:test.t, slave:test.t] +connection master; delete from t where a=2; select unix_timestamp() into @tstart; +connection master; +connection slave; +connection master; select unix_timestamp() into @tend; select @tend-@tstart <= 5; @tend-@tstart <= 5 1 include/diff_tables.inc [master:test.t, slave:test.t] +connection master; drop table if exists t; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result index 8bb426d9448..991ad8d1c48 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result @@ -1,6 +1,8 @@ include/master-slave.inc [connection master] +connection master; drop table if exists t; +connection slave; show variables like 'tokudb_rpl_%'; Variable_name Value tokudb_rpl_check_readonly ON @@ -8,20 +10,29 @@ tokudb_rpl_lookup_rows OFF tokudb_rpl_lookup_rows_delay 10000 tokudb_rpl_unique_checks OFF tokudb_rpl_unique_checks_delay 10000 +connection master; create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb; insert into t values (1,0); insert into t values (2,0),(3,0); insert into t values (4,0); +connection master; +connection slave; +connection master; include/diff_tables.inc [master:test.t, slave:test.t] +connection master; update t set b=b+1 where a=2; update t set b=b+2 where a=1; update t set b=b+3 where a=4; update t set b=b+4 where a=3; update t set b=b+1 where 1<=a and a<=3; # select unix_timestamp() into @tstart; +connection master; +connection slave; +connection master; # Commented out for MariaDB # select unix_timestamp() into @tend; # select @tend-@tstart <= 5; # assert no delay in the delete time +connection slave; select * from t; a b 1 3 @@ -29,5 +40,7 @@ a b 3 5 4 3 include/diff_tables.inc [master:test.t, slave:test.t] +connection master; drop table if exists t; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result index ca547e34be2..1de619eb4ec 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result @@ -1,14 +1,23 @@ include/master-slave.inc [connection master] +connection master; drop table if exists t; +connection slave; show variables like 'tokudb_rpl_unique_checks%'; Variable_name Value tokudb_rpl_unique_checks OFF tokudb_rpl_unique_checks_delay 5000 +connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; insert into t values (1); insert into t values (2),(3); insert into t values (4); +connection slave; +connection master; +connection slave; +connection master; include/diff_tables.inc [master:test.t, slave:test.t] +connection master; drop table if exists t; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result index 4f289345a4b..d7e99db1d0e 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result @@ -55,21 +55,21 @@ show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) -(PARTITION pa100 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION BY RANGE (`id`) +(PARTITION `pa100` VALUES LESS THAN (100) ENGINE = TokuDB, + PARTITION `paMax` VALUES LESS THAN MAXVALUE ENGINE = TokuDB) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -93,25 +93,27 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2; id dt user uuidf fkid filler 1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL 2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL +connection slave; +connection slave; show create table test.byrange_tbl; Table Create Table byrange_tbl CREATE TABLE `byrange_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) -(PARTITION pa100 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ + PARTITION BY RANGE (`id`) +(PARTITION `pa100` VALUES LESS THAN (100) ENGINE = TokuDB, + PARTITION `paMax` VALUES LESS THAN MAXVALUE ENGINE = TokuDB) show create table test.regular_tbl; Table Create Table regular_tbl CREATE TABLE `regular_tbl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, `uuidf` varbinary(255) DEFAULT NULL, `fkid` int(11) DEFAULT NULL, @@ -140,6 +142,7 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2; id dt user uuidf fkid filler 1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL 2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL +connection master; DROP PROCEDURE test.proc_norm; DROP PROCEDURE test.proc_byrange; DROP TABLE test.regular_tbl; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result index 2eb4bce3efe..f014ca6a90d 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result @@ -14,10 +14,12 @@ name age id Andy 31 00000001 Jacob 2 00000002 Caleb 1 00000003 +connection slave; SELECT * FROM t1 ORDER BY id; name age id Andy 31 00000001 Jacob 2 00000002 Caleb 1 00000003 +connection master; DROP TABLE t1; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_rfr_disable_on_expl_pk_absence.result b/storage/tokudb/mysql-test/rpl/r/rpl_rfr_disable_on_expl_pk_absence.result index 2977dc859f5..127184a0766 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_rfr_disable_on_expl_pk_absence.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_rfr_disable_on_expl_pk_absence.result @@ -1,8 +1,10 @@ include/master-slave.inc [connection master] call mtr.add_suppression("read free replication is disabled for tokudb table"); +connection master; CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB; INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'); +connection slave; SELECT * FROM t; a b 1 a @@ -10,6 +12,7 @@ a b 3 c 4 d 5 e +connection master; UPDATE t SET a = a + 10 WHERE b = 'b'; SELECT * FROM t; a b @@ -18,6 +21,7 @@ a b 3 c 4 d 5 e +connection slave; SELECT * FROM t; a b 1 a @@ -25,6 +29,7 @@ a b 3 c 4 d 5 e +connection master; UPDATE t SET a = a + 10 WHERE b = 'b'; SELECT * FROM t; a b @@ -33,6 +38,7 @@ a b 3 c 4 d 5 e +connection slave; SELECT * FROM t; a b 1 a @@ -40,5 +46,7 @@ a b 3 c 4 d 5 e +connection master; DROP TABLE t; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result index f137414c6c9..32a42143180 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result @@ -1,10 +1,15 @@ include/master-slave.inc [connection master] +connection slave; +connection slave; +connection master; CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'TokuDB' ; SELECT * FROM t1; C1 C2 +connection slave; SELECT * FROM t1; C1 C2 +connection master; INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X'); INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A'); SELECT * FROM t1 ORDER BY C1,C2; @@ -15,6 +20,7 @@ A C X X X Y X Z +connection slave; SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A A @@ -23,6 +29,7 @@ A C X X X Y X Z +connection master; DELETE FROM t1 WHERE C1 = C2; SELECT * FROM t1 ORDER BY C1,C2; C1 C2 @@ -30,12 +37,14 @@ A B A C X Y X Z +connection slave; SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B A C X Y X Z +connection master; UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C'; SELECT * FROM t1 ORDER BY C1,C2; C1 C2 @@ -43,16 +52,19 @@ A B A I X Y X Z +connection slave; SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B A I X Y X Z +connection slave; include/assert.inc [Counter for COM_COMMIT is consistent with the number of actual commits] include/assert.inc [Counter for COM_INSERT is consistent with the number of actual inserts] include/assert.inc [Counter for COM_DELETE is consistent with the number of actual deletes] include/assert.inc [Counter for COM_UPDATE is consistent with the number of actual updates] +connection master; UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N'; SELECT * FROM t1 ORDER BY c1,c2; C1 C2 @@ -60,12 +72,14 @@ A B A I X Y X Z +connection slave; SELECT * FROM t1 ORDER BY c1,c2; C1 C2 A B A I X Y X Z +connection master; CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = 'TokuDB' ; INSERT INTO t2 VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25), @@ -88,6 +102,7 @@ c1 c12 c2 5 A 25 8 A 64 9 A 81 +connection slave; SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 2 @@ -106,6 +121,7 @@ c1 c12 c2 5 A 25 8 A 64 9 A 81 +connection master; UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1; SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; c1 c12 c2 @@ -118,6 +134,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +connection slave; SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -129,6 +146,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +connection master; UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999; SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 @@ -141,6 +159,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +connection slave; SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -152,6 +171,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +connection master; DELETE FROM t2 WHERE c1 % 4 = 0; SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 @@ -162,6 +182,7 @@ c1 c12 c2 6 A 36 7 A 49 9 A 81 +connection slave; SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -171,7 +192,9 @@ c1 c12 c2 6 A 36 7 A 49 9 A 81 +connection master; UPDATE t2 SET c12='X'; +connection master; CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = 'TokuDB' ; INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1); INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2); @@ -183,6 +206,7 @@ A C 1 B 2 X X 3 B 1 X Y 2 B 1 X Z 2 B 2 +connection slave; SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A A 3 B 2 @@ -191,6 +215,7 @@ A C 1 B 2 X X 3 B 1 X Y 2 B 1 X Z 2 B 2 +connection master; DELETE FROM t3 WHERE C1 = C2; SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 @@ -198,12 +223,14 @@ A B 1 B 1 A C 1 B 2 X Y 2 B 1 X Z 2 B 2 +connection slave; SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 A C 1 B 2 X Y 2 B 1 X Z 2 B 2 +connection master; UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C'; SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 @@ -211,12 +238,14 @@ A B 1 B 1 A I 1 B 2 X Y 2 B 1 X Z 2 B 2 +connection slave; SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 A I 1 B 2 X Y 2 B 1 X Z 2 B 2 +connection master; CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT) ENGINE = 'TokuDB'; INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3); INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6); @@ -228,6 +257,7 @@ X X 3 A C 4 X Z 5 A A 6 +connection slave; SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -236,6 +266,7 @@ X X 3 A C 4 X Z 5 A A 6 +connection master; DELETE FROM t6 WHERE C1 = C2; SELECT * FROM t6 ORDER BY C3; C1 C2 C3 @@ -243,12 +274,14 @@ A B 1 X Y 2 A C 4 X Z 5 +connection slave; SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 X Y 2 A C 4 X Z 5 +connection master; UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C'; SELECT * FROM t6 ORDER BY C3; C1 C2 C3 @@ -256,12 +289,14 @@ A B 1 X Y 2 A I 4 X Z 5 +connection slave; SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 X Y 2 A I 4 X Z 5 +connection master; CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = 'TokuDB' ; INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3); INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6); @@ -310,6 +345,7 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +connection slave; SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2 X Q 2 1 R 1 X Y 2 S 1 @@ -354,19 +390,24 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +connection slave; SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY'; +connection master; CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = 'TokuDB' ; INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 +connection slave; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; +connection master; CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'TokuDB' ; ---- on slave: original values --- +connection slave; +--- original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); SELECT * FROM t7 ORDER BY C1; C1 C2 @@ -374,21 +415,23 @@ C1 C2 2 6 3 9 set @@global.slave_exec_mode= 'IDEMPOTENT'; ---- on master: new values inserted --- +connection master; +--- new values inserted --- INSERT INTO t7 VALUES (1,2), (2,4), (3,6); SELECT * FROM t7 ORDER BY C1; C1 C2 1 2 2 4 3 6 +connection slave; set @@global.slave_exec_mode= default; ---- on slave: old values should be overwritten by replicated values --- +--- old values should be overwritten by replicated values --- SELECT * FROM t7 ORDER BY C1; C1 C2 1 2 2 4 3 6 ---- on master --- +connection master; CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'TokuDB' ; INSERT INTO t8 VALUES (99,99,99); INSERT INTO t8 VALUES (99,22,33); @@ -400,7 +443,7 @@ ERROR 23000: Duplicate entry '99' for key 'c' SELECT * FROM t8 ORDER BY a; a b c 99 99 99 ---- on slave --- +connection slave; SELECT * FROM t8 ORDER BY a; a b c 99 99 99 @@ -412,10 +455,10 @@ a b c 3 6 9 99 99 99 set @@global.slave_exec_mode= 'IDEMPOTENT'; ---- on master --- +connection master; INSERT INTO t8 VALUES (2,4,8); +connection slave; set @@global.slave_exec_mode= default; ---- on slave --- SELECT * FROM t8 ORDER BY a; a b c 1 2 3 @@ -423,100 +466,136 @@ a b c 3 6 9 99 99 99 **** Test for BUG#31552 **** -**** On Master **** +connection master; DELETE FROM t1; +connection slave; include/rpl_reset.inc -**** On Master **** +connection master; INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); -**** On Master **** +connection slave; set @@global.slave_exec_mode= 'IDEMPOTENT'; DELETE FROM t1 WHERE C1 = 'L'; +connection master; DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +connection slave; set @@global.slave_exec_mode= default; include/check_slave_is_running.inc SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** -**** On Master **** +connection master; DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); INSERT INTO t1 VALUES( '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); -**** On Slave **** +connection slave; SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 +connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +connection slave; +connection master; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'TokuDB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'TokuDB' ; +connection slave; 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) ENGINE = 'TokuDB' ; +connection slave; 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) ENGINE = 'TokuDB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'TokuDB' ; +connection slave; 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) ENGINE = 'TokuDB' ; +connection slave; 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) ENGINE = 'TokuDB' ; +connection slave; SET @saved_slave_type_conversions = @@slave_type_conversions; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] +connection master; INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +connection slave; include/diff_tables.inc [master:t1, slave:t1] [expecting slave to replicate correctly] +connection master; INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +connection slave; include/diff_tables.inc [master:t2, slave:t2] +connection slave; SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535"); call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032"); call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677"); +call mtr.add_suppression("Can't find record in 't1'"); include/rpl_reset.inc [expecting slave to replicate correctly] +connection master; INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +connection slave; include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] +connection master; INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); +connection slave; include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'' include/rpl_reset.inc [expecting slave to stop] +connection master; INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); +connection slave; include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'' include/rpl_reset.inc [expecting slave to replicate correctly] +connection master; INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +connection slave; include/diff_tables.inc [master:t7, slave:t7] +connection master; drop table t1, t2, t3, t4, t5, t6, t7; +connection slave; +connection master; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='TokuDB'; 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); +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; drop table t1; +connection slave; +connection master; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, @@ -568,10 +647,13 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6; 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; +connection slave; *** results: t2 must be consistent **** include/diff_tables.inc [master:t2, slave:t2] +connection master; DROP TABLE t1, t2; EOF OF TESTS +connection master; CREATE TABLE t1 (a int) ENGINE='TokuDB'; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); @@ -585,41 +667,47 @@ 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; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; drop table t1; +connection slave; +connection master; +connection slave; SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY'; +connection master; CREATE TABLE t1 (a bit) ENGINE='TokuDB'; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3; -INSERT INTO t1 ( a ) VALUES ( 5 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 5 ); DELETE FROM t1 WHERE a < 2 LIMIT 4; DELETE FROM t1 WHERE a < 9 LIMIT 4; -INSERT INTO t1 ( a ) VALUES ( 9 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 9 ); UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6; -INSERT INTO t1 ( a ) VALUES ( 8 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 8 ); UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0; -INSERT INTO t1 ( a ) VALUES ( 4 ); -INSERT INTO t1 ( a ) VALUES ( 3 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 4 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6; DELETE FROM t1 WHERE a = 4 LIMIT 7; -UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9; +UPDATE IGNORE t1 SET a = 9 WHERE a < 2 LIMIT 9; UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2; DELETE FROM t1 WHERE a < 0 LIMIT 5; -INSERT INTO t1 ( a ) VALUES ( 5 ); -UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4; -INSERT INTO t1 ( a ) VALUES ( 5 ); -UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8; +INSERT IGNORE INTO t1 ( a ) VALUES ( 5 ); +UPDATE IGNORE t1 SET a = 4 WHERE a < 6 LIMIT 4; +INSERT IGNORE INTO t1 ( a ) VALUES ( 5 ); +UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 8; DELETE FROM t1 WHERE a < 8 LIMIT 8; -INSERT INTO t1 ( a ) VALUES ( 6 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 6 ); DELETE FROM t1 WHERE a < 6 LIMIT 7; UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7; UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6; -INSERT INTO t1 ( a ) VALUES ( 7 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 7 ); DELETE FROM t1 WHERE a < 9 LIMIT 4; -INSERT INTO t1 ( a ) VALUES ( 7 ); -INSERT INTO t1 ( a ) VALUES ( 6 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 7 ); +INSERT IGNORE INTO t1 ( a ) VALUES ( 6 ); UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4; DELETE FROM t1 WHERE a = 2 LIMIT 9; DELETE FROM t1 WHERE a = 1 LIMIT 4; @@ -628,8 +716,11 @@ INSERT INTO t1 ( a ) VALUES ( 0 ); 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; +UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 3; +connection slave; SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; include/diff_tables.inc [master:t1, slave:t1] +connection master; drop table t1; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result index 4fb33dc4b6b..084089078cc 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +connection master; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; ***** Table Create Section **** @@ -24,6 +25,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; LENGTH(data) 16384 +connection slave; **** Data Insert Validation Slave Section test.t1 **** @@ -36,6 +38,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; LENGTH(data) 16384 +connection master; **** Data Update Section test.t1 **** @@ -50,6 +53,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; LENGTH(data) 17408 +connection slave; **** Data Update Validation Slave Section test.t1 **** @@ -59,6 +63,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; LENGTH(data) 17408 +connection master; **** End Test Section test.t1 **** @@ -109,6 +114,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 20000 b2 30000 dd2 +connection slave; **** Data Insert Validation Slave Section test.t2 **** @@ -120,6 +126,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 20000 b2 30000 dd2 +connection master; **** Data Update Section test.t2 **** @@ -136,6 +143,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 2256 b1 3000 dd1 +connection slave; **** Data Update Validation Slave Section test.t2 **** @@ -147,7 +155,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 2256 b1 3000 dd1 +connection master; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result index faebaba2add..df1fe125aa4 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result @@ -2,27 +2,39 @@ include/master-slave.inc [connection master] ## case #1 - last_null_bit_pos==0 in record_compare without X bit include/rpl_reset.inc +connection master; CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=TokuDB DEFAULT CHARSET=latin1; INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); -UPDATE t1 SET c5 = 'a'; +UPDATE IGNORE t1 SET c5 = 'a'; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit ## (1 column less and no varchar) include/rpl_reset.inc +connection master; CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=TokuDB DEFAULT CHARSET=latin1; INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); -UPDATE t1 SET c5 = 'a'; +UPDATE IGNORE t1 SET c5 = 'a'; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; ## case #2 - X bit is wrongly set. include/rpl_reset.inc +connection master; CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=TokuDB DEFAULT CHARSET= latin1; INSERT INTO t1(c1) VALUES (10); INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result index dbe82cfe8ac..44aacc95124 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result @@ -12,32 +12,24 @@ INSERT INTO test.t1 VALUES (14); ROLLBACK to savepoint t1_save; COMMIT; END| - -< ---- Master selects-- > -------------------------- CALL test.p1(12); SELECT * FROM test.t1; num 12 - -< ---- Slave selects-- > ------------------------- +connection slave; SELECT * FROM test.t1; num 12 - -< ---- Master selects-- > -------------------------- +connection master; CALL test.p1(13); SELECT * FROM test.t1; num 13 - -< ---- Slave selects-- > ------------------------- +connection slave; SELECT * FROM test.t1; num 13 +connection master; DROP PROCEDURE test.p1; DROP TABLE test.t1; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result index d25adb366d5..165df929809 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result @@ -1,9 +1,12 @@ include/master-slave.inc [connection master] +connection master; +connection slave; STOP SLAVE; SET @my_sql_mode= @@global.sql_mode; SET GLOBAL SQL_MODE='STRICT_ALL_TABLES'; START SLAVE; +connection master; CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE=TokuDB; CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE=TokuDB; CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE=TokuDB; @@ -16,6 +19,7 @@ CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=TokuDB; CREATE TABLE t7 (a INT NOT NULL) ENGINE=TokuDB; CREATE TABLE t8 (a INT NOT NULL) ENGINE=TokuDB; CREATE TABLE t9 (a INT) ENGINE=TokuDB; +connection slave; ALTER TABLE t1_int ADD x INT DEFAULT 42; ALTER TABLE t1_bit ADD x BIT(3) DEFAULT b'011', @@ -37,7 +41,7 @@ set @@global.slave_exec_mode= 'IDEMPOTENT'; INSERT INTO t1_int VALUES (2, 4, 4711); INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar'); INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01'); -**** On Master **** +connection master; INSERT INTO t1_int VALUES (1,2); INSERT INTO t1_int VALUES (2,5); INSERT INTO t1_bit VALUES (1,2); @@ -56,7 +60,7 @@ SELECT * FROM t1_char ORDER BY a; a b 1 2 2 5 -**** On Slave **** +connection slave; set @@global.slave_exec_mode= default; SELECT a,b,x FROM t1_int ORDER BY a; a b x @@ -70,7 +74,7 @@ SELECT a,b,x FROM t1_char ORDER BY a; a b x 1 2 Just a test 2 5 Foo is a bar -**** On Master **** +connection master; UPDATE t1_int SET b=2*b WHERE a=2; UPDATE t1_char SET b=2*b WHERE a=2; UPDATE t1_bit SET b=2*b WHERE a=2; @@ -86,7 +90,7 @@ SELECT * FROM t1_char ORDER BY a; a b 1 2 2 10 -**** On Slave **** +connection slave; SELECT a,b,x FROM t1_int ORDER BY a; a b x 1 2 42 @@ -99,38 +103,59 @@ SELECT a,b,x FROM t1_char ORDER BY a; a b x 1 2 Just a test 2 10 Foo is a bar +connection master; INSERT INTO t9 VALUES (2); +connection slave; +connection master; INSERT INTO t1_nodef VALUES (1,2); +connection slave; select count(*) from t1_nodef; count(*) 1 +connection master; INSERT INTO t9 VALUES (2); -**** On Master **** +connection slave; +connection master; INSERT INTO t2 VALUES (2,4); SELECT * FROM t2; a b 2 4 -**** On Slave **** +connection slave; SELECT * FROM t2; a 2 include/check_slave_is_running.inc +connection master; INSERT INTO t9 VALUES (4); +connection slave; +connection master; INSERT INTO t4 VALUES (4); +connection slave; call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535"); call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677"); include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'' +connection master; INSERT INTO t9 VALUES (5); +connection slave; +connection master; INSERT INTO t5 VALUES (5,10,25); +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float'' +connection master; INSERT INTO t9 VALUES (6); +connection slave; +connection master; INSERT INTO t6 VALUES (6,12,36); +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float'' +connection master; INSERT INTO t9 VALUES (6); +connection slave; include/check_slave_is_running.inc +connection master; INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; @@ -143,6 +168,7 @@ a 1 2 3 +connection slave; SELECT * FROM t7 ORDER BY a; a e1 e2 e3 e4 e5 e6 e7 e8 1 NULL NULL NULL NULL NULL NULL NULL NULL @@ -153,37 +179,40 @@ a e1 e2 e3 e4 e5 e6 e7 e8 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 -**** On Master **** +connection master; TRUNCATE t1_nodef; SET SQL_LOG_BIN=0; INSERT INTO t1_nodef VALUES (1,2); INSERT INTO t1_nodef VALUES (2,4); SET SQL_LOG_BIN=1; -**** On Slave **** +connection slave; +connection slave; INSERT INTO t1_nodef VALUES (1,2,3,4,5); INSERT INTO t1_nodef VALUES (2,4,6,8,10); -**** On Master **** +connection master; UPDATE t1_nodef SET b=2*b WHERE a=1; SELECT * FROM t1_nodef ORDER BY a; a b 1 4 2 4 -**** On Slave **** +connection slave; SELECT * FROM t1_nodef ORDER BY a; a b x y z 1 4 3 4 5 2 4 6 8 10 -**** On Master **** +connection master; DELETE FROM t1_nodef WHERE a=2; SELECT * FROM t1_nodef ORDER BY a; a b 1 4 -**** On Slave **** +connection slave; SELECT * FROM t1_nodef ORDER BY a; a b x y z 1 4 3 4 5 **** Cleanup **** +connection master; DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef; DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9; +connection slave; SET @@global.sql_mode= @my_sql_mode; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result index 5e7c3c94b14..19ca9b2c59e 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result @@ -1,22 +1,34 @@ include/master-slave.inc [connection master] include/rpl_reset.inc +connection master; CREATE TABLE t1 (c1 BIT, c2 INT) Engine=TokuDB; INSERT INTO `t1` VALUES ( 1, 1 ); UPDATE t1 SET c1=NULL where c2=1; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DELETE FROM t1 WHERE c2=1 LIMIT 1; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; include/rpl_reset.inc +connection master; CREATE TABLE t1 (c1 CHAR) Engine=TokuDB; INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; SELECT * FROM t1; c1 w UPDATE t1 SET c1=NULL WHERE c1='w'; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DELETE FROM t1 LIMIT 2; +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result index 63ca932bf57..9151f407548 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +connection master; CREATE TABLE t4 ( id INT(5) unsigned NOT NULL auto_increment, name varchar(15) NOT NULL default '', @@ -15,10 +16,12 @@ SELECT * FROM t4; id name number 1 XXX 12345 2 XXY 12345 +connection slave; SELECT * FROM t4; id name number 1 XXX 12345 2 XXY 12345 +connection master; LOAD DATA INFILE '../../std_data/loaddata_pair.dat' REPLACE INTO TABLE t4 @@ -27,18 +30,26 @@ SELECT * FROM t4; id name number 4 XXX 12345 5 XXY 12345 +connection slave; SELECT * FROM t4; id name number 4 XXX 12345 5 XXY 12345 +connection master; +connection slave; +connection master; FLUSH LOGS; +connection slave; FLUSH LOGS; +connection master; DROP DATABASE IF EXISTS mysqltest1; CREATE DATABASE mysqltest1; CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT) ENGINE=InnoDB; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="TokuDB"; SET AUTOCOMMIT = 0; +connection slave; -------- switch to slave -------- +connection slave; ALTER TABLE mysqltest1.t1 ENGINE = MyISAM; SHOW CREATE TABLE mysqltest1.t1; Table Create Table @@ -46,6 +57,7 @@ t1 CREATE TABLE `t1` ( `f1` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -------- switch to master -------- +connection master; INSERT INTO mysqltest1.t1 SET f1= 1; DROP TEMPORARY TABLE mysqltest1.tmp; ROLLBACK; @@ -67,7 +79,9 @@ tmp2 CREATE TEMPORARY TABLE `tmp2` ( SELECT COUNT(*) FROM mysqltest1.t1; COUNT(*) 0 +connection slave; -------- switch to slave -------- +connection slave; SHOW CREATE TABLE mysqltest1.tmp; ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist SHOW CREATE TABLE mysqltest1.tmp2; @@ -78,6 +92,7 @@ COUNT(*) 2 FLUSH LOGS; -------- switch to master -------- +connection master; FLUSH LOGS; DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2; DROP DATABASE mysqltest1; @@ -101,11 +116,15 @@ INSERT INTO t1 (b) VALUES (1),(2),(3); BEGIN; INSERT INTO t1(b) VALUES (4); -------- switch to master1 -------- +connection master1; RENAME TABLE t1 TO t3, t2 TO t1;; -------- switch to master -------- +connection master; COMMIT; -------- switch to master1 -------- +connection master1; -------- switch to master -------- +connection master; SELECT * FROM t1; id b SELECT * FROM t3; @@ -114,7 +133,9 @@ id b 2 2 3 3 4 4 +connection slave; -------- switch to slave -------- +connection slave; SELECT * FROM t1; id b SELECT * FROM t3; @@ -124,6 +145,7 @@ id b 3 3 4 4 -------- switch to master -------- +connection master; DROP TABLE t1; DROP TABLE t3; End of 6.0 tests diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result index f5b84a27f72..c7450a1b9c0 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result @@ -102,37 +102,40 @@ Master bykey 500 CALL test.proc_byrange(); SELECT count(*) as "Master byrange" FROM test.byrange_tbl; Master byrange 500 +connection slave; +connection slave; show create table test.byrange_tbl; Table byrange_tbl Create Table CREATE TABLE `byrange_tbl` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, - `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `user` char(255) DEFAULT NULL, - `uuidf` longblob, + `uuidf` longblob DEFAULT NULL, `fkid` mediumint(9) DEFAULT NULL, `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TokuDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (id) -SUBPARTITION BY HASH (id) + PARTITION BY RANGE (`id`) +SUBPARTITION BY HASH (`id`) SUBPARTITIONS 2 -(PARTITION pa1 VALUES LESS THAN (10) ENGINE = TokuDB, - PARTITION pa2 VALUES LESS THAN (20) ENGINE = TokuDB, - PARTITION pa3 VALUES LESS THAN (30) ENGINE = TokuDB, - PARTITION pa4 VALUES LESS THAN (40) ENGINE = TokuDB, - PARTITION pa5 VALUES LESS THAN (50) ENGINE = TokuDB, - PARTITION pa6 VALUES LESS THAN (60) ENGINE = TokuDB, - PARTITION pa7 VALUES LESS THAN (70) ENGINE = TokuDB, - PARTITION pa8 VALUES LESS THAN (80) ENGINE = TokuDB, - PARTITION pa9 VALUES LESS THAN (90) ENGINE = TokuDB, - PARTITION pa10 VALUES LESS THAN (100) ENGINE = TokuDB, - PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */ +(PARTITION `pa1` VALUES LESS THAN (10) ENGINE = TokuDB, + PARTITION `pa2` VALUES LESS THAN (20) ENGINE = TokuDB, + PARTITION `pa3` VALUES LESS THAN (30) ENGINE = TokuDB, + PARTITION `pa4` VALUES LESS THAN (40) ENGINE = TokuDB, + PARTITION `pa5` VALUES LESS THAN (50) ENGINE = TokuDB, + PARTITION `pa6` VALUES LESS THAN (60) ENGINE = TokuDB, + PARTITION `pa7` VALUES LESS THAN (70) ENGINE = TokuDB, + PARTITION `pa8` VALUES LESS THAN (80) ENGINE = TokuDB, + PARTITION `pa9` VALUES LESS THAN (90) ENGINE = TokuDB, + PARTITION `pa10` VALUES LESS THAN (100) ENGINE = TokuDB, + PARTITION `pa11` VALUES LESS THAN MAXVALUE ENGINE = TokuDB) SELECT count(*) "Slave norm" FROM test.regular_tbl; Slave norm 500 SELECT count(*) "Slave bykey" FROM test.bykey_tbl; Slave bykey 500 SELECT count(*) "Slave byrange" FROM test.byrange_tbl; Slave byrange 500 +connection master; DROP PROCEDURE test.proc_norm; DROP PROCEDURE test.proc_bykey; DROP PROCEDURE test.proc_byrange; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result index ac9aa2460f7..f3ffc908504 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result @@ -27,6 +27,8 @@ SET del_count = del_count - 2; END WHILE; END| CALL test.proc_norm(); +connection slave; +connection master; DROP PROCEDURE test.proc_norm; DROP TABLE test.regular_tbl; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result index d72837498cd..cc9174ba09e 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_commit_after_flush.result @@ -5,6 +5,9 @@ begin; insert into t1 values(1); flush tables with read lock; commit; +connection slave; +connection master; unlock tables; drop table t1; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result index fdff14d3cdc..02da7194eb5 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id.result @@ -9,13 +9,16 @@ # include/master-slave.inc [connection master] +connection master; SET @old_concurrent_insert= @@global.concurrent_insert; SET @@global.concurrent_insert= 0; +connection master; create table t1(a int auto_increment, key(a)) engine=tokudb; create table t2(b int auto_increment, c int, key(b)) engine=tokudb; insert into t1 values (1),(2),(3); insert into t1 values (null); insert into t2 values (null,last_insert_id()); +connection slave; select * from t1 ORDER BY a; a 1 @@ -25,6 +28,7 @@ a select * from t2 ORDER BY b; b c 1 4 +connection master; drop table t1; drop table t2; create table t1(a int auto_increment, key(a)) engine=tokudb; @@ -35,6 +39,7 @@ insert into t1 values (null),(null),(null); insert into t2 values (5,0); insert into t2 values (null,last_insert_id()); SET FOREIGN_KEY_CHECKS=1; +connection slave; select * from t1; a 10 @@ -45,6 +50,7 @@ select * from t2; b c 5 0 6 11 +connection master; # # check if INSERT SELECT in auto_increment is well replicated (bug #490) # @@ -63,6 +69,7 @@ b c 7 11 8 12 9 13 +connection slave; select * from t1 ORDER BY a; a 10 @@ -76,21 +83,28 @@ b c 7 11 8 12 9 13 +connection master; drop table t1; drop table t2; +connection slave; # # Bug#8412: Error codes reported in binary log for CHARACTER SET, # FOREIGN_KEY_CHECKS # +connection master; SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ) engine=tokudb; SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); Got one of the listed errors +connection slave; +connection master; drop table t1; +connection slave; # # Bug#14553: NULL in WHERE resets LAST_INSERT_ID # +connection master; set @@session.sql_auto_is_null=1; create table t1(a int auto_increment, key(a)) engine=tokudb; create table t2(a int) engine=tokudb; @@ -100,9 +114,12 @@ insert into t2 (a) select a from t1 where a is null; select * from t2; a 1 +connection slave; +connection slave; select * from t2; a 1 +connection master; drop table t1; drop table t2; # @@ -113,6 +130,7 @@ drop table t2; # # The solution is not to reset last_insert_id on enter to sub-statement. # +connection master; drop function if exists bug15728; drop function if exists bug15728_insert; drop table if exists t1, t2; @@ -178,6 +196,7 @@ id last_id 1 3 2 4 3 5 +connection slave; select * from t1; id last_id 1 0 @@ -191,6 +210,7 @@ id last_id 1 3 2 4 3 5 +connection master; drop function bug15728; drop function bug15728_insert; drop table t1,t2; @@ -211,20 +231,24 @@ insert into t1 values(null,100); select * from t1 order by n; n b 1 100 +connection slave; insert into t1 values(null,200),(null,300); delete from t1 where b <> 100; select * from t1 order by n; n b 1 100 +connection master; replace into t1 values(null,100),(null,350); select * from t1 order by n; n b 2 100 3 350 +connection slave; select * from t1 order by n; n b 2 100 3 350 +connection master; insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000; select * from t1 order by n; n b @@ -232,12 +256,14 @@ n b 4 400 1000 350 1001 600 +connection slave; select * from t1 order by n; n b 2 100 4 400 1000 350 1001 600 +connection master; drop table t1; create table t1 (n int primary key auto_increment not null, b int, unique(b)) engine=tokudb; @@ -245,21 +271,27 @@ insert into t1 values(null,100); select * from t1 order by n; n b 1 100 +connection slave; insert into t1 values(null,200),(null,300); delete from t1 where b <> 100; select * from t1 order by n; n b 1 100 +connection master; insert into t1 values(null,100),(null,350) on duplicate key update n=2; select * from t1 order by n; n b 2 100 3 350 +connection slave; select * from t1 order by n; n b 2 100 3 350 +connection master; drop table t1; +connection slave; +connection master; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, UNIQUE(b)) ENGINE=tokudb; INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; @@ -267,10 +299,12 @@ SELECT * FROM t1 ORDER BY a; a b 1 10 2 2 +connection slave; SELECT * FROM t1 ORDER BY a; a b 1 10 2 2 +connection master; drop table t1; CREATE TABLE t1 ( id bigint(20) unsigned NOT NULL auto_increment, @@ -309,6 +343,7 @@ id field_1 field_2 field_3 4 4 d 4d 5 5 e 5e 8 6 f 6f +connection slave; SELECT * FROM t1 ORDER BY id; id field_1 field_2 field_3 1 1 a 1a @@ -317,7 +352,9 @@ id field_1 field_2 field_3 4 4 d 4d 5 5 e 5e 8 6 f 6f +connection master; drop table t1, t2; +connection master; DROP PROCEDURE IF EXISTS p1; DROP TABLE IF EXISTS t1, t2; SELECT LAST_INSERT_ID(0); @@ -345,12 +382,14 @@ id last_id SELECT * FROM t2 ORDER BY id; id last_id 1 0 +connection slave; SELECT * FROM t1 ORDER BY id; id last_id 0 1 SELECT * FROM t2 ORDER BY id; id last_id 1 0 +connection master; DROP PROCEDURE p1; DROP TABLE t1, t2; DROP PROCEDURE IF EXISTS p1; @@ -396,7 +435,9 @@ INSERT INTO t1 VALUES (NULL, f2()); INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID()); UPDATE t1 SET j= -1 WHERE i IS NULL; INSERT INTO t1 (i) VALUES (NULL); +connection master1; INSERT INTO t1 (i) VALUES (NULL); +connection master; SELECT f3(); f3() 0 @@ -426,6 +467,7 @@ i 5 6 16 +connection slave; SELECT * FROM t1; i j 1 -1 @@ -452,19 +494,23 @@ i 5 6 16 +connection master; DROP PROCEDURE p1; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; DROP TABLE t1, t2; +connection slave; # # End of 5.0 tests # +connection master; create table t2 ( id int not null auto_increment, last_id int, primary key (id) ) engine=tokudb; +connection master; truncate table t2; create table t1 (id tinyint primary key) engine=tokudb; create function insid() returns int @@ -491,6 +537,7 @@ select * from t2 order by id; id last_id 4 0 8 0 +connection slave; select * from t1 order by id; id 0 @@ -498,6 +545,7 @@ select * from t2 order by id; id last_id 4 0 8 0 +connection master; drop table t1; drop function insid; truncate table t2; @@ -517,12 +565,14 @@ n b select * from t2 order by id; id last_id 1 3 +connection slave; select * from t1 order by n; n b 1 10 select * from t2 order by id; id last_id 1 3 +connection master; drop table t1, t2; drop procedure foo; SET @@global.concurrent_insert= @old_concurrent_insert; diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result index 359904787e3..20369a1842c 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_insert_id_pk.result @@ -6,6 +6,7 @@ create table t2(b int auto_increment, c int, primary key(b)); insert into t1 values (1),(2),(3); insert into t1 values (null); insert into t2 values (null,last_insert_id()); +connection slave; select * from t1 ORDER BY a; a 1 @@ -15,6 +16,7 @@ a select * from t2 ORDER BY b; b c 1 4 +connection master; drop table t1; drop table t2; create table t1(a int auto_increment, key(a)) engine=tokudb; @@ -25,6 +27,7 @@ insert into t1 values (null),(null),(null); insert into t2 values (5,0); insert into t2 values (null,last_insert_id()); SET FOREIGN_KEY_CHECKS=1; +connection slave; select * from t1; a 10 @@ -35,6 +38,7 @@ select * from t2; b c 5 0 6 11 +connection master; drop table t2; drop table t1; create table t1(a int auto_increment, primary key(a)); @@ -50,6 +54,7 @@ b c 7 11 8 12 9 13 +connection slave; select * from t1 ORDER BY a; a 10 @@ -63,12 +68,17 @@ b c 7 11 8 12 9 13 +connection master; drop table t1; drop table t2; +connection slave; +connection master; SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); Got one of the listed errors +connection slave; +connection master; drop table t1; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result index b5ceeba165c..d6d4aebd523 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result @@ -1,6 +1,6 @@ include/master-slave.inc [connection master] -==========MASTER========== +connection master; show global variables like 'binlog_format%'; Variable_name Value binlog_format MIXED @@ -10,7 +10,7 @@ binlog_format MIXED select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format MIXED MIXED -==========SLAVE=========== +connection slave; show global variables like 'binlog_format%'; Variable_name Value binlog_format MIXED @@ -20,6 +20,7 @@ binlog_format MIXED select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format MIXED MIXED +connection master; ******************** DDL for database ******************** DROP DATABASE IF EXISTS test_rpl; @@ -29,14 +30,14 @@ ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci; DROP DATABASE test_rpl_1; CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci; -==========MASTER========== SHOW DATABASES LIKE 'test_rpl%'; Database (test_rpl%) test_rpl -==========SLAVE=========== +connection slave; SHOW DATABASES LIKE 'test_rpl%'; Database (test_rpl%) test_rpl +connection master; USE test_rpl; ******************** DDL for tables ******************** @@ -47,7 +48,6 @@ ALTER TABLE t0 ADD INDEX index1 (b); ALTER TABLE t0 DROP COLUMN c; RENAME TABLE t0 TO t1; CREATE TABLE t2 LIKE t1; -==========MASTER========== SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` ( PRIMARY KEY (`a`), KEY `index1` (`b`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -==========SLAVE=========== +connection slave; USE test_rpl; SHOW CREATE TABLE t1; Table Create Table @@ -82,12 +82,12 @@ t2 CREATE TABLE `t2` ( PRIMARY KEY (`a`), KEY `index1` (`b`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 +connection master; ******************** DDL for indexes ******************** ALTER TABLE t2 ADD COLUMN d datetime; CREATE INDEX index2 on t2 (d); CREATE INDEX index3 on t2 (a, d); -==========MASTER========== SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -107,7 +107,7 @@ t2 CREATE TABLE `t2` ( KEY `index2` (`d`), KEY `index3` (`a`,`d`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 -==========SLAVE=========== +connection slave; USE test_rpl; SHOW CREATE TABLE t1; Table Create Table @@ -128,6 +128,7 @@ t2 CREATE TABLE `t2` ( KEY `index2` (`d`), KEY `index3` (`a`,`d`) ) ENGINE=TokuDB DEFAULT CHARSET=latin1 +connection master; ALTER TABLE t2 DROP COLUMN d; @@ -170,5 +171,8 @@ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d) master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d +connection slave; +connection master; drop database test_rpl; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result index 59b05ea4dfb..7f8b9dd5104 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result @@ -3,7 +3,7 @@ Warnings: Warning 131 Using tokudb_pk_insert_mode is deprecated and the parameter may be removed in future releases. include/master-slave.inc [connection master] -==========MASTER========== +connection master; show global variables like 'binlog_format%'; Variable_name Value binlog_format MIXED @@ -13,7 +13,7 @@ binlog_format MIXED select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format MIXED MIXED -==========SLAVE=========== +connection slave; show global variables like 'binlog_format%'; Variable_name Value binlog_format MIXED @@ -23,6 +23,7 @@ binlog_format MIXED select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format MIXED MIXED +connection master; CREATE DATABASE test_rpl; ******************** PREPARE TESTING ******************** @@ -36,7 +37,6 @@ INSERT INTO t2 VALUES(1, 't2, text 1'); ******************** DELETE ******************** DELETE FROM t1 WHERE a = 1; DELETE FROM t2 WHERE b <> UUID(); -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -48,7 +48,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -61,6 +61,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; DELETE FROM t1; DELETE FROM t2; @@ -71,7 +72,6 @@ INSERT INTO t2 SELECT * FROM t1; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1'; DELETE FROM t1 WHERE a = 2; DELETE FROM t2 WHERE a = 2; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -84,7 +84,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -98,6 +98,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 +connection master; DELETE FROM t1; DELETE FROM t2; @@ -108,7 +109,6 @@ a b 10 line A 20 line B 30 line C -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 3 @@ -122,7 +122,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -137,6 +137,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; DELETE FROM t1; DELETE FROM t2; @@ -148,7 +149,6 @@ REPLACE INTO t1 VALUES(1, 't1, text 11'); REPLACE INTO t1 VALUES(2, UUID()); REPLACE INTO t1 SET a=3, b='t1, text 33'; DELETE FROM t1 WHERE a = 2; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 2 @@ -161,7 +161,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -175,6 +175,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; DELETE FROM t1; DELETE FROM t2; @@ -214,7 +215,6 @@ DELETE FROM t2; ******************** TRUNCATE ******************** INSERT INTO t1 VALUES(1, 't1, text 1'); -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -226,7 +226,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -239,8 +239,8 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; TRUNCATE t1; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -251,7 +251,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -263,6 +263,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; DELETE FROM t1; DELETE FROM t2; @@ -270,7 +271,6 @@ DELETE FROM t2; INSERT INTO t1 VALUES(1, 't1, text 1'); INSERT INTO t2 VALUES(1, 't2, text 1'); UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -283,7 +283,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -297,8 +297,8 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 +connection master; UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test'; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -311,7 +311,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 test -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -325,6 +325,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 test +connection master; DELETE FROM t1; DELETE FROM t2; @@ -344,7 +345,6 @@ USE test_rpl; START TRANSACTION; INSERT INTO t1 VALUES (1, 'start'); COMMIT; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -356,7 +356,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -369,10 +369,10 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; START TRANSACTION; INSERT INTO t1 VALUES (2, 'rollback'); ROLLBACK; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -384,7 +384,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -397,12 +397,12 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; START TRANSACTION; INSERT INTO t1 VALUES (3, 'before savepoint s1'); SAVEPOINT s1; INSERT INTO t1 VALUES (4, 'after savepoint s1'); ROLLBACK TO SAVEPOINT s1; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 2 @@ -415,7 +415,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -428,6 +428,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; START TRANSACTION; INSERT INTO t1 VALUES (5, 'before savepoint s2'); SAVEPOINT s2; @@ -436,7 +437,6 @@ INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID())); RELEASE SAVEPOINT s2; COMMIT; DELETE FROM t1 WHERE a = 7; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 4 @@ -451,7 +451,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -467,6 +467,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; DELETE FROM t1; DELETE FROM t2; @@ -482,73 +483,73 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ******************** CREATE USER ******************** CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111'; -==========MASTER========== SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *1111111111111111111111111111111111111111 N -==========SLAVE=========== +connection slave; USE test_rpl; SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *1111111111111111111111111111111111111111 N +connection master; ******************** GRANT ******************** GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost'; -==========MASTER========== SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *1111111111111111111111111111111111111111 Y -==========SLAVE=========== +connection slave; USE test_rpl; SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *1111111111111111111111111111111111111111 Y +connection master; ******************** REVOKE ******************** REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost'; -==========MASTER========== SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *1111111111111111111111111111111111111111 N -==========SLAVE=========== +connection slave; USE test_rpl; SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *1111111111111111111111111111111111111111 N +connection master; ******************** SET PASSWORD ******************** SET PASSWORD FOR 'user_test_rpl'@'localhost' = '*0000000000000000000000000000000000000000'; -==========MASTER========== SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *0000000000000000000000000000000000000000 N -==========SLAVE=========== +connection slave; USE test_rpl; SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl *0000000000000000000000000000000000000000 N +connection master; ******************** RENAME USER ******************** RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost'; -==========MASTER========== SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N -==========SLAVE=========== +connection slave; USE test_rpl; SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N +connection master; ******************** DROP USER ******************** DROP USER 'user_test_rpl_2'@'localhost'; -==========MASTER========== SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv -==========SLAVE=========== +connection slave; USE test_rpl; SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; host user password select_priv +connection master; INSERT INTO t1 VALUES(100, 'test'); ******************** ANALYZE ******************** @@ -583,14 +584,14 @@ SHOW VARIABLES LIKE 'test_rpl_var'; Variable_name Value ******************** SHOW ******************** -==========MASTER========== SHOW DATABASES LIKE 'test_rpl%'; Database (test_rpl%) test_rpl -==========SLAVE=========== +connection slave; SHOW DATABASES LIKE 'test_rpl%'; Database (test_rpl%) test_rpl +connection master; ******************** PROCEDURE ******************** CREATE PROCEDURE p1 () @@ -606,7 +607,6 @@ CALL p1(); INSERT INTO t1 VALUES(202, 'test 202'); CALL p2(); DELETE FROM t1 WHERE a = 202; -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 2 @@ -619,7 +619,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -633,6 +633,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; ALTER PROCEDURE p1 COMMENT 'p1'; DROP PROCEDURE p1; DROP PROCEDURE p2; @@ -645,7 +646,6 @@ FOR EACH ROW BEGIN INSERT INTO t2 SET a = NEW.a, b = NEW.b; END| INSERT INTO t1 VALUES (1, 'test'); -==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -658,7 +658,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 test -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -672,6 +672,7 @@ COUNT(*) SELECT * FROM t2 ORDER BY a; a b 1 test +connection master; DELETE FROM t1; DELETE FROM t2; DROP TRIGGER tr1; @@ -681,16 +682,15 @@ DROP TRIGGER tr1; GRANT EVENT ON *.* TO 'root'@'localhost'; INSERT INTO t1 VALUES(1, 'test1'); CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1; -==========MASTER========== SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci -==========SLAVE=========== +connection slave; USE test_rpl; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci -==========MASTER========== +connection master; SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -702,7 +702,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -715,7 +715,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========MASTER========== +connection master; SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -727,7 +727,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -740,17 +740,17 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; ALTER EVENT e1 RENAME TO e2; -==========MASTER========== SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci -==========SLAVE=========== +connection slave; USE test_rpl; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci -==========MASTER========== +connection master; SELECT COUNT(*) FROM t1; COUNT(*) 1 @@ -762,7 +762,7 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b -==========SLAVE=========== +connection slave; USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) @@ -775,14 +775,15 @@ COUNT(*) 0 SELECT * FROM t2 ORDER BY a; a b +connection master; DROP EVENT e2; -==========MASTER========== SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation -==========SLAVE=========== +connection slave; USE test_rpl; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +connection master; DELETE FROM t1; DELETE FROM t2; @@ -791,37 +792,37 @@ INSERT INTO t1 VALUES(1, 'test1'); INSERT INTO t1 VALUES(2, 'test2'); CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1; CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID(); -==========MASTER========== SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 1 test1 -==========SLAVE=========== +connection slave; USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 1 test1 +connection master; ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2; -==========MASTER========== SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 2 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 2 test2 -==========SLAVE=========== +connection slave; USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 2 latin1 latin1_swedish_ci SELECT * FROM v1 ORDER BY a; a b 2 test2 +connection master; DROP VIEW v1; DROP VIEW v2; DELETE FROM t1; @@ -850,6 +851,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 1 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # DELETE FROM t2 WHERE b <> UUID() master-bin.000001 # Table_map # # table_id: # (test_rpl.t2) master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -863,10 +865,12 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES(2, UUID()) master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test_rpl.t2) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -886,6 +890,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -908,6 +913,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11') master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # REPLACE INTO t1 VALUES(2, UUID()) master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -1002,6 +1008,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2') master-bin.000001 # Query # # SAVEPOINT `s2` master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2') +master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID())) master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -1055,6 +1062,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202') master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # UPDATE t1 SET b = UUID() WHERE a = 202 master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -1079,6 +1087,7 @@ FOR EACH ROW BEGIN INSERT INTO t2 SET a = NEW.a, b = NEW.b; END master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SET a = NEW.a, b = NEW.b master-bin.000001 # Table_map # # table_id: # (test_rpl.t1) master-bin.000001 # Table_map # # table_id: # (test_rpl.t2) master-bin.000001 # Write_rows_v1 # # table_id: # @@ -1131,5 +1140,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 master-bin.000001 # Xid # # COMMIT /* XID */ +connection slave; +connection master; drop database test_rpl; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result index 89236dcea4e..1036e753961 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update.result @@ -21,5 +21,7 @@ a b 1 0 2 1 UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; +connection slave; +connection master; drop table t1, t2; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result index df5fac74cf0..e51eac13783 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update2.result @@ -30,6 +30,7 @@ SELECT * FROM t2 ORDER BY a; a b 1 0 2 1 +connection slave; SELECT * FROM t1 ORDER BY a; a b 1 4 @@ -38,16 +39,23 @@ SELECT * FROM t2 ORDER BY a; a b 1 0 2 1 +connection master; drop table t1,t2; +connection slave; reset master; +connection master; CREATE TABLE t1 ( a INT ); INSERT INTO t1 VALUES (0); UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; select * from t1; a 3 +connection slave; +connection slave; select * from t1; a 3 +connection master; drop table t1; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result index bcad07eb0b6..aae924f2ae8 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_multi_update3.result @@ -31,6 +31,8 @@ SELECT * FROM t2 ORDER BY a; a b 1 6 2 6 +connection slave; +connection slave; SELECT * FROM t1 ORDER BY a; a b 1 0 @@ -39,9 +41,11 @@ SELECT * FROM t2 ORDER BY a; a b 1 6 2 6 +connection master; drop table t1,t2; -------- Test 1 for BUG#9361 -------- +connection master; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1 ( @@ -66,15 +70,19 @@ WHERE b2 = 'baz') AND a.a3 IS NULL AND a.a4 = 'foo' AND a.a5 = 'bar'; +connection slave; +connection slave; SELECT * FROM t1; a1 a2 a3 a4 a5 No 1 NULL foo bar SELECT * FROM t2; b1 b2 1 baz +connection master; DROP TABLE t1, t2; -------- Test 2 for BUG#9361 -------- +connection master; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t3; @@ -115,9 +123,12 @@ FROM t3 WHERE y = 34 ) WHERE b.x = 23; +connection slave; +connection slave; SELECT * FROM t1; i j x y z 1 2 23 24 71 +connection master; DROP TABLE t1, t2, t3; DROP TABLE IF EXISTS t1; Warnings: @@ -175,6 +186,7 @@ idpro price nbprice 1 1.0000 3 2 1.0000 2 3 2.0000 1 +connection slave; select "-- SLAVE AFTER JOIN --" as ""; -- SLAVE AFTER JOIN -- @@ -191,5 +203,6 @@ idpro price nbprice 1 1.0000 3 2 1.0000 2 3 2.0000 1 +connection master; DROP TABLE t1, t2; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result index c81a2ebac44..593f177569f 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result @@ -1,6 +1,8 @@ include/master-slave.inc [connection master] +connection master; drop table if exists t; +connection slave; show variables like 'tokudb_rpl%'; Variable_name Value tokudb_rpl_check_readonly ON @@ -8,14 +10,21 @@ tokudb_rpl_lookup_rows ON tokudb_rpl_lookup_rows_delay 0 tokudb_rpl_unique_checks OFF tokudb_rpl_unique_checks_delay 5000 +connection master; create table t (a bigint not null, primary key(a)) engine=tokudb; select unix_timestamp() into @tstart; insert into t values (1); insert into t values (2),(3); insert into t values (4); +connection slave; +connection master; select unix_timestamp()-@tstart <= 10; unix_timestamp()-@tstart <= 10 0 +connection slave; +connection master; include/diff_tables.inc [master:test.t, slave:test.t] +connection master; drop table if exists t; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result index f283b3adf80..ab33725fa3f 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_log.result @@ -1,13 +1,16 @@ include/master-slave.inc [connection master] +connection slave; include/stop_slave.inc include/wait_for_slave_to_stop.inc reset master; reset slave; start slave; include/wait_for_slave_to_start.inc +connection slave; set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode; set @@global.slave_ddl_exec_mode=STRICT; +connection master; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB; insert into t1 values (NULL); drop table t1; @@ -21,6 +24,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -29,6 +33,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # load data infile '../../std_data/words.dat' into table t1 ignore 1 lines master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -44,11 +49,13 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ flush logs; create table t3 (a int)ENGINE=TokuDB; +connection master; select * from t1 order by 1 asc; word Aarhus @@ -120,6 +127,7 @@ Aberdeen Abernathy aberrant aberration +connection slave; select * from t1 order by 1 asc; word Aarhus @@ -194,6 +202,7 @@ aberration flush logs; include/stop_slave.inc include/start_slave.inc +connection master; create table t2 (n int)ENGINE=TokuDB; insert into t2 values (1); include/show_binlog_events.inc @@ -201,6 +210,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -209,6 +219,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # load data infile '../../std_data/words.dat' into table t1 ignore 1 lines master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -220,6 +231,7 @@ master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB master-bin.000002 # Gtid # # GTID #-#-# master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows # # insert into t2 values (1) master-bin.000002 # Table_map # # table_id: # (test.t2) master-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000002 # Xid # # COMMIT /* XID */ @@ -227,6 +239,7 @@ show binary logs; Log_name File_size master-bin.000001 # master-bin.000002 # +connection slave; show binary logs; Log_name File_size slave-bin.000001 # @@ -236,6 +249,7 @@ Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Annotate_rows # # insert into t1 values (NULL) slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F slave-bin.000001 # Xid # # COMMIT /* XID */ @@ -244,6 +258,7 @@ slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Annotate_rows # # load data infile '../../std_data/words.dat' into table t1 ignore 1 lines slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F slave-bin.000001 # Xid # # COMMIT /* XID */ @@ -255,16 +270,19 @@ Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Gtid # # GTID #-#-# slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB slave-bin.000002 # Gtid # # BEGIN GTID #-#-# +slave-bin.000002 # Annotate_rows # # insert into t2 values (1) slave-bin.000002 # Table_map # # table_id: # (test.t2) slave-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F slave-bin.000002 # Xid # # COMMIT /* XID */ 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 +connection master; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; include/rpl_reset.inc +connection master; create table t1(a int auto_increment primary key, b int); insert into t1 values (NULL, 1); set insert_id=5; @@ -274,10 +292,12 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int) master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL, 1) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT @@ -287,5 +307,7 @@ a b 5 1 6 1 drop table t1; +connection slave; set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode; +connection master; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result index 4d9497386d6..c3345d52d06 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp003.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; @@ -17,22 +18,29 @@ END| SELECT get_lock("test", 200); get_lock("test", 200) 1 +connection master1; CALL test.p1(); +connection master; CALL test.p2(); SELECT release_lock("test"); release_lock("test") 1 +connection master1; get_lock("test", 100) 1 SELECT release_lock("test"); release_lock("test") 1 +connection master; SELECT * FROM test.t1; a 5 +connection slave; +connection slave; SELECT * FROM test.t1; a 5 +connection master; DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=TOKUDB; CALL test.p2(); @@ -45,10 +53,14 @@ release_lock("test") SELECT * FROM test.t1; a 8 +connection slave; +connection slave; SELECT * FROM test.t1; a 8 +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result index c8da9ade375..33c6c266950 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_sp006.result @@ -33,9 +33,14 @@ BEGIN INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1'); END| CALL p2(); +connection slave; +connection master; CALL p1(); +connection slave; +connection master; DROP TABLE t1; DROP TABLE t2; DROP PROCEDURE p1; DROP PROCEDURE p2; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result index a0573fac89e..4d7ab112bc8 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_row_trig004.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +connection master; DROP TRIGGER test.t1_bi_t2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; @@ -15,13 +16,17 @@ n d select * from test.t2; n f 1 0 +connection slave; +connection slave; select * from test.t1; n d 1 1.234 select * from test.t2; n f 1 0 +connection master; DROP TRIGGER test.t1_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result index 0334000f12e..652ef18c039 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_stm_log.result @@ -1,13 +1,16 @@ include/master-slave.inc [connection master] +connection slave; include/stop_slave.inc include/wait_for_slave_to_stop.inc reset master; reset slave; start slave; include/wait_for_slave_to_start.inc +connection slave; set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode; set @@global.slave_ddl_exec_mode=STRICT; +connection master; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB; insert into t1 values (NULL); drop table t1; @@ -47,8 +50,10 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# flush logs; create table t3 (a int)ENGINE=TokuDB; +connection master; select * from t1 order by 1 asc; word Aarhus @@ -120,6 +125,7 @@ Aberdeen Abernathy aberrant aberration +connection slave; select * from t1 order by 1 asc; word Aarhus @@ -194,6 +200,7 @@ aberration flush logs; include/stop_slave.inc include/start_slave.inc +connection master; create table t2 (n int)ENGINE=TokuDB; insert into t2 values (1); include/show_binlog_events.inc @@ -226,6 +233,7 @@ show binary logs; Log_name File_size master-bin.000001 # master-bin.000002 # +connection slave; show binary logs; Log_name File_size slave-bin.000001 # @@ -259,10 +267,12 @@ slave-bin.000002 # Xid # # COMMIT /* XID */ 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 +connection master; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; include/rpl_reset.inc +connection master; create table t1(a int auto_increment primary key, b int); insert into t1 values (NULL, 1); set insert_id=5; @@ -286,5 +296,7 @@ a b 5 1 6 1 drop table t1; +connection slave; set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode; +connection master; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result index 5915abe9e94..5d3737817a1 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result @@ -1,35 +1,47 @@ include/master-slave.inc [connection master] include/rpl_reset.inc -**** On Master **** +connection master; CREATE TABLE t1 (a INT, b LONG) ENGINE=TokuDB; INSERT INTO t1 VALUES (1,1), (2,2); -**** On Master **** +connection slave; +connection master; TRUNCATE TABLE t1; +connection slave; include/diff_tables.inc [master:t1, slave:t1] ==== Test using a table with delete triggers ==== -**** On Master **** +connection master; SET @count := 1; CREATE TABLE t2 (a INT, b LONG) ENGINE=TokuDB; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; -**** On Master **** +connection slave; +connection master; TRUNCATE TABLE t1; +connection slave; include/diff_tables.inc [master:t2, slave:t2] +connection master; DROP TABLE t1,t2; +connection slave; include/rpl_reset.inc -**** On Master **** +connection master; CREATE TABLE t1 (a INT, b LONG) ENGINE=TokuDB; INSERT INTO t1 VALUES (1,1), (2,2); -**** On Master **** +connection slave; +connection master; DELETE FROM t1; +connection slave; include/diff_tables.inc [master:t1, slave:t1] ==== Test using a table with delete triggers ==== -**** On Master **** +connection master; SET @count := 1; CREATE TABLE t2 (a INT, b LONG) ENGINE=TokuDB; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; -**** On Master **** +connection slave; +connection master; DELETE FROM t1; +connection slave; include/diff_tables.inc [master:t2, slave:t2] +connection master; DROP TABLE t1,t2; +connection slave; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result index daceec6180a..636792ce4db 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result @@ -1,10 +1,15 @@ include/master-slave.inc [connection master] +connection slave; SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS; SET GLOBAL SLAVE_TYPE_CONVERSIONS = ''; +connection master; CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=TokuDB; INSERT INTO t1 VALUES (b'0', b'01', b'101'); +connection slave; include/diff_tables.inc [master:t1, slave:t1] +connection master; DROP TABLE t1; +connection slave; SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; include/rpl_end.inc diff --git a/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result b/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result index 78a66421446..aa95091b40b 100644 --- a/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result +++ b/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result @@ -2,12 +2,15 @@ include/master-slave.inc [connection master] CREATE TABLE t1(`a` INT) ENGINE=TokuDB; CREATE TABLE t2(`a` INT) ENGINE=InnoDB; +connection master; begin; insert into t1 values (1); insert into t2 values (1); commit; +connection slave; TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:test.t1, slave:test.t1] include/diff_tables.inc [master:test.t2, slave:test.t2] +connection master; drop table t1,t2; include/rpl_end.inc |