Skip to content

Commit 692f328

Browse files
committed
Additional fixes for main.debug_sync failures
Test for MDEV-30364 moved to main.mdl_sync, main.debug_sync is intended to test debug sync facility itself. Using ER_LOCK_WAIT_TIMEOUT instead of ER_QUERY_INTERRUPTED allows less thread synchronization. Originally fixed by da5cffe.
1 parent 0707dac commit 692f328

File tree

4 files changed

+43
-68
lines changed

4 files changed

+43
-68
lines changed

mysql-test/main/debug_sync.result

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -320,32 +320,3 @@ SHOW VARIABLES LIKE 'DEBUG_SYNC';
320320
Variable_name Value
321321
debug_sync ON - current signals: 's2,s7,s1,s5'
322322
SET DEBUG_SYNC= 'RESET';
323-
#
324-
# MDEV-30364 Assertion MDL_EXCLUSIVE on DISCARD TABLESPACE in LOCK TABLE mode
325-
#
326-
create table t (c int) engine=innodb;
327-
connect con1,localhost,root;
328-
set debug_sync='get_schema_column SIGNAL waiting WAIT_FOR go';
329-
select column_name from information_schema.columns
330-
where table_schema='test' and table_name='t';
331-
connection default;
332-
set debug_sync= 'now WAIT_FOR waiting';
333-
lock table t write;
334-
alter table t discard tablespace;
335-
connect con2,localhost,root;
336-
kill query $connid;
337-
disconnect con2;
338-
connection default;
339-
ERROR 70100: Query execution was interrupted
340-
set debug_sync='now SIGNAL go';
341-
connection con1;
342-
column_name
343-
c
344-
disconnect con1;
345-
connection default;
346-
unlock tables;
347-
drop table t;
348-
set debug_sync= 'reset';
349-
#
350-
# End of 10.6 tests
351-
#

mysql-test/main/debug_sync.test

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -448,42 +448,3 @@ SHOW VARIABLES LIKE 'DEBUG_SYNC';
448448
# Otherwise signal would confuse the next test.
449449
#
450450
SET DEBUG_SYNC= 'RESET';
451-
452-
--echo #
453-
--echo # MDEV-30364 Assertion MDL_EXCLUSIVE on DISCARD TABLESPACE in LOCK TABLE mode
454-
--echo #
455-
create table t (c int) engine=innodb;
456-
--connect con1,localhost,root
457-
set debug_sync='get_schema_column SIGNAL waiting WAIT_FOR go';
458-
send select column_name from information_schema.columns
459-
where table_schema='test' and table_name='t';
460-
461-
--connection default
462-
set debug_sync= 'now WAIT_FOR waiting';
463-
let $connid=`select connection_id()`;
464-
lock table t write;
465-
send alter table t discard tablespace;
466-
467-
--connect con2,localhost,root
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
471-
--disconnect con2
472-
473-
--connection default
474-
--error ER_QUERY_INTERRUPTED
475-
reap;
476-
set debug_sync='now SIGNAL go';
477-
478-
--connection con1
479-
reap;
480-
--disconnect con1
481-
482-
--connection default
483-
unlock tables;
484-
drop table t;
485-
set debug_sync= 'reset';
486-
487-
--echo #
488-
--echo # End of 10.6 tests
489-
--echo #

mysql-test/main/mdl_sync.result

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,3 +3046,23 @@ disconnect con1;
30463046
connection default;
30473047
DROP VIEW v1;
30483048
SET debug_sync='reset';
3049+
#
3050+
# MDEV-30364 Assertion MDL_EXCLUSIVE on DISCARD TABLESPACE in LOCK TABLE mode
3051+
#
3052+
create table t (c int) engine=innodb;
3053+
set debug_sync='get_schema_column SIGNAL waiting WAIT_FOR go';
3054+
select column_name from information_schema.columns
3055+
where table_schema='test' and table_name='t';
3056+
connect con1,localhost,root;
3057+
set debug_sync= 'now WAIT_FOR waiting';
3058+
lock table t write;
3059+
set statement lock_wait_timeout=0 for alter table t discard tablespace;
3060+
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
3061+
unlock tables;
3062+
set debug_sync='now SIGNAL go';
3063+
disconnect con1;
3064+
connection default;
3065+
column_name
3066+
c
3067+
drop table t;
3068+
set debug_sync= 'reset';

mysql-test/main/mdl_sync.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4062,6 +4062,29 @@ connection default;
40624062
DROP VIEW v1;
40634063
SET debug_sync='reset';
40644064

4065+
4066+
--echo #
4067+
--echo # MDEV-30364 Assertion MDL_EXCLUSIVE on DISCARD TABLESPACE in LOCK TABLE mode
4068+
--echo #
4069+
create table t (c int) engine=innodb;
4070+
set debug_sync='get_schema_column SIGNAL waiting WAIT_FOR go';
4071+
send select column_name from information_schema.columns
4072+
where table_schema='test' and table_name='t';
4073+
4074+
--connect con1,localhost,root
4075+
set debug_sync= 'now WAIT_FOR waiting';
4076+
lock table t write;
4077+
--error ER_LOCK_WAIT_TIMEOUT
4078+
set statement lock_wait_timeout=0 for alter table t discard tablespace;
4079+
unlock tables;
4080+
set debug_sync='now SIGNAL go';
4081+
--disconnect con1
4082+
4083+
--connection default
4084+
reap;
4085+
drop table t;
4086+
set debug_sync= 'reset';
4087+
40654088
# Check that all connections opened by test cases in this file are really
40664089
# gone so execution of other tests won't be affected by their presence.
40674090
--source include/wait_until_count_sessions.inc

0 commit comments

Comments
 (0)