1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Dmitry Lenev
2010-02-03 08:32:38 +03:00
parent c2fe19883e
commit 0ede71256f
3 changed files with 31 additions and 0 deletions

View File

@ -5030,6 +5030,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
/*
@ -5059,6 +5060,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);