Commit 3f24cf2d authored by Monty's avatar Monty

Don't delete non existing .TMD and .OLD files for Aria internal temporary tables

(Simple speedup)
parent 65151e0c
......@@ -2655,7 +2655,7 @@ void ha_maria::drop_table(const char *name)
{
DBUG_ASSERT(file->s->temporary);
(void) ha_close();
(void) maria_delete_table_files(name, 0);
(void) maria_delete_table_files(name, 1, 0);
}
......
......@@ -78,11 +78,11 @@ int maria_delete_table(const char *name)
DBUG_RETURN(1);
}
DBUG_RETURN(maria_delete_table_files(name, sync_dir));
DBUG_RETURN(maria_delete_table_files(name, 0, sync_dir));
}
int maria_delete_table_files(const char *name, myf sync_dir)
int maria_delete_table_files(const char *name, my_bool temporary, myf sync_dir)
{
char from[FN_REFLEN];
DBUG_ENTER("maria_delete_table_files");
......@@ -97,9 +97,12 @@ int maria_delete_table_files(const char *name, myf sync_dir)
DBUG_RETURN(my_errno);
// optional files from maria_pack:
fn_format(from,name,"",".TMD",MY_UNPACK_FILENAME|MY_APPEND_EXT);
mysql_file_delete_with_symlink(key_file_dfile, from, MYF(0));
fn_format(from,name,"",".OLD",MY_UNPACK_FILENAME|MY_APPEND_EXT);
mysql_file_delete_with_symlink(key_file_dfile, from, MYF(0));
if (!temporary)
{
fn_format(from,name,"",".TMD",MY_UNPACK_FILENAME|MY_APPEND_EXT);
mysql_file_delete_with_symlink(key_file_dfile, from, MYF(0));
fn_format(from,name,"",".OLD",MY_UNPACK_FILENAME|MY_APPEND_EXT);
mysql_file_delete_with_symlink(key_file_dfile, from, MYF(0));
}
DBUG_RETURN(0);
}
......@@ -1351,7 +1351,8 @@ void _ma_remap_file(MARIA_HA *info, my_off_t size);
MARIA_RECORD_POS _ma_write_init_default(MARIA_HA *info, const uchar *record);
my_bool _ma_write_abort_default(MARIA_HA *info);
int maria_delete_table_files(const char *name, myf sync_dir);
int maria_delete_table_files(const char *name, my_bool temporary,
myf sync_dir);
/*
This cannot be in my_base.h as it clashes with HA_SPATIAL.
......
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