1 connect (con1,localhost,root,,);
2 connect (con2,localhost,root,,);
6 drop table if exists t1,t2;
7 drop database if exists mysqltest;
10 create temporary table t1(n int not null primary key);
11 create table t2(n int);
12 insert into t2 values(3);
18 send replace into t1 select n from t2;
31 flush tables with read lock;
41 #test if drop database will wait until we release the global read lock
43 create database mysqltest;
44 create table mysqltest.t1(n int);
45 insert into mysqltest.t1 values (23);
46 flush tables with read lock;
48 send drop database mysqltest;
50 select * from mysqltest.t1;
55 # test if dirty close releases global read lock
57 create table t1 (n int);
58 flush tables with read lock;
61 insert into t1 values (345);
66 # Bug#9459 - deadlock with flush with lock, and lock table write
68 create table t1 (c1 int);
70 # Cannot get the global read lock with write locked tables.
72 flush tables with read lock;
74 # Can get the global read lock with read locked tables.
75 flush tables with read lock;
81 # Release all table locks and the global read lock.
83 create table t2 (c1 int);
84 create table t3 (c1 int);
85 lock table t1 read, t2 read, t3 write;
86 # Cannot get the global read lock with write locked tables.
88 flush tables with read lock;
89 lock table t1 read, t2 read, t3 read;
90 # Can get the global read lock with read locked tables.
91 flush tables with read lock;
92 # Release all table locks and the global read lock.
94 drop table t1, t2, t3;
99 # Test of deadlock problem when doing FLUSH TABLE with read lock
100 # (Bug was in NTPL threads in Linux when using different mutex while
101 # waiting for a condtion variable)
103 create table t1 (c1 int);
104 create table t2 (c1 int);
106 connect (con1,localhost,root,,);
107 connect (con3,localhost,root,,);
113 send flush tables with read lock;
117 send insert into t2 values(1);
129 # It hangs here (insert into t2 does not end).
137 # Bug#32528 Global read lock with a low priority write lock causes a server crash
141 drop table if exists t1, t2;
144 set session low_priority_updates=1;
146 create table t1 (a int);
147 create table t2 (b int);
149 lock tables t1 write;
150 --error ER_LOCK_OR_ACTIVE_TRANSACTION
151 flush tables with read lock;
154 lock tables t1 read, t2 write;
155 --error ER_LOCK_OR_ACTIVE_TRANSACTION
156 flush tables with read lock;
160 flush tables with read lock;
165 set session low_priority_updates=default;
168 # Bug #33334 mysqltest_embedded crashes when disconnecting before reap
171 connect (con1,localhost,root,,);
172 send select benchmark(200, (select sin(1))) > 1000;
174 --source include/wait_until_disconnected.inc
177 --echo End of 5.0 tests
180 # Bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
182 set @old_general_log= @@general_log;
183 set @old_read_only= @@read_only;
184 set global general_log= on;
186 flush tables with read lock;
190 set global read_only=1;
194 flush tables with read lock;
198 set global general_log= @old_general_log;
199 set global read_only= @old_read_only;
201 --echo End of 5.1 tests