summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2016-07-18 11:50:08 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2016-07-18 11:50:08 +0400
commitbf2e31500c9a0a7fcdccfb724e9447347a3ab684 (patch)
tree241096e790cb73d15daea32ed6054982f49acfb6 /sql/sql_table.cc
parentc6fdb92ca829fed893d9e7324e80b1450de16087 (diff)
downloadmariadb-git-bf2e31500c9a0a7fcdccfb724e9447347a3ab684.tar.gz
MDEV-8569 build_table_filename() doesn't support temporary tables.
Temporary tables support added for RENAME and ALTER TABLE.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 7bf008870b9..7cf31ee4fe8 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2710,14 +2710,15 @@ bool log_drop_table(THD *thd, const char *db_name, size_t db_name_length,
*/
bool quick_rm_table(THD *thd, handlerton *base, const char *db,
- const char *table_name, uint flags)
+ const char *table_name, uint flags, const char *table_path)
{
char path[FN_REFLEN + 1];
bool error= 0;
DBUG_ENTER("quick_rm_table");
- uint path_length= build_table_filename(path, sizeof(path) - 1,
- db, table_name, reg_ext, flags);
+ uint path_length= table_path ?
+ (strxnmov(path, sizeof(path) - 1, table_path, reg_ext, NullS) - path) :
+ build_table_filename(path, sizeof(path)-1, db, table_name, reg_ext, flags);
if (mysql_file_delete(key_file_frm, path, MYF(0)))
error= 1; /* purecov: inspected */
path[path_length - reg_ext_length]= '\0'; // Remove reg_ext
@@ -9220,7 +9221,8 @@ err_new_table_cleanup:
else
(void) quick_rm_table(thd, new_db_type,
alter_ctx.new_db, alter_ctx.tmp_name,
- (FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)));
+ (FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)),
+ alter_ctx.get_tmp_path());
/*
No default value was provided for a DATE/DATETIME field, the