1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Backport of revno: 2617.68.36

---------------------------------------------

This is a patch for bug#47098 assert in MDL_context::destroy on
HANDLER <damaged merge table> OPEN.
      
The assert occurs in MDL_context::destroy when the connection is terminated,
because all mdl_tickets have not been released.
MERGE tables do not support being opened using the HANDLER ... OPEN command,
and trying to do so will result in an error. In the event of an error, all
tables that are opened, should be closed again. The fix for bug#45781 made
sure that this also works for MERGE tables, which causes multiple tables to
be opened.
This fix extends the fix for bug#45781, by ensuring that also all locks are
released, when MERGE tables are involved.

mysql-test/r/merge.result:
  The result of the test.
mysql-test/t/merge.test:
  Added a test based on the bug report, as well as a test of the more general
  scenario.
sql/sql_handler.cc:
  Added code to release all the locks.
This commit is contained in:
unknown
2009-12-09 14:41:56 +01:00
parent 527813b413
commit 832ad46641
3 changed files with 69 additions and 1 deletions

View File

@ -321,6 +321,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
can close a single table only.
*/
close_thread_tables(thd);
thd->mdl_context.release_all_locks();
my_error(ER_ILLEGAL_HA, MYF(0), hash_tables->alias);
error= TRUE;
}