summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
blob: f9624904649c338d0f358753be6d3faa9df623fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ==== Purpose ====
#
# Verify that the slave stops gracefully when reading a relay log with
# corrupted data.
#
# ==== Implementation ====
#
# Setup "fake replication" where the slave only starts the SQL thread,
# not the IO thread, and reads from an existing relay log that has
# been prepared so that it contains the error.  This requires some
# extra server options: see the -master.opt file.
#
# ==== Related bugs ====
#
# BUG#31793: log event corruption causes crash
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event

-- source include/have_log_bin.inc
# BUG#40482 only manifested itself in debug-compiled binaries.
-- source include/have_debug.inc
-- source include/master-slave.inc

--connection slave
call mtr.add_suppression('Found invalid event in binary log');
call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');

#
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
#
# The relay log contains an Incident_log_event with a non-existing
# incident number.

--echo ==== Initialize ====
--source include/stop_slave.inc
RESET SLAVE;

let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
source include/setup_fake_relay_log.inc;

--echo ==== Test ====
START SLAVE SQL_THREAD;
let $slave_sql_errno= 1594; # ER_SLAVE_RELAY_LOG_READ_FAILURE
source include/wait_for_slave_sql_error.inc;
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $error

--echo ==== Clean up ====
source include/cleanup_fake_relay_log.inc;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc