mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 23:03:28 +03:00
MBug#687320: Fix sporadic test failures in innodb_mysql.test and partition_innodb_semi_consistent.test
Problem is that these tests run with --innodb-lock-wait-timeout=2 in .opt (and this is necessary as built-in innodb does not allow to change this dynamically). This cases another part of the test to occasionally time out an UPDATE, which subsequently caused the test case to timeout due to waiting for a condition (successful UPDATE) that never occurs. Fixed by re-trying the update in case of timeout. Tested by inserting a sleep() in the connection that the UPDATE is waiting for, and checking that the retry loops a couple of times until the other connection is done and COMMITs.
This commit is contained in:
@ -1594,7 +1594,17 @@ TRUNCATE t1;
|
||||
INSERT INTO t1 VALUES (1,'init');
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
# retry the UPDATE in case it times out the lock before con1 has time
|
||||
# to COMMIT.
|
||||
DECLARE do_retry INT DEFAULT 0;
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
|
||||
retry_loop:LOOP
|
||||
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
|
||||
IF do_retry = 0 THEN
|
||||
LEAVE retry_loop;
|
||||
END IF;
|
||||
SET do_retry = 0;
|
||||
END LOOP;
|
||||
INSERT INTO t2 VALUES ();
|
||||
END|
|
||||
BEGIN;
|
||||
|
Reference in New Issue
Block a user