summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-19 19:55:49 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-21 10:03:16 +0200
commite4f70789d5bae1d3692800f55a46905517a6119b (patch)
tree4e5b99b9921a0907fbded9a73524b6733f151c14
parent398d33ce9d937386e2762a91d10bbc12217878db (diff)
downloadmariadb-git-e4f70789d5bae1d3692800f55a46905517a6119b.tar.gz
fix sporadic innodb.auto_increment_dup failures
fix a race condition in the test
-rw-r--r--mysql-test/suite/innodb/r/auto_increment_dup.result6
-rw-r--r--mysql-test/suite/innodb/t/auto_increment_dup.test8
2 files changed, 9 insertions, 5 deletions
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result
index bb4ee9bc0e7..fa0921b57a5 100644
--- a/mysql-test/suite/innodb/r/auto_increment_dup.result
+++ b/mysql-test/suite/innodb/r/auto_increment_dup.result
@@ -81,18 +81,20 @@ affected rows: 0
#
connect con1, localhost, root;
connect con2, localhost, root;
+SET DEBUG_SYNC='now WAIT_FOR write_row_done';
connection con1;
#
# Connection 1
#
-SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'ha_write_row_end WAIT_FOR continue', 'RESET');
+SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue';
affected rows: 0
INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
connection con2;
#
# Connection 2
#
-SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'execute_command_after_close_tables SIGNAL continue', 'RESET');
+affected rows: 0
+SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
affected rows: 0
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test
index 558fed21ae5..45e4559a038 100644
--- a/mysql-test/suite/innodb/t/auto_increment_dup.test
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.test
@@ -77,18 +77,20 @@ CREATE TABLE t1(
--connect(con1, localhost, root)
--connect(con2, localhost, root)
+--send SET DEBUG_SYNC='now WAIT_FOR write_row_done'
--connection con1
--echo #
--echo # Connection 1
--echo #
-SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'ha_write_row_end WAIT_FOR continue', 'RESET');
+SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue';
--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
--connection con2
--echo #
--echo # Connection 2
--echo #
-SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'execute_command_after_close_tables SIGNAL continue', 'RESET');
---error 1205
+--reap
+SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
+--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
--connection con1