1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Speed up the test innodb.lock_insert_into_empty

Let us use innodb_lock_wait_timeout=0 for an immediate timeout.
Also, do not override the timeout in the default connection,
so that further tests will use the default setting.
This commit is contained in:
Marko Mäkelä
2021-07-01 10:04:47 +03:00
parent add782a13e
commit ce1c957ab1
2 changed files with 16 additions and 10 deletions

View File

@@ -5,17 +5,20 @@ BEGIN;
DELETE FROM t1;
INSERT INTO t2 VALUES(1),(1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
connect con1,localhost,root,,;
BEGIN;
SELECT * FROM t2 LOCK IN SHARE MODE;
a
connection default;
SET innodb_lock_wait_timeout=1;
connect con1,localhost,root,,;
SET innodb_lock_wait_timeout=0;
INSERT INTO t2 VALUES(2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1;
connection default;
ROLLBACK;
connection con1;
INSERT INTO t2 VALUES(3);
COMMIT;
disconnect con1;
connection default;
SELECT * FROM t1;
a
SELECT * FROM t2;
@@ -45,7 +48,7 @@ INSERT INTO t1 SET k=1;
START TRANSACTION;
INSERT INTO t1 SET k=2;
connect con1,localhost,root,,test;
SET innodb_lock_wait_timeout= 1;
SET innodb_lock_wait_timeout=0;
CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
AS SELECT k FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction

View File

@@ -9,17 +9,20 @@ DELETE FROM t1;
--error ER_DUP_ENTRY
INSERT INTO t2 VALUES(1),(1);
connect (con1,localhost,root,,);
BEGIN;
SELECT * FROM t2 LOCK IN SHARE MODE;
connection default;
SET innodb_lock_wait_timeout=1;
connect (con1,localhost,root,,);
SET innodb_lock_wait_timeout=0;
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t2 VALUES(2);
disconnect con1;
connection default;
ROLLBACK;
connection con1;
INSERT INTO t2 VALUES(3);
COMMIT;
disconnect con1;
connection default;
SELECT * FROM t1;
SELECT * FROM t2;
@@ -50,7 +53,7 @@ START TRANSACTION;
INSERT INTO t1 SET k=2;
--connect (con1,localhost,root,,test)
SET innodb_lock_wait_timeout= 1;
SET innodb_lock_wait_timeout=0;
--error ER_LOCK_WAIT_TIMEOUT
CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
AS SELECT k FROM t1;