List:Commits« Previous MessageNext Message »
From:msvensson Date:May 2 2008 12:41pm
Subject:bk commit into 5.0 tree (msvensson:1.2615) BUG#36469
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson.  When msvensson does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-05-02 14:41:19+02:00, msvensson@stripped +2 -0
  Bug#36469 mysql_upgrade does not use --tmpdir

  client/mysql_upgrade.c@stripped, 2008-05-02 14:41:18+02:00, msvensson@stripped +10 -1
    Add --tmpdir option to mysql_upgrade and use it when creating temporary files.

  mysql-test/mysql-test-run.pl@stripped, 2008-05-02 14:41:18+02:00, msvensson@stripped +1 -0
    Pass --tmpdir to mysql_upgrade

diff -Nrup a/client/mysql_upgrade.c b/client/mysql_upgrade.c
--- a/client/mysql_upgrade.c	2007-10-09 04:30:39 +02:00
+++ b/client/mysql_upgrade.c	2008-05-02 14:41:18 +02:00
@@ -40,6 +40,8 @@ static DYNAMIC_STRING ds_args;
 static char *opt_password= 0;
 static my_bool tty_password= 0;
 
+static char opt_tmpdir[FN_REFLEN];
+
 #ifndef DBUG_OFF
 static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
 #endif
@@ -105,6 +107,8 @@ static struct my_option my_long_options[
 #endif
   {"socket", 'S', "Socket file to use for connection.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"tmpdir", 't', "Directory for temporary files",
+   0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"user", 'u', "User for login if not current user.", (gptr*) &opt_user,
    (gptr*) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
@@ -229,6 +233,11 @@ get_one_option(int optid, const struct m
     }
     break;
 
+  case 't':
+    strnmov(opt_tmpdir, argument, sizeof(opt_tmpdir));
+    add_option= FALSE;
+    break;
+
   case 'b': /* --basedir   */
   case 'v': /* --verbose   */
   case 'd': /* --datadir   */
@@ -449,7 +458,7 @@ static int run_query(const char *query, 
   char query_file_path[FN_REFLEN];
   DBUG_ENTER("run_query");
   DBUG_PRINT("enter", ("query: %s", query));
-  if ((fd= create_temp_file(query_file_path, NULL,
+  if ((fd= create_temp_file(query_file_path, opt_tmpdir,
                             "sql", O_CREAT | O_SHARE | O_RDWR,
                             MYF(MY_WME))) < 0)
     die("Failed to create temporary file for defaults");
diff -Nrup a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
--- a/mysql-test/mysql-test-run.pl	2008-05-02 09:13:42 +02:00
+++ b/mysql-test/mysql-test-run.pl	2008-05-02 14:41:18 +02:00
@@ -1745,6 +1745,7 @@ sub mysql_upgrade_arguments()
   mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
   mtr_add_arg($args, "--datadir=$master->[0]->{'path_myddir'}");
   mtr_add_arg($args, "--basedir=$glob_basedir");
+  mtr_add_arg($args, "--tmpdir=$opt_tmpdir");
 
   if ( $opt_debug )
   {
Thread
bk commit into 5.0 tree (msvensson:1.2615) BUG#36469msvensson2 May