diff options
Diffstat (limited to 'mysql-test/t')
25 files changed, 102 insertions, 59 deletions
diff --git a/mysql-test/t/rpl_LD_INFILE.test b/mysql-test/t/rpl_LD_INFILE.test index 06c14cf109c..ae647ed6648 100644 --- a/mysql-test/t/rpl_LD_INFILE.test +++ b/mysql-test/t/rpl_LD_INFILE.test @@ -27,11 +27,12 @@ save_master_pos; sync_slave_with_master; connection slave; SELECT * FROM test.t1 ORDER BY a DESC; -connection master; -# Lets cleanup -#show binlog events; +# Cleanup +#show binlog events; +connection master; DROP TABLE test.t1; +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/t/rpl_drop_temp.test index 53261e91b7b..305c78d3f06 100644 --- a/mysql-test/t/rpl_drop_temp.test +++ b/mysql-test/t/rpl_drop_temp.test @@ -18,7 +18,10 @@ disconnect master; connection slave; --real_sleep 3 # time for DROP to be written show status like 'Slave_open_temp_tables'; + +# Cleanup connection default; drop database mysqltest; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/t/rpl_ignore_table.test index bc651779208..84b0a4cde38 100644 --- a/mysql-test/t/rpl_ignore_table.test +++ b/mysql-test/t/rpl_ignore_table.test @@ -23,6 +23,8 @@ UPDATE test.t4 NATURAL JOIN test.t1 SET t1.a=5; sync_slave_with_master; SELECT * FROM t4; +# Cleanup connection master; DROP TABLE t1; DROP TABLE t4; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_loaddata2.test b/mysql-test/t/rpl_loaddata2.test index 8bbbbf62f61..439c2b48ca5 100644 --- a/mysql-test/t/rpl_loaddata2.test +++ b/mysql-test/t/rpl_loaddata2.test @@ -4,11 +4,11 @@ CREATE TABLE t1 (word CHAR(20) NOT NULL); LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; SELECT * FROM t1 ORDER BY word; sync_slave_with_master; -SELECT * FROM t1 ORDER BY word; -########## -# Change Author: JBM -# Change Date: 2006-01-16 -# Change: Added Order by for NDB -########## +# Check +SELECT * FROM t1 ORDER BY word; +# Cleanup +connection master; +drop table t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_loaddata_m.test b/mysql-test/t/rpl_loaddata_m.test index 01ef89d4efc..42c3ad99f33 100644 --- a/mysql-test/t/rpl_loaddata_m.test +++ b/mysql-test/t/rpl_loaddata_m.test @@ -42,8 +42,11 @@ SHOW TABLES; SELECT COUNT(*) FROM mysqltest.t1; #show binlog events; + +# Cleanup connection master; DROP DATABASE mysqltest; DROP TABLE test.t1; +sync_slave_with_master; # End of test diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/t/rpl_loaddata_s.test index fc3e3d128a6..8e2bf012bc9 100644 --- a/mysql-test/t/rpl_loaddata_s.test +++ b/mysql-test/t/rpl_loaddata_s.test @@ -22,3 +22,8 @@ sync_with_master; select count(*) from test.t1; # check that LOAD was replicated --replace_column 2 # 5 # show binlog events from 102; # should be nothing + +# Cleanup +connection master; +drop table test.t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_loadfile.test b/mysql-test/t/rpl_loadfile.test index 61a0cc46628..1e7f2c5fdfe 100644 --- a/mysql-test/t/rpl_loadfile.test +++ b/mysql-test/t/rpl_loadfile.test @@ -40,8 +40,10 @@ sync_slave_with_master; connection slave; SELECT * FROM test.t1 ORDER BY blob_column; -# Lets cleanup +# Cleanup connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE test.t1; +sync_slave_with_master; + # End of 5.0 test case diff --git a/mysql-test/t/rpl_multi_update4.test b/mysql-test/t/rpl_multi_update4.test index 3d909b8e5cd..4991a385f6f 100644 --- a/mysql-test/t/rpl_multi_update4.test +++ b/mysql-test/t/rpl_multi_update4.test @@ -15,7 +15,7 @@ connection slave; drop database if exists d2; --enable_warnings -### Test +### Do on master connection master; create database d1; # accepted by slave @@ -30,15 +30,16 @@ insert into t2 select id + 3 from t1; update t1 join t2 using (id) set t1.id = 0; insert into d1.t0 values (0); # replication works +### Check on slave + sync_slave_with_master; use d1; -#connection slave; select * from t0 where id=0; # must find ### Clean-up connection master; drop database d1; drop database d2; - +sync_slave_with_master; # End of test diff --git a/mysql-test/t/rpl_ndb_basic.test b/mysql-test/t/rpl_ndb_basic.test index 95c1737f715..57028464179 100644 --- a/mysql-test/t/rpl_ndb_basic.test +++ b/mysql-test/t/rpl_ndb_basic.test @@ -144,3 +144,4 @@ select * from t1 order by nid; # cleanup --connection master DROP TABLE t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test index 58321babb39..078d1048794 100644 --- a/mysql-test/t/rpl_redirect.test +++ b/mysql-test/t/rpl_redirect.test @@ -38,8 +38,10 @@ disable_rpl_parse; SELECT * FROM t1 ORDER BY n; connection slave; SELECT * FROM t1 ORDER BY n; -drop table t1; + +# Cleanup connection master; drop table t1; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/t/rpl_row_func001.test b/mysql-test/t/rpl_row_func001.test index 6c538017911..53fb55118e6 100644 --- a/mysql-test/t/rpl_row_func001.test +++ b/mysql-test/t/rpl_row_func001.test @@ -48,9 +48,10 @@ connection master; #Used for debugging #show binlog events; -# Lets cleanup +# Cleanup DROP FUNCTION test.f1; DROP TABLE test.t1; +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_func002.test b/mysql-test/t/rpl_row_func002.test index 3812eac201c..966124ce035 100644 --- a/mysql-test/t/rpl_row_func002.test +++ b/mysql-test/t/rpl_row_func002.test @@ -87,10 +87,10 @@ connection master; --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/func002_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/func002_slave.sql -# First lets cleanupi +# Cleanup DROP FUNCTION test.f1; DROP TABLE test.t1; - +sync_slave_with_master; # the test will show that the diff statement failed and no reject file # will be created. You will need to go to the mysql-test dir and diff @@ -99,6 +99,5 @@ DROP TABLE test.t1; exec diff ./var/tmp/func002_master.sql ./var/tmp/func002_slave.sql; - # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/t/rpl_row_sp001.test index 6a38feb0999..88384b242b0 100644 --- a/mysql-test/t/rpl_row_sp001.test +++ b/mysql-test/t/rpl_row_sp001.test @@ -124,10 +124,12 @@ SELECT * FROM t2 ORDER BY a; # First lets cleanup +connection master; DROP PROCEDURE test.p1; DROP PROCEDURE test.p2; DROP TABLE test.t1; DROP TABLE test.t2; +sync_slave_with_master; # Lets compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-test/t/rpl_row_sp005.test b/mysql-test/t/rpl_row_sp005.test index b55d10a1b8a..054fa02f514 100644 --- a/mysql-test/t/rpl_row_sp005.test +++ b/mysql-test/t/rpl_row_sp005.test @@ -97,10 +97,14 @@ connection master; ALTER PROCEDURE test.p1 MODIFIES SQL DATA; #show binlog events; +# Cleanup + +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_sp008.test b/mysql-test/t/rpl_row_sp008.test index c30339b8c7c..611062543e0 100644 --- a/mysql-test/t/rpl_row_sp008.test +++ b/mysql-test/t/rpl_row_sp008.test @@ -51,8 +51,11 @@ let $VERSION=`select version()`; --replace_result $VERSION VERSION show binlog events; +# Cleanup +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_sp009.test b/mysql-test/t/rpl_row_sp009.test index 64a2d19aed1..92d47c6f50f 100644 --- a/mysql-test/t/rpl_row_sp009.test +++ b/mysql-test/t/rpl_row_sp009.test @@ -94,14 +94,12 @@ connection slave; sync_with_master; SELECT * FROM test.t2 ORDER BY a; - +# Cleanup connection master; #show binlog events; -# lets cleanup - DROP PROCEDURE test.p1; DROP TABLE test.t1; DROP TABLE test.t2; - +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_sp010.test b/mysql-test/t/rpl_row_sp010.test index 8d11ca10087..10940e1e030 100644 --- a/mysql-test/t/rpl_row_sp010.test +++ b/mysql-test/t/rpl_row_sp010.test @@ -66,16 +66,15 @@ connection slave; sync_with_master; SELECT * FROM test.t2; +# Cleanup connection master; #show binlog events; -# lets cleanup - DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p4; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; - +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_sp011.test b/mysql-test/t/rpl_row_sp011.test index 8d843510b6b..73d2f628dbd 100644 --- a/mysql-test/t/rpl_row_sp011.test +++ b/mysql-test/t/rpl_row_sp011.test @@ -78,15 +78,13 @@ CALL test.p1(); #SELECT * FROM test.t2; sync_slave_with_master; #SELECT * FROM test.t2; -connection master; - -#show binlog events; -# lets cleanup --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp011_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp011_slave.sql - +# Cleanup +connection master; +#show binlog events; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; @@ -96,9 +94,7 @@ DROP PROCEDURE IF EXISTS test.p6; DROP PROCEDURE IF EXISTS test.p7; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; - - -# First lets cleanup +sync_slave_with_master; # Lets compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-test/t/rpl_row_sp012.test b/mysql-test/t/rpl_row_sp012.test index 2b9c07895f0..5b6fc139577 100644 --- a/mysql-test/t/rpl_row_sp012.test +++ b/mysql-test/t/rpl_row_sp012.test @@ -61,14 +61,14 @@ SELECT USER(); CALL test.p3(); CALL test.p2(); +# Cleanup connection master; - -# lets cleanup DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_row_trig001.test b/mysql-test/t/rpl_row_trig001.test index f2584933a32..b7866069a51 100644 --- a/mysql-test/t/rpl_row_trig001.test +++ b/mysql-test/t/rpl_row_trig001.test @@ -78,8 +78,8 @@ let $message=<End test section 2 (Tiggers & SP)>; --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/trig001_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/trig001_slave.sql -# First lets cleanup - +# Cleanup +connection master; DROP PROCEDURE test.p2; DROP PROCEDURE test.p3; DROP TRIGGER test.t2_ai; @@ -87,6 +87,7 @@ DROP TRIGGER test.t3_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; +sync_slave_with_master; # Lets compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-test/t/rpl_row_trig002.test b/mysql-test/t/rpl_row_trig002.test index d2a1b6327dd..7ca8a68f060 100644 --- a/mysql-test/t/rpl_row_trig002.test +++ b/mysql-test/t/rpl_row_trig002.test @@ -67,15 +67,14 @@ save_master_pos; connection slave; sync_with_master; SELECT * FROM test.t1 ORDER BY id; -connection master; +# Cleanup +connection master; #show binlog events; - -# cleanup - DROP TRIGGER test.t2_ai; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; +sync_slave_with_master; # End of 5.0 test case diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test index 19824fb28e8..ff81e2f010e 100644 --- a/mysql-test/t/rpl_skip_error.test +++ b/mysql-test/t/rpl_skip_error.test @@ -1,6 +1,7 @@ ########################################## # 2006-02-07 By JBM: Added order by ######################################### +# Note that errors are ignored by opt file. source include/master-slave.inc; create table t1 (n int not null primary key); @@ -9,14 +10,20 @@ connection slave; sync_with_master; insert into t1 values (1); connection master; +# Here we expect (ignored) error, since 1 is already in slave table insert into t1 values (1); + +# These should work fine insert into t1 values (2),(3); + save_master_pos; connection slave; sync_with_master; select * from t1 ORDER BY n; +# Cleanup connection master; drop table t1; -sync_with_master; +sync_slave_with_master; + # End of 4.1 tests diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test index 985cebabe7e..a4a276b63d6 100644 --- a/mysql-test/t/rpl_slave_status.test +++ b/mysql-test/t/rpl_slave_status.test @@ -1,11 +1,21 @@ -# Test case for BUG #10780 --source include/master-slave.inc + +############################################################################ +# Test case for BUG#10780 +# +# REQUIREMENT +# A slave without replication privileges should have Slave_IO_Running = No + +# 1. Create new replication user connection master; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; + connection slave; stop slave; change master to master_user='rpl',master_password='rpl'; start slave; + +# 2. Do replication as new user connection master; --disable_warnings drop table if exists t1; @@ -16,12 +26,19 @@ save_master_pos; connection slave; sync_with_master; select * from t1; + +# 3. Delete new replication user connection master; delete from mysql.user where user='rpl'; flush privileges; connection slave; + +# 4. Restart slave without privileges +# (slave.err will contain access denied error for this START SLAVE command) stop slave; start slave; + +# 5. Make sure Slave_IO_Running = No --replace_result $MASTER_MYPORT MASTER_MYPORT # Column 1 is replaced, since the output can be either # "Connecting to master" or "Waiting for master update" @@ -29,8 +46,12 @@ start slave; --vertical_results show slave status; +# Cleanup (Note that slave IO thread is not running) +connection slave; +drop table t1; connection master; drop table t1; -sync_with_master; + +# end of test case for BUG#10780 # end of 4.1 tests diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 708a3e0acaa..73f14bd49b3 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -429,17 +429,10 @@ CALL p1('test'); SELECT * FROM t1; sync_slave_with_master; -connection slave; - SELECT * FROM t1; -# Cleanup. - +# Cleanup connection master; - DROP PROCEDURE p1; - -# cleanup -connection master; drop table t1; -reset master; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_sp004.test b/mysql-test/t/rpl_sp004.test index 6f6bd79ae82..9156e6f4047 100644 --- a/mysql-test/t/rpl_sp004.test +++ b/mysql-test/t/rpl_sp004.test @@ -75,21 +75,21 @@ sync_with_master; SELECT * FROM test.t1; SELECT * FROM test.t2; #SELECT * FROM test.t3; -connection master; -#show binlog events; - - -# If the test fails, you will need to diff the dumps to see why. --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp004_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp004_slave.sql +# Cleanup +connection master; +#show binlog events; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; -#sync_slave_with_master; +sync_slave_with_master; + +# If the test fails, you will need to diff the dumps to see why. -- exec diff ./var/tmp/sp004_master.sql ./var/tmp/sp004_slave.sql |