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) ...@@ -340,7 +340,13 @@ static void usage(void)
this option is deprecated; you can set variables\n\ this option is deprecated; you can set variables\n\
directly with '--variable-name=value'.\n\ directly with '--variable-name=value'.\n\
-t, --tmpdir=path Path for temporary files. Multiple paths can be\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\ in a round-robin fashion.\n\
-s, --silent Only print errors. One can use two -s to make\n\ -s, --silent Only print errors. One can use two -s to make\n\
myisamchk very silent\n\ myisamchk very silent\n\
......
...@@ -17,7 +17,12 @@ ...@@ -17,7 +17,12 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include <m_string.h> #include <m_string.h>
#if defined( __WIN__) || defined(OS2)
#define DELIM ';'
#else
#define DELIM ':' #define DELIM ':'
#endif
my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
{ {
char *end, *copy; char *end, *copy;
...@@ -45,13 +50,13 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) ...@@ -45,13 +50,13 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
convert_dirname(buff, pathlist, end); convert_dirname(buff, pathlist, end);
if (!(copy=my_strdup(buff, MYF(MY_WME)))) if (!(copy=my_strdup(buff, MYF(MY_WME))))
return TRUE; return TRUE;
if (insert_dynamic(&t_arr, &copy)) if (insert_dynamic(&t_arr, (gptr)&copy))
return TRUE; return TRUE;
pathlist=end+1; pathlist=end+1;
} }
while (*end); while (*end);
freeze_size(&t_arr); freeze_size(&t_arr);
tmpdir->list=t_arr.buffer; tmpdir->list=(char **)t_arr.buffer;
tmpdir->max=t_arr.elements-1; tmpdir->max=t_arr.elements-1;
tmpdir->cur=0; tmpdir->cur=0;
return FALSE; return FALSE;
...@@ -72,7 +77,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir) ...@@ -72,7 +77,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
uint i; uint i;
for (i=0; i<=tmpdir->max; i++) for (i=0; i<=tmpdir->max; i++)
my_free(tmpdir->list[i], MYF(0)); 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); pthread_mutex_destroy(&tmpdir->mutex);
} }
...@@ -2931,13 +2931,13 @@ struct my_option my_long_options[] = ...@@ -2931,13 +2931,13 @@ struct my_option my_long_options[] =
#endif /* HAVE_BERKELEY_DB */ #endif /* HAVE_BERKELEY_DB */
{"skip-bdb", OPT_BDB_SKIP, "Don't use berkeley db (will save memory)", {"skip-bdb", OPT_BDB_SKIP, "Don't use berkeley db (will save memory)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"big-tables", OPT_BIG_TABLES, {"big-tables", OPT_BIG_TABLES,
"Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors)", "Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-do-db", OPT_BINLOG_DO_DB, {"binlog-do-db", OPT_BINLOG_DO_DB,
"Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.", "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB,
"Tells the master that updates to the given database should not be logged tothe binary log", "Tells the master that updates to the given database should not be logged tothe binary log",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"bind-address", OPT_BIND_ADDRESS, "IP address to bind to", {"bind-address", OPT_BIND_ADDRESS, "IP address to bind to",
...@@ -3306,12 +3306,18 @@ struct my_option my_long_options[] = ...@@ -3306,12 +3306,18 @@ struct my_option my_long_options[] =
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
#endif #endif
{"temp-pool", OPT_TEMP_POOL, {"temp-pool", OPT_TEMP_POOL,
"Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.", "Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
(gptr*) &use_temp_pool, (gptr*) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1, (gptr*) &use_temp_pool, (gptr*) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"tmpdir", 't', {"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,
(gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"transaction-isolation", OPT_TX_ISOLATION, {"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