mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / flush_block_commit_notembedded.test
blobb774d7ec069785a85908c64f7a6a433dfd2f3e9e
1 # Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
2 # transactions.
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
23 connection con1;
24 CREATE TABLE t1 (a INT) ENGINE=innodb;
25 RESET MASTER;
26 SET AUTOCOMMIT=0;
27 INSERT t1 VALUES (1);
28 --echo # Switch to connection con2
29 connection con2;
30 FLUSH TABLES WITH READ LOCK;
31 --source include/show_binlog_events.inc
32 --echo # Switch to connection con1
33 connection con1;
34 send COMMIT;
35 --echo # Switch to connection con2
36 connection con2;
37 sleep 1;
38 --source include/show_binlog_events.inc
39 UNLOCK TABLES;
40 --echo # Switch to connection con1
41 connection con1;
42 reap;
43 DROP TABLE t1;
44 SET AUTOCOMMIT=1;
46 --echo # Switch to connection default and close connections con1 and con2
47 connection default;
48 disconnect con1;
49 disconnect con2;
51 # Wait till all disconnects are completed
52 --source include/wait_until_count_sessions.inc