From 545ac7f323b0419eb39ee65531665e836fcfa53d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Feb 2006 12:52:35 +0100 Subject: [PATCH] test updates mysql-test/t/rpl_trigger.test: Test cleanup mysql-test/t/rpl_ndb_sync.test: Test cleanup mysql-test/t/rpl_ndb_idempotent.test: Test cleanup mysql-test/r/rpl_trigger.result: Updated result files mysql-test/r/rpl_ndb_sync.result: Updated result files mysql-test/r/rpl_ndb_idempotent.result: Updated result files mysql-test/t/rpl_ndb_dd_basic.test: Rename: mysql-test/t/rpl_ndb_disk.test -> mysql-test/t/rpl_ndb_dd_basic.test mysql-test/r/rpl_ndb_dd_basic.result: Rename: mysql-test/t/rpl_ndb_dd_basic.result -> mysql-test/r/rpl_ndb_dd_basic.result mysql-test/r/rpl_ndb_sp006.result: New results file mysql-test/t/rpl_row_sp007_innodb-slave.opt: Ensure slave tables are created as innodb mysql-test/t/disabled.def: updated 17290 mysql-test/r/rpl_ndb_sp007.result: New results file mysql-test/t/rpl_ndb_sp007.test: Added comment mysql-test/t/rpl_ndb_sp006.test: Added comment mysql-test/extra/rpl_tests/rpl_row_sp003.test: Augmented for use with NDB due to injector thread not populating the bin log before sync with master is done mysql-test/r/rpl_ndb_sp003.result: New results file mysql-test/t/rpl_ndb_sp003.test: Wrapper to use same code for testing NDB that is used for InnoDB Currently --- mysql-test/extra/rpl_tests/rpl_row_sp003.test | 5 +- ...db_disk.result => rpl_ndb_dd_basic.result} | 0 mysql-test/r/rpl_ndb_idempotent.result | 1 + mysql-test/r/rpl_ndb_sp003.result | 49 ++++++++++++++++++ mysql-test/r/rpl_ndb_sp006.result | 45 +++++++++++++++++ mysql-test/r/rpl_ndb_sp007.result | 50 +++++++++++++++++++ mysql-test/r/rpl_ndb_sync.result | 3 +- mysql-test/r/rpl_trigger.result | 3 ++ mysql-test/t/disabled.def | 9 ++-- ...pl_ndb_disk.test => rpl_ndb_dd_basic.test} | 0 mysql-test/t/rpl_ndb_idempotent.test | 5 ++ mysql-test/t/rpl_ndb_sp003.test | 9 ++++ mysql-test/t/rpl_ndb_sp006.test | 9 ++++ mysql-test/t/rpl_ndb_sp007.test | 9 ++++ mysql-test/t/rpl_ndb_sync.test | 6 ++- mysql-test/t/rpl_row_sp007_innodb-slave.opt | 1 + mysql-test/t/rpl_trigger.test | 9 +++- 17 files changed, 204 insertions(+), 9 deletions(-) rename mysql-test/r/{rpl_ndb_disk.result => rpl_ndb_dd_basic.result} (100%) create mode 100644 mysql-test/r/rpl_ndb_sp003.result create mode 100644 mysql-test/r/rpl_ndb_sp006.result create mode 100644 mysql-test/r/rpl_ndb_sp007.result rename mysql-test/t/{rpl_ndb_disk.test => rpl_ndb_dd_basic.test} (100%) create mode 100644 mysql-test/t/rpl_ndb_sp003.test create mode 100644 mysql-test/t/rpl_ndb_sp006.test create mode 100644 mysql-test/t/rpl_ndb_sp007.test create mode 100644 mysql-test/t/rpl_row_sp007_innodb-slave.opt diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test index 2073fb41264..0934e2d6f98 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test +++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test @@ -46,7 +46,10 @@ CALL test.p2(); SELECT release_lock("test"); SELECT * FROM test.t1; #show binlog events; - +# Added sleep for use with NDB to ensure that +# the injector thread will populate log before +# we switch to the slave. +sleep 5; sync_slave_with_master; connection slave; SELECT * FROM test.t1; diff --git a/mysql-test/r/rpl_ndb_disk.result b/mysql-test/r/rpl_ndb_dd_basic.result similarity index 100% rename from mysql-test/r/rpl_ndb_disk.result rename to mysql-test/r/rpl_ndb_dd_basic.result diff --git a/mysql-test/r/rpl_ndb_idempotent.result b/mysql-test/r/rpl_ndb_idempotent.result index 054ff599c23..3315e05f97e 100644 --- a/mysql-test/r/rpl_ndb_idempotent.result +++ b/mysql-test/r/rpl_ndb_idempotent.result @@ -70,3 +70,4 @@ row2 new on slave 2 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.000001 master-bin.000001 Yes Yes 0 0 None 0 No +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/r/rpl_ndb_sp003.result b/mysql-test/r/rpl_ndb_sp003.result new file mode 100644 index 00000000000..94f320f387b --- /dev/null +++ b/mysql-test/r/rpl_ndb_sp003.result @@ -0,0 +1,49 @@ +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 PROCEDURE IF EXISTS test.p1; +DROP PROCEDURE IF EXISTS test.p2; +DROP TABLE IF EXISTS test.t1; +CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER; +CREATE PROCEDURE test.p1() +BEGIN +INSERT INTO test.t1 VALUES (4); +SELECT get_lock("test", 100); +UPDATE test.t1 set a=a+4 WHERE a=4; +END| +CREATE PROCEDURE test.p2() +BEGIN +UPDATE test.t1 SET a=a+1; +END| +SELECT get_lock("test", 200); +get_lock("test", 200) +1 + CALL test.p1(); +CALL test.p2(); +SELECT release_lock("test"); +release_lock("test") +1 +SELECT * FROM test.t1; +a +5 +SELECT * FROM test.t1; +a +5 +DROP TABLE IF EXISTS test.t1; +CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER; +CALL test.p2(); +CALL test.p1(); +get_lock("test", 100) +0 +SELECT * FROM test.t1; +a +8 +SELECT * FROM test.t1; +a +8 +DROP PROCEDURE IF EXISTS test.p1; +DROP PROCEDURE IF EXISTS test.p2; +DROP TABLE IF EXISTS test.t1; diff --git a/mysql-test/r/rpl_ndb_sp006.result b/mysql-test/r/rpl_ndb_sp006.result new file mode 100644 index 00000000000..6d32f26b280 --- /dev/null +++ b/mysql-test/r/rpl_ndb_sp006.result @@ -0,0 +1,45 @@ +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; +create database if not exists mysqltest1; +DROP PROCEDURE IF EXISTS mysqltest1.p1; +DROP PROCEDURE IF EXISTS mysqltest1.p2; +DROP TABLE IF EXISTS mysqltest1.t2; +DROP TABLE IF EXISTS mysqltest1.t1; +CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=NDBCLUSTER; +CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=NDBCLUSTER; +CREATE PROCEDURE mysqltest1.p1() +BEGIN +DECLARE done INT DEFAULT 0; +DECLARE spa CHAR(16); +DECLARE spb INT; +DECLARE cur1 CURSOR FOR SELECT name, +(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5) +------------------------- +CALL test.p1(12); +Warnings: +Note 1051 Unknown table 't1' +SELECT * FROM test.t1; +num +12 + +< ---- Slave selects-- > +------------------------ +SELECT * FROM test.t1; +num +12 + +< ---- Master selects-- > +------------------------- +CALL test.p1(13); +SELECT * FROM test.t1; +num +13 + +< ---- Slave selects-- > +------------------------ +SELECT * FROM test.t1; +num +13 +DROP PROCEDURE IF EXISTS test.p1; +DROP TABLE IF EXISTS test.t1; diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/r/rpl_ndb_sync.result index 8449f8cb11e..5f465dc427c 100644 --- a/mysql-test/r/rpl_ndb_sync.result +++ b/mysql-test/r/rpl_ndb_sync.result @@ -25,12 +25,13 @@ hex(c2) hex(c3) c1 0 1 BCDEF 1 0 CD 0 0 DEFGHIJKL -CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP; +CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP; DELETE FROM cluster_replication.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; @the_backup_id:=backup_id +DROP TABLE cluster_replication.backup_info; UPDATE t1 SET c2=0 WHERE c3="row2"; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; hex(c1) hex(c2) c3 diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/r/rpl_trigger.result index 7613f2547f0..ccfa1b5e66b 100644 --- a/mysql-test/r/rpl_trigger.result +++ b/mysql-test/r/rpl_trigger.result @@ -4,6 +4,9 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t2 (a int auto_increment, primary key (a), b int); create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5010e8afb81..12ec8c12f95 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -27,9 +27,10 @@ rpl_ndb_basic : Bug#16228 rpl_sp : Bug #16456 ndb_autodiscover : Needs to be fixed w.r.t binlog ndb_autodiscover2 : Needs to be fixed w.r.t binlog -#ndb_alter_table_row : sometimes wrong error 1015!=1046 +ndb_alter_table_row : sometimes wrong error 1015!=1046 ndb_gis : garbled msgs from corrupt THD* -rpl_ndb_auto_inc : MySQL Bugs:17086 -rpl_ndb_relay_space : Bug 16993 +rpl_ndb_auto_inc : Bug #17086 +rpl_ndb_relay_space : Bug #16993 ndb_binlog_ddl_multi : Bug #17038 -rpl_ndb_log : MySQL Bugs: #17158 +rpl_ndb_log : Bug #17158 +rpl_ndb_sp007 : Bug #17290 diff --git a/mysql-test/t/rpl_ndb_disk.test b/mysql-test/t/rpl_ndb_dd_basic.test similarity index 100% rename from mysql-test/t/rpl_ndb_disk.test rename to mysql-test/t/rpl_ndb_dd_basic.test diff --git a/mysql-test/t/rpl_ndb_idempotent.test b/mysql-test/t/rpl_ndb_idempotent.test index 1f14ce59a2e..bb33dfaf701 100644 --- a/mysql-test/t/rpl_ndb_idempotent.test +++ b/mysql-test/t/rpl_ndb_idempotent.test @@ -109,3 +109,8 @@ SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 7 8 9 16 22 23 33 SHOW SLAVE STATUS; + +connection master; +DROP TABLE IF EXISTS t1; + +# End of 5.1 Test diff --git a/mysql-test/t/rpl_ndb_sp003.test b/mysql-test/t/rpl_ndb_sp003.test new file mode 100644 index 00000000000..75ad9f0a488 --- /dev/null +++ b/mysql-test/t/rpl_ndb_sp003.test @@ -0,0 +1,9 @@ +################################# +# Wrapper for rpl_row_sp003.test# +# These tests have been wrapped # +# so the same code can be used # +# For different engines # +################################# +-- source include/have_ndb.inc +let $engine_type=NDBCLUSTER; +-- source extra/rpl_tests/rpl_row_sp003.test diff --git a/mysql-test/t/rpl_ndb_sp006.test b/mysql-test/t/rpl_ndb_sp006.test new file mode 100644 index 00000000000..590facc3648 --- /dev/null +++ b/mysql-test/t/rpl_ndb_sp006.test @@ -0,0 +1,9 @@ +################################# +# Wrapper for rpl_row_sp006.test# +# These tests have been wrapped # +# so the same code can be used # +# For different engines # +################################# +-- source include/have_ndb.inc +let $engine_type=NDBCLUSTER; +-- source extra/rpl_tests/rpl_row_sp006.test diff --git a/mysql-test/t/rpl_ndb_sp007.test b/mysql-test/t/rpl_ndb_sp007.test new file mode 100644 index 00000000000..767fd105518 --- /dev/null +++ b/mysql-test/t/rpl_ndb_sp007.test @@ -0,0 +1,9 @@ +################################# +# Wrapper for rpl_row_sp007.test# +# These tests have been wrapped # +# so the same code can be used # +# For different engines # +################################# +-- source include/have_ndb.inc +let $engine_type=NDBCLUSTER; +-- source extra/rpl_tests/rpl_row_sp007.test diff --git a/mysql-test/t/rpl_ndb_sync.test b/mysql-test/t/rpl_ndb_sync.test index 61591b8fc68..5c990cd4842 100644 --- a/mysql-test/t/rpl_ndb_sync.test +++ b/mysql-test/t/rpl_ndb_sync.test @@ -27,13 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; # take a backup on master --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat -CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP; +CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP; DELETE FROM cluster_replication.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; --replace_column 1 SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; let the_backup_id=`select @the_backup_id` ; - +DROP TABLE cluster_replication.backup_info; # update a row UPDATE t1 SET c2=0 WHERE c3="row2"; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; @@ -130,3 +130,5 @@ connection slave; reset slave; # should now contain nothing select * from cluster_replication.apply_status; + +# End 5.1 Test diff --git a/mysql-test/t/rpl_row_sp007_innodb-slave.opt b/mysql-test/t/rpl_row_sp007_innodb-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_row_sp007_innodb-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/t/rpl_trigger.test index 0eca7308adc..498aa479b27 100644 --- a/mysql-test/t/rpl_trigger.test +++ b/mysql-test/t/rpl_trigger.test @@ -3,7 +3,14 @@ # Adding statement include due to Bug 12574 # TODO: Remove statement include once 12574 is patched --source include/have_binlog_format_statement.inc -source include/master-slave.inc; +--source include/master-slave.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; + +--enable_warnings # # #12482: Triggers has side effects with auto_increment values