Skip to content

Commit 24dcb10

Browse files
author
serg@serg.mylan
committed
fix rpl_trunc_binlog to test the new behaviour
1 parent e29191e commit 24dcb10

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

mysql-test/r/rpl_trunc_binlog.result

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
66
start slave;
77
stop slave;
88
flush logs;
9+
create table t1 (a int) engine=bdb;
910
reset slave;
1011
start slave;
1112
show slave status;
1213
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
13-
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 # # master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # None 0 No #
14+
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 # # master-bin.000002 Yes Yes 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 4 # None 0 No #
15+
select * from t1;
16+
a
17+
drop table t1;
55 Bytes
Binary file not shown.

mysql-test/t/rpl_trunc_binlog.test

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
# We are testing if a binlog which contains BEGIN but not COMMIT (the
2-
# master did while writing the transaction to the binlog) triggers an
3-
# error on slave. So we use such a truncated binlog and simulate that
2+
# master died while writing the transaction to the binlog) triggers a
3+
# rollback on slave. So we use such a truncated binlog and simulate that
44
# the master restarted after this.
55

66
source include/master-slave.inc;
77

88
connection slave;
9-
# If we are not supporting transactions in the slave, the unfinished transaction
10-
# won't cause any error, so we need to skip the test. In the 4.0 testsuite, the
11-
# slave always runs without InnoDB, so we check for BDB.
9+
# If we are not supporting transactions in the slave, the unfinished
10+
# transaction won't cause any error, so we need to skip the test. In the 4.0
11+
# testsuite, the slave always runs without InnoDB, so we check for BDB.
1212
source include/have_bdb.inc;
1313
stop slave;
14+
1415
connection master;
1516
flush logs;
1617
system mv -f var/log/master-bin.000001 var/log/master-bin.000002;
1718
system cp std_data/trunc_binlog.000001 var/log/master-bin.000001;
19+
1820
connection slave;
21+
22+
# truncated binlog contains: BEGIN; INSERT t1 VALUES (1);
23+
# so let's create the table t1 on slave
24+
25+
create table t1 (a int) engine=bdb;
1926
reset slave;
2027
start slave;
2128
# can't sync_with_master so we must sleep
2229
sleep 3;
2330
--replace_result $MASTER_MYPORT MASTER_PORT
2431
--replace_column 1 # 8 # 9 # 23 # 33 #
2532
show slave status;
33+
select * from t1;
34+
drop table t1;
35+

0 commit comments

Comments
 (0)