Skip to content

Commit 8a6bb95

Browse files
committed
MDEV-37862 - innodb.gap_locks test failure: 0 lock structs, 0 row locks
Test was affected by incompletely closed preceding connections. Make test agnostic to concurrent connections by querying InnoDB status only for connections that it uses. This is an addition to 3b2169f, which didn't handle a case when preceding test has active transaction on disconnect.
1 parent 7fed014 commit 8a6bb95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mysql-test/suite/innodb/t/gap_locks.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ INSERT INTO t1 VALUES (1,'1',1),(2,'2',1);
66

77
SET @save_locks= @@GLOBAL.innodb_status_output_locks;
88
SET GLOBAL INNODB_STATUS_OUTPUT_LOCKS = 'ON';
9+
let $default_id= `select connection_id()`;
10+
let $reg= /.*---TRANSACTION \d+, ACTIVE.*?(\d+ lock struct...), heap size \d+(, \d+ row lock...).*?\nMariaDB thread id $default_id,.*/\1\2/;
911

1012
let $isolation= 4;
1113
while ($isolation) {
@@ -34,7 +36,7 @@ DELETE FROM t1 WHERE b='2' AND c=2;
3436
# not of any inactive ones. Note the use of non-greedy match ".*?", so that
3537
# we get the values for the ACTIVE transaction, not the last values in the
3638
# list.
37-
--replace_regex /.*---TRANSACTION \d+, ACTIVE.*?(\d+ lock struct...), heap size \d+(, \d+ row lock...).*/\1\2/
39+
--replace_regex $reg
3840
SHOW ENGINE INNODB STATUS;
3941
ROLLBACK;
4042

0 commit comments

Comments
 (0)