2017-06-22 15:35:36 +02:00
|
|
|
#
|
|
|
|
# MDEV-12882 - Assertion `mdl_ticket->m_type == MDL_SHARED_UPGRADABLE ||
|
|
|
|
# mdl_ticket->m_type == MDL_SHARED_NO_WRITE ||
|
|
|
|
# mdl_ticket->m_type == MDL_SHARED_NO_READ_WRITE ||
|
|
|
|
# mdl_ticket->m_type == MDL_SHARED_READ'
|
|
|
|
# failed in MDL_context::upgrade_shared_lock
|
|
|
|
#
|
|
|
|
CREATE TABLE t1(a INT) ENGINE=InnoDB;
|
2018-11-06 16:05:24 +01:00
|
|
|
CREATE TABLE t3(a INT) ENGINE=myisam;
|
2017-06-22 15:35:36 +02:00
|
|
|
LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ;
|
2017-06-30 13:37:39 +02:00
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
2018-11-06 16:05:24 +01:00
|
|
|
MDL_BACKUP_TRANS_DML Backup lock
|
2017-06-30 13:37:39 +02:00
|
|
|
MDL_SHARED_NO_READ_WRITE Table metadata lock test t1
|
2017-06-22 15:35:36 +02:00
|
|
|
UNLOCK TABLES;
|
|
|
|
LOCK TABLES t1 AS t2 READ, t1 WRITE CONCURRENT;
|
2017-06-30 13:37:39 +02:00
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
2018-11-06 16:05:24 +01:00
|
|
|
MDL_BACKUP_TRANS_DML Backup lock
|
2017-06-30 13:37:39 +02:00
|
|
|
MDL_SHARED_WRITE Table metadata lock test t1
|
|
|
|
MDL_SHARED_READ_ONLY Table metadata lock test t1
|
2017-06-22 15:35:36 +02:00
|
|
|
UNLOCK TABLES;
|
2018-11-06 16:05:24 +01:00
|
|
|
LOCK TABLES t1 WRITE CONCURRENT, t3 WRITE;
|
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
|
|
|
MDL_BACKUP_DDL Backup lock
|
|
|
|
MDL_BACKUP_DML Backup lock
|
|
|
|
MDL_SHARED_WRITE Table metadata lock test t1
|
|
|
|
MDL_SHARED_NO_READ_WRITE Table metadata lock test t3
|
|
|
|
MDL_INTENTION_EXCLUSIVE Schema metadata lock test
|
|
|
|
UNLOCK TABLES;
|
|
|
|
LOCK TABLES t3 WRITE, t1 WRITE CONCURRENT;
|
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
|
|
|
MDL_BACKUP_DDL Backup lock
|
|
|
|
MDL_BACKUP_DML Backup lock
|
|
|
|
MDL_SHARED_WRITE Table metadata lock test t1
|
|
|
|
MDL_SHARED_NO_READ_WRITE Table metadata lock test t3
|
|
|
|
MDL_INTENTION_EXCLUSIVE Schema metadata lock test
|
|
|
|
UNLOCK TABLES;
|
|
|
|
LOCK TABLES t1 WRITE, mysql.user WRITE;
|
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
|
|
|
MDL_BACKUP_DDL Backup lock
|
|
|
|
MDL_SHARED_NO_READ_WRITE Table metadata lock mysql user
|
|
|
|
MDL_SHARED_NO_READ_WRITE Table metadata lock test t1
|
|
|
|
MDL_INTENTION_EXCLUSIVE Schema metadata lock mysql
|
2018-11-24 14:13:41 +01:00
|
|
|
MDL_SHARED_NO_READ_WRITE Table metadata lock mysql global_priv
|
2018-11-06 16:05:24 +01:00
|
|
|
MDL_INTENTION_EXCLUSIVE Schema metadata lock test
|
|
|
|
UNLOCK TABLES;
|
|
|
|
LOCK TABLES mysql.general_log WRITE;
|
|
|
|
ERROR HY000: You can't use locks with log tables
|
|
|
|
LOCK TABLES t1 WRITE,information_schema.tables READ;
|
|
|
|
UNLOCK TABLES;
|
|
|
|
DROP TABLE t1,t3;
|
|
|
|
#
|
|
|
|
# Check MDL locks taken for different kind of tables by open
|
|
|
|
#
|
|
|
|
CREATE TABLE t1(a INT) ENGINE=InnoDB;
|
|
|
|
CREATE TABLE t3(a INT) ENGINE=myisam;
|
|
|
|
connect locker,localhost,root,,;
|
|
|
|
connection default;
|
|
|
|
FLUSH TABLES WITH READ LOCK;
|
|
|
|
connection locker;
|
|
|
|
insert into t1 values (1);
|
|
|
|
connection default;
|
|
|
|
connection default;
|
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
|
|
|
MDL_BACKUP_FTWRL2 Backup lock
|
|
|
|
MDL_SHARED_WRITE Table metadata lock test t1
|
|
|
|
unlock tables;
|
|
|
|
connection locker;
|
|
|
|
unlock tables;
|
|
|
|
connection default;
|
|
|
|
FLUSH TABLES WITH READ LOCK;
|
|
|
|
connection locker;
|
|
|
|
insert into t3 values (2);
|
|
|
|
connection default;
|
|
|
|
connection default;
|
|
|
|
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
|
|
|
|
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
|
|
|
|
MDL_BACKUP_FTWRL2 Backup lock
|
|
|
|
MDL_SHARED_WRITE Table metadata lock test t3
|
|
|
|
unlock tables;
|
|
|
|
connection locker;
|
|
|
|
unlock tables;
|
|
|
|
connection default;
|
|
|
|
disconnect locker;
|
|
|
|
DROP TABLE t1,t3;
|