Skip to content

Commit

Permalink
Make mysql.innodb_mysql_lock deterministic
Browse files Browse the repository at this point in the history
MDEV-7861 main.innodb_mysql_lock fails sporadically in buildbot
  • Loading branch information
montywi committed Mar 26, 2020
1 parent caf110f commit 0fb8421
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions mysql-test/main/innodb_mysql_lock.result
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ connection con3;
set @@autocommit=0;
DROP TABLE t1;
connection con1;
# Waiting for until transaction will be locked inside innodb subsystem
# Connection 1 is now holding the lock.
# Issuing insert from connection 1 while connection 2&3
# is waiting for the lock should give a deadlock error.
Expand Down
9 changes: 6 additions & 3 deletions mysql-test/main/innodb_mysql_lock.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--source include/have_metadata_lock_info.inc
-- source include/have_innodb.inc

# Save the initial number of concurrent sessions.
Expand Down Expand Up @@ -36,10 +37,12 @@ set @@autocommit=0;
--send DROP TABLE t1

connection con1;
--echo # Waiting for until transaction will be locked inside innodb subsystem
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE info = "INSERT INTO t1 VALUES (1)" and
state = "update";
SELECT COUNT(*) = 1 FROM information_schema.innodb_trx
WHERE trx_query = 'INSERT INTO t1 VALUES (1)' AND
trx_operation_state = 'inserting' AND
trx_state = 'LOCK WAIT';
--source include/wait_condition.inc
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
Expand Down

0 comments on commit 0fb8421

Please sign in to comment.