Commit 1f08a518 authored by unknown's avatar unknown

Case when we close temporary table which was not opened in its engine (ALTER TABLE) fixed.

parent c46ce32c
......@@ -2360,8 +2360,13 @@ void close_temporary(TABLE *table, bool free_share, bool delete_table)
DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'",
table->s->db.str, table->s->table_name.str));
/* in_use is not set for replication temporary tables during shutdown */
if (table->in_use)
/*
in_use is not set for replication temporary tables during shutdown.
table->file->get_table() could not be set for ALTER table
when we do not open it in engine.
*/
if (table->file->get_table() && table->in_use)
{
table->file->update_global_table_stats();
table->file->update_global_index_stats();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment