diff options
author | davi@moksha.com.br <> | 2007-10-12 10:55:46 -0300 |
---|---|---|
committer | davi@moksha.com.br <> | 2007-10-12 10:55:46 -0300 |
commit | b92f3309f1c020ab146d0d5e685249535018c1fc (patch) | |
tree | 6c435d327bcada48efbcb8d2a84f503816cb8d2c /sql/sql_handler.cc | |
parent | c3d06676f8ca9ecf14c2da4a48c9feddba5767c6 (diff) | |
download | mariadb-git-b92f3309f1c020ab146d0d5e685249535018c1fc.tar.gz |
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.
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r-- | sql/sql_handler.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index e87381dd49c..822f2b2c419 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -466,6 +466,12 @@ retry: { mysql_ha_close_table(thd, tables); 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; } |