mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#31409 RENAME TABLE causes server crash or deadlock when used with HANDLER statements
If mysql_lock_tables fails because the lock was aborted, we need to reset thd->some_tables_delete, otherwise we might loop indefinitely because handler's tables are not closed in a standard way, meaning that close_thread_tables() (which resets some_tables_deleted) is not used. This patch fixes sporadical failures of handler_myisam/innodb tests which were introduced by previous fix for this bug. sql/sql_handler.cc: Properly reset thd->some_tables_deleted if mysql_lock_tables fails for some reason.
This commit is contained in:
@ -466,6 +466,12 @@ retry:
|
|||||||
{
|
{
|
||||||
mysql_ha_close_table(thd, tables);
|
mysql_ha_close_table(thd, tables);
|
||||||
hash_tables->table= NULL;
|
hash_tables->table= NULL;
|
||||||
|
/*
|
||||||
|
The lock might have been aborted, we need to manually reset
|
||||||
|
thd->some_tables_deleted because handler's tables are closed
|
||||||
|
in a non-standard way. Otherwise we might loop indefinitely.
|
||||||
|
*/
|
||||||
|
thd->some_tables_deleted= 0;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user