1
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
2
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
3
SET @runtime = <intended_runtime>;
4
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
5
DROP TABLE IF EXISTS t1;
6
# Subtest 2A (one connection, no PREPARE/EXECUTE)
8
# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
9
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
10
# default: DROP TABLE t1
11
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
12
# Subtest 2B (one connection, use PREPARE/EXECUTE)
14
# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
15
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
16
# default: DROP TABLE t1
17
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
18
# Subtest 2C (two connections, no PREPARE/EXECUTE)
20
# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
21
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
22
# default: DROP TABLE t1
23
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
24
# Subtest 2D (two connections, use PREPARE/EXECUTE)
26
# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
27
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
28
# default: DROP TABLE t1
29
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
30
# Subtest 3A (one connection, no PREPARE/EXECUTE)
32
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE
33
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
34
# default: DROP TABLE t1
35
# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
36
# Subtest 3B (one connection, use PREPARE/EXECUTE)
38
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE
39
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
40
# default: DROP TABLE t1
41
# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
42
# Subtest 3C (two connections, no PREPARE/EXECUTE)
44
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE
45
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
46
# default: DROP TABLE t1
47
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
48
# Subtest 3D (two connections, use PREPARE/EXECUTE)
50
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE
51
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
52
# default: DROP TABLE t1
53
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
54
# Subtest 5A (one connection, no PREPARE/EXECUTE)
56
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
57
# default: INSERT INTO t1 SET f2 = 9
58
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
59
# default: DROP TABLE t1
60
# Subtest 5B (one connection, use PREPARE/EXECUTE)
62
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
63
# default: INSERT INTO t1 SET f2 = 9
64
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
65
# default: DROP TABLE t1
66
# Subtest 5C (two connections, no PREPARE/EXECUTE)
68
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
69
# con2: INSERT INTO t1 SET f2 = 9
70
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
72
# Subtest 5D (two connections, use PREPARE/EXECUTE)
74
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
75
# con2: INSERT INTO t1 SET f2 = 9
76
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
78
DEALLOCATE PREPARE stmt_start;
79
DEALLOCATE PREPARE stmt_break;