From e56a53920b0075f9a534610032ee05f2e249e3ae Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 1 Jul 2016 13:57:18 +0400 Subject: [PATCH] MDEV-10315 - Online ALTER TABLE may get stuck in tdc_remove_table There was race condition between online ALTER TABLE and statements performing TABLE_SHARE release without marking it flushed (e.g. in case of table cache overflow, SET @@global.table_open_cache, manager thread purging table cache). The reason was missing mysql_cond_broadcast(). --- sql/table_cache.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 097f37d26d8..bdb7914c32b 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -876,6 +876,8 @@ void tdc_release_share(TABLE_SHARE *share) } if (--share->tdc.ref_count) { + if (!share->is_view) + mysql_cond_broadcast(&share->tdc.COND_release); mysql_mutex_unlock(&share->tdc.LOCK_table_share); mysql_mutex_unlock(&LOCK_unused_shares); DBUG_VOID_RETURN;