~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
--disable_warnings
2
drop table if exists t1,t2;
3
--enable_warnings
4
5
connect (locker,localhost,root,,);
6
connect (reader,localhost,root,,);
7
connect (writer,localhost,root,,);
8
9
#
10
# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
11
#
12
connect (con1,localhost,root,,);
13
connect (con2,localhost,root,,);
14
#
15
connection con1;
16
CREATE DATABASE mysqltest_1;
17
FLUSH TABLES WITH READ LOCK;
18
#
19
# With bug in place: acquire LOCK_mysql_create_table and
20
# wait in wait_if_global_read_lock().
21
connection con2;
22
send DROP DATABASE mysqltest_1;
23
#
24
# With bug in place: try to acquire LOCK_mysql_create_table...
25
# When fixed: Reject dropping db because of the read lock.
26
connection con1;
27
let $wait_condition=
1273.13.35 by Brian Aker
Remove processlist from old I_S.
28
  select count(*) = 1 from data_dictionary.processlist
1 by brian
clean slate
29
  where state = "Waiting for release of readlock"
30
  and info = "DROP DATABASE mysqltest_1";
31
--source include/wait_condition.inc
32
--error ER_CANT_UPDATE_WITH_READLOCK
33
DROP DATABASE mysqltest_1;
34
UNLOCK TABLES;
35
#
36
connection con2;
37
reap;
38
#
39
connection default;
40
disconnect con1;
41
disconnect con2;
42
# This must have been dropped by connection 2 already,
43
# which waited until the global read lock was released.
44
--error ER_DB_DROP_EXISTS
45
DROP DATABASE mysqltest_1;
46
47
--echo End of 5.1 tests