diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test index 26b1e6d5ba0..d3959d10306 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test @@ -1,16 +1,22 @@ ############################################################# +# Author: Chuck +############################################################# # Purpose: To test having extra columns on the master WL#3915 # engine inspecific sourced part ############################################################# - +# Change Author: Jeb +# Change: Cleanup and extend testing +############################################################# # TODO: partition specific # -- source include/have_partition.inc +# Note: Will be done in different test due to NDB using this +# test case. +############################################################ ########### Clean up ################ --disable_warnings --disable_query_log -DROP TABLE IF EXISTS t1,t2,t3,t4,t31; - +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31; --enable_query_log --enable_warnings @@ -70,154 +76,87 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t31; #VARCHAR(M) # - +let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`; +--echo +--echo *********************************************************** +--echo *********************************************************** +--echo ***************** Start of Testing ************************ +--echo *********************************************************** +--echo *********************************************************** +--echo * This test format == $binformat and engine == $engine_type +--echo *********************************************************** +--echo *********************************************************** +--echo +--echo ***** Testing more columns on the Master ***** +--echo connection master; eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00') - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0); - - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST') - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi'); - - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0') - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT) - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7, drop f8; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness'); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT, - f9 LONGBLOB) - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob'); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT, - f9 LONGBLOB, - f10 BIT(63)) - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101'); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; - eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT, - f9 LONGBLOB, - f10 BIT(63), - f11 VARBINARY(64)) - ENGINE=$engine_type; - -#connection slave; - sync_slave_with_master; - alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; + f5 FLOAT DEFAULT '2.00', + f6 CHAR(4) DEFAULT 'TEST', + f7 INT DEFAULT '0', + f8 TEXT, + f9 LONGBLOB, + f10 BIT(63), + f11 VARBINARY(64))ENGINE=$engine_type; +--echo +--echo * Alter Table on Slave and drop columns f5 through f11 * +--echo +sync_slave_with_master; +alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; +--echo +--echo * Insert data in Master then update and delete some rows* +--echo connection master; +let $j= 50; +--disable_query_log +while ($j) +{ + eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2, + 'got stolen from the paradise', + 'very fat blob', b'01010101010101', + 0x123456); + dec $j; +} +let $j= 30; +while ($j) +{ + eval update t1 set f4= 'next' where f1=$j; + dec $j; + dec $j; + eval delete from t1 where f1=$j; + dec $j; +} +--enable_query_log - INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101', 0x123456); - INSERT into t1 values (2, 2, 2, 'second', 2.0, 'kaks', 2, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456), (3, 3, 3, 'third', 3.0, 'kolm', 3, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456); - update t1 set f4= 'next' where f1=1; - delete from t1 where f1=1; - - select * from t1 order by f3; - +--echo * Select count and 20 rows from Master * +--echo +SELECT COUNT(*) FROM t1; +--echo +SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, + hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; #connection slave; - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; +sync_slave_with_master; +--echo +--echo * Select count and 20 rows from Slave * +--echo +SELECT COUNT(*) FROM t1; +--echo +SELECT * FROM t1 ORDER BY f3 LIMIT 20; +--echo +--echo * Show Slave Status * +--echo +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical show slave status; +--echo ### Altering table def scenario +--echo +--echo ***** Testing Altering table def scenario ***** +--echo connection master; @@ -232,7 +171,7 @@ connection master; f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE=$engine_type; - +--echo eval CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ f5 DOUBLE DEFAULT '2.00', @@ -243,7 +182,7 @@ connection master; f12 SET('a', 'b', 'c') default 'b') ENGINE=$engine_type; - +--echo # no ENUM and SET eval CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -256,7 +195,7 @@ connection master; f11 CHAR(255)) ENGINE=$engine_type; - +--echo eval CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -293,7 +232,9 @@ connection master; f34 VARBINARY(1025), f35 VARCHAR(257) ) ENGINE=$engine_type; - +--echo +--echo ** Alter tables on slave and drop columns ** +--echo #connection slave; sync_slave_with_master; alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop @@ -308,8 +249,8 @@ f12; drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, drop f33, drop f34, drop f35; - - +--echo +--echo ** 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'; @@ -458,7 +399,10 @@ binary data'; /*f34 VARBINARY(1025),*/ '3333 minus 3', /*f35 VARCHAR(257),*/ NULL ); - +--echo +--echo ** Sync slave with master ** +--echo ** Do selects from tables ** +--echo #connection slave; sync_slave_with_master; @@ -469,24 +413,33 @@ binary data'; select * from t31 order by f1; connection master; - +--echo +--echo ** Do updates master ** +--echo 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; +--echo +--echo ** Delete from Master ** +--echo + delete from t1; delete from t2; delete from t3; delete from t4; delete from t31; +--echo +--echo ** Check slave status ** +--echo #connection slave; sync_slave_with_master; select * from t31; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --query_vertical show slave status; #### Clean Up #### @@ -496,11 +449,600 @@ connection master; --disable_query_log DROP TABLE t1,t2,t3,t4,t31; +###################################################### #connection slave; sync_slave_with_master; --enable_query_log --enable_warnings +--echo +--echo **************************************** +--echo * columns in master at middle of table * +--echo * Expect: Proper error message * +--echo **************************************** +--echo +--echo ** Stop and Reset Slave ** +--echo +STOP SLAVE; +RESET SLAVE; +--echo +--echo ** create table slave side ** +eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) + ) ENGINE=$engine_type; -# END of the tests +--echo +--echo ** Connect to master and create table ** +--echo +--connection master +eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', + c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type; +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), + (2,@b1,DEFAULT,'JOE',DEFAULT), + (3,@b1,DEFAULT,'QA',DEFAULT); + +--echo +--echo ******************************************** +--echo *** Expect slave to fail with Error 1523 *** +--echo ******************************************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +--echo +--echo *** Drop t10 *** +connection master; +DROP TABLE t10; +sync_slave_with_master; + +############################################ +############## Continued ################### +############################################ +--echo +--echo ********************************************* +--echo * More columns in master at middle of table * +--echo * Expect: Proper error message * +--echo ********************************************* +--echo +--echo *** Create t11 on slave *** +STOP SLAVE; +RESET SLAVE; + +eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t11 on Master *** +connection master; +eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, + c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), + (2,@b1,'Testing is cool','JOE',DEFAULT), + (3,@b1,DEFAULT,'QA',DEFAULT); + +--echo +--echo ******************************************** +--echo *** Expect slave to fail with Error 1523 *** +--echo ******************************************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +--echo +--echo *** Drop t11 *** +connection master; +DROP TABLE t11; +sync_slave_with_master; + +############################################ +############## Continued ################### +############################################ +--echo +--echo ********************************************* +--echo * More columns in master at middle of table * +--echo * Expect: This one should pass blob-text * +--echo ********************************************* +--echo +--echo *** Create t12 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB + ) ENGINE=$engine_type; + +--echo +--echo *** Create t12 on Master *** +connection master; +eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, + c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',DEFAULT,DEFAULT), + (3,@b1,'QA',DEFAULT,DEFAULT); +--echo +SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; + +--echo +--echo *** Select on Slave *** +sync_slave_with_master; +SELECT a,hex(b),c FROM t12 ORDER BY a; + +--echo +--echo *** Drop t12 *** +connection master; +DROP TABLE t12; +sync_slave_with_master; + +############################################ +############## Continued ################### +############################################ +--echo +--echo **************************************************** +--echo * - Alter Master adding columns at middle of table * +--echo * Expect: columns added * +--echo **************************************************** +--echo +--echo +--echo *** Create t14 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t14 on Master *** +connection master; +eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** 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; +--echo +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), + (2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), + (3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); +--echo +--replace_column 7 CURRENT_TIMESTAMP +SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; + +--echo +--echo *** Select on Slave **** +sync_slave_with_master; +SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; + +#################################################### +--echo +--echo **************************************************** +--echo * - Alter Master Dropping columns from the middle. * +--echo * Expect: columns dropped * +--echo **************************************************** +--echo +--echo *** connect to master and drop columns *** +connection master; +ALTER TABLE t14 DROP COLUMN c2; +ALTER TABLE t14 DROP COLUMN c7; +--echo +--echo *** Select from Master *** +SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; +--echo + +--echo ************ +--echo * Bug30415 * +--echo ************ +# Uncomment below once fixed + +#--echo *** Select from Slave *** +#sync_slave_with_master; +#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; + +# Bug30415 +# Remove below once fixed +#*************************** +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +#*************************** + +STOP SLAVE; +RESET SLAVE; + +--echo +--echo *** Drop t14 *** +DROP TABLE t14; + +connection master; +DROP TABLE t14; +RESET MASTER; + +connection slave; +START SLAVE; + +################################################# +--echo +--echo ************************************************* +--echo * - Alter Master adding columns at end of table * +--echo * Expect: Error 1054 * +--echo ************************************************* +--echo +--echo *** Create t15 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t15 on Master *** +connection master; +eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), + (2,@b1,'JOE',DEFAULT,DEFAULT,3.00), + (3,@b1,'QA',DEFAULT,DEFAULT,3.00); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; + +--echo +--echo ******************************************** +--echo *** Expect slave to fail with Error 1054 *** +--echo ******************************************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +STOP SLAVE; +RESET SLAVE; + +--echo +--echo *** Drop t15 *** +DROP TABLE t15; + +connection master; +DROP TABLE t15; +RESET MASTER; + +connection slave; +START SLAVE; + +#################################################### +--echo +--echo ************************************************ +--echo * - Create index on Master column not on slave * +--echo * Expect:Warning * +--echo ************************************************ +--echo +--echo *** Create t16 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t16 on Master *** +connection master; +eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Create Index and Data Insert *** +connection master; +CREATE INDEX part_of_c6 ON t16 (c6); +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',2,DEFAULT), + (3,@b1,'QA',3,DEFAULT); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; + +# Uncomment the below when bug 30434 is patched + +#--echo *** Select on Slave **** +#sync_slave_with_master; +#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1; +# +#--echo *** Drop t16 *** +#connection master; +#DROP TABLE t16; +#sync_slave_with_master; + +# Remove the below when bug 30434 is patched +#******************************************* +--echo +--echo ***************** +--echo *** BUG 30434 *** +--echo ***************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +STOP SLAVE; +RESET SLAVE; + +--echo +--echo *** Drop t16 *** +DROP TABLE t16; + +connection master; +DROP TABLE t16; +RESET MASTER; + +connection slave; +START SLAVE; +#******************************************* + +#################################################### +--echo +--echo ***************************************************** +--echo * - Delete rows using column on Master not on slave * +--echo * Expect: Rows Deleted * +--echo ***************************************************** +--echo +--echo *** Create t17 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t17 on Master *** +connection master; +eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',2,DEFAULT), + (3,@b1,'QA',3,DEFAULT); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; + +--echo +--echo ** Select * from Slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; + +--echo +--echo ** Delete from master ** +connection master; +DELETE FROM t17 WHERE c6 = 3; +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; + +--echo +--echo ** Check slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; + + +connection master; +DROP TABLE t17; +sync_slave_with_master; +--echo + +#################################################### +--echo +--echo ***************************************************** +--echo * - Update row using column on Master not on slave * +--echo * Expect: Rows updated * +--echo ***************************************************** +--echo +--echo ** Bug30674 ** +--echo +--echo *** Create t18 on slave *** +--echo + +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t18 on Master *** +connection master; +eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); + +INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',2,DEFAULT), + (3,@b1,'QA',3,DEFAULT); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; + +--echo +--echo ** Select * from Slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; + +--echo +--echo ** update from master ** +connection master; +####################################### +# This test should be uncommented +# once bug30674 is patched +####################################### + +#*************************** +#UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; +#*************************** + +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; + +--echo +--echo ** Check slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; + +connection master; +DROP TABLE t18; +sync_slave_with_master; +--echo + +#################################################### +--echo +--echo ***************************************************** +--echo * - Insert UUID column on Master not on slave * +--echo * Expect: Rows inserted * +--echo ***************************************************** +--echo +--echo *** Create t5 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t5 on Master *** +connection master; +eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 LONG, + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), + (2,@b1,'JOE',UUID(),DEFAULT), + (3,@b1,'QA',UUID(),DEFAULT); +--replace_column 4 UUID 5 TIME +SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; + +--echo +--echo ** Select * from Slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; + +connection master; +DROP TABLE t5; +sync_slave_with_master; +--echo + +# END of 5.1 tests case diff --git a/mysql-test/extra/rpl_tests/rpl_row_charset.test b/mysql-test/extra/rpl_tests/rpl_row_charset.test index a21ed5bb841..c1eccff9bd5 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_row_charset.test @@ -38,7 +38,7 @@ show create database mysqltest3; connection master; use mysqltest2; -create table t1 (a int auto_increment primary key, b varchar(100)); +--eval create table t1 (a int auto_increment primary key, b varchar(100))engine=$engine_type; set character_set_client=cp850, collation_connection=latin2_croatian_ci; insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@collation_server); @@ -146,13 +146,15 @@ set collation_server=9999998; select "--- --3943--" as ""; use test; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +--eval CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=$engine_type; SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('Ну, за рыбалку','Ну, за рыбалку'); +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; sync_slave_with_master; +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; connection master; diff --git a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result index 8d1dcc4ef18..1d61e2c59c2 100644 --- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result +++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result @@ -1888,5 +1888,27 @@ set engine_condition_pushdown = 1; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); fname lname Young Foo +drop table t1; +create table t1 (a int, b int, c int, d int, primary key using hash(a)) +engine=ndbcluster; +insert into t1 values (10,1,100,0+0x1111); +insert into t1 values (20,2,200,0+0x2222); +insert into t1 values (30,3,300,0+0x3333); +insert into t1 values (40,4,400,0+0x4444); +insert into t1 values (50,5,500,0+0x5555); +set engine_condition_pushdown = on; +select a,b,d from t1 +where b in (0,1,2,5) +order by b; +a b d +10 1 4369 +20 2 8738 +50 5 21845 +a b d +10 1 4369 +20 2 8738 +50 5 21845 +Warnings: +Warning 4294 Scan filter is too large, discarded set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/ndb/r/ndb_multi.result b/mysql-test/suite/ndb/r/ndb_multi.result index 2bc49bf9b45..98c4265b833 100644 --- a/mysql-test/suite/ndb/r/ndb_multi.result +++ b/mysql-test/suite/ndb/r/ndb_multi.result @@ -121,3 +121,24 @@ show tables; Tables_in_db t2 drop database db; +use test; +create table `test`.`t1$EX` + (server_id int unsigned, +master_server_id int unsigned, +master_epoch bigint unsigned, +count int unsigned, +primary key(server_id, master_server_id, +master_epoch, count)) +engine ndb; +show tables like '%$%'; +Tables_in_test (%$%) +t1$EX +use test; +show tables like '%$%'; +Tables_in_test (%$%) +t1$EX +drop table `test`.`t1$EX`; +show tables like '%$%'; +Tables_in_test (%$%) +show tables like '%$%'; +Tables_in_test (%$%) diff --git a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test index ab56430ac1d..9e6a5e90e40 100644 --- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test +++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test @@ -1752,5 +1752,1030 @@ SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); set engine_condition_pushdown = 1; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); +# bug#29390 (scan filter is too large, discarded) + +drop table t1; + +create table t1 (a int, b int, c int, d int, primary key using hash(a)) + engine=ndbcluster; + +insert into t1 values (10,1,100,0+0x1111); +insert into t1 values (20,2,200,0+0x2222); +insert into t1 values (30,3,300,0+0x3333); +insert into t1 values (40,4,400,0+0x4444); +insert into t1 values (50,5,500,0+0x5555); + +set engine_condition_pushdown = on; + +select a,b,d from t1 + where b in (0,1,2,5) + order by b; + +--disable_query_log +select a,b,d from t1 + where b in ( +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,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,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2) + order by b; +--enable_query_log + set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/ndb/t/ndb_multi.test b/mysql-test/suite/ndb/t/ndb_multi.test index b8e052d606b..ce7e22b3b7f 100644 --- a/mysql-test/suite/ndb/t/ndb_multi.test +++ b/mysql-test/suite/ndb/t/ndb_multi.test @@ -122,4 +122,31 @@ connection server2; show tables; drop database db; + +# +# bug#31470, ndb table with special characters in name +# are not discovered correctly connection server1; +use test; +create table `test`.`t1$EX` + (server_id int unsigned, + master_server_id int unsigned, + master_epoch bigint unsigned, + count int unsigned, + primary key(server_id, master_server_id, + master_epoch, count)) + engine ndb; + +# check that table shows up ok on both servers +# before bugfix table would not show up on server2 +show tables like '%$%'; +connection server2; +use test; +show tables like '%$%'; + +# check cleanup +drop table `test`.`t1$EX`; +show tables like '%$%'; + +connection server1; +show tables like '%$%'; diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result index c991b2f1946..2d6bed37901 100644 --- a/mysql-test/suite/rpl/r/rpl_bug31076.result +++ b/mysql-test/suite/rpl/r/rpl_bug31076.result @@ -61,3 +61,4 @@ visits_id myid src ip cc org ref time host entry visit_exit user_id visit_start SELECT * FROM visits_events; event_id visit_id timestamp src data visits_events_id 20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207 +DROP DATABASE track; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index 18906617925..28985eb8cba 100644 Binary files a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result and b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result differ diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 5bc1a13b107..966f97e0578 100644 Binary files a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result and b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result differ diff --git a/mysql-test/suite/rpl/r/rpl_row_charset.result b/mysql-test/suite/rpl/r/rpl_row_charset.result index e51f3e57d1f..caaa9d8332b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_charset.result +++ b/mysql-test/suite/rpl/r/rpl_row_charset.result @@ -40,7 +40,7 @@ show create database mysqltest3; Database Create Database mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ use mysqltest2; -create table t1 (a int auto_increment primary key, b varchar(100)); +create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam;; set character_set_client=cp850, collation_connection=latin2_croatian_ci; insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@collation_server); @@ -117,7 +117,7 @@ master-bin.000001 # Query # # create database mysqltest2 character set latin2 master-bin.000001 # Query # # create database mysqltest3 master-bin.000001 # Query # # drop database mysqltest3 master-bin.000001 # Query # # create database mysqltest3 -master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) @@ -177,14 +177,16 @@ select "--- --3943--" as ""; --- --3943-- use test; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=myisam;; SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('Ну, за рыбалку','Ну, за рыбалку'); +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 diff --git a/mysql-test/suite/rpl/r/rpl_row_charset_innodb.result b/mysql-test/suite/rpl/r/rpl_row_charset_innodb.result new file mode 100644 index 00000000000..eb1dc585457 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_charset_innodb.result @@ -0,0 +1,215 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set timestamp=1000000000; +drop database if exists mysqltest2; +drop database if exists mysqltest3; +create database mysqltest2 character set latin2; +set @@character_set_server=latin5; +create database mysqltest3; + +--- --master-- +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ + +--- --slave-- +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ +set @@collation_server=armscii8_bin; +drop database mysqltest3; +create database mysqltest3; + +--- --master-- +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ + +--- --slave-- +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ +use mysqltest2; +create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb;; +set character_set_client=cp850, collation_connection=latin2_croatian_ci; +insert into t1 (b) values(@@character_set_server); +insert into t1 (b) values(@@collation_server); +insert into t1 (b) values(@@character_set_client); +insert into t1 (b) values(@@character_set_connection); +insert into t1 (b) values(@@collation_connection); + +--- --master-- +select * from t1 order by a; +a b +1 armscii8 +2 armscii8_bin +3 cp850 +4 latin2 +5 latin2_croatian_ci + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 armscii8 +2 armscii8_bin +3 cp850 +4 latin2 +5 latin2_croatian_ci +select "--- --muller--" as ""; + +--- --muller-- +set character_set_client=latin1, collation_connection=latin1_german1_ci; +truncate table t1; +insert into t1 (b) values(@@collation_connection); +insert into t1 (b) values(LEAST("MЭller","Muffler")); +set collation_connection=latin1_german2_ci; +insert into t1 (b) values(@@collation_connection); +insert into t1 (b) values(LEAST("MЭller","Muffler")); + +--- --master-- +select * from t1 order by a; +a b +1 latin1_german1_ci +2 Muffler +3 latin1_german2_ci +4 MЭller + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 latin1_german1_ci +2 Muffler +3 latin1_german2_ci +4 MЭller +select "--- --INSERT--" as ""; + +--- --INSERT-- +set @a= _cp850 'MЭller' collate cp850_general_ci; +truncate table t1; +insert into t1 (b) values(collation(@a)); + +--- --master-- +select * from t1 order by a; +a b +1 cp850_general_ci + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 cp850_general_ci +drop database mysqltest2; +drop database mysqltest3; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Query # # drop database if exists mysqltest3 +master-bin.000001 # Query # # create database mysqltest2 character set latin2 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # drop database mysqltest3 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # drop database mysqltest2 +master-bin.000001 # Query # # drop database mysqltest3 +select "--- --global--" as ""; + +--- --global-- +set global character_set_server=latin2; +set global character_set_server=latin1; +set global character_set_server=latin2; +set global character_set_server=latin1; +select "--- --oneshot--" as ""; + +--- --oneshot-- +set one_shot @@character_set_server=latin5; +set @@max_join_size=1000; +select @@character_set_server; +@@character_set_server +latin5 +select @@character_set_server; +@@character_set_server +latin1 +set @@character_set_server=latin5; +select @@character_set_server; +@@character_set_server +latin5 +select @@character_set_server; +@@character_set_server +latin5 +set one_shot max_join_size=10; +ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server +set character_set_client=9999999; +ERROR 42000: Unknown character set: '9999999' +set collation_server=9999998; +ERROR HY000: Unknown collation: '9999998' +select "--- --3943--" as ""; + +--- --3943-- +use test; +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=innodb;; +SET CHARACTER_SET_CLIENT=koi8r, +CHARACTER_SET_CONNECTION=cp1251, +CHARACTER_SET_RESULTS=koi8r; +INSERT INTO t1 (c1, c2) VALUES ('Ну, за рыбалку','Ну, за рыбалку'); +SET SQL_BIG_SELECTS=1; +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +SET SQL_BIG_SELECTS=1; +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +drop table t1; +select "--- --6676--" as ""; + +--- --6676-- +create table `t1` ( +`pk` varchar(10) not null default '', +primary key (`pk`) +) engine=innodb default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result b/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result deleted file mode 100644 index 0b1f2e6c8bf..00000000000 Binary files a/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result and /dev/null differ diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test index 6cb8cc0d902..70584e4e830 100644 --- a/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -111,3 +111,6 @@ VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), SELECT * FROM visits; SELECT * FROM visits_events; + +DROP DATABASE track; +# End 5.1 test case diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test index 082c22329fa..5255a9cfbad 100644 --- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test +++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test @@ -12,4 +12,5 @@ set binlog_format=row; set binlog_format=statement; -- source extra/rpl_tests/rpl_extraMaster_Col.test - +set binlog_format=mixed; +-- source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test index 5bbd7953294..e6b41eabd0d 100644 --- a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test +++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test @@ -11,3 +11,5 @@ set binlog_format=row; set binlog_format=statement; -- source extra/rpl_tests/rpl_extraMaster_Col.test +set binlog_format=mixed; +-- source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test b/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test new file mode 100644 index 00000000000..1465500d0eb --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test @@ -0,0 +1,9 @@ +######################################################## +# By JBM 2005-02-15 Wrapped to allow reuse of test code# +# Added to skip if ndb is default # +######################################################## +-- source include/not_ndb_default.inc +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc +let $engine_type=innodb; +-- source extra/rpl_tests/rpl_row_charset.test diff --git a/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test b/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test deleted file mode 100644 index b91947e52e2..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test +++ /dev/null @@ -1,12 +0,0 @@ -########################################### -# Purpose: Wrapper for rpl_extraMaster_Col.test -# Using NDB -########################################### --- source include/have_ndb.inc --- source include/ndb_master-slave.inc --- source include/have_binlog_format_row.inc - -let $engine_type = 'NDB'; - --- source extra/rpl_tests/rpl_extraMaster_Col.test - diff --git a/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test b/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test deleted file mode 100644 index 84734204439..00000000000 --- a/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test +++ /dev/null @@ -1,13 +0,0 @@ -########################################### -# Purpose: Wrapper for rpl_extraMaster_Col.test -# Using NDB -########################################### --- source include/have_ndb.inc --- source include/ndb_master-slave.inc --- source include/have_binlog_format_statement.inc - -let $engine_type = 'NDB'; - --- source extra/rpl_tests/rpl_extraMaster_Col.test - - diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result index ed9b3cfbfa8..8b1f3093332 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result @@ -40,7 +40,7 @@ show create database mysqltest3; Database Create Database mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ use mysqltest2; -create table t1 (a int auto_increment primary key, b varchar(100)); +create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB;; set character_set_client=cp850, collation_connection=latin2_croatian_ci; insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@collation_server); @@ -117,29 +117,27 @@ master-bin.000001 # Query # # create database mysqltest2 character set latin2 master-bin.000001 # Query # # create database mysqltest3 master-bin.000001 # Query # # drop database mysqltest3 master-bin.000001 # Query # # create database mysqltest3 -master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # drop database mysqltest2 master-bin.000001 # Query # # drop database mysqltest3 select "--- --global--" as ""; @@ -177,14 +175,16 @@ select "--- --3943--" as ""; --- --3943-- use test; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=NDB;; SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('Ну, за рыбалку','Ну, за рыбалку'); +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result new file mode 100644 index 00000000000..38c8ab2afc5 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result @@ -0,0 +1,2286 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set binlog_format=row; + +*********************************************************** +*********************************************************** +***************** Start of Testing ************************ +*********************************************************** +*********************************************************** +* This test format == binlog_format ROW and engine == 'NDB' +*********************************************************** +*********************************************************** + +***** Testing more columns on the Master ***** + +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 FLOAT DEFAULT '2.00', +f6 CHAR(4) DEFAULT 'TEST', +f7 INT DEFAULT '0', +f8 TEXT, +f9 LONGBLOB, +f10 BIT(63), +f11 VARBINARY(64))ENGINE='NDB'; + +* Alter Table on Slave and drop columns f5 through f11 * + +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* + +* Select count and 20 rows from Master * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, +hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) +2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +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 + +* Select count and 20 rows from Slave * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT * FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next + +* Show Slave Status * + +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + + +***** Testing Altering table def scenario ***** + +CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f7 DECIMAL(17,9) default '1000.00', +f8 MEDIUMBLOB, +f9 NUMERIC(6,4) default '2000.00', +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 + +CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f8 MEDIUMBLOB, +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; + +CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 DECIMAL(17,9) default '1000.00', +f7 MEDIUMBLOB, +f8 NUMERIC(6,4) default '2000.00', +f9 VARCHAR(1024), +f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f11 CHAR(255)) +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f8' at row 1 + +CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 BIGINT, +f6 BLOB, +f7 DATE, +f8 DATETIME, +f9 FLOAT, +f10 INT, +f11 LONGBLOB, +f12 LONGTEXT, +f13 MEDIUMBLOB, +f14 MEDIUMINT, +f15 MEDIUMTEXT, +f16 REAL, +f17 SMALLINT, +f18 TEXT, +f19 TIME, +f20 TIMESTAMP, +f21 TINYBLOB, +f22 TINYINT, +f23 TINYTEXT, +f24 YEAR, +f25 BINARY(255), +f26 BIT(64), +f27 CHAR(255), +f28 DECIMAL(30,7), +f29 DOUBLE, +f30 ENUM ('a','b', 'c') default 'a', +f31 FLOAT, +f32 NUMERIC(17,9), +f33 SET ('a', 'b', 'c') default 'b', +f34 VARBINARY(1025), +f35 VARCHAR(257) +) ENGINE='NDB'; + +** Alter tables on slave and drop columns ** + +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; +alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; +alter table t31 +drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, +drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, +drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, +drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, +drop f33, drop f34, drop f35; + +** Insert Data into 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', +2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', +'01234567', 'c'), +(3, 3, 3, 'third', +3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', +'01234567', 'c'); +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 +Warning 1264 Out of range value for column 'f9' at row 2 +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', +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', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ); +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', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 5, 'fifth', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 6, 'sixth', +/* f5 BIGINT, */ NULL, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ NULL +); +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 +Warning 1264 Out of range value for column 'f5' at row 2 +Warning 1264 Out of range value for column 'f24' at row 2 +Warning 1264 Out of range value for column 'f24' at row 3 + +** Sync slave with master ** +** Do selects from tables ** + +select * from t1 order by f3; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next +31 31 31 second +32 32 32 second +33 33 33 second +34 34 34 second +35 35 35 second +36 36 36 second +37 37 37 second +38 38 38 second +39 39 39 second +40 40 40 second +41 41 41 second +42 42 42 second +43 43 43 second +44 44 44 second +45 45 45 second +46 46 46 second +47 47 47 second +48 48 48 second +49 49 49 second +50 50 50 second +select * from t2 order by f1; +f1 f2 f3 f4 +1 1 1 first +2 2 2 second +3 3 3 third +select * from t3 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t4 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t31 order by f1; +f1 f2 f3 f4 +1 1 5 fifth +1 1 3 third +1 1 1 first +1 1 6 sixth +1 1 2 second +1 1 4 fourth + +** 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; +Warnings: +Warning 1048 Column 'f3' cannot be null + +** Delete from Master ** + +delete from t1; +delete from t2; +delete from t3; +delete from t4; +delete from t31; + +** Check slave status ** + +select * from t31; +f1 f2 f3 f4 +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + +**************************************** +* columns in master at middle of table * +* Expect: Proper error message * +**************************************** + +** Stop and Reset Slave ** + +STOP SLAVE; +RESET SLAVE; + +** create table slave side ** +CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) +) ENGINE='NDB'; + +** Connect to master and create table ** + +CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', +c CHAR(5), e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), +(2,@b1,DEFAULT,'JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t10 *** +DROP TABLE t10; + +********************************************* +* More columns in master at middle of table * +* Expect: Proper error message * +********************************************* + +*** Create t11 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) +) ENGINE='NDB'; + +*** Create t11 on Master *** +CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), +(2,@b1,'Testing is cool','JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t11 *** +DROP TABLE t11; + +********************************************* +* More columns in master at middle of table * +* Expect: This one should pass blob-text * +********************************************* + +*** Create t12 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB +) ENGINE='NDB'; + +*** Create t12 on Master *** +CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',DEFAULT,DEFAULT), +(3,@b1,'QA',DEFAULT,DEFAULT); + +SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; +a hex(b) f c e +1 62316231623162316231623162316231 Kyle test 1 +2 62316231623162316231623162316231 JOE test 1 +3 62316231623162316231623162316231 QA test 1 + +*** Select on Slave *** +SELECT a,hex(b),c FROM t12 ORDER BY a; +a hex(b) c +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +*** Drop t12 *** +DROP TABLE t12; + +**************************************************** +* - Alter Master adding columns at middle of table * +* Expect: columns added * +**************************************************** + + +*** Create t14 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t14 on Master *** +CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; +ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; + +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), +(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), +(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); + +SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; +c1 c2 c3 hex(c4) c5 c6 c7 +1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP + +*** Select on 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 +2 2.00 This Test Should work 62316231623162316231623162316231 JOE +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA + +**************************************************** +* - Alter Master Dropping columns from the middle. * +* Expect: columns dropped * +**************************************************** + +*** connect to master and drop columns *** +ALTER TABLE t14 DROP COLUMN c2; +ALTER TABLE t14 DROP COLUMN c7; + +*** Select from Master *** +SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; +c1 c3 hex(c4) c5 c6 +1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 +2 This Test Should work 62316231623162316231623162316231 JOE 1 +3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 + +************ +* Bug30415 * +************ +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1091 +Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_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' +STOP SLAVE; +RESET SLAVE; + +*** Drop t14 *** +DROP TABLE t14; +DROP TABLE t14; +RESET MASTER; +START SLAVE; + +************************************************* +* - Alter Master adding columns at end of table * +* Expect: Error 1054 * +************************************************* + +*** Create t15 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t15 on Master *** +CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), +(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), +(3,@b1,'QA',DEFAULT,DEFAULT,3.00); +SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; +c1 hex(c4) c5 c6 c7 c2 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 +2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 +3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 + +******************************************** +*** Expect slave to fail with Error 1054 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1054 +Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_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; +RESET SLAVE; + +*** Drop t15 *** +DROP TABLE t15; +DROP TABLE t15; +RESET MASTER; +START SLAVE; + +************************************************ +* - Create index on Master column not on slave * +* Expect:Warning * +************************************************ + +*** Create t16 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t16 on Master *** +CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Create Index and Data Insert *** +CREATE INDEX part_of_c6 ON t16 (c6); +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +***************** +*** BUG 30434 *** +***************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1072 +Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_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; +RESET SLAVE; + +*** Drop t16 *** +DROP TABLE t16; +DROP TABLE t16; +RESET MASTER; +START SLAVE; + +***************************************************** +* - Delete rows using column on Master not on slave * +* Expect: Rows Deleted * +***************************************************** + +*** Create t17 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t17 on Master *** +CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** Delete from 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 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +DROP TABLE t17; + + +***************************************************** +* - Update row using column on Master not on slave * +* Expect: Rows updated * +***************************************************** + +** Bug30674 ** + +*** Create t18 on slave *** + +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t18 on Master *** +CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** update from master ** +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA +DROP TABLE t18; + + +***************************************************** +* - Insert UUID column on Master not on slave * +* Expect: Rows inserted * +***************************************************** + +*** Create t5 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t5 on Master *** +CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 LONG, +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), +(2,@b1,'JOE',UUID(),DEFAULT), +(3,@b1,'QA',UUID(),DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 6231623162316231 Kyle UUID TIME +2 6231623162316231 JOE UUID TIME +3 6231623162316231 QA UUID TIME + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; +c1 hex(c4) c5 +1 6231623162316231 Kyle +2 6231623162316231 JOE +3 6231623162316231 QA +DROP TABLE t5; + +set binlog_format=mixed; + +*********************************************************** +*********************************************************** +***************** Start of Testing ************************ +*********************************************************** +*********************************************************** +* This test format == binlog_format MIXED and engine == 'NDB' +*********************************************************** +*********************************************************** + +***** Testing more columns on the Master ***** + +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 FLOAT DEFAULT '2.00', +f6 CHAR(4) DEFAULT 'TEST', +f7 INT DEFAULT '0', +f8 TEXT, +f9 LONGBLOB, +f10 BIT(63), +f11 VARBINARY(64))ENGINE='NDB'; + +* Alter Table on Slave and drop columns f5 through f11 * + +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* + +* Select count and 20 rows from Master * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, +hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) +2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +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 + +* Select count and 20 rows from Slave * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT * FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next + +* Show Slave Status * + +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + + +***** Testing Altering table def scenario ***** + +CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f7 DECIMAL(17,9) default '1000.00', +f8 MEDIUMBLOB, +f9 NUMERIC(6,4) default '2000.00', +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 + +CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f8 MEDIUMBLOB, +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; + +CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 DECIMAL(17,9) default '1000.00', +f7 MEDIUMBLOB, +f8 NUMERIC(6,4) default '2000.00', +f9 VARCHAR(1024), +f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f11 CHAR(255)) +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f8' at row 1 + +CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 BIGINT, +f6 BLOB, +f7 DATE, +f8 DATETIME, +f9 FLOAT, +f10 INT, +f11 LONGBLOB, +f12 LONGTEXT, +f13 MEDIUMBLOB, +f14 MEDIUMINT, +f15 MEDIUMTEXT, +f16 REAL, +f17 SMALLINT, +f18 TEXT, +f19 TIME, +f20 TIMESTAMP, +f21 TINYBLOB, +f22 TINYINT, +f23 TINYTEXT, +f24 YEAR, +f25 BINARY(255), +f26 BIT(64), +f27 CHAR(255), +f28 DECIMAL(30,7), +f29 DOUBLE, +f30 ENUM ('a','b', 'c') default 'a', +f31 FLOAT, +f32 NUMERIC(17,9), +f33 SET ('a', 'b', 'c') default 'b', +f34 VARBINARY(1025), +f35 VARCHAR(257) +) ENGINE='NDB'; + +** Alter tables on slave and drop columns ** + +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; +alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; +alter table t31 +drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, +drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, +drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, +drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, +drop f33, drop f34, drop f35; + +** Insert Data into 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', +2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', +'01234567', 'c'), +(3, 3, 3, 'third', +3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', +'01234567', 'c'); +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 +Warning 1264 Out of range value for column 'f9' at row 2 +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', +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', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ); +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', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 5, 'fifth', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 6, 'sixth', +/* f5 BIGINT, */ NULL, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ NULL +); +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 +Warning 1264 Out of range value for column 'f5' at row 2 +Warning 1264 Out of range value for column 'f24' at row 2 +Warning 1264 Out of range value for column 'f24' at row 3 + +** Sync slave with master ** +** Do selects from tables ** + +select * from t1 order by f3; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next +31 31 31 second +32 32 32 second +33 33 33 second +34 34 34 second +35 35 35 second +36 36 36 second +37 37 37 second +38 38 38 second +39 39 39 second +40 40 40 second +41 41 41 second +42 42 42 second +43 43 43 second +44 44 44 second +45 45 45 second +46 46 46 second +47 47 47 second +48 48 48 second +49 49 49 second +50 50 50 second +select * from t2 order by f1; +f1 f2 f3 f4 +1 1 1 first +2 2 2 second +3 3 3 third +select * from t3 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t4 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t31 order by f1; +f1 f2 f3 f4 +1 1 5 fifth +1 1 3 third +1 1 1 first +1 1 6 sixth +1 1 2 second +1 1 4 fourth + +** 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; +Warnings: +Warning 1048 Column 'f3' cannot be null + +** Delete from Master ** + +delete from t1; +delete from t2; +delete from t3; +delete from t4; +delete from t31; + +** Check slave status ** + +select * from t31; +f1 f2 f3 f4 +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + +**************************************** +* columns in master at middle of table * +* Expect: Proper error message * +**************************************** + +** Stop and Reset Slave ** + +STOP SLAVE; +RESET SLAVE; + +** create table slave side ** +CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) +) ENGINE='NDB'; + +** Connect to master and create table ** + +CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', +c CHAR(5), e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), +(2,@b1,DEFAULT,'JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t10 *** +DROP TABLE t10; + +********************************************* +* More columns in master at middle of table * +* Expect: Proper error message * +********************************************* + +*** Create t11 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) +) ENGINE='NDB'; + +*** Create t11 on Master *** +CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), +(2,@b1,'Testing is cool','JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t11 *** +DROP TABLE t11; + +********************************************* +* More columns in master at middle of table * +* Expect: This one should pass blob-text * +********************************************* + +*** Create t12 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB +) ENGINE='NDB'; + +*** Create t12 on Master *** +CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',DEFAULT,DEFAULT), +(3,@b1,'QA',DEFAULT,DEFAULT); + +SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; +a hex(b) f c e +1 62316231623162316231623162316231 Kyle test 1 +2 62316231623162316231623162316231 JOE test 1 +3 62316231623162316231623162316231 QA test 1 + +*** Select on Slave *** +SELECT a,hex(b),c FROM t12 ORDER BY a; +a hex(b) c +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +*** Drop t12 *** +DROP TABLE t12; + +**************************************************** +* - Alter Master adding columns at middle of table * +* Expect: columns added * +**************************************************** + + +*** Create t14 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t14 on Master *** +CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; +ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; + +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), +(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), +(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); + +SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; +c1 c2 c3 hex(c4) c5 c6 c7 +1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP + +*** Select on 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 +2 2.00 This Test Should work 62316231623162316231623162316231 JOE +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA + +**************************************************** +* - Alter Master Dropping columns from the middle. * +* Expect: columns dropped * +**************************************************** + +*** connect to master and drop columns *** +ALTER TABLE t14 DROP COLUMN c2; +ALTER TABLE t14 DROP COLUMN c7; + +*** Select from Master *** +SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; +c1 c3 hex(c4) c5 c6 +1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 +2 This Test Should work 62316231623162316231623162316231 JOE 1 +3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 + +************ +* Bug30415 * +************ +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1091 +Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_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' +STOP SLAVE; +RESET SLAVE; + +*** Drop t14 *** +DROP TABLE t14; +DROP TABLE t14; +RESET MASTER; +START SLAVE; + +************************************************* +* - Alter Master adding columns at end of table * +* Expect: Error 1054 * +************************************************* + +*** Create t15 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t15 on Master *** +CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), +(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), +(3,@b1,'QA',DEFAULT,DEFAULT,3.00); +SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; +c1 hex(c4) c5 c6 c7 c2 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 +2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 +3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 + +******************************************** +*** Expect slave to fail with Error 1054 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1054 +Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_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; +RESET SLAVE; + +*** Drop t15 *** +DROP TABLE t15; +DROP TABLE t15; +RESET MASTER; +START SLAVE; + +************************************************ +* - Create index on Master column not on slave * +* Expect:Warning * +************************************************ + +*** Create t16 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t16 on Master *** +CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Create Index and Data Insert *** +CREATE INDEX part_of_c6 ON t16 (c6); +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +***************** +*** BUG 30434 *** +***************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1072 +Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_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; +RESET SLAVE; + +*** Drop t16 *** +DROP TABLE t16; +DROP TABLE t16; +RESET MASTER; +START SLAVE; + +***************************************************** +* - Delete rows using column on Master not on slave * +* Expect: Rows Deleted * +***************************************************** + +*** Create t17 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t17 on Master *** +CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** Delete from 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 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +DROP TABLE t17; + + +***************************************************** +* - Update row using column on Master not on slave * +* Expect: Rows updated * +***************************************************** + +** Bug30674 ** + +*** Create t18 on slave *** + +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t18 on Master *** +CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** update from master ** +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA +DROP TABLE t18; + + +***************************************************** +* - Insert UUID column on Master not on slave * +* Expect: Rows inserted * +***************************************************** + +*** Create t5 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t5 on Master *** +CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 LONG, +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), +(2,@b1,'JOE',UUID(),DEFAULT), +(3,@b1,'QA',UUID(),DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 6231623162316231 Kyle UUID TIME +2 6231623162316231 JOE UUID TIME +3 6231623162316231 QA UUID TIME + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; +c1 hex(c4) c5 +1 6231623162316231 Kyle +2 6231623162316231 JOE +3 6231623162316231 QA +DROP TABLE t5; + diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test index 4bac267443e..f14229a52f9 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test @@ -1,8 +1,8 @@ ######################################################## # By JBM 2005-02-15 Wrapped to allow reuse of test code# ######################################################## ---source include/have_ndb.inc --- source include/have_binlog_format_row.inc +-- source include/have_ndb.inc +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_row_charset.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test new file mode 100644 index 00000000000..d78eda7eef1 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test @@ -0,0 +1,14 @@ +############################################################# +# Purpose: To test having extra columns on the master WL#3915 +############################################################# +-- source include/have_ndb.inc +-- source include/ndb_master-slave.inc +-- source include/have_binlog_format_mixed_or_row.inc + +let $engine_type = 'NDB'; + +set binlog_format=row; +-- source extra/rpl_tests/rpl_extraMaster_Col.test + +set binlog_format=mixed; +-- source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc index 94342c6d2ad..d8dff3c7e2f 100644 --- a/sql/ha_ndbcluster_cond.cc +++ b/sql/ha_ndbcluster_cond.cc @@ -1338,9 +1338,23 @@ ha_ndbcluster_cond::generate_scan_filter(NdbScanOperation *op) if (m_cond_stack) { - NdbScanFilter filter(op); + NdbScanFilter filter(op, false); // don't abort on too large - DBUG_RETURN(generate_scan_filter_from_cond(filter)); + int ret=generate_scan_filter_from_cond(filter); + if (ret != 0) + { + const NdbError& err=filter.getNdbError(); + if (err.code == NdbScanFilter::FilterTooLarge) + { + // err.message has static storage + DBUG_PRINT("info", ("%s", err.message)); + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + err.code, err.message); + ret=0; + } + } + if (ret != 0) + DBUG_RETURN(ret); } else { @@ -1391,7 +1405,7 @@ int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op, { KEY_PART_INFO* key_part= key_info->key_part; KEY_PART_INFO* end= key_part+key_info->key_parts; - NdbScanFilter filter(op); + NdbScanFilter filter(op, true); // abort on too large int res; DBUG_ENTER("generate_scan_filter_from_key"); diff --git a/sql/handler.cc b/sql/handler.cc index dbe7f6727f7..126882c8e44 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2641,8 +2641,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) frmblob and frmlen are set, write the frm to disk */ - (void)strxnmov(path,FN_REFLEN-1,mysql_data_home,FN_ROOTDIR, - db,FN_ROOTDIR,name,NullS); + build_table_filename(path, FN_REFLEN-1, db, name, "", 0); // Save the frm file error= writefrm(path, frmblob, frmlen); my_free(frmblob, MYF(0)); diff --git a/storage/ndb/include/kernel/signaldata/ScanTab.hpp b/storage/ndb/include/kernel/signaldata/ScanTab.hpp index 0074078533f..3d2071ca019 100644 --- a/storage/ndb/include/kernel/signaldata/ScanTab.hpp +++ b/storage/ndb/include/kernel/signaldata/ScanTab.hpp @@ -46,6 +46,7 @@ public: * Length of signal */ STATIC_CONST( StaticLength = 11 ); + STATIC_CONST( MaxTotalAttrInfo = 0xFFFF ); private: diff --git a/storage/ndb/include/ndbapi/Ndb.hpp b/storage/ndb/include/ndbapi/Ndb.hpp index 4d0219d1a3c..e758d174309 100644 --- a/storage/ndb/include/ndbapi/Ndb.hpp +++ b/storage/ndb/include/ndbapi/Ndb.hpp @@ -1056,6 +1056,7 @@ class Ndb friend class NdbBlob; friend class NdbImpl; friend class Ndb_internal; + friend class NdbScanFilterImpl; #endif public: diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp index 06111941df4..2f899d5b4bd 100644 --- a/storage/ndb/include/ndbapi/NdbOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp @@ -842,8 +842,10 @@ protected: virtual ~NdbOperation(); void next(NdbOperation*); // Set next pointer NdbOperation* next(); // Get next pointer + public: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + NdbTransaction* getNdbTransaction(); const NdbOperation* next() const; const NdbRecAttr* getFirstRecAttr() const; #endif diff --git a/storage/ndb/include/ndbapi/NdbPool.hpp b/storage/ndb/include/ndbapi/NdbPool.hpp index 1963bf26448..44b6d7488f0 100644 --- a/storage/ndb/include/ndbapi/NdbPool.hpp +++ b/storage/ndb/include/ndbapi/NdbPool.hpp @@ -17,7 +17,8 @@ class Ndb; class NdbPool; bool -create_instance(Uint32 max_ndb_objects, +create_instance(Ndb_cluster_connection* cc, + Uint32 max_ndb_objects, Uint32 no_conn_obj, Uint32 init_no_ndb_objects); diff --git a/storage/ndb/include/ndbapi/NdbScanFilter.hpp b/storage/ndb/include/ndbapi/NdbScanFilter.hpp index 1ef62558560..4527012a6c4 100644 --- a/storage/ndb/include/ndbapi/NdbScanFilter.hpp +++ b/storage/ndb/include/ndbapi/NdbScanFilter.hpp @@ -17,6 +17,7 @@ #define NDB_SCAN_FILTER_HPP #include +#include /** * @class NdbScanFilter @@ -31,8 +32,13 @@ public: /** * Constructor * @param op The NdbOperation that the filter belongs to (is applied to). + * @param abort_on_too_large abort transaction on filter too large + * default: true + * @param max_size Maximum size of generated filter in words */ - NdbScanFilter(class NdbOperation * op); + NdbScanFilter(class NdbOperation * op, + bool abort_on_too_large = true, + Uint32 max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS); ~NdbScanFilter(); /** @@ -166,6 +172,27 @@ public: /** @} *********************************************************************/ #endif + enum Error { + FilterTooLarge = 4294 + }; + + /** + * Get filter level error. + * + * Most errors are set only on operation level, and they abort the + * transaction. The error FilterTooLarge is set on filter level and + * by default it propagates to operation level and also aborts the + * transaction. + * + * If option abort_on_too_large is set to false, then FilterTooLarge + * does not propagate. One can then either ignore this error (in + * which case no filtering is done) or try to define a new filter + * immediately. + */ + const class NdbError & getNdbError() const; +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + NdbOperation * getNdbOperation(); +#endif private: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbScanFilterImpl; diff --git a/storage/ndb/include/ndbapi/NdbTransaction.hpp b/storage/ndb/include/ndbapi/NdbTransaction.hpp index 20c9c709e51..6a057655398 100644 --- a/storage/ndb/include/ndbapi/NdbTransaction.hpp +++ b/storage/ndb/include/ndbapi/NdbTransaction.hpp @@ -170,6 +170,15 @@ public: #endif }; +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + /** + * Convenience method to fetch this transaction's Ndb* object + */ + Ndb * getNdb() { + return theNdb; + } +#endif + #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Get an NdbOperation for a table. diff --git a/storage/ndb/include/ndbapi/ndbapi_limits.h b/storage/ndb/include/ndbapi/ndbapi_limits.h index 63399e4bd0a..e283913d059 100644 --- a/storage/ndb/include/ndbapi/ndbapi_limits.h +++ b/storage/ndb/include/ndbapi/ndbapi_limits.h @@ -26,4 +26,6 @@ #define NDB_MAX_TUPLE_SIZE (NDB_MAX_TUPLE_SIZE_IN_WORDS*4) #define NDB_MAX_ACTIVE_EVENTS 100 +#define NDB_MAX_SCANFILTER_SIZE_IN_WORDS 50000 + #endif diff --git a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp index 0964a54f906..068b0c6ac18 100644 --- a/storage/ndb/src/common/debugger/EventLogger.cpp +++ b/storage/ndb/src/common/debugger/EventLogger.cpp @@ -498,10 +498,10 @@ void getTextTransReportCounters(QQQQ) { // ------------------------------------------------------------------- BaseString::snprintf(m_text, m_text_len, "Trans. Count = %u, Commit Count = %u, " - "Read Count = %u, Simple Read Count = %u,\n" + "Read Count = %u, Simple Read Count = %u, " "Write Count = %u, AttrInfo Count = %u, " - "Concurrent Operations = %u, Abort Count = %u\n" - " Scans: %u Range scans: %u", + "Concurrent Operations = %u, Abort Count = %u" + " Scans = %u Range scans = %u", theData[1], theData[2], theData[3], @@ -797,9 +797,9 @@ void getTextBackupFailedToStart(QQQQ) { } void getTextBackupCompleted(QQQQ) { BaseString::snprintf(m_text, m_text_len, - "Backup %u started from node %u completed\n" - " StartGCP: %u StopGCP: %u\n" - " #Records: %u #LogRecords: %u\n" + "Backup %u started from node %u completed." + " StartGCP: %u StopGCP: %u" + " #Records: %u #LogRecords: %u" " Data: %u bytes Log: %u bytes", theData[2], refToNode(theData[1]), theData[3], theData[4], theData[6], theData[8], diff --git a/storage/ndb/src/cw/cpcd/APIService.cpp b/storage/ndb/src/cw/cpcd/APIService.cpp index 1c1cfb94cd4..f60abc08817 100644 --- a/storage/ndb/src/cw/cpcd/APIService.cpp +++ b/storage/ndb/src/cw/cpcd/APIService.cpp @@ -145,7 +145,7 @@ CPCDAPISession::CPCDAPISession(NDB_SOCKET_TYPE sock, : SocketServer::Session(sock) , m_cpcd(cpcd) { - m_input = new SocketInputStream(sock); + m_input = new SocketInputStream(sock, 7*24*60*60000); m_output = new SocketOutputStream(sock); m_parser = new Parser(commands, *m_input, true, true, true); } diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt index 83d2dfaec5a..3282cd41fa0 100644 --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4029 Next DBLQH 5045 Next DBDICT 6008 -Next DBDIH 7186 +Next DBDIH 7193 Next DBTC 8054 Next CMVMI 9000 Next BACKUP 10038 @@ -157,6 +157,9 @@ And crash when all have "not" been sent 7027: Crash in master when changing state to LCP_TAB_SAVED 7018: Crash in master when changing state to LCP_TAB_SAVED +7191: Crash when receiving LCP_COMPLETE_REP +7192: Crash in setLcpActiveStatusStart - when dead node missed to LCP's + ERROR CODES FOR TESTING NODE FAILURE, FAILURE IN COPY FRAGMENT PROCESS: ----------------------------------------------------------------------- diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 5bef13cd0b9..1177500bc27 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -318,6 +318,7 @@ public: Uint8 noOfStartedChkpt; MasterLCPConf::State lcpStateAtTakeOver; + Uint32 m_remove_node_from_table_lcp_id; }; typedef Ptr NodeRecordPtr; /**********************************************************************/ diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 762d4ea5141..dc35e6fba41 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -5069,6 +5069,18 @@ void Dbdih::startRemoveFailedNode(Signal* signal, NodeRecordPtr failedNodePtr) return; } + /** + * If node has node complete LCP + * we need to remove it as undo might not be complete + * bug#31257 + */ + failedNodePtr.p->m_remove_node_from_table_lcp_id = RNIL; + if (c_lcpState.m_LCP_COMPLETE_REP_Counter_LQH.isWaitingFor(failedNodePtr.i)) + { + jam(); + failedNodePtr.p->m_remove_node_from_table_lcp_id = SYSFILE->latestLCP_ID; + } + jam(); signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE; signal->theData[1] = failedNodePtr.i; @@ -5710,6 +5722,11 @@ void Dbdih::removeNodeFromTable(Signal* signal, return; }//if + NodeRecordPtr nodePtr; + nodePtr.i = nodeId; + ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord); + const Uint32 lcpId = nodePtr.p->m_remove_node_from_table_lcp_id; + /** * For each fragment */ @@ -5717,7 +5734,6 @@ void Dbdih::removeNodeFromTable(Signal* signal, Uint32 noOfRemovedLcpReplicas = 0; // No of replicas in LCP removed Uint32 noOfRemainingLcpReplicas = 0;// No of replicas in LCP remaining - //const Uint32 lcpId = SYSFILE->latestLCP_ID; const bool lcpOngoingFlag = (tabPtr.p->tabLcpStatus== TabRecord::TLS_ACTIVE); const bool unlogged = (tabPtr.p->tabStorage != TabRecord::ST_NORMAL); @@ -5752,6 +5768,23 @@ void Dbdih::removeNodeFromTable(Signal* signal, noOfRemovedLcpReplicas ++; replicaPtr.p->lcpOngoingFlag = false; } + + if (lcpId != RNIL) + { + jam(); + Uint32 lcpNo = prevLcpNo(replicaPtr.p->nextLcp); + if (replicaPtr.p->lcpStatus[lcpNo] == ZVALID && + replicaPtr.p->lcpId[lcpNo] == SYSFILE->latestLCP_ID) + { + jam(); + replicaPtr.p->lcpStatus[lcpNo] = ZINVALID; + replicaPtr.p->lcpId[lcpNo] = 0; + replicaPtr.p->nextLcp = lcpNo; + ndbout_c("REMOVING lcp: %u from table: %u frag: %u node: %u", + SYSFILE->latestLCP_ID, + tabPtr.i, fragNo, nodeId); + } + } } } if (!found) @@ -10898,6 +10931,8 @@ void Dbdih::execLCP_COMPLETE_REP(Signal* signal) { jamEntry(); + CRASH_INSERTION(7191); + #if 0 g_eventLogger.info("LCP_COMPLETE_REP"); printLCP_COMPLETE_REP(stdout, @@ -13657,6 +13692,7 @@ void Dbdih::setLcpActiveStatusStart(Signal* signal) // It must be taken over with the copy fragment process after a system // crash. We indicate this by setting the active status to TAKE_OVER. /*-------------------------------------------------------------------*/ + c_lcpState.m_participatingLQH.set(nodePtr.i); nodePtr.p->activeStatus = Sysfile::NS_TakeOver; //break; // Fall through case Sysfile::NS_TakeOver:{ @@ -13699,6 +13735,7 @@ void Dbdih::setLcpActiveStatusStart(Signal* signal) break; case Sysfile::NS_ActiveMissed_2: jam(); + CRASH_INSERTION(7192); if ((nodePtr.p->nodeStatus == NodeRecord::ALIVE) && (!nodePtr.p->copyCompleted)) { jam(); diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index efb88bfccd2..43d49e791be 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -14084,11 +14084,16 @@ void Dblqh::execSTART_FRAGREQ(Signal* signal) fragptr.p->fragStatus = Fragrecord::ACTIVE_CREATION; } - c_tup->disk_restart_mark_no_lcp(tabptr.i, fragId); + c_tup->disk_restart_lcp_id(tabptr.i, fragId, RNIL); jamEntry(); - return; - }//if + } + else + { + jam(); + c_tup->disk_restart_lcp_id(tabptr.i, fragId, lcpId); + jamEntry(); + } c_lcpId = (c_lcpId == 0 ? lcpId : c_lcpId); c_lcpId = (c_lcpId < lcpId ? c_lcpId : lcpId); diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index f28687dca0d..3db91c55849 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -641,6 +641,8 @@ typedef Ptr FragoperrecPtr; */ Page_request_list::Head m_page_requests[MAX_FREE_LIST]; + DLList::Head m_unmap_pages; + /** * Current extent */ @@ -702,7 +704,8 @@ struct Fragrecord { DLList::Head m_scanList; - enum { UC_LCP = 1, UC_CREATE = 2 }; + enum { UC_LCP = 1, UC_CREATE = 2, UC_SET_LCP = 3 }; + Uint32 m_restore_lcp_id; Uint32 m_undo_complete; Uint32 m_tablespace_id; Uint32 m_logfile_group_id; @@ -2830,7 +2833,7 @@ private: public: int disk_page_load_hook(Uint32 page_id); - void disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count); + void disk_page_unmap_callback(Uint32 when, Uint32 page, Uint32 dirty_count); int disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId, const Local_key* key, Uint32 pages); @@ -2851,11 +2854,11 @@ public: Local_key m_key; }; - void disk_restart_mark_no_lcp(Uint32 table, Uint32 frag); + void disk_restart_lcp_id(Uint32 table, Uint32 frag, Uint32 lcpId); private: void disk_restart_undo_next(Signal*); - void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag); + void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag, Uint32 lcpId); void disk_restart_undo_callback(Signal* signal, Uint32, Uint32); void disk_restart_undo_alloc(Apply_undo*); void disk_restart_undo_update(Apply_undo*); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp index 87705232de2..8420e7f2bde 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp @@ -903,8 +903,10 @@ Dbtup::disk_page_set_dirty(PagePtr pagePtr) } void -Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) +Dbtup::disk_page_unmap_callback(Uint32 when, + Uint32 page_id, Uint32 dirty_count) { + jamEntry(); Ptr gpage; m_global_page_pool.getPtr(gpage, page_id); PagePtr pagePtr; @@ -918,17 +920,9 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) { return ; } - - Local_key key; - key.m_page_no = pagePtr.p->m_page_no; - key.m_file_no = pagePtr.p->m_file_no; + Uint32 idx = pagePtr.p->list_index; - ndbassert((idx & 0x8000) == 0); - - if (DBG_DISK) - ndbout << "disk_page_unmap_callback " << key << endl; - Ptr tabPtr; tabPtr.i= pagePtr.p->m_table_id; ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec); @@ -938,26 +932,89 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info; - if (dirty_count == 0) + if (when == 0) { - Uint32 free = pagePtr.p->free_space; - Uint32 used = pagePtr.p->uncommitted_used_space; - ddassert(free >= used); - ddassert(alloc.calc_page_free_bits(free - used) == idx); + /** + * Before pageout + */ + jam(); + + if (DBG_DISK) + { + Local_key key; + key.m_page_no = pagePtr.p->m_page_no; + key.m_file_no = pagePtr.p->m_file_no; + ndbout << "disk_page_unmap_callback(before) " << key + << " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl; + } + + ndbassert((idx & 0x8000) == 0); + + ArrayPool *pool= (ArrayPool*)&m_global_page_pool; + LocalDLList list(*pool, alloc.m_dirty_pages[idx]); + LocalDLList list2(*pool, alloc.m_unmap_pages); + list.remove(pagePtr); + list2.add(pagePtr); + + if (dirty_count == 0) + { + jam(); + pagePtr.p->list_index = idx | 0x8000; + + Local_key key; + key.m_page_no = pagePtr.p->m_page_no; + key.m_file_no = pagePtr.p->m_file_no; + + Uint32 free = pagePtr.p->free_space; + Uint32 used = pagePtr.p->uncommitted_used_space; + ddassert(free >= used); + ddassert(alloc.calc_page_free_bits(free - used) == idx); + + Tablespace_client tsman(0, c_tsman, + fragPtr.p->fragTableId, + fragPtr.p->fragmentId, + fragPtr.p->m_tablespace_id); + + tsman.unmap_page(&key, idx); + jamEntry(); + } + } + else if (when == 1) + { + /** + * After page out + */ + jam(); + + Local_key key; + key.m_page_no = pagePtr.p->m_page_no; + key.m_file_no = pagePtr.p->m_file_no; + Uint32 real_free = pagePtr.p->free_space; + if (DBG_DISK) + { + ndbout << "disk_page_unmap_callback(after) " << key + << " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl; + } + + ArrayPool *pool= (ArrayPool*)&m_global_page_pool; + LocalDLList list(*pool, alloc.m_unmap_pages); + list.remove(pagePtr); + Tablespace_client tsman(0, c_tsman, fragPtr.p->fragTableId, fragPtr.p->fragmentId, fragPtr.p->m_tablespace_id); - tsman.unmap_page(&key, idx); - jamEntry(); - pagePtr.p->list_index = idx | 0x8000; + if (DBG_DISK && alloc.calc_page_free_bits(real_free) != (idx & ~0x8000)) + { + ndbout << key + << " calc: " << alloc.calc_page_free_bits(real_free) + << " idx: " << (idx & ~0x8000) + << endl; + } + tsman.update_page_free_bits(&key, alloc.calc_page_free_bits(real_free)); } - - ArrayPool *pool= (ArrayPool*)&m_global_page_pool; - LocalDLList list(*pool, alloc.m_dirty_pages[idx]); - list.remove(pagePtr); } void @@ -969,8 +1026,6 @@ Dbtup::disk_page_alloc(Signal* signal, Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info; Uint64 lsn; - Uint32 old_free = pagePtr.p->free_space; - Uint32 old_bits= alloc.calc_page_free_bits(old_free); if (tabPtrP->m_attributes[DD].m_no_of_varsize == 0) { ddassert(pagePtr.p->uncommitted_used_space > 0); @@ -988,20 +1043,6 @@ Dbtup::disk_page_alloc(Signal* signal, lsn= disk_page_undo_alloc(pagePtr.p, key, sz, gci, logfile_group_id); } - - Uint32 new_free = pagePtr.p->free_space; - Uint32 new_bits= alloc.calc_page_free_bits(new_free); - - if (old_bits != new_bits) - { - Tablespace_client tsman(signal, c_tsman, - fragPtrP->fragTableId, - fragPtrP->fragmentId, - fragPtrP->m_tablespace_id); - - tsman.update_page_free_bits(key, new_bits, lsn); - jamEntry(); - } } void @@ -1016,7 +1057,6 @@ Dbtup::disk_page_free(Signal *signal, Uint32 logfile_group_id= fragPtrP->m_logfile_group_id; Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info; Uint32 old_free= pagePtr.p->free_space; - Uint32 old_bits= alloc.calc_page_free_bits(old_free); Uint32 sz; Uint64 lsn; @@ -1043,19 +1083,7 @@ Dbtup::disk_page_free(Signal *signal, } Uint32 new_free = pagePtr.p->free_space; - Uint32 new_bits = alloc.calc_page_free_bits(new_free); - if (old_bits != new_bits) - { - Tablespace_client tsman(signal, c_tsman, - fragPtrP->fragTableId, - fragPtrP->fragmentId, - fragPtrP->m_tablespace_id); - - tsman.update_page_free_bits(key, new_bits, lsn); - jamEntry(); - } - Uint32 ext = pagePtr.p->m_extent_info_ptr; Uint32 used = pagePtr.p->uncommitted_used_space; Uint32 old_idx = pagePtr.p->list_index; @@ -1341,15 +1369,23 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, case File_formats::Undofile::UNDO_LCP_FIRST: case File_formats::Undofile::UNDO_LCP: { + jam(); ndbrequire(len == 3); + Uint32 lcp = ptr[0]; Uint32 tableId = ptr[1] >> 16; Uint32 fragId = ptr[1] & 0xFFFF; - disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP); + disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP, lcp); disk_restart_undo_next(signal); + + if (DBG_UNDO) + { + ndbout_c("UNDO LCP %u (%u, %u)", lcp, tableId, fragId); + } return; } case File_formats::Undofile::UNDO_TUP_ALLOC: { + jam(); Disk_undo::Alloc* rec= (Disk_undo::Alloc*)ptr; preq.m_page.m_page_no = rec->m_page_no; preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16; @@ -1358,6 +1394,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, } case File_formats::Undofile::UNDO_TUP_UPDATE: { + jam(); Disk_undo::Update* rec= (Disk_undo::Update*)ptr; preq.m_page.m_page_no = rec->m_page_no; preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16; @@ -1366,6 +1403,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, } case File_formats::Undofile::UNDO_TUP_FREE: { + jam(); Disk_undo::Free* rec= (Disk_undo::Free*)ptr; preq.m_page.m_page_no = rec->m_page_no; preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16; @@ -1377,6 +1415,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, * */ { + jam(); Disk_undo::Create* rec= (Disk_undo::Create*)ptr; Ptr tabPtr; tabPtr.i= rec->m_table; @@ -1384,12 +1423,34 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, for(Uint32 i = 0; ifragrec[i] != RNIL) disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i], - Fragrecord::UC_CREATE); + Fragrecord::UC_CREATE, 0); disk_restart_undo_next(signal); + + if (DBG_UNDO) + { + ndbout_c("UNDO CREATE (%u)", tabPtr.i); + } return; } case File_formats::Undofile::UNDO_TUP_DROP: + { jam(); + Disk_undo::Drop* rec = (Disk_undo::Drop*)ptr; + Ptr tabPtr; + tabPtr.i= rec->m_table; + ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec); + for(Uint32 i = 0; ifragrec[i] != RNIL) + disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i], + Fragrecord::UC_CREATE, 0); + disk_restart_undo_next(signal); + + if (DBG_UNDO) + { + ndbout_c("UNDO DROP (%u)", tabPtr.i); + } + return; + } case File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT: jam(); case File_formats::Undofile::UNDO_TUP_FREE_EXTENT: @@ -1398,6 +1459,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, return; case File_formats::Undofile::UNDO_END: + jam(); f_undo_done = true; return; default: @@ -1431,14 +1493,32 @@ Dbtup::disk_restart_undo_next(Signal* signal) } void -Dbtup::disk_restart_mark_no_lcp(Uint32 tableId, Uint32 fragId) +Dbtup::disk_restart_lcp_id(Uint32 tableId, Uint32 fragId, Uint32 lcpId) { jamEntry(); - disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_CREATE); + + if (lcpId == RNIL) + { + disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_CREATE, 0); + if (DBG_UNDO) + { + ndbout_c("mark_no_lcp (%u, %u)", tableId, fragId); + } + } + else + { + disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_SET_LCP, lcpId); + if (DBG_UNDO) + { + ndbout_c("mark_no_lcp (%u, %u)", tableId, fragId); + } + + } } void -Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag) +Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag, + Uint32 lcpId) { Ptr tabPtr; tabPtr.i= tableId; @@ -1446,11 +1526,43 @@ Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag) if (tabPtr.p->tableStatus == DEFINED) { + jam(); FragrecordPtr fragPtr; getFragmentrec(fragPtr, fragId, tabPtr.p); if (!fragPtr.isNull()) { - fragPtr.p->m_undo_complete |= flag; + jam(); + switch(flag){ + case Fragrecord::UC_CREATE: + jam(); + fragPtr.p->m_undo_complete |= flag; + return; + case Fragrecord::UC_LCP: + jam(); + if (fragPtr.p->m_undo_complete == 0 && + fragPtr.p->m_restore_lcp_id == lcpId) + { + jam(); + fragPtr.p->m_undo_complete |= flag; + if (DBG_UNDO) + ndbout_c("table: %u fragment: %u lcp: %u -> done", + tableId, fragId, lcpId); + } + return; + case Fragrecord::UC_SET_LCP: + { + jam(); + if (DBG_UNDO) + ndbout_c("table: %u fragment: %u restore to lcp: %u", + tableId, fragId, lcpId); + ndbrequire(fragPtr.p->m_undo_complete == 0); + ndbrequire(fragPtr.p->m_restore_lcp_id == RNIL); + fragPtr.p->m_restore_lcp_id = lcpId; + return; + } + } + jamLine(flag); + ndbrequire(false); } } } @@ -1474,6 +1586,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal, pagePtr.p->nextList != RNIL || pagePtr.p->prevList != RNIL) { + jam(); update = true; pagePtr.p->list_index |= 0x8000; pagePtr.p->nextList = pagePtr.p->prevList = RNIL; @@ -1484,6 +1597,9 @@ Dbtup::disk_restart_undo_callback(Signal* signal, if (tableId >= cnoOfTablerec) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO table> %u", tableId); disk_restart_undo_next(signal); return; } @@ -1492,6 +1608,9 @@ Dbtup::disk_restart_undo_callback(Signal* signal, if (undo->m_table_ptr.p->tableStatus != DEFINED) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO !defined (%u) ", tableId); disk_restart_undo_next(signal); return; } @@ -1499,19 +1618,25 @@ Dbtup::disk_restart_undo_callback(Signal* signal, getFragmentrec(undo->m_fragment_ptr, fragId, undo->m_table_ptr.p); if(undo->m_fragment_ptr.isNull()) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO fragment null %u/%u", tableId, fragId); disk_restart_undo_next(signal); return; } if (undo->m_fragment_ptr.p->m_undo_complete) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO undo complete %u/%u", tableId, fragId); disk_restart_undo_next(signal); return; } - Local_key key; - key.m_page_no = pagePtr.p->m_page_no; - key.m_file_no = pagePtr.p->m_file_no; + Local_key key = undo->m_key; +// key.m_page_no = pagePtr.p->m_page_no; +// key.m_file_no = pagePtr.p->m_file_no; Uint64 lsn = 0; lsn += pagePtr.p->m_page_header.m_page_lsn_hi; lsn <<= 32; @@ -1521,6 +1646,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal, if (undo->m_lsn <= lsn) { + jam(); if (DBG_UNDO) { ndbout << "apply: " << undo->m_lsn << "(" << lsn << " )" @@ -1535,12 +1661,15 @@ Dbtup::disk_restart_undo_callback(Signal* signal, */ switch(undo->m_type){ case File_formats::Undofile::UNDO_TUP_ALLOC: + jam(); disk_restart_undo_alloc(undo); break; case File_formats::Undofile::UNDO_TUP_UPDATE: + jam(); disk_restart_undo_update(undo); break; case File_formats::Undofile::UNDO_TUP_FREE: + jam(); disk_restart_undo_free(undo); break; default: @@ -1555,14 +1684,17 @@ Dbtup::disk_restart_undo_callback(Signal* signal, m_pgman.update_lsn(undo->m_key, lsn); jamEntry(); + + disk_restart_undo_page_bits(signal, undo); } else if (DBG_UNDO) { + jam(); ndbout << "ignore: " << undo->m_lsn << "(" << lsn << " )" - << key << " type: " << undo->m_type << endl; + << key << " type: " << undo->m_type + << " tab: " << tableId << endl; } - disk_restart_undo_page_bits(signal, undo); disk_restart_undo_next(signal); } @@ -1637,16 +1769,12 @@ Dbtup::disk_restart_undo_page_bits(Signal* signal, Apply_undo* undo) Uint32 new_bits = alloc.calc_page_free_bits(free); pageP->list_index = 0x8000 | new_bits; - Uint64 lsn = 0; - lsn += pageP->m_page_header.m_page_lsn_hi; lsn <<= 32; - lsn += pageP->m_page_header.m_page_lsn_lo; - Tablespace_client tsman(signal, c_tsman, fragPtrP->fragTableId, fragPtrP->fragmentId, fragPtrP->m_tablespace_id); - tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn, lsn); + tsman.restart_undo_page_free_bits(&undo->m_key, new_bits); jamEntry(); } @@ -1683,6 +1811,7 @@ Dbtup::disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId, if (alloc.m_curr_extent_info_ptr_i != RNIL) { + jam(); Ptr old; c_extent_pool.getPtr(old, alloc.m_curr_extent_info_ptr_i); ndbassert(old.p->m_free_matrix_pos == RNIL); @@ -1709,6 +1838,7 @@ void Dbtup::disk_restart_page_bits(Uint32 tableId, Uint32 fragId, const Local_key*, Uint32 bits) { + jam(); TablerecPtr tabPtr; FragrecordPtr fragPtr; tabPtr.i = tableId; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 6866236f15e..c8df5f5154e 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -143,6 +143,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) regFragPtr.p->m_lcp_scan_op = RNIL; regFragPtr.p->m_lcp_keep_list = RNIL; regFragPtr.p->m_var_page_chunks = RNIL; + regFragPtr.p->m_restore_lcp_id = RNIL; if (ERROR_INSERTED(4007) && regTabPtr.p->fragid[0] == fragId || ERROR_INSERTED(4008) && regTabPtr.p->fragid[1] == fragId) { @@ -674,11 +675,11 @@ Dbtup::undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused) switch(ret){ case 0: return; + case -1: + warningEvent("Failed to sync log for create of table: %u", regTabPtr.i); default: - ndbout_c("ret: %d", ret); - ndbrequire(false); + execute(signal, req.m_callback, regFragPtr.p->m_logfile_group_id); } - } void @@ -959,8 +960,6 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, return; } -#if NOT_YET_UNDO_DROP_TABLE -#error "This code is complete, but I prefer not to enable it until I need it" if (logfile_group_id != RNIL) { Callback cb; @@ -968,8 +967,15 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, cb.m_callbackFunction = safe_cast(&Dbtup::drop_table_log_buffer_callback); Uint32 sz= sizeof(Disk_undo::Drop) >> 2; - (void) c_lgman->alloc_log_space(logfile_group_id, sz); - + int r0 = c_lgman->alloc_log_space(logfile_group_id, sz); + if (r0) + { + jam(); + warningEvent("Failed to alloc log space for drop table: %u", + tabPtr.i); + goto done; + } + Logfile_client lgman(this, c_lgman, logfile_group_id); int res= lgman.get_log_buffer(signal, sz, &cb); switch(res){ @@ -977,15 +983,18 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, jam(); return; case -1: - ndbrequire("NOT YET IMPLEMENTED" == 0); + warningEvent("Failed to get log buffer for drop table: %u", + tabPtr.i); + c_lgman->free_log_space(logfile_group_id, sz); + goto done; break; default: execute(signal, cb, logfile_group_id); return; } } -#endif - + +done: drop_table_logsync_callback(signal, tabPtr.i, RNIL); } @@ -997,7 +1006,20 @@ Dbtup::drop_fragment_unmap_pages(Signal *signal, { if (tabPtr.p->m_no_of_disk_attributes) { + jam(); Disk_alloc_info& alloc_info= fragPtr.p->m_disk_alloc_info; + + if (!alloc_info.m_unmap_pages.isEmpty()) + { + jam(); + ndbout_c("waiting for unmape pages"); + signal->theData[0] = ZUNMAP_PAGES; + signal->theData[1] = tabPtr.i; + signal->theData[2] = fragPtr.i; + signal->theData[3] = pos; + sendSignal(cownref, GSN_CONTINUEB, signal, 4, JBB); + return; + } while(alloc_info.m_dirty_pages[pos].isEmpty() && pos < MAX_FREE_LIST) pos++; @@ -1164,9 +1186,10 @@ Dbtup::drop_table_log_buffer_callback(Signal* signal, Uint32 tablePtrI, switch(ret){ case 0: return; + case -1: + warningEvent("Failed to syn log for drop of table: %u", tablePtrI); default: - ndbout_c("ret: %d", ret); - ndbrequire(false); + execute(signal, req.m_callback, logfile_group_id); } } diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index 6e53531e118..a5f7d4be0a9 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -772,7 +772,7 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) uncommitted = committed = ~(unsigned)0; int ret = tsman.get_page_free_bits(&key, &uncommitted, &committed); ndbrequire(ret == 0); - if (committed == 0) { + if (committed == 0 && uncommitted == 0) { // skip empty page jam(); pos.m_get = ScanPos::Get_next_page_dd; diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp index 23738717580..0481f7b399b 100644 --- a/storage/ndb/src/kernel/blocks/lgman.cpp +++ b/storage/ndb/src/kernel/blocks/lgman.cpp @@ -2701,8 +2701,16 @@ Lgman::execute_undo_record(Signal* signal) Uint32 lcp = * (ptr - len + 1); if(m_latest_lcp && lcp > m_latest_lcp) { - // Just ignore - break; + if (0) + { + const Uint32 * base = ptr - len + 1; + Uint32 lcp = base[0]; + Uint32 tableId = base[1] >> 16; + Uint32 fragId = base[1] & 0xFFFF; + + ndbout_c("NOT! ignoring lcp: %u tab: %u frag: %u", + lcp, tableId, fragId); + } } if(m_latest_lcp == 0 || diff --git a/storage/ndb/src/kernel/blocks/pgman.cpp b/storage/ndb/src/kernel/blocks/pgman.cpp index febac4c4050..aa1f04c720c 100644 --- a/storage/ndb/src/kernel/blocks/pgman.cpp +++ b/storage/ndb/src/kernel/blocks/pgman.cpp @@ -500,6 +500,11 @@ Pgman::release_page_entry(Ptr& ptr) if (! (state & Page_entry::LOCKED)) ndbrequire(! (state & Page_entry::REQUEST)); + + if (ptr.p->m_copy_page_i != RNIL) + { + m_global_page_pool.release(ptr.p->m_copy_page_i); + } set_page_state(ptr, 0); m_page_hashlist.remove(ptr); @@ -1149,7 +1154,8 @@ Pgman::process_cleanup(Signal* signal) #ifdef VM_TRACE debugOut << "PGMAN: " << ptr << " : process_cleanup" << endl; #endif - c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i, + c_tup->disk_page_unmap_callback(0, + ptr.p->m_real_page_i, ptr.p->m_dirty_count); pageout(signal, ptr); max_count--; @@ -1187,6 +1193,11 @@ Pgman::move_cleanup_ptr(Ptr ptr) void Pgman::execLCP_FRAG_ORD(Signal* signal) { + if (ERROR_INSERTED(11008)) + { + ndbout_c("Ignore LCP_FRAG_ORD"); + return; + } LcpFragOrd* ord = (LcpFragOrd*)signal->getDataPtr(); ndbrequire(ord->lcpId >= m_last_lcp_complete + 1 || m_last_lcp_complete == 0); m_last_lcp = ord->lcpId; @@ -1203,6 +1214,12 @@ Pgman::execLCP_FRAG_ORD(Signal* signal) void Pgman::execEND_LCP_REQ(Signal* signal) { + if (ERROR_INSERTED(11008)) + { + ndbout_c("Ignore END_LCP"); + return; + } + EndLcpReq* req = (EndLcpReq*)signal->getDataPtr(); m_end_lcp_req = *req; @@ -1281,7 +1298,8 @@ Pgman::process_lcp(Signal* signal) { DBG_LCP(" pageout()" << endl); ptr.p->m_state |= Page_entry::LCP; - c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i, + c_tup->disk_page_unmap_callback(0, + ptr.p->m_real_page_i, ptr.p->m_dirty_count); pageout(signal, ptr); } @@ -1503,6 +1521,10 @@ Pgman::fswriteconf(Signal* signal, Ptr ptr) Page_state state = ptr.p->m_state; ndbrequire(state & Page_entry::PAGEOUT); + c_tup->disk_page_unmap_callback(1, + ptr.p->m_real_page_i, + ptr.p->m_dirty_count); + state &= ~ Page_entry::PAGEOUT; state &= ~ Page_entry::EMPTY; state &= ~ Page_entry::DIRTY; @@ -1756,7 +1778,7 @@ Pgman::get_page(Signal* signal, Ptr ptr, Page_request page_req) #endif state |= Page_entry::REQUEST; - if (only_request && req_flags & Page_request::EMPTY_PAGE) + if (only_request && (req_flags & Page_request::EMPTY_PAGE)) { state |= Page_entry::EMPTY; } @@ -2418,7 +2440,8 @@ Pgman::execDUMP_STATE_ORD(Signal* signal) if (pl_hash.find(ptr, key)) { ndbout << "pageout " << ptr << endl; - c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i, + c_tup->disk_page_unmap_callback(0, + ptr.p->m_real_page_i, ptr.p->m_dirty_count); pageout(signal, ptr); } @@ -2474,6 +2497,11 @@ Pgman::execDUMP_STATE_ORD(Signal* signal) { SET_ERROR_INSERT_VALUE(11007); } + + if (signal->theData[0] == 11008) + { + SET_ERROR_INSERT_VALUE(11008); + } } // page cache client diff --git a/storage/ndb/src/kernel/blocks/tsman.cpp b/storage/ndb/src/kernel/blocks/tsman.cpp index 8f61ec0cf7b..3a7003d56c8 100644 --- a/storage/ndb/src/kernel/blocks/tsman.cpp +++ b/storage/ndb/src/kernel/blocks/tsman.cpp @@ -299,7 +299,7 @@ Tsman::execDUMP_STATE_ORD(Signal* signal){ Uint32 new_bits = curr_bits ^ rand(); Local_key key = chunks[chunk].start_page; key.m_page_no += page; - ndbrequire(update_page_free_bits(signal, &key, new_bits, 0) == 0); + ndbrequire(update_page_free_bits(signal, &key, new_bits) == 0); } } } @@ -366,6 +366,20 @@ Tsman::execCREATE_FILEGROUP_REQ(Signal* signal){ CreateFilegroupImplRef::SignalLength, JBB); } +NdbOut& +operator<<(NdbOut& out, const File_formats::Datafile::Extent_header & obj) +{ + out << "table: " << obj.m_table + << " fragment: " << obj.m_fragment_id << " "; + for(Uint32 i = 0; i<32; i++) + { + char t[2]; + BaseString::snprintf(t, sizeof(t), "%x", obj.get_free_bits(i)); + out << t; + } + return out; +} + void Tsman::execDROP_FILEGROUP_REQ(Signal* signal){ jamEntry(); @@ -1590,8 +1604,7 @@ Tsman::execFREE_EXTENT_REQ(Signal* signal) int Tsman::update_page_free_bits(Signal* signal, Local_key *key, - unsigned committed_bits, - Uint64 lsn) + unsigned committed_bits) { jamEntry(); @@ -1626,6 +1639,18 @@ Tsman::update_page_free_bits(Signal* signal, File_formats::Datafile::Extent_header* header = page->get_header(val.m_extent_no, val.m_extent_size); + if (header->m_table == RNIL) + { + ndbout << "update page free bits page: " << *key + << " " << *header << endl; + } + + if (0) + { + ndbout << "update page free bits page(" << committed_bits << ") " + << *key << " " << *header << endl; + } + ndbrequire(header->m_table != RNIL); Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val); @@ -1637,7 +1662,7 @@ Tsman::update_page_free_bits(Signal* signal, Uint32 src = header->get_free_bits(page_no_in_extent) & UNCOMMITTED_MASK; header->update_free_bits(page_no_in_extent, src | committed_bits); - m_page_cache_client.update_lsn(preq.m_page, lsn); + m_page_cache_client.update_lsn(preq.m_page, 0); return 0; } @@ -1725,6 +1750,11 @@ Tsman::unmap_page(Signal* signal, Local_key *key, Uint32 uncommitted_bits) File_formats::Datafile::Extent_header* header = page->get_header(val.m_extent_no, val.m_extent_size); + if (header->m_table == RNIL) + { + ndbout << "trying to unmap page: " << *key + << " " << *header << endl; + } ndbrequire(header->m_table != RNIL); Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val); @@ -1746,9 +1776,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal, Uint32 tableId, Uint32 fragId, Local_key *key, - unsigned bits, - Uint64 undo_lsn, - Uint64 page_lsn) + unsigned bits) { jamEntry(); @@ -1782,21 +1810,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal, (File_formats::Datafile::Extent_page*)ptr_p; File_formats::Datafile::Extent_header* header = page->get_header(val.m_extent_no, val.m_extent_size); - - Uint64 lsn = 0; - lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32; - lsn += page->m_page_header.m_page_lsn_lo; - - if (undo_lsn > lsn && undo_lsn > page_lsn) - { - if (DBG_UNDO) - ndbout << "tsman: ignore " << undo_lsn << "(" << lsn << ", " - << page_lsn << ") " - << *key << " " - << " -> " << bits << endl; - return 0; - } - + if (header->m_table == RNIL) { if (DBG_UNDO) @@ -1815,7 +1829,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal, */ if (DBG_UNDO) { - ndbout << "tsman: apply " << undo_lsn << "(" << lsn << ") " + ndbout << "tsman: apply " << *key << " " << (src & COMMITTED_MASK) << " -> " << bits << endl; } @@ -1863,7 +1877,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal) /** * Handling of unmapped extent header pages is not implemented */ - int flags = 0; + int flags = Page_cache_client::DIRTY_REQ; int real_page_id; Uint32 page_no; Uint32 src_bits; diff --git a/storage/ndb/src/kernel/blocks/tsman.hpp b/storage/ndb/src/kernel/blocks/tsman.hpp index 1293cc54141..20019e6d4d1 100644 --- a/storage/ndb/src/kernel/blocks/tsman.hpp +++ b/storage/ndb/src/kernel/blocks/tsman.hpp @@ -209,12 +209,12 @@ private: void load_extent_page_callback(Signal*, Uint32, Uint32); void create_file_ref(Signal*, Ptr, Ptr, Uint32,Uint32,Uint32); - int update_page_free_bits(Signal*, Local_key*, unsigned committed_bits, - Uint64 lsn); + int update_page_free_bits(Signal*, Local_key*, unsigned committed_bits); + int get_page_free_bits(Signal*, Local_key*, unsigned*, unsigned*); int unmap_page(Signal*, Local_key*, unsigned uncommitted_bits); int restart_undo_page_free_bits(Signal*, Uint32, Uint32, Local_key*, - unsigned committed_bits, Uint64, Uint64); + unsigned committed_bits); int alloc_extent(Signal* signal, Uint32 tablespace, Local_key* key); int alloc_page_from_extent(Signal*, Uint32, Local_key*, Uint32 bits); @@ -320,7 +320,7 @@ public: /** * Update page free bits */ - int update_page_free_bits(Local_key*, unsigned bits, Uint64 lsn); + int update_page_free_bits(Local_key*, unsigned bits); /** * Get page free bits @@ -336,8 +336,7 @@ public: /** * Undo handling of page bits */ - int restart_undo_page_free_bits(Local_key*, unsigned bits, - Uint64 lsn, Uint64 page_lsn); + int restart_undo_page_free_bits(Local_key*, unsigned bits); /** * Get tablespace info @@ -417,10 +416,9 @@ Tablespace_client::free_extent(Local_key* key, Uint64 lsn) inline int Tablespace_client::update_page_free_bits(Local_key *key, - unsigned committed_bits, - Uint64 lsn) + unsigned committed_bits) { - return m_tsman->update_page_free_bits(m_signal, key, committed_bits, lsn); + return m_tsman->update_page_free_bits(m_signal, key, committed_bits); } inline @@ -442,17 +440,13 @@ Tablespace_client::unmap_page(Local_key *key, unsigned uncommitted_bits) inline int Tablespace_client::restart_undo_page_free_bits(Local_key* key, - unsigned committed_bits, - Uint64 lsn, - Uint64 page_lsn) + unsigned committed_bits) { return m_tsman->restart_undo_page_free_bits(m_signal, m_table_id, m_fragment_id, key, - committed_bits, - lsn, - page_lsn); + committed_bits); } #endif diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp index 875cc2771ae..9e8910c9649 100644 --- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp @@ -269,8 +269,8 @@ static const char* helpText = "CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off\n" "CLUSTERLOG INFO Print cluster log information\n" " START Start data node (started with -n)\n" -" RESTART [-n] [-i] Restart data or management server node\n" -" STOP Stop data or management server node\n" +" RESTART [-n] [-i] [-a] Restart data or management server node\n" +" STOP [-a] Stop data or management server node\n" "ENTER SINGLE USER MODE Enter single user mode\n" "EXIT SINGLE USER MODE Exit single user mode\n" " STATUS Print status\n" @@ -434,7 +434,7 @@ static const char* helpTextRestart = " NDB Cluster -- Management Client -- Help for RESTART command\n" "---------------------------------------------------------------------------\n" "RESTART Restart data or management server node\n\n" -" RESTART [-n] [-i] \n" +" RESTART [-n] [-i] [-a]\n" " Restart the data or management node (or All data nodes).\n\n" " -n (--nostart) restarts the node but does not\n" " make it join the cluster. Use ' START' to\n" @@ -445,6 +445,7 @@ static const char* helpTextRestart = " in the same node group during start up.\n\n" " Consult the documentation before using -i.\n\n" " INCORRECT USE OF -i WILL CAUSE DATA LOSS!\n" +" -a Aborts the node, not syncing GCP.\n" ; static const char* helpTextStop = @@ -452,10 +453,11 @@ static const char* helpTextStop = " NDB Cluster -- Management Client -- Help for STOP command\n" "---------------------------------------------------------------------------\n" "STOP Stop data or management server node\n\n" -" STOP Stop the data or management server node .\n\n" +" STOP [-a] Stop the data or management server node .\n\n" " ALL STOP will just stop all data nodes.\n\n" " If you desire to also shut down management servers,\n" -" use SHUTDOWN instead.\n" +" use SHUTDOWN instead.\n" +" -a Aborts the node, not syncing GCP.\n" ; static const char* helpTextEnterSingleUserMode = diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp index af708664a69..ee5bb5103d8 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -234,10 +234,10 @@ MgmtSrvr::startEventLog() } } -void -MgmtSrvr::stopEventLog() +void +MgmtSrvr::stopEventLog() { - // Nothing yet + g_eventLogger.close(); } bool diff --git a/storage/ndb/src/ndbapi/NdbOperation.cpp b/storage/ndb/src/ndbapi/NdbOperation.cpp index 50531292e40..ddaf5d0b233 100644 --- a/storage/ndb/src/ndbapi/NdbOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbOperation.cpp @@ -429,3 +429,9 @@ NdbOperation::getTable() const { return m_currentTable; } + +NdbTransaction* +NdbOperation::getNdbTransaction() +{ + return theNdbCon; +} diff --git a/storage/ndb/src/ndbapi/NdbScanFilter.cpp b/storage/ndb/src/ndbapi/NdbScanFilter.cpp index fb47772fdea..25f74ce71a4 100644 --- a/storage/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/storage/ndb/src/ndbapi/NdbScanFilter.cpp @@ -14,11 +14,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include "NdbDictionaryImpl.hpp" #include #include #include +#include +#include "NdbApiSignal.hpp" +#include "NdbUtil.hpp" #ifdef VM_TRACE #include @@ -52,14 +56,37 @@ public: int cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, const void * value, Uint32 len); + + bool m_abort_on_too_large; + + NdbOperation::OperationStatus m_initial_op_status; + Uint32 m_initial_AI_size; + Uint32 m_max_size; + + Uint32 get_size() { + assert(m_operation->theTotalCurrAI_Len >= m_initial_AI_size); + return m_operation->theTotalCurrAI_Len - m_initial_AI_size; + } + bool check_size() { + if (get_size() <= m_max_size) + return true; + handle_filter_too_large(); + return false; + } + void handle_filter_too_large(); + + NdbError m_error; }; const Uint32 LabelExit = ~0; -NdbScanFilter::NdbScanFilter(class NdbOperation * op) +NdbScanFilter::NdbScanFilter(class NdbOperation * op, + bool abort_on_too_large, + Uint32 max_size) : m_impl(* new NdbScanFilterImpl()) { + DBUG_ENTER("NdbScanFilter::NdbScanFilter"); m_impl.m_current.m_group = (NdbScanFilter::Group)0; m_impl.m_current.m_popCount = 0; m_impl.m_current.m_ownLabel = 0; @@ -69,6 +96,21 @@ NdbScanFilter::NdbScanFilter(class NdbOperation * op) m_impl.m_latestAttrib = ~0; m_impl.m_operation = op; m_impl.m_negative = 0; + + DBUG_PRINT("info", ("op status: %d tot AI: %u in curr: %u", + op->theStatus, + op->theTotalCurrAI_Len, op->theAI_LenInCurrAI)); + + m_impl.m_abort_on_too_large = abort_on_too_large; + + m_impl.m_initial_op_status = op->theStatus; + m_impl.m_initial_AI_size = op->theTotalCurrAI_Len; + if (max_size > NDB_MAX_SCANFILTER_SIZE_IN_WORDS) + max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS; + m_impl.m_max_size = max_size; + + m_impl.m_error.code = 0; + DBUG_VOID_RETURN; } NdbScanFilter::~NdbScanFilter(){ @@ -200,30 +242,38 @@ NdbScanFilter::end(){ switch(tmp.m_group){ case NdbScanFilter::AND: if(tmp.m_trueLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_trueLabel); + if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1) + return -1; } break; case NdbScanFilter::NAND: if(tmp.m_trueLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_falseLabel); + if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1) + return -1; } break; case NdbScanFilter::OR: if(tmp.m_falseLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_falseLabel); + if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1) + return -1; } break; case NdbScanFilter::NOR: if(tmp.m_falseLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_trueLabel); + if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1) + return -1; } break; default: @@ -231,24 +281,29 @@ NdbScanFilter::end(){ return -1; } - m_impl.m_operation->def_label(tmp.m_ownLabel); + if (m_impl.m_operation->def_label(tmp.m_ownLabel) == -1) + return -1; if(m_impl.m_stack.size() == 0){ switch(tmp.m_group){ case NdbScanFilter::AND: case NdbScanFilter::NOR: - m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; break; case NdbScanFilter::OR: case NdbScanFilter::NAND: - m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; break; default: m_impl.m_operation->setErrorCodeAbort(4260); return -1; } } - + + if (!m_impl.check_size()) + return -1; return 0; } @@ -261,10 +316,16 @@ NdbScanFilter::istrue(){ } if(m_impl.m_current.m_trueLabel == (Uint32)~0){ - return m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; } else { - return m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel); + if (m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel) == -1) + return -1; } + + if (!m_impl.check_size()) + return -1; + return 0; } int @@ -276,12 +337,22 @@ NdbScanFilter::isfalse(){ } if(m_impl.m_current.m_falseLabel == (Uint32)~0){ - return m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; } else { - return m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel); + if (m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel) == -1) + return -1; } + + if (!m_impl.check_size()) + return -1; + return 0; } +NdbOperation * +NdbScanFilter::getNdbOperation(){ + return m_impl.m_operation; +} #define action(x, y, z) @@ -330,7 +401,11 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ } Branch1 branch = table2[op].m_branches[m_current.m_group]; - (m_operation->* branch)(AttrId, m_current.m_ownLabel); + if ((m_operation->* branch)(AttrId, m_current.m_ownLabel) == -1) + return -1; + + if (!check_size()) + return -1; return 0; } @@ -463,8 +538,12 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, return -1; } - int ret = (m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel); - return ret; + if ((m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel) == -1) + return -1; + + if (!check_size()) + return -1; + return 0; } int @@ -490,7 +569,130 @@ NdbScanFilter::cmp(BinaryCondition cond, int ColId, return m_impl.cond_col_const(Interpreter::NOT_LIKE, ColId, val, len); } return -1; -} +} + +void +NdbScanFilterImpl::handle_filter_too_large() +{ + DBUG_ENTER("NdbScanFilterImpl::handle_filter_too_large"); + + NdbOperation* const op = m_operation; + m_error.code = NdbScanFilter::FilterTooLarge; + if (m_abort_on_too_large) + op->setErrorCodeAbort(m_error.code); + + /* + * Possible interpreted parts at this point are: + * + * 1. initial read + * 2. interpreted program + * + * It is assumed that NdbScanFilter has created all of 2 + * so that we don't have to save interpreter state. + */ + + const Uint32 size = get_size(); + assert(size != 0); + + // new ATTRINFO size + const Uint32 new_size = m_initial_AI_size; + + // find last signal for new size + assert(op->theFirstATTRINFO != NULL); + NdbApiSignal* lastSignal = op->theFirstATTRINFO; + Uint32 n = 0; + while (n + AttrInfo::DataLength < new_size) { + lastSignal = lastSignal->next(); + assert(lastSignal != NULL); + n += AttrInfo::DataLength; + } + assert(n < size); + + // release remaining signals + NdbApiSignal* tSignal = lastSignal->next(); + op->theNdb->releaseSignalsInList(&tSignal); + lastSignal->next(NULL); + + // length of lastSignal + const Uint32 new_curr = AttrInfo::HeaderLength + new_size - n; + assert(new_curr <= 25); + + DBUG_PRINT("info", ("op status: %d->%d tot AI: %u->%u in curr: %u->%u", + op->theStatus, m_initial_op_status, + op->theTotalCurrAI_Len, new_size, + op->theAI_LenInCurrAI, new_curr)); + + // reset op state + op->theStatus = m_initial_op_status; + + // reset interpreter state to initial + + NdbBranch* tBranch = op->theFirstBranch; + while (tBranch != NULL) { + NdbBranch* tmp = tBranch; + tBranch = tBranch->theNext; + op->theNdb->releaseNdbBranch(tmp); + } + op->theFirstBranch = NULL; + op->theLastBranch = NULL; + + NdbLabel* tLabel = op->theFirstLabel; + while (tLabel != NULL) { + NdbLabel* tmp = tLabel; + tLabel = tLabel->theNext; + op->theNdb->releaseNdbLabel(tmp); + } + op->theFirstLabel = NULL; + op->theLastLabel = NULL; + + NdbCall* tCall = op->theFirstCall; + while (tCall != NULL) { + NdbCall* tmp = tCall; + tCall = tCall->theNext; + op->theNdb->releaseNdbCall(tmp); + } + op->theFirstCall = NULL; + op->theLastCall = NULL; + + NdbSubroutine* tSubroutine = op->theFirstSubroutine; + while (tSubroutine != NULL) { + NdbSubroutine* tmp = tSubroutine; + tSubroutine = tSubroutine->theNext; + op->theNdb->releaseNdbSubroutine(tmp); + } + op->theFirstSubroutine = NULL; + op->theLastSubroutine = NULL; + + op->theNoOfLabels = 0; + op->theNoOfSubroutines = 0; + + // reset AI size + op->theTotalCurrAI_Len = new_size; + op->theAI_LenInCurrAI = new_curr; + + // reset signal pointers + op->theCurrentATTRINFO = lastSignal; + op->theATTRINFOptr = &lastSignal->getDataPtrSend()[new_curr]; + + // interpreter sizes are set later somewhere + + DBUG_VOID_RETURN; +} + +static void +update(const NdbError & _err){ + NdbError & error = (NdbError &) _err; + ndberror_struct ndberror = (ndberror_struct)error; + ndberror_update(&ndberror); + error = NdbError(ndberror); +} + +const NdbError & +NdbScanFilter::getNdbError() const +{ + update(m_impl.m_error); + return m_impl.m_error; +} #if 0 diff --git a/storage/ndb/src/ndbapi/NdbScanOperation.cpp b/storage/ndb/src/ndbapi/NdbScanOperation.cpp index 89782453a72..055fbf28339 100644 --- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp @@ -872,6 +872,10 @@ NdbScanOperation::doSendScan(int aProcessorId) // sending it. This could not be done in openScan because // we created the ATTRINFO signals after the SCAN_TABREQ signal. ScanTabReq * const req = CAST_PTR(ScanTabReq, tSignal->getDataPtrSend()); + if (unlikely(theTotalCurrAI_Len > ScanTabReq::MaxTotalAttrInfo)) { + setErrorCode(4257); + return -1; + } req->attrLenKeyLen = (tupKeyLen << 16) | theTotalCurrAI_Len; Uint32 tmp = req->requestInfo; ScanTabReq::setDistributionKeyFlag(tmp, theDistrKeyIndicator_); diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index a0417e5b118..0ad2faff76a 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -624,6 +624,7 @@ ErrorBundle ErrorCodes[] = { { 4273, DMEC, IE, "No blob table in dict cache" }, { 4274, DMEC, IE, "Corrupted main table PK in blob operation" }, { 4275, DMEC, AE, "The blob method is incompatible with operation type or lock mode" }, + { 4294, DMEC, AE, "Scan filter is too large, discarded" }, { NO_CONTACT_WITH_PROCESS, DMEC, AE, "No contact with the process (dead ?)."}, diff --git a/storage/ndb/test/ndbapi/testDict.cpp b/storage/ndb/test/ndbapi/testDict.cpp index 13c071f968e..16b6e129605 100644 --- a/storage/ndb/test/ndbapi/testDict.cpp +++ b/storage/ndb/test/ndbapi/testDict.cpp @@ -684,7 +684,7 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == records); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == (records/2)); @@ -862,7 +862,7 @@ int runPkSizes(NDBT_Context* ctx, NDBT_Step* step){ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == records); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == (records/2)); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -2706,7 +2706,262 @@ runDictRestart(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug29501(NDBT_Context* ctx, NDBT_Step* step) { + NdbRestarter res; + NdbDictionary::LogfileGroup lg; + lg.setName("DEFAULT-LG"); + lg.setUndoBufferSize(8*1024*1024); + + if (res.getNumDbNodes() < 2) + return NDBT_OK; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + int node = res.getRandomNotMasterNodeId(rand()); + res.restartOneDbNode(node, true, true, false); + + if(pDict->createLogfileGroup(lg) != 0){ + g_err << "Failed to create logfilegroup:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + NdbDictionary::Undofile uf; + uf.setPath("undofile01.dat"); + uf.setSize(5*1024*1024); + uf.setLogfileGroup("DEFAULT-LG"); + + if(pDict->createUndofile(uf) != 0){ + g_err << "Failed to create undofile:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + res.waitNodesNoStart(&node, 1); + res.startNodes(&node, 1); + + if (res.waitClusterStarted()){ + g_err << "Node restart failed" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lg.getName())) != 0){ + g_err << "Drop of LFG Failed" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + return NDBT_OK; +} + +int +runDropDDObjects(NDBT_Context* ctx, NDBT_Step* step){ + //Purpose is to drop all tables, data files, Table spaces and LFG's + Uint32 i = 0; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + NdbDictionary::Dictionary::List list; + if (pDict->listObjects(list) == -1) + return NDBT_FAILED; + + //Search the list and drop all tables found + const char * tableFound = 0; + for (i = 0; i < list.count; i++){ + switch(list.elements[i].type){ + case NdbDictionary::Object::UserTable: + tableFound = list.elements[i].name; + if(tableFound != 0){ + if(pDict->dropTable(tableFound) != 0){ + g_err << "Failed to drop table: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + tableFound = 0; + break; + default: + break; + } + } + + //Search the list and drop all data file found + const char * dfFound = 0; + for (i = 0; i < list.count; i++){ + switch(list.elements[i].type){ + case NdbDictionary::Object::Datafile: + dfFound = list.elements[i].name; + if(dfFound != 0){ + if(pDict->dropDatafile(pDict->getDatafile(0, dfFound)) != 0){ + g_err << "Failed to drop datafile: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + dfFound = 0; + break; + default: + break; + } + } + + //Search the list and drop all Table Spaces Found + const char * tsFound = 0; + for (i = 0; i dropTablespace(pDict->getTablespace(tsFound)) != 0){ + g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + tsFound = 0; + break; + default: + break; + } + } + + //Search the list and drop all LFG Found + //Currently only 1 LGF is supported, but written for future + //when more then one is supported. + const char * lgFound = 0; + for (i = 0; i < list.count; i++){ + switch(list.elements[i].type){ + case NdbDictionary::Object::LogfileGroup: + lgFound = list.elements[i].name; + if(lgFound != 0){ + if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lgFound)) != 0){ + g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + lgFound = 0; + break; + default: + break; + } + } + + return NDBT_OK; +} + +int +runWaitStarted(NDBT_Context* ctx, NDBT_Step* step){ + + NdbRestarter restarter; + restarter.waitClusterStarted(300); + + NdbSleep_SecSleep(3); + return NDBT_OK; +} + +int +testDropDDObjectsSetup(NDBT_Context* ctx, NDBT_Step* step){ + //Purpose is to setup to test DropDDObjects + char tsname[256]; + char dfname[256]; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + NdbDictionary::LogfileGroup lg; + lg.setName("DEFAULT-LG"); + lg.setUndoBufferSize(8*1024*1024); + + + if(pDict->createLogfileGroup(lg) != 0){ + g_err << "Failed to create logfilegroup:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + NdbDictionary::Undofile uf; + uf.setPath("undofile01.dat"); + uf.setSize(5*1024*1024); + uf.setLogfileGroup("DEFAULT-LG"); + + if(pDict->createUndofile(uf) != 0){ + g_err << "Failed to create undofile:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + BaseString::snprintf(tsname, sizeof(tsname), "TS-%u", rand()); + BaseString::snprintf(dfname, sizeof(dfname), "%s-%u.dat", tsname, rand()); + + if (create_tablespace(pDict, lg.getName(), tsname, dfname)){ + g_err << "Failed to create undofile:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + return NDBT_OK; +} + +int +DropDDObjectsVerify(NDBT_Context* ctx, NDBT_Step* step){ + //Purpose is to verify test DropDDObjects worked + Uint32 i = 0; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + NdbDictionary::Dictionary::List list; + if (pDict->listObjects(list) == -1) + return NDBT_FAILED; + + bool ddFound = false; + for (i = 0; i getNumLoops(); + int records = ctx->getNumRecords(); + Ndb* pNdb = GETNDB(step); + NdbRestarter res; + + if (res.getNumDbNodes() < 2) + { + return NDBT_OK; + } + + int nodes[2]; + nodes[0] = res.getMasterNodeId(); + nodes[1] = res.getNextMasterNodeId(nodes[0]); + + while (res.getNodeGroup(nodes[0]) != res.getNodeGroup(nodes[1])) + { + ndbout_c("Restarting %u as it not in same node group as %u", + nodes[1], nodes[0]); + if (res.restartOneDbNode(nodes[1], false, true, true)) + return NDBT_FAILED; + + if (res.waitNodesNoStart(nodes+1, 1)) + return NDBT_FAILED; + + if (res.startNodes(nodes+1, 1)) + return NDBT_FAILED; + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + nodes[1] = res.getNextMasterNodeId(nodes[0]); + } + + ndbout_c("nodes[0]: %u nodes[1]: %u", nodes[0], nodes[1]); + + int val = DumpStateOrd::DihMinTimeBetweenLCP; + if (res.dumpStateAllNodes(&val, 1)) + return NDBT_FAILED; + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + if (res.dumpStateAllNodes(val2, 2)) + return NDBT_FAILED; + + if (res.insertErrorInAllNodes(932)) + return NDBT_FAILED; + + if (res.insertErrorInNode(nodes[1], 7192)) + return NDBT_FAILED; + + if (res.insertErrorInNode(nodes[0], 7191)) + return NDBT_FAILED; + + if (res.waitClusterNoStart()) + return NDBT_FAILED; + + if (res.startAll()) + return NDBT_FAILED; + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + if (res.restartOneDbNode(nodes[1], false, false, true)) + return NDBT_FAILED; + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + return NDBT_OK; +} + NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ @@ -2085,6 +2159,9 @@ TESTCASE("Bug21271", STEP(runPkUpdateUntilStopped); FINALIZER(runClearTable); } +TESTCASE("Bug31525", ""){ + INITIALIZER(runBug31525); +} TESTCASE("Bug24717", ""){ INITIALIZER(runBug24717); } diff --git a/storage/ndb/test/ndbapi/testScan.cpp b/storage/ndb/test/ndbapi/testScan.cpp index 2561869fa5f..df6dbe2e550 100644 --- a/storage/ndb/test/ndbapi/testScan.cpp +++ b/storage/ndb/test/ndbapi/testScan.cpp @@ -579,7 +579,7 @@ int runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){ para = myRandom48(239)+1; g_info << i << ": "; - if (hugoTrans.scanUpdateRecords(GETNDB(step), records, 0, para) == NDBT_FAILED){ + if (hugoTrans.scanUpdateRecords(GETNDB(step), 0, 0, para) == NDBT_FAILED){ return NDBT_FAILED; } i++; diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp index 9710dc93551..3cd7a3798c5 100644 --- a/storage/ndb/test/ndbapi/testSystemRestart.cpp +++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp @@ -122,7 +122,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -143,7 +143,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -266,7 +266,7 @@ int runSystemRestart2(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -330,7 +330,7 @@ int runSystemRestartTestUndoLog(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -1294,6 +1294,30 @@ runBug28770(NDBT_Context* ctx, NDBT_Step* step) { return result; } +int +runStopper(NDBT_Context* ctx, NDBT_Step* step) +{ + NdbRestarter restarter; + Uint32 stop = 0; +loop: + while (!ctx->isTestStopped() && + ((stop = ctx->getProperty("StopAbort", Uint32(0))) == 0)) + { + NdbSleep_MilliSleep(30); + } + + if (ctx->isTestStopped()) + { + return NDBT_OK; + } + + ndbout << "Killing in " << stop << "ms..." << flush; + NdbSleep_MilliSleep(stop); + restarter.restartAll(false, true, true); + ctx->setProperty("StopAbort", Uint32(0)); + goto loop; +} + int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) { Ndb* pNdb = GETNDB(step); @@ -1303,6 +1327,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) NdbRestarter restarter; NdbBackup backup(GETNDB(step)->getNodeId()+1); bool lcploop = ctx->getProperty("LCP", (unsigned)0); + bool all = ctx->getProperty("ALL", (unsigned)0); Uint32 i = 1; Uint32 backupId; @@ -1328,11 +1353,18 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) ndbout << "Loading records..." << startFrom << endl; CHECK(hugoTrans.loadTable(pNdb, startFrom) == 0); - ndbout << "Making " << nodeId << " crash" << endl; - int kill[] = { 9999, 1000, 3000 }; - CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); - CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); - + if (!all) + { + ndbout << "Making " << nodeId << " crash" << endl; + int kill[] = { 9999, 1000, 3000 }; + CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); + CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + } + else + { + ndbout << "Crashing cluster" << endl; + ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000)); + } Uint64 end = NdbTick_CurrentMillisecond() + 4000; Uint32 row = startFrom; do { @@ -1342,11 +1374,17 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) row += 1000; } while (NdbTick_CurrentMillisecond() < end); - ndbout << "Waiting for " << nodeId << " to restart" << endl; - CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); - - ndbout << "Restarting cluster" << endl; - CHECK(restarter.restartAll(false, true, true) == 0); + if (!all) + { + ndbout << "Waiting for " << nodeId << " to restart" << endl; + CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); + ndbout << "Restarting cluster" << endl; + CHECK(restarter.restartAll(false, true, true) == 0); + } + else + { + ndbout << "Waiting for cluster to restart" << endl; + } CHECK(restarter.waitClusterNoStart() == 0); CHECK(restarter.startAll() == 0); CHECK(restarter.waitClusterStarted() == 0); @@ -1371,7 +1409,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) } ndbout << "runSR_DD_1 finished" << endl; - + ctx->stopTest(); return result; } @@ -1385,6 +1423,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) NdbRestarter restarter; NdbBackup backup(GETNDB(step)->getNodeId()+1); bool lcploop = ctx->getProperty("LCP", (unsigned)0); + bool all = ctx->getProperty("ALL", (unsigned)0); Uint32 i = 1; Uint32 backupId; @@ -1405,10 +1444,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); - ndbout << "Making " << nodeId << " crash" << endl; - int kill[] = { 9999, 3000, 10000 }; - CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); - CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + if (!all) + { + ndbout << "Making " << nodeId << " crash" << endl; + int kill[] = { 9999, 3000, 10000 }; + CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); + CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + } + else + { + ndbout << "Crashing cluster" << endl; + ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000)); + } Uint64 end = NdbTick_CurrentMillisecond() + 11000; Uint32 row = startFrom; @@ -1420,11 +1467,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) break; } while (NdbTick_CurrentMillisecond() < end); - ndbout << "Waiting for " << nodeId << " to restart" << endl; - CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); - - ndbout << "Restarting cluster" << endl; - CHECK(restarter.restartAll(false, true, true) == 0); + if (!all) + { + ndbout << "Waiting for " << nodeId << " to restart" << endl; + CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); + ndbout << "Restarting cluster" << endl; + CHECK(restarter.restartAll(false, true, true) == 0); + } + else + { + ndbout << "Waiting for cluster to restart" << endl; + } + CHECK(restarter.waitClusterNoStart() == 0); CHECK(restarter.startAll() == 0); CHECK(restarter.waitClusterStarted() == 0); @@ -1443,7 +1497,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) } ndbout << "runSR_DD_2 finished" << endl; - + ctx->stopTest(); return result; } @@ -1628,12 +1682,29 @@ TESTCASE("Bug24664", FINALIZER(runClearTable); } TESTCASE("SR_DD_1", "") +{ + TC_PROPERTY("ALL", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_1); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_1b", "") { INITIALIZER(runWaitStarted); STEP(runSR_DD_1); FINALIZER(runClearTable); } TESTCASE("SR_DD_1_LCP", "") +{ + TC_PROPERTY("ALL", 1); + TC_PROPERTY("LCP", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_1); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_1b_LCP", "") { TC_PROPERTY("LCP", 1); INITIALIZER(runWaitStarted); @@ -1641,12 +1712,29 @@ TESTCASE("SR_DD_1_LCP", "") FINALIZER(runClearTable); } TESTCASE("SR_DD_2", "") +{ + TC_PROPERTY("ALL", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_2); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_2b", "") { INITIALIZER(runWaitStarted); STEP(runSR_DD_2); FINALIZER(runClearTable); } TESTCASE("SR_DD_2_LCP", "") +{ + TC_PROPERTY("ALL", 1); + TC_PROPERTY("LCP", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_2); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_2b_LCP", "") { TC_PROPERTY("LCP", 1); INITIALIZER(runWaitStarted); diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp index e1e0012d0d8..2083e235a3e 100644 --- a/storage/ndb/test/ndbapi/test_event.cpp +++ b/storage/ndb/test/ndbapi/test_event.cpp @@ -1730,7 +1730,7 @@ runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){ HugoTransactions hugoTrans(*ctx->getTab()); while (ctx->isTestStopped() == false) { - if (hugoTrans.scanUpdateRecords(GETNDB(step), records, abort, + if (hugoTrans.scanUpdateRecords(GETNDB(step), 0, abort, parallelism) == NDBT_FAILED){ return NDBT_FAILED; } diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index ebcb3456056..0ca81b7f63b 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -555,7 +555,7 @@ args: -n Bug25554 T1 max-time: 3000 cmd: testNodeRestart -args: -n Bug25984 +args: -n Bug25984 T1 max-time: 1000 cmd: testNodeRestart @@ -575,6 +575,14 @@ args: -n Bug29364 T1 # # DICT TESTS +max-time: 500 +cmd: testDict +args: -n Bug29501 T1 + +max-time: 500 +cmd: testDict +args: -n testDropDDObjects T1 + max-time: 1500 cmd: testDict args: -n CreateAndDrop @@ -950,31 +958,67 @@ max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1 D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1 D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b D2 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1_LCP D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b_LCP D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1_LCP D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b_LCP D2 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2 D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2 D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b D2 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2_LCP D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b_LCP D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2_LCP D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b_LCP D2 + +max-time: 600 +cmd: testNodeRestart +args: -n Bug31525 T1 +