From 2027841d5bc7e22ebb24a5a7538d0fd057dd8352 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 16 Dec 2018 18:32:05 +0100 Subject: MDEV-16110 ALTER with ALGORITHM=INPLACE breaks temporary table with virtual columns Part two, temporary tables. Make temporary tables respect TABLE::m_needs_reopen. See also 77cd754229b --- sql/temporary_tables.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql') diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index a4ece127f96..29c9910f332 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1042,6 +1042,13 @@ TABLE *THD::find_temporary_table(const char *key, uint key_length, case TMP_TABLE_ANY: found= true; break; } } + if (table && unlikely(table->m_needs_reopen)) + { + share->all_tmp_tables.remove(table); + free_temporary_table(table); + it.rewind(); + continue; + } result= table; break; } -- cgit v1.2.1