summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/timeout.test
blob: 9f6e692b148fb3d63e266975ce1ccf6dc662cf62 (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
--echo #
--echo # MDEV-11379 - AliSQL: [Feature] Issue#8: SELECT FOR UPDATE WAIT
--echo # MDEV-11388 - AliSQL: [Feature] Issue#15 DDL FAST FAIL
--echo #
CREATE TABLE t1(a INT, b TEXT, c MULTIPOLYGON NOT NULL);
CREATE INDEX i1 ON t1(a) WAIT 1;
CREATE FULLTEXT INDEX i2 ON t1(b) WAIT 1;
CREATE SPATIAL INDEX i3 ON t1(c) WAIT 1;
ALTER TABLE t1 WAIT 1 COMMENT='test';
OPTIMIZE TABLE t1 WAIT 1;
DROP INDEX i1 ON t1 WAIT 1;
TRUNCATE TABLE t1 WAIT 1;
RENAME TABLE t1 WAIT 1 TO t2;
RENAME TABLE t2 NOWAIT TO t1;

connect(con1, localhost, root,,);
LOCK TABLE t1 WRITE WAIT 31536001;

connection default;
--error ER_LOCK_WAIT_TIMEOUT
CREATE INDEX i1 ON t1(a) WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
CREATE INDEX i1 ON t1(a) NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
CREATE FULLTEXT INDEX i2 ON t1(b) WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
CREATE FULLTEXT INDEX i2 ON t1(b) NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
CREATE SPATIAL INDEX i3 ON t1(c) WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
CREATE SPATIAL INDEX i3 ON t1(c) NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 WAIT 0 COMMENT='test';
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 NOWAIT COMMENT='test';
OPTIMIZE TABLE t1 WAIT 0;
OPTIMIZE TABLE t1 NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
DROP INDEX i1 ON t1 WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
DROP INDEX i1 ON t1 NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
TRUNCATE TABLE t1 WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
TRUNCATE TABLE t1 NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
RENAME TABLE t1 WAIT 0 TO t2;
--error ER_LOCK_WAIT_TIMEOUT
RENAME TABLE t1 NOWAIT TO t2;
--error ER_LOCK_WAIT_TIMEOUT
DROP TABLE t1 WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
DROP TABLE t1 NOWAIT;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLE t1 WRITE WAIT 0;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLE t1 WRITE NOWAIT;

disconnect con1;
DROP TABLE t1 WAIT 1;