1 # Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
3 # We verify that we did not introduce a deadlock.
4 # This is intended to mimick how mysqldump and innobackup work.
6 --source include/have_log_bin.inc
8 # And it requires InnoDB
9 --source include/have_log_bin.inc
10 --source include/have_innodb.inc
12 # Save the initial number of concurrent sessions
13 --source include/count_sessions.inc
16 --echo # Establish connection con1 (user=root)
17 connect (con1,localhost,root,,);
18 --echo # Establish connection con2 (user=root)
19 connect (con2,localhost,root,,);
21 # FLUSH TABLES WITH READ LOCK should block writes to binlog too
22 --echo # Switch to connection con1
24 CREATE TABLE t1 (a INT) ENGINE=innodb;
28 --echo # Switch to connection con2
30 FLUSH TABLES WITH READ LOCK;
31 --source include/show_binlog_events.inc
32 --echo # Switch to connection con1
35 --echo # Switch to connection con2
38 --source include/show_binlog_events.inc
40 --echo # Switch to connection con1
46 --echo # Switch to connection default and close connections con1 and con2
51 # Wait till all disconnects are completed
52 --source include/wait_until_count_sessions.inc