summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/repair.result14
-rw-r--r--mysql-test/t/repair.test15
-rw-r--r--sql/sql_table.cc2
3 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index 77eb927a21f..6ab5ecb7e18 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -169,3 +169,17 @@ test.t1 repair Error Table 't1' was locked with a READ lock and can't be updated
test.t1 repair status Operation failed
UNLOCK TABLES;
DROP TABLE t1;
+#
+# Test for bug #50784 "MDL: Assertion `m_tickets.is_empty() ||
+# m_tickets.front() == m_trans_sentinel'"
+#
+drop tables if exists t1, t2;
+create table t1 (i int);
+create table t2 (j int);
+set @@autocommit= 0;
+repair table t1, t2;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+test.t2 repair status OK
+set @@autocommit= default;
+drop tables t1, t2;
diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test
index ec4c9b3cae8..3c55f06ff4c 100644
--- a/mysql-test/t/repair.test
+++ b/mysql-test/t/repair.test
@@ -173,3 +173,18 @@ REPAIR TABLE t1;
UNLOCK TABLES;
DROP TABLE t1;
+
+
+--echo #
+--echo # Test for bug #50784 "MDL: Assertion `m_tickets.is_empty() ||
+--echo # m_tickets.front() == m_trans_sentinel'"
+--echo #
+--disable_warnings
+drop tables if exists t1, t2;
+--enable_warnings
+create table t1 (i int);
+create table t2 (j int);
+set @@autocommit= 0;
+repair table t1, t2;
+set @@autocommit= default;
+drop tables t1, t2;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 29596ceab92..56a659173f3 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5031,6 +5031,7 @@ send_result_message:
trans_commit_stmt(thd);
trans_commit_implicit(thd);
close_thread_tables(thd);
+ thd->mdl_context.release_transactional_locks();
table->table=0; // For query cache
/*
@@ -5060,6 +5061,7 @@ err:
trans_rollback_stmt(thd);
trans_rollback(thd);
close_thread_tables(thd); // Shouldn't be needed
+ thd->mdl_context.release_transactional_locks();
if (table)
table->table=0;
DBUG_RETURN(TRUE);