Debian Codegraph @

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

raw
1 ###########################################################################
2 # BUG#20928790 SHOW BINLOG EVENTS COMPLETELY LOCKS DOWN WRITES TO BINLOG, #
3 # HENCE TRANSACTIONS. #
4 # #
5 # Problem: While a `SHOW BINLOG EVENTS` is executing, any parallel #
6 # transaction is blocked. #
7 # #
8 # Steps to reproduce: #
9 # =================== #
10 # 1) Execute 'show binlog events' on one connection and let it wait #
11 # inside a loop that reads the events from the file using DEBUG_SYNC #
12 # point #
13 # 2) While the command is waiting, execute some transactions and see #
14 # that they are not blocked. #
15 # #
16 ###########################################################################
17 --source include/have_debug_sync.inc
18 --source include/have_binlog_format_statement.inc
19
20 # To make test to start with binlog.000001
21 RESET MASTER;
22 # Run some sample tests to put it in binlog.000001
23 CREATE TABLE t1(i INT);
24 DROP TABLE t1;
25
26 connect (con1,localhost,root,,);
27 # Let show binlog events wait while it is reading events
28 SET DEBUG_SYNC = "wait_in_show_binlog_events_loop SIGNAL reached_for_loop WAIT_FOR go_ahead";
29 --send SHOW BINLOG EVENTS
30
31 --connection default
32 # Make sure show binlog events execution reaches the point where we wanted to
33 SET DEBUG_SYNC = "now WAIT_FOR reached_for_loop";
34
35 # Now execute some transactions and it should not be blocked
36 CREATE TABLE t1(i INT);
37 INSERT INTO t1 VALUES (12);
38 DROP TABLE t1;
39
40 # Once above sample transactions are running fine, send signal to continue
41 # 'show binlog events' command
42 SET DEBUG_SYNC = "now SIGNAL go_ahead";
43
44 # Make sure show binlog events run successfully
45 # 'show binlog events' output varies for different runs
46 # (gtid, non-gtid, 5.6, 5.7). So lets disable the output
47 --disable_result_log
48 --connection con1
49 --reap
50 --enable_result_log