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
# And it requires InnoDB
7
-- source include/have_innodb.inc
9
connect (con1,localhost,root,,);
10
connect (con2,localhost,root,,);
11
connect (con3,localhost,root,,);
15
drop table if exists t1;
17
create table t1 (a int) engine=innodb;
22
insert into t1 values(1);
24
flush tables with read lock;
27
send commit; # blocked by con2
30
select * from t1; # verify con1 was blocked and data did not move
39
select * from t1 for update;
42
send select * from t1 for update; # blocked by con1
45
send flush tables with read lock; # blocked by con2
47
commit; # should not be blocked by con3
54
# BUG#6732 FLUSH TABLES WITH READ LOCK + COMMIT hangs later FLUSH TABLES
58
commit; # unlock InnoDB row locks to allow insertions
61
insert into t1 values(10);
62
flush tables with read lock;
66
flush tables with read lock; # bug caused hang here
69
# BUG#7358 SHOW CREATE DATABASE fails if open transaction
73
show create database test;