summaryrefslogtreecommitdiff
path: root/mysql-test/r/repair.result
diff options
context:
space:
mode:
authorDmitry Lenev <dlenev@mysql.com>2010-02-03 08:32:38 +0300
committerDmitry Lenev <dlenev@mysql.com>2010-02-03 08:32:38 +0300
commited91202ac9a130d8f5e7bf45aef46892221ef137 (patch)
tree69becb06ba31292574c7de7e0553de5046563a1f /mysql-test/r/repair.result
parenta6daa9ada052b7b7b09683ea6d565c92f5e15512 (diff)
downloadmariadb-git-ed91202ac9a130d8f5e7bf45aef46892221ef137.tar.gz
Fix for bug #50784 "MDL: Assertion `m_tickets.is_empty() ||
m_tickets.front() == m_trans_sentinel'". Debug build of server crashed due to assert failure in MDL subsystem when one tried to execute multi-table REPAIR or OPTIMIZE in autocommit=0 mode. The assert failure occured when multi-table REPAIR or OPTIMIZE started processing of second table from its table list and tried to acquire upgradable metadata lock on this table. The cause of the assert failure were MDL locks left over from processing of previous table. It turned out that in autocommit=0 mode close_thread_tables() which happens at the end of table processing doesn't release metadata locks. This fix solves problem by releasing locks explicitly using MDL_context::release_trans_locks() call. mysql-test/r/repair.result: Added test for bug #50784 "MDL: Assertion `m_tickets.is_empty() || m_tickets.front() == m_trans_sentinel'". mysql-test/t/repair.test: Added test for bug #50784 "MDL: Assertion `m_tickets.is_empty() || m_tickets.front() == m_trans_sentinel'". sql/sql_table.cc: Ensure that metadata locks are released after multi-table REPAIR/ OPTIMIZE/... processes each table. close_thread_tables() which is called after processing each table doesn't release metadata locks if we are in autocommit=0 mode. So this have to be done explicitly by calling MDL_context::release_trans_locks().
Diffstat (limited to 'mysql-test/r/repair.result')
-rw-r--r--mysql-test/r/repair.result14
1 files changed, 14 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;