| 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) |
| 7 |
# connection action |
| 8 |
# default: CREATE TABLE t1 ENGINE = CSV 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) |
| 13 |
# connection action |
| 14 |
# default: CREATE TABLE t1 ENGINE = CSV 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) |
| 19 |
# connection action |
| 20 |
# default: CREATE TABLE t1 ENGINE = CSV 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) |
| 25 |
# connection action |
| 26 |
# default: CREATE TABLE t1 ENGINE = CSV 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) |
| 31 |
# connection action |
| 32 |
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV |
| 33 |
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV (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) |
| 37 |
# connection action |
| 38 |
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV |
| 39 |
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV (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) |
| 43 |
# connection action |
| 44 |
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV |
| 45 |
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV (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) |
| 49 |
# connection action |
| 50 |
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV |
| 51 |
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV (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 |
DEALLOCATE PREPARE stmt_start; |
| 55 |
DEALLOCATE PREPARE stmt_break; |