~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/t/flush.test

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
connect (con1,localhost,root,,);
 
2
connect (con2,localhost,root,,);
 
3
connection con1;
 
4
 
 
5
--disable_warnings
 
6
drop table if exists t1,t2;
 
7
drop database if exists mysqltest;
 
8
--enable_warnings
 
9
 
 
10
create temporary table t1(n int not null primary key);
 
11
create table t2(n int);
 
12
insert into t2 values(3);
 
13
let $1=100;
 
14
disable_query_log;
 
15
while ($1)
 
16
{
 
17
 connection con1;
 
18
 send replace into t1 select n from t2;
 
19
 connection con2;
 
20
 send flush tables;
 
21
 connection con1;
 
22
 reap;
 
23
 connection con2;
 
24
 reap;
 
25
 dec $1;
 
26
}
 
27
enable_query_log;
 
28
connection con1;
 
29
select * from t1;
 
30
connection con2;
 
31
flush tables with read lock;
 
32
--error 1223
 
33
drop table t2;
 
34
connection con1;
 
35
send drop table t2;
 
36
connection con2;
 
37
unlock tables;
 
38
connection con1;
 
39
reap;
 
40
 
 
41
#test if drop database will wait until we release the global read lock
 
42
connection con1;
 
43
create database mysqltest;
 
44
create table mysqltest.t1(n int);
 
45
insert into mysqltest.t1 values (23);
 
46
flush tables with read lock;
 
47
connection con2;
 
48
send drop database mysqltest;
 
49
connection con1;
 
50
select * from mysqltest.t1;
 
51
unlock tables;
 
52
connection con2;
 
53
reap;
 
54
 
 
55
## test if dirty close releases global read lock
 
56
#connection con1;
 
57
#create table t1 (n int);
 
58
#flush tables with read lock;
 
59
#dirty_close con1;
 
60
#connection con2;
 
61
#insert into t1 values (345);
 
62
#select * from t1;
 
63
#drop table t1;
 
64
 
 
65
# End of 4.1 tests
 
66
 
 
67
#
 
68
# Test of deadlock problem when doing FLUSH TABLE with read lock
 
69
# (Bug was in NTPL threads in Linux when using different mutex while
 
70
#  waiting for a condtion variable)
 
71
 
 
72
create table t1 (c1 int);
 
73
create table t2 (c1 int);
 
74
 
 
75
connect (con3,localhost,root,,);
 
76
 
 
77
connection con1;
 
78
 
 
79
connection con2;
 
80
send flush tables with read lock;
 
81
 
 
82
connection con3;
 
83
send insert into t2 values(1);
 
84
 
 
85
connection con1;
 
86
unlock tables;
 
87
disconnect con1;
 
88
 
 
89
connection con2;
 
90
reap;
 
91
disconnect con2;
 
92
 
 
93
connection con3;
 
94
# It hangs here (insert into t2 does not end).
 
95
reap;
 
96
disconnect con3;
 
97
 
 
98
connection default;
 
99
drop table t1, t2;
 
100
 
 
101
#
 
102
# Bug #33334 mysqltest_embedded crashes when disconnecting before reap
 
103
#
 
104
 
 
105
connect (con1,localhost,root,,);
 
106
send select benchmark(200, (select sin(1))) > 1000;
 
107
disconnect con1;
 
108
connection default;
 
109
 
 
110
--echo End of 5.0 tests
 
111