Commit 68cd8c47 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

--tmpdir=dir1:dir2... uses (is_windows ? ";" : ":") as a delimiter

parent f7ca3212
......@@ -340,7 +340,13 @@ static void usage(void)
this option is deprecated; you can set variables\n\
directly with '--variable-name=value'.\n\
-t, --tmpdir=path Path for temporary files. Multiple paths can be\n\
specified, separated by colon (:), they will be used\n\
specified, separated by "
#if defined( __WIN__) || defined(OS2)
"semicolon (;)"
#else
"colon (:)"
#endif
", they will be used\n\
in a round-robin fashion.\n\
-s, --silent Only print errors. One can use two -s to make\n\
myisamchk very silent\n\
......
......@@ -17,7 +17,12 @@
#include "mysys_priv.h"
#include <m_string.h>
#if defined( __WIN__) || defined(OS2)
#define DELIM ';'
#else
#define DELIM ':'
#endif
my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
{
char *end, *copy;
......@@ -45,13 +50,13 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
convert_dirname(buff, pathlist, end);
if (!(copy=my_strdup(buff, MYF(MY_WME))))
return TRUE;
if (insert_dynamic(&t_arr, &copy))
if (insert_dynamic(&t_arr, (gptr)&copy))
return TRUE;
pathlist=end+1;
}
while (*end);
freeze_size(&t_arr);
tmpdir->list=t_arr.buffer;
tmpdir->list=(char **)t_arr.buffer;
tmpdir->max=t_arr.elements-1;
tmpdir->cur=0;
return FALSE;
......@@ -72,7 +77,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
uint i;
for (i=0; i<=tmpdir->max; i++)
my_free(tmpdir->list[i], MYF(0));
my_free(tmpdir->list, MYF(0));
my_free((gptr)tmpdir->list, MYF(0));
pthread_mutex_destroy(&tmpdir->mutex);
}
......@@ -3311,7 +3311,13 @@ struct my_option my_long_options[] =
(gptr*) &use_temp_pool, (gptr*) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files. Several paths may be specified, separated by a colon (:), in this case they are used in a round-robin fashion.",
"Path for temporary files. Several paths may be specified, separated by a "
#if defined( __WIN__) || defined(OS2)
"semicolon (;)"
#else
"colon (:)"
#endif
", in this case they are used in a round-robin fashion.",
(gptr*) &opt_mysql_tmpdir,
(gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"transaction-isolation", OPT_TX_ISOLATION,
......
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