diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-02-05 00:57:31 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-08-11 12:32:08 +0300 |
commit | 22914ec793b850438c77acf070f8441cf307ebf6 (patch) | |
tree | 09976886fe80cdfe0eaf384916610c715a39c802 /sql/sql_base.cc | |
parent | 0b74c8832d45340a455f27c3b4aa20db5d8313db (diff) | |
download | mariadb-git-22914ec793b850438c77acf070f8441cf307ebf6.tar.gz |
MDEV-18154 Deadlock and assertion upon no-op ALTER under LOCK TABLES
1. Fix DBUG_ASSERT(!table->pos_in_locked_tables) in tc_release_table();
2. Fix access of prematurely freed MDL_ticket: don't close ticket if table was not closed;
3. Fix deadlock after erroneous ALTER.
mysql_alter_table() leaves dirty table->m_needs_reopen in case of
error exit which then incorrectly treated by mysql_lock_tables().
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 287d5771155..99c8a227861 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2433,6 +2433,7 @@ unlink_all_closed_tables(THD *thd, MYSQL_LOCK *lock, size_t reopen_count) DBUG_ASSERT(thd->open_tables == m_reopen_array[reopen_count]); thd->open_tables->pos_in_locked_tables->table= NULL; + thd->open_tables->pos_in_locked_tables= NULL; close_thread_table(thd, &thd->open_tables); } |