1 # TODO: Only run this if we have privilege to do flush table
7 # Should work in embedded server after mysqltest is fixed
8 -- source include/not_embedded.inc
10 drop table if exists t1,t2;
12 create table t1 (a int not null auto_increment primary key);
13 insert into t1 values(0);
15 # Test for with read lock + flush
22 # Test for with 2 read lock in different thread + flush
25 connect (locker,localhost,root,,test);
39 # Test for with a write lock and a waiting read lock + flush
43 send lock table t1 read;
54 # Test for with a read lock and a waiting write lock + flush
58 send lock table t1 write;
73 # In the following test FLUSH TABLES produces a deadlock
74 # (hang forever) if the fix for BUG #3565 is missing.
75 # And it shows that handler tables are re-opened after flush (BUG #4286).
77 create table t1(table_id char(20) primary key);
78 create table t2(table_id char(20) primary key);
79 insert into t1 values ('test.t1');
80 insert into t1 values ('');
81 insert into t2 values ('test.t2');
82 insert into t2 values ('');
83 handler t1 open as a1;
84 handler t1 open as a2;
86 handler a1 read first limit 9;
87 handler a2 read first limit 9;
88 handler t2 read first limit 9;
90 handler a1 read first limit 9;
91 handler a2 read first limit 9;
92 handler t2 read first limit 9;
95 handler t1 open as a1;
97 handler t1 open as a2;
100 handler a1 read first limit 9;
101 handler a2 read first limit 9;
102 handler t2 read first limit 9;
104 handler a1 read first limit 9;
105 handler a2 read first limit 9;
106 handler t2 read first limit 9;
113 # The fix for BUG #4286 cannot restore the position after a flush.
115 create table t1(table_id char(20) primary key);
116 insert into t1 values ('Record-01');
117 insert into t1 values ('Record-02');
118 insert into t1 values ('Record-03');
119 insert into t1 values ('Record-04');
120 insert into t1 values ('Record-05');
122 handler t1 read first limit 1;
123 handler t1 read next limit 1;
124 handler t1 read next limit 1;
126 handler t1 read next limit 1;
127 handler t1 read next limit 1;
132 # Bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client
134 FLUSH TABLES WITH READ LOCK ;
135 FLUSH TABLES WITH READ LOCK ;