~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/t/flush_table.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# TODO: Only run this if we have privilege to do flush table
 
2
 
 
3
#
 
4
# Test of flush table
 
5
#
 
6
 
 
7
# Should work in embedded server after mysqltest is fixed
 
8
-- source include/not_embedded.inc
 
9
--disable_warnings
 
10
drop table if exists t1,t2;
 
11
--enable_warnings
 
12
create table t1 (a int not null auto_increment primary key);
 
13
insert into t1 values(0);
 
14
 
 
15
# Test for with read lock + flush
 
16
 
 
17
lock table t1 read;
 
18
flush table t1;
 
19
check table t1;
 
20
unlock tables;
 
21
 
 
22
# Test for with 2 read lock in different thread + flush
 
23
 
 
24
lock table t1 read;
 
25
connect (locker,localhost,root,,test);
 
26
connection locker;
 
27
lock table t1 read;
 
28
connection default;
 
29
send flush table t1;
 
30
connection locker;
 
31
--sleep 2
 
32
select * from t1;
 
33
unlock tables;
 
34
connection default;
 
35
reap;
 
36
select * from t1;
 
37
unlock tables;
 
38
 
 
39
# Test for with a write lock and a waiting read lock + flush
 
40
 
 
41
lock table t1 write;
 
42
connection locker;
 
43
send lock table t1 read;
 
44
connection default;
 
45
sleep 2;
 
46
flush table t1;
 
47
select * from t1;
 
48
unlock tables;
 
49
connection locker;
 
50
reap;
 
51
unlock tables;
 
52
connection default;
 
53
 
 
54
# Test for with a read lock and a waiting write lock + flush
 
55
 
 
56
lock table t1 read;
 
57
connection locker;
 
58
send lock table t1 write;
 
59
connection default;
 
60
sleep 2;
 
61
flush table t1;
 
62
select * from t1;
 
63
unlock tables;
 
64
connection locker;
 
65
reap;
 
66
unlock tables;
 
67
select * from t1;
 
68
connection default;
 
69
drop table t1;
 
70
disconnect locker;
 
71
 
 
72
#
 
73
# Bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client
 
74
#
 
75
FLUSH TABLES WITH READ LOCK ;
 
76
FLUSH TABLES WITH READ LOCK ;
 
77
UNLOCK TABLES;
 
78
 
 
79
# End of 4.1 tests