Skip to content

Commit da5cffe

Browse files
committed
Fix sporadic test failure of main.debug_sync
The test case was not waiting for a prior --send to have proceeded far enough before attempting to KILL it. This meant the KILL could get lost if timing delayed the connection in --send. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
1 parent 00d3dc9 commit da5cffe

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mysql-test/main/debug_sync.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,15 @@ SET DEBUG_SYNC= 'RESET';
325325
#
326326
create table t (c int) engine=innodb;
327327
connect con1,localhost,root;
328-
set debug_sync='get_schema_column WAIT_FOR go';
328+
set debug_sync='get_schema_column SIGNAL waiting WAIT_FOR go';
329329
select column_name from information_schema.columns
330330
where table_schema='test' and table_name='t';
331331
connection default;
332+
set debug_sync= 'now WAIT_FOR waiting';
332333
lock table t write;
333334
alter table t discard tablespace;
334335
connect con2,localhost,root;
336+
kill query $connid;
335337
disconnect con2;
336338
connection default;
337339
ERROR 70100: Query execution was interrupted

mysql-test/main/debug_sync.test

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,21 +454,20 @@ SET DEBUG_SYNC= 'RESET';
454454
--echo #
455455
create table t (c int) engine=innodb;
456456
--connect con1,localhost,root
457-
set debug_sync='get_schema_column WAIT_FOR go';
457+
set debug_sync='get_schema_column SIGNAL waiting WAIT_FOR go';
458458
send select column_name from information_schema.columns
459459
where table_schema='test' and table_name='t';
460460

461461
--connection default
462-
let $wait_condition=select 1 from information_schema.processlist where state like 'debug sync point%';
463-
--source include/wait_condition.inc
462+
set debug_sync= 'now WAIT_FOR waiting';
464463
let $connid=`select connection_id()`;
465464
lock table t write;
466465
send alter table t discard tablespace;
467466

468467
--connect con2,localhost,root
469-
--disable_query_log
470-
--eval kill query $connid
471-
--enable_query_log
468+
--let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist WHERE id=$connid AND state='Waiting for table metadata lock' AND INFO='alter table t discard tablespace'
469+
--source include/wait_condition.inc
470+
--evalp kill query $connid
472471
--disconnect con2
473472

474473
--connection default

0 commit comments

Comments
 (0)