mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Rename of stat table tried to rename open table.
When compiling with -DEXTRA_DEBUG and run main.stat_tables_missing on go the warning: Warning: Table: ./mysql/column_stats is open on rename old_table This happened because rename_table_in_stat_tables() re-open the table that was to be renamed. Fixed by moving update of stat tables after all renames has been made.
This commit is contained in:
parent
bff7cf9df8
commit
daf333abcf
1 changed files with 6 additions and 5 deletions
|
@ -9157,11 +9157,6 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list,
|
|||
close_all_tables_for_name(thd, table->s, HA_EXTRA_PREPARE_FOR_RENAME,
|
||||
NULL);
|
||||
|
||||
(void) rename_table_in_stat_tables(thd, &alter_ctx->db,
|
||||
&alter_ctx->table_name,
|
||||
&alter_ctx->new_db,
|
||||
&alter_ctx->new_alias);
|
||||
|
||||
if (mysql_rename_table(old_db_type, &alter_ctx->db, &alter_ctx->table_name,
|
||||
&alter_ctx->new_db, &alter_ctx->new_alias, 0))
|
||||
error= -1;
|
||||
|
@ -9178,6 +9173,12 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list,
|
|||
NO_FK_CHECKS);
|
||||
error= -1;
|
||||
}
|
||||
/* Update stat tables last. This is to be able to handle rename of a stat table */
|
||||
if (error == 0)
|
||||
(void) rename_table_in_stat_tables(thd, &alter_ctx->db,
|
||||
&alter_ctx->table_name,
|
||||
&alter_ctx->new_db,
|
||||
&alter_ctx->new_alias);
|
||||
}
|
||||
|
||||
if (likely(!error))
|
||||
|
|
Loading…
Add table
Reference in a new issue