# The LOCK_TYPE in table performance_schema.metadata_locks # not change after MDL upgrade or downgrade --source include/have_debug.inc --source include/have_debug_sync.inc # Prepare connect (con1, localhost, root, , ); create table t1 (id int key, c1 int); insert into t1 values (1, 10); # DDL and check MDL LOCK_TYPE --connection con1 SET DEBUG_SYNC='RESET'; SET DEBUG_SYNC= 'alter_opened_table WAIT_FOR continue1'; SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade WAIT_FOR continue2'; SET DEBUG_SYNC= 'alter_table_before_main_binlog WAIT_FOR continue3'; --echo # Sending: --send alter table t1 change column c1 c1 bigint --connection default # expected SHARED_UPGRADABLE select * from performance_schema.metadata_locks where OBJECT_TYPE = 'TABLE' and OBJECT_NAME = 't1'; SET DEBUG_SYNC= 'now SIGNAL continue1'; --sleep 1 # expected SHARED_NO_WRITE select * from performance_schema.metadata_locks where OBJECT_TYPE = 'TABLE' and OBJECT_NAME = 't1'; SET DEBUG_SYNC= 'now SIGNAL continue2'; --sleep 1 # expected EXCLUSIVE select * from performance_schema.metadata_locks where OBJECT_TYPE = 'TABLE' and OBJECT_NAME = 't1'; SET DEBUG_SYNC= 'now SIGNAL continue3'; --sleep 1 --connection con1 --echo # Reaping ALTER TABLE ... --reap SET DEBUG_SYNC= 'RESET'; # Cleanup --connection default drop table t1;