1#
2# This include file is used by more than one test suite
3# (currently rpl and binlog_encryption).
4# Please check all dependent tests after modifying it
5#
6
7#
8# Bug#11747416 : 32228 	A disk full makes binary log corrupt.
9#
10#
11# The test demonstrates reading from binlog error propagation to slave
12# and reporting there.
13# Conditions for the bug include a crash at time of the last event to
14# the binlog was written partly. With the fixes the event is not sent out
15# any longer, but rather the dump thread sends out a sound error message.
16#
17# Crash is not simulated. A binlog with partly written event in its end is installed
18# and replication is started from it.
19#
20
21--source include/have_binlog_format_mixed.inc
22--source include/master-slave.inc
23
24--connection slave
25# Make sure the slave is stopped while we are messing with master.
26# Otherwise we get occasional failures as the slave manages to re-connect
27# to the newly started master and we get extra events applied, causing
28# conflicts.
29--source include/stop_slave.inc
30
31--connection master
32call mtr.add_suppression("Error in Log_event::read_log_event()");
33--let $datadir= `SELECT @@datadir`
34
35--let $rpl_server_number= 1
36--source include/rpl_stop_server.inc
37
38--remove_file $datadir/master-bin.000001
39--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
40
41--let $rpl_server_number= 1
42--source include/rpl_start_server.inc
43
44--source include/wait_until_connected_again.inc
45
46# evidence of the partial binlog
47--error ER_ERROR_WHEN_EXECUTING_COMMAND
48show binlog events;
49
50--connection slave
51call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
52reset slave;
53start slave;
54
55# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
56--let $slave_param=Last_IO_Errno
57--let $slave_param_value=1236
58--source include/wait_for_slave_param.inc
59
60--let $slave_field_result_replace= / at [0-9]*/ at XXX/
61--let $status_items= Last_IO_Errno, Last_IO_Error
62--source include/show_slave_status.inc
63
64#
65# Cleanup
66#
67
68--connection master
69reset master;
70
71--connection slave
72stop slave;
73reset slave;
74# Table was created from binlog, it may not be created if SQL thread is running
75# slowly and IO thread reaches incident before SQL thread applies it.
76--disable_warnings
77drop table if exists t;
78--enable_warnings
79reset master;
80
81--echo End of the tests
82--let $rpl_only_running_threads= 1
83--source include/rpl_end.inc
84