From 8a6bb954f7643c63b379dc6bb014f1d987f3aa66 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 6 Jan 2026 14:20:30 +0400 Subject: [PATCH] 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 3b2169f0d1e, which didn't handle a case when preceding test has active transaction on disconnect. --- mysql-test/suite/innodb/t/gap_locks.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/t/gap_locks.test b/mysql-test/suite/innodb/t/gap_locks.test index e0af735ef67ce..6291e3f2b3dc2 100644 --- a/mysql-test/suite/innodb/t/gap_locks.test +++ b/mysql-test/suite/innodb/t/gap_locks.test @@ -6,6 +6,8 @@ INSERT INTO t1 VALUES (1,'1',1),(2,'2',1); SET @save_locks= @@GLOBAL.innodb_status_output_locks; SET GLOBAL INNODB_STATUS_OUTPUT_LOCKS = 'ON'; +let $default_id= `select connection_id()`; +let $reg= /.*---TRANSACTION \d+, ACTIVE.*?(\d+ lock struct...), heap size \d+(, \d+ row lock...).*?\nMariaDB thread id $default_id,.*/\1\2/; let $isolation= 4; while ($isolation) { @@ -34,7 +36,7 @@ DELETE FROM t1 WHERE b='2' AND c=2; # not of any inactive ones. Note the use of non-greedy match ".*?", so that # we get the values for the ACTIVE transaction, not the last values in the # list. ---replace_regex /.*---TRANSACTION \d+, ACTIVE.*?(\d+ lock struct...), heap size \d+(, \d+ row lock...).*/\1\2/ +--replace_regex $reg SHOW ENGINE INNODB STATUS; ROLLBACK;