summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_innodb_semi_consistent.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/partition_innodb_semi_consistent.test')
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent.test12
1 files changed, 11 insertions, 1 deletions
diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test
index 2711d79f194..9d3e2570256 100644
--- a/mysql-test/t/partition_innodb_semi_consistent.test
+++ b/mysql-test/t/partition_innodb_semi_consistent.test
@@ -117,7 +117,17 @@ INSERT INTO t1 VALUES (1,'init');
DELIMITER |;
CREATE PROCEDURE p1()
BEGIN
- UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ # 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|
DELIMITER ;|