From 32e3f4612505662d37085ddd8cb97aecdda43486 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Feb 2006 00:18:10 +0100 Subject: [PATCH] More test case updates for using RPL with NDB as default engine mysql-test/t/rpl_create_database.test: Updated to pass when other default engines are being used mysql-test/r/rpl_create_database.result: Updated to pass when other default engines are being used mysql-test/t/rpl_row_func003-slave.opt: new opt file to enusre innodb on slave mysql-test/t/rpl_replicate_do.test: Updated with order by for use during ndb testing mysql-test/r/rpl_replicate_do.result: Updated with order by for use during ndb testing mysql-test/t/rpl_redirect.test: updated with order by mysql-test/r/rpl_redirect.result: updated with order by mysql-test/t/rpl_ndb_func003.test: New func003 wrapper to use NDB engine for table creation mysql-test/r/rpl_ndb_func003.result: New func003 wrapper to use NDB engine for table creation mysql-test/r/rpl_row_sp001.result: updated with order by mysql-test/t/rpl_row_sp001.test: updated with order by BitKeeper/deleted/.del-rpl_row_log.test~f6ed1be9e3ca110f: Delete: mysql-test/extra/rpl_tests/rpl_row_log.test mysql-test/extra/rpl_tests/rpl_log.test: Updated test to ensure that MyISAM, and innodb engines passed even if NDB was used as default engine. Due to diff in bin log output between MyISAM, InnoDB and NDB the file had to use different wrappers and results files. mysql-test/t/rpl_row_log.test: part of rpl_log.test check in mysql-test/r/rpl_row_log.result: part of rpl_log.test check in mysql-test/r/rpl_row_log_innodb.result: part of rpl_log.test check in mysql-test/t/rpl_row_log_innodb-master.opt: part of rpl_log.test check in mysql-test/t/rpl_row_log_innodb-slave.opt: part of rpl_log.test check in mysql-test/t/rpl_row_log_innodb.test: part of rpl_log.test check in mysql-test/r/rpl_ndb_log.result: part of rpl_log.test check in mysql-test/t/rpl_ndb_log.test: part of rpl_log.test check in mysql-test/t/rpl_ndb_log-master.opt: part of rpl_log.test check in mysql-test/t/disabled.def: Updated with MySQL Bugs: #17158 --- mysql-test/extra/rpl_tests/rpl_log.test | 16 ++- mysql-test/r/rpl_create_database.result | 18 ++- mysql-test/r/rpl_ndb_func003.result | 29 +++++ mysql-test/r/rpl_ndb_log.result | 139 +++++++++++++++++++++ mysql-test/r/rpl_redirect.result | 8 +- mysql-test/r/rpl_replicate_do.result | 2 +- mysql-test/r/rpl_row_log.result | 42 +++---- mysql-test/r/rpl_row_log_innodb.result | 113 +++++++++++++++++ mysql-test/r/rpl_row_sp001.result | 16 +-- mysql-test/t/disabled.def | 1 + mysql-test/t/rpl_create_database.test | 6 +- mysql-test/t/rpl_ndb_func003.test | 11 ++ mysql-test/t/rpl_ndb_log-master.opt | 1 + mysql-test/t/rpl_ndb_log.test | 12 ++ mysql-test/t/rpl_redirect.test | 8 +- mysql-test/t/rpl_replicate_do.test | 2 +- mysql-test/t/rpl_row_func003-slave.opt | 1 + mysql-test/t/rpl_row_log.test | 9 +- mysql-test/t/rpl_row_log_innodb-master.opt | 1 + mysql-test/t/rpl_row_log_innodb-slave.opt | 1 + mysql-test/t/rpl_row_log_innodb.test | 12 ++ mysql-test/t/rpl_row_sp001.test | 16 +-- 22 files changed, 400 insertions(+), 64 deletions(-) create mode 100644 mysql-test/r/rpl_ndb_func003.result create mode 100644 mysql-test/r/rpl_ndb_log.result create mode 100644 mysql-test/r/rpl_row_log_innodb.result create mode 100644 mysql-test/t/rpl_ndb_func003.test create mode 100644 mysql-test/t/rpl_ndb_log-master.opt create mode 100644 mysql-test/t/rpl_ndb_log.test create mode 100644 mysql-test/t/rpl_row_func003-slave.opt create mode 100644 mysql-test/t/rpl_row_log_innodb-master.opt create mode 100644 mysql-test/t/rpl_row_log_innodb-slave.opt create mode 100644 mysql-test/t/rpl_row_log_innodb.test diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test index 252c1fcca41..1e5074d9260 100644 --- a/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-test/extra/rpl_tests/rpl_log.test @@ -30,21 +30,25 @@ let $VERSION=`select version()`; connection master; reset master; -create table t1(n int not null auto_increment primary key); +eval create table t1(n int not null auto_increment primary key)ENGINE=$engine_type; insert into t1 values (NULL); drop table t1; -create table t1 (word char(20) not null); +eval create table t1 (word char(20) not null)ENGINE=$engine_type; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; select count(*) from t1; drop table t1; --replace_result $VERSION VERSION --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events; --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events from 102 limit 1; --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events from 102 limit 2; --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events from 102 limit 2,1; flush logs; @@ -64,7 +68,7 @@ flush logs; # To make it predictable, we do a useless update now, but which has the # interest of making the slave catch both rotate events. -create table t5 (a int); +eval create table t5 (a int)ENGINE=$engine_type; drop table t5; # Sync slave and force it to start on another binary log @@ -82,14 +86,16 @@ connection master; # Create some entries for second log -create table t1 (n int); +eval create table t1 (n int)ENGINE=$engine_type; insert into t1 values (1); drop table t1; --replace_result $VERSION VERSION --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events; --replace_result $VERSION VERSION --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events in 'master-bin.000002'; show binary logs; save_master_pos; @@ -99,9 +105,11 @@ sync_with_master; show binary logs; --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events in 'slave-bin.000001' from 4; --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION --replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// show binlog events in 'slave-bin.000002' from 4; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 8 # 9 # 16 # 23 # 33 # diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/r/rpl_create_database.result index 74708c8ec9a..cb3c7944962 100644 --- a/mysql-test/r/rpl_create_database.result +++ b/mysql-test/r/rpl_create_database.result @@ -61,16 +61,14 @@ mysql mysqltest_prometheus mysqltest_sisyfos test -SHOW CREATE TABLE mysqltest_prometheus.t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW CREATE TABLE mysqltest_sisyfos.t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +USE mysqltest_prometheus; +SHOW TABLES; +Tables_in_mysqltest_prometheus +t1 +USE mysqltest_sisyfos; +SHOW TABLES; +Tables_in_mysqltest_sisyfos +t2 DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; diff --git a/mysql-test/r/rpl_ndb_func003.result b/mysql-test/r/rpl_ndb_func003.result new file mode 100644 index 00000000000..ad72a3fb244 --- /dev/null +++ b/mysql-test/r/rpl_ndb_func003.result @@ -0,0 +1,29 @@ +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; +DROP FUNCTION IF EXISTS test.f1; +DROP TABLE IF EXISTS test.t1; +CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=NDB; +create function test.f1() RETURNS CHAR(16) +BEGIN +DECLARE tmp CHAR(16); +DECLARE var_name FLOAT; +SET var_name = RAND(); +IF var_name > .6 +THEN SET tmp = 'Texas'; +ELSE SET tmp = 'MySQL'; +END IF; +RETURN tmp; +END| +INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1()); +INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1()); +SET AUTOCOMMIT=0; +START TRANSACTION; +INSERT INTO test.t1 VALUES (null,test.f1()); +ROLLBACK; +SET AUTOCOMMIT=1; +DROP FUNCTION test.f1; +DROP TABLE test.t1; diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result new file mode 100644 index 00000000000..523495e284f --- /dev/null +++ b/mysql-test/r/rpl_ndb_log.result @@ -0,0 +1,139 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +reset master; +reset slave; +reset master; +create table t1(n int not null auto_increment primary key)ENGINE=NDB; +insert into t1 values (NULL); +drop table t1; +create table t1 (word char(20) not null)ENGINE=NDB; +load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; +select count(*) from t1; +count(*) +69 +drop table t1; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Table_map 1 # cluster_replication.apply_status +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Table_map 1 # test.t1 +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Table_map 1 # cluster_replication.apply_status +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # use `test`; drop table t1 +show binlog events from 102 limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +show binlog events from 102 limit 2; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +master-bin.000001 # Query 1 # BEGIN +show binlog events from 102 limit 2,1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Table_map 1 # cluster_replication.apply_status +flush logs; +create table t5 (a int)ENGINE=NDB; +drop table t5; +start slave; +flush logs; +stop slave; +create table t1 (n int)ENGINE=NDB; +insert into t1 values (1); +drop table t1; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Table_map 1 # cluster_replication.apply_status +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Table_map 1 # test.t1 +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Table_map 1 # cluster_replication.apply_status +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 +show binlog events in 'master-bin.000002'; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000002 # Query 1 # use `test`; create table t5 (a int)ENGINE=NDB +master-bin.000002 # Query 1 # BEGIN +master-bin.000002 # Table_map 1 # cluster_replication.apply_status +master-bin.000002 # Write_rows 1 # +master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Query 1 # use `test`; drop table t5 +master-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=NDB +master-bin.000002 # Query 1 # BEGIN +master-bin.000002 # Table_map 1 # cluster_replication.apply_status +master-bin.000002 # Write_rows 1 # +master-bin.000002 # Table_map 1 # test.t1 +master-bin.000002 # Write_rows 1 # +master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Query 1 # use `test`; drop table t1 +show binary logs; +Log_name File_size +master-bin.000001 1087 +master-bin.000002 991 +start slave; +show binary logs; +Log_name File_size +slave-bin.000001 1494 +slave-bin.000002 583 +show binlog events in 'slave-bin.000001' from 4; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 +slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +slave-bin.000001 # Query 2 # BEGIN +slave-bin.000001 # Table_map 2 # cluster_replication.apply_status +slave-bin.000001 # Write_rows 2 # +slave-bin.000001 # Table_map 2 # test.t1 +slave-bin.000001 # Write_rows 2 # +slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Query 1 # use `test`; drop table t1 +slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB +slave-bin.000001 # Query 2 # BEGIN +slave-bin.000001 # Table_map 2 # cluster_replication.apply_status +slave-bin.000001 # Write_rows 2 # +slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Query 1 # use `test`; drop table t1 +slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)ENGINE=NDB +slave-bin.000001 # Query 2 # BEGIN +slave-bin.000001 # Table_map 2 # cluster_replication.apply_status +slave-bin.000001 # Write_rows 2 # +slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Query 1 # use `test`; drop table t5 +slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from 4; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 +slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=NDB +slave-bin.000002 # Query 2 # BEGIN +slave-bin.000002 # Table_map 2 # cluster_replication.apply_status +slave-bin.000002 # Write_rows 2 # +slave-bin.000002 # Table_map 2 # test.t1 +slave-bin.000002 # Write_rows 2 # +slave-bin.000002 # Query 2 # COMMIT +slave-bin.000002 # Query 1 # use `test`; drop table t1 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 991 # # master-bin.000002 Yes Yes # 0 0 991 # None 0 No # +show binlog events in 'slave-bin.000005' from 4; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/r/rpl_redirect.result index 9dd51eaba4d..b4ef84da559 100644 --- a/mysql-test/r/rpl_redirect.result +++ b/mysql-test/r/rpl_redirect.result @@ -12,26 +12,26 @@ Server_id Host Port Rpl_recovery_rank Master_id create table t1 ( n int); insert into t1 values (1),(2),(3),(4); insert into t1 values(5); -select * from t1; +SELECT * FROM t1 ORDER BY n; n 1 2 3 4 5 -select * from t1; +SELECT * FROM t1 ORDER BY n; n 1 2 3 4 -select * from t1; +SELECT * FROM t1 ORDER BY n; n 1 2 3 4 -select * from t1; +SELECT * FROM t1 ORDER BY n; n 1 2 diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index 438671fb103..9f7e1a81507 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -16,7 +16,7 @@ insert into t1 values(15),(16),(17); update t1 set m=20 where m=16; delete from t1 where m=17; create table t11 select * from t1; -select * from t1; +select * from t1 ORDER BY m; m 15 20 diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result index 8784d9d16e2..85c93702de2 100644 --- a/mysql-test/r/rpl_row_log.result +++ b/mysql-test/r/rpl_row_log.result @@ -8,10 +8,10 @@ stop slave; reset master; reset slave; reset master; -create table t1(n int not null auto_increment primary key); +create table t1(n int not null auto_increment primary key)ENGINE=MyISAM; insert into t1 values (NULL); drop table t1; -create table t1 (word char(20) not null); +create table t1 (word char(20) not null)ENGINE=MyISAM; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; select count(*) from t1; count(*) @@ -20,41 +20,41 @@ drop table t1; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Write_rows 1 # master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null) +master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Write_rows 1 # master-bin.000001 # Query 1 # use `test`; drop table t1 show binlog events from 102 limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM show binlog events from 102 limit 2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Table_map 1 # test.t1 show binlog events from 102 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # flush logs; -create table t5 (a int); +create table t5 (a int)ENGINE=MyISAM; drop table t5; start slave; flush logs; stop slave; -create table t1 (n int); +create table t1 (n int)ENGINE=MyISAM; insert into t1 values (1); drop table t1; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Write_rows 1 # master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null) +master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Write_rows 1 # master-bin.000001 # Query 1 # use `test`; drop table t1 @@ -62,44 +62,44 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000002 # Query 1 # use `test`; create table t5 (a int) +master-bin.000002 # Query 1 # use `test`; create table t5 (a int)ENGINE=MyISAM master-bin.000002 # Query 1 # use `test`; drop table t5 -master-bin.000002 # Query 1 # use `test`; create table t1 (n int) +master-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=MyISAM master-bin.000002 # Table_map 1 # test.t1 master-bin.000002 # Write_rows 1 # master-bin.000002 # Query 1 # use `test`; drop table t1 show binary logs; Log_name File_size -master-bin.000001 1306 -master-bin.000002 499 +master-bin.000001 1332 +master-bin.000002 525 start slave; show binary logs; Log_name File_size -slave-bin.000001 1467 -slave-bin.000002 337 +slave-bin.000001 1506 +slave-bin.000002 350 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key) +slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM slave-bin.000001 # Table_map 1 # test.t1 slave-bin.000001 # Write_rows 1 # slave-bin.000001 # Query 1 # use `test`; drop table t1 -slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null) +slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM slave-bin.000001 # Table_map 1 # test.t1 slave-bin.000001 # Write_rows 1 # slave-bin.000001 # Query 1 # use `test`; drop table t1 -slave-bin.000001 # Query 1 # use `test`; create table t5 (a int) +slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)ENGINE=MyISAM slave-bin.000001 # Query 1 # use `test`; drop table t5 slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 show binlog events in 'slave-bin.000002' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 -slave-bin.000002 # Query 1 # use `test`; create table t1 (n int) +slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=MyISAM slave-bin.000002 # Table_map 1 # test.t1 slave-bin.000002 # Write_rows 1 # slave-bin.000002 # Query 1 # use `test`; drop table t1 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 499 # # master-bin.000002 Yes Yes # 0 0 499 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 525 # # master-bin.000002 Yes Yes # 0 0 525 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result new file mode 100644 index 00000000000..2bc7534f31f --- /dev/null +++ b/mysql-test/r/rpl_row_log_innodb.result @@ -0,0 +1,113 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +reset master; +reset slave; +reset master; +create table t1(n int not null auto_increment primary key)ENGINE=InnoDB; +insert into t1 values (NULL); +drop table t1; +create table t1 (word char(20) not null)ENGINE=InnoDB; +load data infile '../../std_data/words.dat' into table t1 ignore 1 lines; +select count(*) from t1; +count(*) +69 +drop table t1; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +master-bin.000001 # Table_map 1 # test.t1 +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Xid 1 # COMMIT /* XID */ +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB +master-bin.000001 # Table_map 1 # test.t1 +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Xid 1 # COMMIT /* XID */ +master-bin.000001 # Query 1 # use `test`; drop table t1 +show binlog events from 102 limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +show binlog events from 102 limit 2; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +master-bin.000001 # Table_map 1 # test.t1 +show binlog events from 102 limit 2,1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Write_rows 1 # +flush logs; +create table t5 (a int)ENGINE=InnoDB; +drop table t5; +start slave; +flush logs; +stop slave; +create table t1 (n int)ENGINE=InnoDB; +insert into t1 values (1); +drop table t1; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +master-bin.000001 # Table_map 1 # test.t1 +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Xid 1 # COMMIT /* XID */ +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB +master-bin.000001 # Table_map 1 # test.t1 +master-bin.000001 # Write_rows 1 # +master-bin.000001 # Xid 1 # COMMIT /* XID */ +master-bin.000001 # Query 1 # use `test`; drop table t1 +master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 +show binlog events in 'master-bin.000002'; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 +master-bin.000002 # Query 1 # use `test`; create table t5 (a int)ENGINE=InnoDB +master-bin.000002 # Query 1 # use `test`; drop table t5 +master-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=InnoDB +master-bin.000002 # Table_map 1 # test.t1 +master-bin.000002 # Write_rows 1 # +master-bin.000002 # Xid 1 # COMMIT /* XID */ +master-bin.000002 # Query 1 # use `test`; drop table t1 +show binary logs; +Log_name File_size +master-bin.000001 1386 +master-bin.000002 552 +start slave; +show binary logs; +Log_name File_size +slave-bin.000001 1560 +slave-bin.000002 377 +show binlog events in 'slave-bin.000001' from 4; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 +slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +slave-bin.000001 # Table_map 1 # test.t1 +slave-bin.000001 # Write_rows 1 # +slave-bin.000001 # Xid 1 # COMMIT /* XID */ +slave-bin.000001 # Query 1 # use `test`; drop table t1 +slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB +slave-bin.000001 # Table_map 1 # test.t1 +slave-bin.000001 # Write_rows 1 # +slave-bin.000001 # Xid 1 # COMMIT /* XID */ +slave-bin.000001 # Query 1 # use `test`; drop table t1 +slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)ENGINE=InnoDB +slave-bin.000001 # Query 1 # use `test`; drop table t5 +slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from 4; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 +slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=InnoDB +slave-bin.000002 # Table_map 1 # test.t1 +slave-bin.000002 # Write_rows 1 # +slave-bin.000002 # Xid 1 # COMMIT /* XID */ +slave-bin.000002 # Query 1 # use `test`; drop table t1 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 552 # # master-bin.000002 Yes Yes # 0 0 552 # None 0 No # +show binlog events in 'slave-bin.000005' from 4; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/r/rpl_row_sp001.result b/mysql-test/r/rpl_row_sp001.result index 0276fb721b9..8c26c061376 100644 --- a/mysql-test/r/rpl_row_sp001.result +++ b/mysql-test/r/rpl_row_sp001.result @@ -28,52 +28,52 @@ UPDATE test.t2 set t ='NONE'; END CASE; end// INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 NEW 2 NEW 3 NEW 4 NEW -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 NEW 2 NEW 3 NEW 4 NEW call test.p2(1); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 Tex 2 Tex 3 Tex 4 Tex -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 Tex 2 Tex 3 Tex 4 Tex call test.p2(2); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 SQL 2 SQL 3 SQL 4 SQL -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 SQL 2 SQL 3 SQL 4 SQL call test.p2(3); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 NONE 2 NONE 3 NONE 4 NONE -select * from test.t2; +SELECT * FROM t2 ORDER BY a; a t 1 NONE 2 NONE diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index a002a34796f..4ffce33766a 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -32,3 +32,4 @@ ndb_gis : garbled msgs from corrupt THD* rpl_ndb_auto_inc : MySQL Bugs:17086 rpl_ndb_relay_space : Results are not deterministic ndb_binlog_ddl_multi : Bug #17038 +rpl_ndb_log : MySQL Bugs: #17158 diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test index 7ec73132113..70cff8daca2 100644 --- a/mysql-test/t/rpl_create_database.test +++ b/mysql-test/t/rpl_create_database.test @@ -58,8 +58,10 @@ let $VERSION=`select version()`; SHOW DATABASES; sync_slave_with_master; SHOW DATABASES; -SHOW CREATE TABLE mysqltest_prometheus.t1; -SHOW CREATE TABLE mysqltest_sisyfos.t2; +USE mysqltest_prometheus; +SHOW TABLES; +USE mysqltest_sisyfos; +SHOW TABLES; connection master; DROP DATABASE IF EXISTS mysqltest_prometheus; diff --git a/mysql-test/t/rpl_ndb_func003.test b/mysql-test/t/rpl_ndb_func003.test new file mode 100644 index 00000000000..2d240385555 --- /dev/null +++ b/mysql-test/t/rpl_ndb_func003.test @@ -0,0 +1,11 @@ +################################### +# Wrapper for rpl_row_func003.test# +# This test was orginally designed# +# To test InnoDB using RBR, but # +# It can also be used to test NDB # +# So this wrapper is being used to# +# reduce test case code # +################################### +-- source include/have_ndb.inc +let $engine_type=NDB; +-- source extra/rpl_tests/rpl_row_func003.test diff --git a/mysql-test/t/rpl_ndb_log-master.opt b/mysql-test/t/rpl_ndb_log-master.opt new file mode 100644 index 00000000000..e0d075c3fbd --- /dev/null +++ b/mysql-test/t/rpl_ndb_log-master.opt @@ -0,0 +1 @@ +--skip-external-locking diff --git a/mysql-test/t/rpl_ndb_log.test b/mysql-test/t/rpl_ndb_log.test new file mode 100644 index 00000000000..e883d24b977 --- /dev/null +++ b/mysql-test/t/rpl_ndb_log.test @@ -0,0 +1,12 @@ +################################### +# Wrapper for rpl_row_log.test # +# Added wrapper so that MyISAM & # +# Innodb and NDB could all use the# +# Same test. NDB produced a diff # +# bin-log # +################################### +-- source include/have_binlog_format_row.inc +-- source include/have_ndb.inc +let $engine_type=NDB; +-- source extra/rpl_tests/rpl_log.test + diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test index c001d85d2f8..58321babb39 100644 --- a/mysql-test/t/rpl_redirect.test +++ b/mysql-test/t/rpl_redirect.test @@ -32,12 +32,12 @@ insert into t1 values(5); connection master; enable_rpl_parse; # The first of the queries will be sent to the slave, the second to the master. -select * from t1; -select * from t1; +SELECT * FROM t1 ORDER BY n; +SELECT * FROM t1 ORDER BY n; disable_rpl_parse; -select * from t1; +SELECT * FROM t1 ORDER BY n; connection slave; -select * from t1; +SELECT * FROM t1 ORDER BY n; drop table t1; connection master; drop table t1; diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/t/rpl_replicate_do.test index 5a2cb50d53a..c9294175f15 100644 --- a/mysql-test/t/rpl_replicate_do.test +++ b/mysql-test/t/rpl_replicate_do.test @@ -21,7 +21,7 @@ create table t11 select * from t1; save_master_pos; connection slave; sync_with_master; -select * from t1; +select * from t1 ORDER BY m; select * from t2; --error 1146 select * from t11; diff --git a/mysql-test/t/rpl_row_func003-slave.opt b/mysql-test/t/rpl_row_func003-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_row_func003-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_row_log.test b/mysql-test/t/rpl_row_log.test index 29abf5bb93e..5a9b21165e5 100644 --- a/mysql-test/t/rpl_row_log.test +++ b/mysql-test/t/rpl_row_log.test @@ -1,4 +1,11 @@ -# Requires row base logging +################################### +# Wrapper for rpl_row_log.test # +# Added wrapper so that MyISAM & # +# Innodb and NDB could all use the# +# Same test. NDB produced a diff # +# bin-log # +################################### -- source include/have_binlog_format_row.inc +let $engine_type=MyISAM; -- source extra/rpl_tests/rpl_log.test diff --git a/mysql-test/t/rpl_row_log_innodb-master.opt b/mysql-test/t/rpl_row_log_innodb-master.opt new file mode 100644 index 00000000000..e0d075c3fbd --- /dev/null +++ b/mysql-test/t/rpl_row_log_innodb-master.opt @@ -0,0 +1 @@ +--skip-external-locking diff --git a/mysql-test/t/rpl_row_log_innodb-slave.opt b/mysql-test/t/rpl_row_log_innodb-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_row_log_innodb-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_row_log_innodb.test b/mysql-test/t/rpl_row_log_innodb.test new file mode 100644 index 00000000000..f4a9cf06291 --- /dev/null +++ b/mysql-test/t/rpl_row_log_innodb.test @@ -0,0 +1,12 @@ +################################### +# Wrapper for rpl_row_log.test # +# Added wrapper so that MyISAM & # +# Innodb and NDB could all use the# +# Same test. NDB produced a diff # +# bin-log # +################################### +-- source include/have_binlog_format_row.inc +-- source include/have_innodb.inc +let $engine_type=InnoDB; +-- source extra/rpl_tests/rpl_log.test + diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/t/rpl_row_sp001.test index f6ac18dc78b..6a38feb0999 100644 --- a/mysql-test/t/rpl_row_sp001.test +++ b/mysql-test/t/rpl_row_sp001.test @@ -85,34 +85,34 @@ delimiter ;// INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; save_master_pos; connection slave; sync_with_master; -select * from test.t2; +SELECT * FROM t2 ORDER BY a; connection master; call test.p2(1); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; sync_slave_with_master; -select * from test.t2; +SELECT * FROM t2 ORDER BY a; connection master; call test.p2(2); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; save_master_pos; connection slave; sync_with_master; -select * from test.t2; +SELECT * FROM t2 ORDER BY a; connection master; call test.p2(3); -select * from test.t2; +SELECT * FROM t2 ORDER BY a; save_master_pos; connection slave; sync_with_master; -select * from test.t2; +SELECT * FROM t2 ORDER BY a; ##Used for debugging #show binlog events;