summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc27
1 files changed, 8 insertions, 19 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a3a82d96b2e..1b4713706fb 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -395,7 +395,8 @@ const char *myisam_recover_options_str="OFF";
const char *sql_mode_str="OFF";
ulong rpl_recovery_rank=0;
-my_string mysql_unix_port=NULL, opt_mysql_tmpdir=NULL, mysql_tmpdir=NULL;
+my_string mysql_unix_port=NULL, opt_mysql_tmpdir=NULL;
+MY_TMPDIR mysql_tmpdir_list;
ulong my_bind_addr; /* the address we bind to */
char *my_bind_addr_str;
DATE_FORMAT dayord;
@@ -852,7 +853,7 @@ void clean_up(bool print_message)
if (defaults_argv)
free_defaults(defaults_argv);
my_free(charsets_list, MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
+ free_tmpdir(&mysql_tmpdir_list);
my_free(slave_load_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
x_free(opt_bin_logname);
x_free(opt_relay_logname);
@@ -1834,17 +1835,6 @@ int main(int argc, char **argv)
load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv);
defaults_argv=argv;
- /* Get default temporary directory */
- opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
-#if defined( __WIN__) || defined(OS2)
- if (!opt_mysql_tmpdir)
- opt_mysql_tmpdir=getenv("TEMP");
- if (!opt_mysql_tmpdir)
- opt_mysql_tmpdir=getenv("TMP");
-#endif
- if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0])
- opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */
-
set_options();
get_options(argc,argv);
if (opt_log || opt_update_log || opt_slow_log || opt_bin_log)
@@ -3320,12 +3310,13 @@ struct my_option my_long_options[] =
"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,
0, 0, 0, 0, 0},
- {"tmpdir", 't', "Path for temporary files", (gptr*) &opt_mysql_tmpdir,
+ {"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.",
+ (gptr*) &opt_mysql_tmpdir,
(gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"transaction-isolation", OPT_TX_ISOLATION,
"Default transaction isolation level", 0, 0, 0, GET_NO_ARG, REQUIRED_ARG, 0,
- 0, 0, 0,
- 0, 0},
+ 0, 0, 0, 0, 0},
{"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running",
(gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -4498,9 +4489,7 @@ static void fix_paths(void)
charsets_dir=mysql_charsets_dir;
}
- char *end=convert_dirname(buff, opt_mysql_tmpdir, NullS);
- if (!(mysql_tmpdir= my_memdup((byte*) buff,(uint) (end-buff)+1,
- MYF(MY_FAE))))
+ if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir))
exit(1);
if (!slave_load_tmpdir)
{