Skip to content

Commit 976fbc5

Browse files
author
Dmitry Lenev
committed
Follow-up to fix for bug#26647340 "LIFT LIMITATION ON ALTER TABLE RENAME + TABLES WITH FOREIGN KEYS + LOCK TABLES".
Adjusted main.alter_table-big test to work correctly with --ps-protocol option.
1 parent 5aa645a commit 976fbc5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

mysql-test/t/alter_table-big.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,17 @@ SELECT * FROM t4;
296296

297297
connection con1;
298298
--echo # But metadata lock on old name can be still kept.
299+
# Disable prepared statements, since for them the below check
300+
# works differently. The prepare phase of statements execution
301+
# acquires weaker S metadata lock (which do not conflict with
302+
# SNRW locks held by LOCK TABLE WRITE) and manages to discover
303+
# that table with such name doesn't exist.
304+
--disable_ps_protocol
299305
SET @@lock_wait_timeout= 1;
300306
--error ER_LOCK_WAIT_TIMEOUT
301307
SELECT * FROM t2;
302308
SET @@lock_wait_timeout= @old_lock_wait_timeout;
309+
--enable_ps_protocol
303310
--echo # New name should not be locked.
304311
SELECT * FROM t4;
305312

@@ -396,10 +403,17 @@ SELECT * FROM t4;
396403

397404
connection con1;
398405
--echo # But metadata lock on old name can be still kept.
406+
# Disable prepared statements, since for them the below check
407+
# works differently. The prepare phase of statements execution
408+
# acquires weaker S metadata lock (which do not conflict with
409+
# SNRW locks held by LOCK TABLE WRITE) and manages to discover
410+
# that table with such name doesn't exist.
411+
--disable_ps_protocol
399412
SET @@lock_wait_timeout= 1;
400413
--error ER_LOCK_WAIT_TIMEOUT
401414
SELECT * FROM t2;
402415
SET @@lock_wait_timeout= @old_lock_wait_timeout;
416+
--enable_ps_protocol
403417
--echo # New name should not be locked.
404418
SELECT * FROM t4;
405419

@@ -496,12 +510,19 @@ SELECT * FROM t4;
496510

497511
connection con1;
498512
--echo # Metadata locks on both old and new names are still kept.
513+
# Disable prepared statements, since for them the below check
514+
# works differently. The prepare phase of statements execution
515+
# acquires weaker S metadata locks (which do not conflict with
516+
# SNRW locks held by LOCK TABLE WRITE) and manages to discover
517+
# that tables with such names don't exist.
518+
--disable_ps_protocol
499519
SET @@lock_wait_timeout= 1;
500520
--error ER_LOCK_WAIT_TIMEOUT
501521
SELECT * FROM t2;
502522
--error ER_LOCK_WAIT_TIMEOUT
503523
SELECT * FROM t4;
504524
SET @@lock_wait_timeout= @old_lock_wait_timeout;
525+
--enable_ps_protocol
505526

506527
connection default;
507528
UNLOCK TABLES;
@@ -528,12 +549,19 @@ SELECT * FROM t3;
528549

529550
connection con1;
530551
--echo # However, metadata locks on both old and new names are still kept.
552+
# Disable prepared statements, since for them the below check
553+
# works differently. The prepare phase of statements execution
554+
# acquires weaker S metadata locks (which do not conflict with
555+
# SNRW locks held by LOCK TABLE WRITE) and manages to discover
556+
# that tables with such names don't exist.
557+
--disable_ps_protocol
531558
SET @@lock_wait_timeout= 1;
532559
--error ER_LOCK_WAIT_TIMEOUT
533560
SELECT * FROM t2;
534561
--error ER_LOCK_WAIT_TIMEOUT
535562
SELECT * FROM t3;
536563
SET @@lock_wait_timeout= @old_lock_wait_timeout;
564+
--enable_ps_protocol
537565

538566
connection default;
539567
--echo # And delete from parent table is possible and doesn't cause asserts.

0 commit comments

Comments
 (0)