Debian Codegraph @

mysql-test/suite/binlog/t/binlog_show_binlog_event_random_pos.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 call mtr.add_suppression("Error in Log_event::read_log_event*");
16 call mtr.add_suppression("Replication event checksum verification failed while reading from a log file*");
17
18 DROP TABLE IF EXISTS t1;
19 CREATE TABLE t1 (c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255), c5 CHAR(255));
20 INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
21 INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
22 UPDATE t1 SET c1=repeat('b',255);
23 INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
24 --let $max_pos= query_get_value(SHOW MASTER STATUS,Position,1)
25 --let $pos= 1
26 while ($pos <= $max_pos)
27 {
28 --disable_query_log
29 --disable_result_log
30 --error 0,1220
31 eval SHOW BINLOG EVENTS FROM $pos LIMIT 100;
32 --inc $pos
33 --enable_result_log
34 --enable_query_log
35 }
36
37 # Testing a case where input position is greater than actual binlog file size.
38 --replace_result $pos POS $max_pos MAX_POS
39 --error 1220
40 eval SHOW BINLOG EVENTS FROM $pos;
41
42 DROP TABLE t1;