mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +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. mysql-test/r/partition.result: Bug #28488: test case mysql-test/t/partition.test: Bug #28488: test case sql/mysql_priv.h: Bug #28488: prefix shadow file with the temp prefix sql/sql_partition.cc: Bug #28488: prefix shadow file with the temp prefix sql/sql_table.cc: Bug #28488: prefix shadow file with the temp prefix
This commit is contained in:
@@ -1262,6 +1262,31 @@ void release_ddl_log()
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
@brief construct a temporary shadow file name.
|
||||
|
||||
@details Make a shadow file name used by ALTER TABLE to construct the
|
||||
modified table (with keeping the original). The modified table is then
|
||||
moved back as original table. The name must start with the temp file
|
||||
prefix so it gets filtered out by table files listing routines.
|
||||
|
||||
@param[out] buff buffer to receive the constructed name
|
||||
@param bufflen size of buff
|
||||
@param lpt alter table data structure
|
||||
|
||||
@retval path length
|
||||
*/
|
||||
|
||||
uint build_table_shadow_filename(char *buff, size_t bufflen,
|
||||
ALTER_PARTITION_PARAM_TYPE *lpt)
|
||||
{
|
||||
char tmp_name[FN_REFLEN];
|
||||
my_snprintf (tmp_name, sizeof (tmp_name), "%s-%s", tmp_file_prefix,
|
||||
lpt->table_name);
|
||||
return build_table_filename(buff, bufflen, lpt->db, tmp_name, "", FN_IS_TMP);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
SYNOPSIS
|
||||
mysql_write_frm()
|
||||
@@ -1302,8 +1327,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
|
||||
/*
|
||||
Build shadow frm file name
|
||||
*/
|
||||
build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
|
||||
lpt->table_name, "#", 0);
|
||||
build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
|
||||
strxmov(shadow_frm_name, shadow_path, reg_ext, NullS);
|
||||
if (flags & WFRM_WRITE_SHADOW)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user