summaryrefslogtreecommitdiff
path: root/mysql-test/main/mdl.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/mdl.test')
-rw-r--r--mysql-test/main/mdl.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/main/mdl.test b/mysql-test/main/mdl.test
new file mode 100644
index 00000000000..b90c74a8f7f
--- /dev/null
+++ b/mysql-test/main/mdl.test
@@ -0,0 +1,19 @@
+--source include/have_metadata_lock_info.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-12882 - Assertion `mdl_ticket->m_type == MDL_SHARED_UPGRADABLE ||
+--echo # mdl_ticket->m_type == MDL_SHARED_NO_WRITE ||
+--echo # mdl_ticket->m_type == MDL_SHARED_NO_READ_WRITE ||
+--echo # mdl_ticket->m_type == MDL_SHARED_READ'
+--echo # failed in MDL_context::upgrade_shared_lock
+--echo #
+
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+UNLOCK TABLES;
+LOCK TABLES t1 AS t2 READ, t1 WRITE CONCURRENT;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+UNLOCK TABLES;
+DROP TABLE t1;