summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2002-10-08 12:39:37 +0000
committerunknown <serg@serg.mysql.com>2002-10-08 12:39:37 +0000
commitfdf39e28dc33506df1969b3fdcf7ab09e7693c76 (patch)
treef56fc2e9d386247b856581d18396d00a3f730667 /sql/sql_base.cc
parentc605095a7d202a8ff3f4061cf1f19512ecb95f0e (diff)
downloadmariadb-git-fdf39e28dc33506df1969b3fdcf7ab09e7693c76.tar.gz
support for --tmpdir=dir1:dir2:...
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 8deae314484..e81d950e2e4 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2227,30 +2227,32 @@ fill_record(Field **ptr,List<Item> &values)
static void mysql_rm_tmp_tables(void)
{
- uint idx;
- char filePath[FN_REFLEN];
+ uint i, idx;
+ char filePath[FN_REFLEN], *tmpdir;
MY_DIR *dirp;
FILEINFO *file;
DBUG_ENTER("mysql_rm_tmp_tables");
+ for (i=0; i<=mysql_tmpdir_list.max; i++)
+ {
+ tmpdir=mysql_tmpdir_list.list[i];
/* See if the directory exists */
- if (!(dirp = my_dir(mysql_tmpdir,MYF(MY_WME | MY_DONT_SORT))))
- DBUG_VOID_RETURN; /* purecov: inspected */
+ if (!(dirp = my_dir(tmpdir,MYF(MY_WME | MY_DONT_SORT))))
+ continue;
- /*
- ** Remove all SQLxxx tables from directory
- */
+ /* Remove all SQLxxx tables from directory */
for (idx=2 ; idx < (uint) dirp->number_off_files ; idx++)
{
file=dirp->dir_entry+idx;
if (!bcmp(file->name,tmp_file_prefix,tmp_file_prefix_length))
{
- sprintf(filePath,"%s%s",mysql_tmpdir,file->name); /* purecov: inspected */
- VOID(my_delete(filePath,MYF(MY_WME))); /* purecov: inspected */
+ sprintf(filePath,"%s%s",tmpdir,file->name);
+ VOID(my_delete(filePath,MYF(MY_WME)));
}
}
my_dirend(dirp);
+ }
DBUG_VOID_RETURN;
}