mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-10748 Server crashes in ha_maria::implicit_commit
Problem was in a combination of LOCK TABLES on several Aria tables followed by an ALTER TABLE. After the ALTER TABLE there was a force close + reopen of the alter table. The close failed because the table was still part of a transaction. Fixed by calling extra(HA_EXTRA_PREPARE_FOR_FORCED_CLOSE) as part of closing the table, which ensures that the table is not anymore part of the current transaction.
This commit is contained in:
@ -2426,9 +2426,17 @@ Locked_tables_list::reopen_tables(THD *thd, bool need_reopen)
|
||||
{
|
||||
if (!table_list->table || !table_list->table->needs_reopen())
|
||||
continue;
|
||||
/* no need to remove the table from the TDC here, thus (TABLE*)1 */
|
||||
close_all_tables_for_name(thd, table_list->table->s,
|
||||
HA_EXTRA_NOT_USED, (TABLE*)1);
|
||||
for (TABLE **prev= &thd->open_tables; *prev; prev= &(*prev)->next)
|
||||
{
|
||||
if (*prev == table_list->table)
|
||||
{
|
||||
thd->locked_tables_list.unlink_from_list(thd, table_list, false);
|
||||
mysql_lock_remove(thd, thd->lock, *prev);
|
||||
(*prev)->file->extra(HA_EXTRA_PREPARE_FOR_FORCED_CLOSE);
|
||||
close_thread_table(thd, prev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
DBUG_ASSERT(table_list->table == NULL);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user