summaryrefslogtreecommitdiff
path: root/mysql-test/t/schema.test
blob: a380a6241dd9cb607bcff48dcbc4172e15e305ca (plain)
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
#
# Just a couple of tests to make sure that schema works.
#
# Drop mysqltest1 database, as it can left from the previous tests.
#

# Save the initial number of concurrent sessions.
--source include/count_sessions.inc

--disable_warnings
drop database if exists mysqltest1;
--enable_warnings

create schema foo;
show create schema foo;
show schemas;
drop schema foo;


--echo #
--echo # Bug #48940 MDL deadlocks against mysql_rm_db
--echo #

--disable_warnings
DROP SCHEMA IF EXISTS schema1;
--enable_warnings

connect(con2, localhost, root);

--echo # Connection default
connection default;

CREATE SCHEMA schema1;
CREATE TABLE schema1.t1 (a INT);

SET autocommit= FALSE;
INSERT INTO schema1.t1 VALUES (1);

--echo # Connection 2
connection con2;
--send DROP SCHEMA schema1

--echo # Connection default
connection default;
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
                     WHERE state= 'Waiting for table' 
                     AND info='DROP SCHEMA schema1';
--source include/wait_condition.inc
--error 1
ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8;
SET autocommit= TRUE;

--echo # Connection 2
connection con2;
--reap

--echo # Connection default
connection default;
disconnect con2;


# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc