mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #28488: Incorrect information in file: './test/t1_test#.frm'
While executing ALTER TABLE ... PARTITION the server uses a temporary "shadow" table to create the updated table. This shadow table then gets renamed as the original table. The shadow table was not prefixed with the special prefix that marks temporary tables so it was picked up by SHOW TABLE STATUS. Fixed by isolating the code to create the shadow table name in a separate function and prefixing the shadow table name with the special prefix to exclude it from the list of user tables. See bug 18775 and WL1324 for details.
This commit is contained in:
@ -5488,8 +5488,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
|
||||
char shadow_path[FN_LEN];
|
||||
DBUG_ENTER("write_log_drop_shadow_frm");
|
||||
|
||||
build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
|
||||
lpt->table_name, "#", 0);
|
||||
build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
|
||||
pthread_mutex_lock(&LOCK_gdl);
|
||||
if (write_log_replace_delete_frm(lpt, 0UL, NULL,
|
||||
(const char*)shadow_path, FALSE))
|
||||
@ -5537,8 +5536,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
|
||||
part_info->first_log_entry= NULL;
|
||||
build_table_filename(path, sizeof(path), lpt->db,
|
||||
lpt->table_name, "", 0);
|
||||
build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
|
||||
lpt->table_name, "#", 0);
|
||||
build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
|
||||
pthread_mutex_lock(&LOCK_gdl);
|
||||
if (write_log_replace_delete_frm(lpt, 0UL, shadow_path, path, TRUE))
|
||||
goto error;
|
||||
@ -5703,8 +5701,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
|
||||
part_info->first_log_entry= NULL;
|
||||
build_table_filename(path, sizeof(path), lpt->db,
|
||||
lpt->table_name, "", 0);
|
||||
build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
|
||||
lpt->table_name, "#", 0);
|
||||
build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
|
||||
pthread_mutex_lock(&LOCK_gdl);
|
||||
if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path,
|
||||
lpt->alter_info->flags & ALTER_REORGANIZE_PARTITION))
|
||||
|
Reference in New Issue
Block a user