Debian Codegraph @

mysql-test/suite/binlog/t/binlog_invalid_read_in_rotate.test

raw
1 # ==== Purpose ====
2 #
3 # Test verifies that reading binary log by using "SHOW BINLOG EVENTS" command
4 # from various random positions doesn't lead to crash. It should exit
5 # gracefully with appropriate error.
6 #
7 # ==== References ====
8 #
9 # MDEV-18046:Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
10
11 --source include/have_log_bin.inc
12 --source include/have_innodb.inc
13
14 RESET MASTER;
15
16 call mtr.add_suppression("Error in Log_event::read_log_event*");
17 call mtr.add_suppression("Replication event checksum verification failed while reading from a log file*");
18
19 DROP TABLE /*! IF EXISTS*/ t1;
20 CREATE TABLE `t1` (
21 `col_int` int,
22 pk integer auto_increment,
23 `col_char_12_key` char(12),
24 `col_int_key` int,
25 `col_char_12` char(12),
26 primary key (pk),
27 key (`col_char_12_key` ),
28 key (`col_int_key` )) ENGINE=InnoDB;
29
30 INSERT /*! IGNORE */ INTO t1 VALUES (183173120, NULL, 'abcd', 1, 'efghijk'), (1, NULL, 'lmno', 2, 'p');
31
32 --disable_warnings
33 ALTER TABLE `t1` ENABLE KEYS;
34 --enable_warnings
35
36 --let $max_pos= query_get_value(SHOW MASTER STATUS,Position,1)
37 --let $pos= 1
38 while ($pos <= $max_pos)
39 {
40 --disable_query_log
41 --disable_result_log
42 --error 0,1220
43 eval SHOW BINLOG EVENTS FROM $pos;
44 --inc $pos
45 --enable_result_log
46 --enable_query_log
47 }
48 DROP TABLE t1;