Commit ce1c957a authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent add782a1
......@@ -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
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment