Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-10-26 08:58:00+02:00, msvensson@stripped +2 -0
Bug#28772 rpl_row_until fails in pushbuild
- Add a "wait_for_slave_io_to_stop.inc" after the two "stop slave"
commands after wich we want to show the slaves status
- Improve comments, both in test and result files
mysql-test/suite/rpl/r/rpl_row_until.result@stripped, 2007-10-26 08:57:58+02:00,
msvensson@stripped +30 -0
Updte test results
mysql-test/suite/rpl/t/rpl_row_until.test@stripped, 2007-10-26 08:57:58+02:00,
msvensson@stripped +40 -14
- Add the fix "wait_for_slave_io_to_stop.inc" after each "stop slave" command
- Add comments describing what is being tested and add some
additional test(s), expecially "easy" is to check that tables t1 and t2
are available on teh slave depending on how far we have replicated
the log from master
diff -Nrup a/mysql-test/suite/rpl/r/rpl_row_until.result
b/mysql-test/suite/rpl/r/rpl_row_until.result
--- a/mysql-test/suite/rpl/r/rpl_row_until.result 2007-08-21 14:33:00 +02:00
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result 2007-10-26 08:57:58 +02:00
@@ -12,13 +12,19 @@ create table t2(n int not null auto_incr
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
+#---------------------------------------------------------
+# Run replication until just before "drop table t1"
start slave until master_log_file='master-bin.000001', master_log_pos=311;
+# Check that t1 still exists and that it contains 1,2,3,4
select * from t1;
n
1
2
3
4
+# Check that t2 has not yet been created
+select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -58,13 +64,19 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+#---------------------------------------------------------
+# Try to start replication with an invalid master_log_file
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+# Check that t1 still exists and that it contains 1,2,3,4
select * from t1;
n
1
2
3
4
+# Check that t2 has not yet been created
+select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -104,7 +116,13 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+#---------------------------------------------------------
+# Run replication until just before the second insert to t2
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+# Check that t1 has been dropped
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+# Check that t2 has been created and contains 1,2
select * from t2;
n
1
@@ -148,8 +166,17 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+#---------------------------------------------------------
+# Run replication until master and slave are in sync
start slave;
stop slave;
+# Check that neither t1 or t2 exist
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+#---------------------------------------------------------
+# Start replication to the current position
start slave until master_log_file='master-bin.000001', master_log_pos=740;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -190,6 +217,8 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+#---------------------------------------------------------
+# Test various error conditions
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561,
relay_log_pos=12;
@@ -204,3 +233,4 @@ start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
Warnings:
Note 1254 Slave is already running
+#---------------------------------------------------------
diff -Nrup a/mysql-test/suite/rpl/t/rpl_row_until.test
b/mysql-test/suite/rpl/t/rpl_row_until.test
--- a/mysql-test/suite/rpl/t/rpl_row_until.test 2007-06-27 14:28:29 +02:00
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test 2007-10-26 08:57:58 +02:00
@@ -13,6 +13,7 @@ save_master_pos;
connection slave;
sync_with_master;
stop slave;
+--source include/wait_for_slave_io_to_stop.inc
connection master;
# create some events on master
@@ -23,44 +24,68 @@ create table t2(n int not null auto_incr
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
-
-# try to replicate all queries until drop of t1
connection slave;
+
+
+echo #---------------------------------------------------------;
+echo # Run replication until just before "drop table t1";
start slave until master_log_file='master-bin.000001', master_log_pos=311;
--source include/wait_for_slave_sql_to_stop.inc
-# here table should be still not deleted
+echo # Check that t1 still exists and that it contains 1,2,3,4;
select * from t1;
+echo # Check that t2 has not yet been created;
+--error ER_NO_SUCH_TABLE
+select * from t2;
source include/show_slave_status.inc;
-# this should fail right after start
+
+echo #---------------------------------------------------------;
+echo # Try to start replication with an invalid master_log_file;
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
--source include/wait_for_slave_sql_to_stop.inc
-# again this table should be still not deleted
+echo # Check that t1 still exists and that it contains 1,2,3,4;
select * from t1;
+echo # Check that t2 has not yet been created;
+--error ER_NO_SUCH_TABLE
+select * from t2;
source include/show_slave_status.inc;
-# try replicate all up to and not including the second insert to t2;
+
+echo #---------------------------------------------------------;
+echo # Run replication until just before the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
--source include/wait_for_slave_sql_to_stop.inc
+echo # Check that t1 has been dropped;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+echo # Check that t2 has been created and contains 1,2;
select * from t2;
source include/show_slave_status.inc;
-# clean up
+
+echo #---------------------------------------------------------;
+echo # Run replication until master and slave are in sync;
start slave;
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
stop slave;
+echo # Check that neither t1 or t2 exist;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+--error ER_NO_SUCH_TABLE
+select * from t2;
+--source include/wait_for_slave_io_to_stop.inc
+
-# this should stop immediately as we are already there
+echo #---------------------------------------------------------;
+echo # Start replication to the current position;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
--source include/wait_for_slave_sql_to_stop.inc
-# here the sql slave thread should be stopped
---replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
source include/show_slave_status.inc;
-#testing various error conditions
+
+echo #---------------------------------------------------------;
+echo # Test various error conditions;
--error 1277
start slave until master_log_file='master-bin', master_log_pos=561;
--error 1277
@@ -74,3 +99,4 @@ start slave until relay_log_file='slave-
# Warning should be given for second command
start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
+echo #---------------------------------------------------------;