Debian Codegraph @

mysql-test/suite/rpl_nogtid/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/not_group_replication_plugin.inc
19 --source include/not_have_privilege_checks_user.inc
20 --source include/master-slave.inc
21
22 # BUG#40482 only manifested itself in debug-compiled binaries.
23 source include/have_debug.inc;
24
25 --connection slave
26 call mtr.add_suppression('Found invalid event in binary log');
27 call mtr.add_suppression('Replica SQL.*Relay log read failure: Could not parse relay log event entry.* MY-013121');
28
29 #
30 # BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
31 #
32 # The relay log contains an Incident_log_event with a non-existing
33 # incident number.
34
35 --echo ==== Initialize ====
36 --source include/stop_slave.inc
37 RESET SLAVE;
38
39 let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
40 source include/setup_fake_relay_log.inc;
41
42 --echo ==== Test ====
43 START SLAVE SQL_THREAD;
44 let $slave_sql_errno= 13121; # ER_REPLICA_RELAY_LOG_READ_FAILURE
45 let $show_slave_sql_error= 1;
46 source include/wait_for_slave_sql_error.inc;
47
48 --echo ==== Clean up ====
49 source include/cleanup_fake_relay_log.inc;
50 --let $rpl_only_running_threads= 1
51 --source include/rpl_end.inc