Debian Codegraph @

mysql-test/suite/rpl/t/rpl_binlog_corruption.test

raw
1 # ==== Purpose ====
2 #
3 # Verify that the slave stops gracefully when reading a relay log with
4 # corrupted data.
5 #
6 # ==== Implementation ====
7 #
8 # Setup "fake replication" where the slave only starts the SQL thread,
9 # not the IO thread, and reads from an existing relay log that has
10 # been prepared so that it contains the error. This requires some
11 # extra server options: see the -master.opt file.
12 #
13 # ==== Related bugs ====
14 #
15 # BUG#31793: log event corruption causes crash
16 # BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
17
18 --source include/master-slave.inc
19
20 # BUG#40482 only manifested itself in debug-compiled binaries.
21 -- source include/have_debug.inc
22
23 --connection slave
24 call mtr.add_suppression('Found invalid event in binary log');
25 call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
26
27 #
28 # BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
29 #
30 # The relay log contains an Incident_log_event with a non-existing
31 # incident number.
32
33 --echo ==== Initialize ====
34 --source include/stop_slave.inc
35 RESET SLAVE;
36
37 let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
38 source include/setup_fake_relay_log.inc;
39
40 --echo ==== Test ====
41 START SLAVE SQL_THREAD;
42 let $slave_sql_errno= 1594; # ER_SLAVE_RELAY_LOG_READ_FAILURE
43 source include/wait_for_slave_sql_error.inc;
44 let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
45 --echo Last_SQL_Error = $error
46
47 --echo ==== Clean up ====
48 source include/cleanup_fake_relay_log.inc;
49 --let $rpl_only_running_threads= 1
50 --source include/rpl_end.inc