~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
# Bug #2397 RENAME TABLES is not blocked by
# FLUSH TABLES WITH READ LOCK
#

connect (con1,localhost,root,,);
connect (con2,localhost,root,,);

connection con1;
CREATE TABLE t1 (a int);
CREATE TABLE t3 (a int);
connection con2;
FLUSH TABLES WITH READ LOCK;
connection con1;
send RENAME TABLE t1 TO t2, t3 to t4;
connection con2;
show tables;
UNLOCK TABLES;
connection con1;
reap;
connection con2;

# Wait for the the tables to be renamed
# i.e the query below succeds
let $query= select * from t2, t4;
source include/wait_for_query_to_suceed.inc;

show tables;

drop table t2, t4;

disconnect con2;
disconnect con1;
connection default;