~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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# TODO: Only run this if we have privilege to do flush table

#
# Test of flush table
#

--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (a int not null auto_increment primary key);
insert into t1 values(0);

# Test for with read lock + flush

lock table t1 read;
flush table t1;
check table t1;
unlock tables;

# Test for with 2 read lock in different thread + flush

lock table t1 read;
connect (locker,localhost,root,,test);
connection locker;
lock table t1 read;
connection default;
send flush table t1;
connection locker;
--sleep 2
select * from t1;
unlock tables;
connection default;
reap;
select * from t1;
unlock tables;

# Test for with a write lock and a waiting read lock + flush

lock table t1 write;
connection locker;
send lock table t1 read;
connection default;
sleep 2;
flush table t1;
select * from t1;
unlock tables;
connection locker;
reap;
unlock tables;
connection default;

# Test for with a read lock and a waiting write lock + flush

lock table t1 read;
connection locker;
send lock table t1 write;
connection default;
sleep 2;
flush table t1;
select * from t1;
unlock tables;
connection locker;
reap;
unlock tables;
select * from t1;
connection default;
drop table t1;
disconnect locker;

#
# Bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client
#
FLUSH TABLES WITH READ LOCK ;
FLUSH TABLES WITH READ LOCK ;
UNLOCK TABLES;

# End of 4.1 tests