diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index ef95103c7bc..256ed4eaad2 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -17,10 +17,8 @@ insert into t1 values('Could not break slave'),('Tried hard'); Master_Log_File = 'master-bin.000001' Relay_Master_Log_File = 'master-bin.000001' include/check_slave_is_running.inc -select * from t1; -s -Could not break slave -Tried hard +include/assert.inc [Table t1 should contain the first inserted line] +include/assert.inc [Table t1 should contain the second inserted line] flush logs; create table t2(m int not null auto_increment primary key); insert into t2 values (34),(67),(123); @@ -31,9 +29,7 @@ master-bin.000001 # master-bin.000002 # master-bin.000003 # create table t3 select * from temp_table; -select * from t3; -a -testing temporary tables +include/assert.inc [Data in t3 should be equal to temp_table] drop table temp_table, t3; insert into t2 values(1234); set insert_id=1234; @@ -60,19 +56,15 @@ insert into t2 values (65); Master_Log_File = 'master-bin.000003' Relay_Master_Log_File = 'master-bin.000003' include/check_slave_is_running.inc -select * from t2; -m -34 -65 -67 -123 -1234 +include/assert.inc [Table t2 should still contain the first inserted line after creation] +include/assert.inc [Table t2 should contain the line inserted after the purge] +include/assert.inc [Table t2 should still contain the second insert line after creation] +include/assert.inc [Table t2 should still contain the third inserted line after creation] +include/assert.inc [Table t2 should still contain the line from the duplicated key test] create temporary table temp_table (a char(80) not null); insert into temp_table values ("testing temporary tables part 2"); create table t3 (n int); -select count(*) from t3 where n >= 4; -count(*) -100 +include/assert.inc [Table t3 should contain 100 lines on the master] create table t4 select * from temp_table; show binary logs; Log_name File_size @@ -85,16 +77,12 @@ master-bin.000008 # show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000008 # -select * from t4; -a -testing temporary tables part 2 +include/assert.inc [Data in t4 should be equal to temp_table] Master_Log_File = 'master-bin.000008' Relay_Master_Log_File = 'master-bin.000008' include/check_slave_is_running.inc lock tables t3 read; -select count(*) from t3 where n >= 4; -count(*) -100 +include/assert.inc [Table t3 should contain 100 lines on the slave] unlock tables; drop table if exists t1,t2,t3,t4; End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 67079b9bea1..dc158d7ef92 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -66,7 +66,17 @@ sync_slave_with_master; let $status_items= Master_Log_File, Relay_Master_Log_File; source include/show_slave_status.inc; source include/check_slave_is_running.inc; -select * from t1; + +--let $assert_text= Table t1 should contain the first inserted line +--let $query_result= query_get_value(select * from t1, "s", 1) +--let $assert_cond= "$query_result" = "Could not break slave" +--source include/assert.inc + +--let $assert_text= Table t1 should contain the second inserted line +--let $query_result= query_get_value(select * from t1, "s", 2) +--let $assert_cond= "$query_result" = "Tried hard" +--source include/assert.inc + connection master; flush logs; create table t2(m int not null auto_increment primary key); @@ -77,7 +87,11 @@ create table t3 select * from temp_table; sync_slave_with_master; -select * from t3; +--let $query_result= query_get_value(select * from t3, "a", 1) +--let $assert_text= Data in t3 should be equal to temp_table +--let $assert_cond= "$query_result" = "testing temporary tables" +--source include/assert.inc + connection master; drop table temp_table, t3; @@ -136,11 +150,30 @@ insert into t2 values (65); sync_slave_with_master; source include/show_slave_status.inc; source include/check_slave_is_running.inc; -select * from t2; + +--let $assert_text= Table t2 should still contain the first inserted line after creation +--let $assert_cond= [select * from t2,"m",1] = 34 +--source include/assert.inc + +--let $assert_text= Table t2 should contain the line inserted after the purge +--let $assert_cond= [select * from t2,"m",2] = 65 +--source include/assert.inc + +--let $assert_text= Table t2 should still contain the second insert line after creation +--let $assert_cond= [select * from t2,"m",3] = 67 +--source include/assert.inc + +--let $assert_text= Table t2 should still contain the third inserted line after creation +--let $assert_cond= [select * from t2,"m",4] = 123 +--source include/assert.inc + +--let $assert_text= Table t2 should still contain the line from the duplicated key test +--let $assert_cond= [select * from t2,"m",5] = 1234 +--source include/assert.inc # # Test forcing the replication log to rotate -# +# connection master; create temporary table temp_table (a char(80) not null); @@ -156,19 +189,31 @@ while ($1) dec $1; } enable_query_log; -select count(*) from t3 where n >= 4; + +--let $assert_text= Table t3 should contain 100 lines on the master +--let $assert_cond= [select count(*) from t3 where n >= 4,"count(*)",1] = 100 +--source include/assert.inc + create table t4 select * from temp_table; source include/show_binary_logs.inc; source include/show_master_status.inc; sync_slave_with_master; -select * from t4; + +--let $query_result= query_get_value(select * from t4, "a", 1) +--let $assert_text= Data in t4 should be equal to temp_table +--let $assert_cond= "$query_result" = "testing temporary tables part 2" +--source include/assert.inc source include/show_slave_status.inc; source include/check_slave_is_running.inc; # because of concurrent insert, the table may not be up to date # if we do not lock lock tables t3 read; -select count(*) from t3 where n >= 4; + +--let $assert_text= Table t3 should contain 100 lines on the slave +--let $assert_cond= [select count(*) from t3 where n >= 4,"count(*)",1] = 100 +--source include/assert.inc + unlock tables; #clean up connection master;