mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
b9381f1041
Added new tests and corrected existing tests
216 lines
10 KiB
Text
216 lines
10 KiB
Text
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
|
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
|
|
SET @runtime = <intended_runtime>;
|
|
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
|
|
DROP TABLE IF EXISTS t1;
|
|
# Subtest 1A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
|
|
ENGINE = NDB
|
|
# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
|
|
# default: DROP TABLE t1
|
|
# Subtest 1B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
|
|
ENGINE = NDB
|
|
# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
|
|
# default: DROP TABLE t1
|
|
# Subtest 1C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
|
|
ENGINE = NDB
|
|
# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
|
|
# con2: DROP TABLE t1
|
|
# Subtest 1D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
|
|
ENGINE = NDB
|
|
# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
|
|
# con2: DROP TABLE t1
|
|
# Subtest 2A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
|
|
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
|
|
# default: DROP TABLE t1
|
|
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
|
|
# Subtest 2B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
|
|
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
|
|
# default: DROP TABLE t1
|
|
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
|
|
# Subtest 2C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
|
|
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
|
|
# default: DROP TABLE t1
|
|
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
|
|
# Subtest 2D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
|
|
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
|
|
# default: DROP TABLE t1
|
|
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
|
|
# Subtest 3A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
|
|
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
|
|
# default: DROP TABLE t1
|
|
# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
|
|
# Subtest 3B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
|
|
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
|
|
# default: DROP TABLE t1
|
|
# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
|
|
# Subtest 3C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
|
|
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
|
|
# default: DROP TABLE t1
|
|
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
|
|
# Subtest 3D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
|
|
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
|
|
# default: DROP TABLE t1
|
|
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
|
|
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB;
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB;
|
|
DROP TABLE t1;
|
|
# Subtest 4A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
|
|
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# Subtest 4B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
|
|
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# Subtest 4C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
|
|
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# Subtest 4D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
|
|
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP TABLE t1
|
|
# Subtest 5A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
|
|
# default: INSERT INTO t1 SET f2 = 9
|
|
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
|
|
# default: DROP TABLE t1
|
|
# Subtest 5B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
|
|
# default: INSERT INTO t1 SET f2 = 9
|
|
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
|
|
# default: DROP TABLE t1
|
|
# Subtest 5C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
|
|
# con2: INSERT INTO t1 SET f2 = 9
|
|
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
|
|
# con2: DROP TABLE t1
|
|
# Subtest 5D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
|
|
# con2: INSERT INTO t1 SET f2 = 9
|
|
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
|
|
# con2: DROP TABLE t1
|
|
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
|
|
# Subtest 6A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
|
|
# default: DROP INDEX IDX1 ON t1
|
|
# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# default: DROP INDEX IDX1 ON t1
|
|
# Subtest 6B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
|
|
# default: DROP INDEX IDX1 ON t1
|
|
# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# default: DROP INDEX IDX1 ON t1
|
|
# Subtest 6C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
|
|
# default: DROP INDEX IDX1 ON t1
|
|
# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# con2: DROP INDEX IDX1 ON t1
|
|
# Subtest 6D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
|
|
# default: DROP INDEX IDX1 ON t1
|
|
# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
|
|
# default: CREATE INDEX IDX1 ON t1 (f2)
|
|
# con2: DROP INDEX IDX1 ON t1
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
|
|
INSERT INTO t1 VALUES(1,1);
|
|
CREATE INDEX IDX ON t1 (f2);
|
|
DROP INDEX IDX ON t1;
|
|
CREATE UNIQUE INDEX IDX ON t1 (f2);
|
|
DROP INDEX IDX ON t1;
|
|
# Subtest 8A (one connection, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX ON t1 (f2)
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# Subtest 8B (one connection, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX ON t1 (f2)
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
|
|
# default: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# Subtest 8C (two connections, no PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX ON t1 (f2)
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# Subtest 8D (two connections, use PREPARE/EXECUTE)
|
|
# connection action
|
|
# default: CREATE INDEX IDX ON t1 (f2)
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
|
|
# con2: SHOW CREATE TABLE t1
|
|
# default: DROP INDEX IDX ON t1
|
|
DROP TABLE t1;
|
|
DEALLOCATE PREPARE stmt_start;
|
|
DEALLOCATE PREPARE stmt_break;
|