MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:March 9 2010 4:23pm
Subject:bzr commit into mysql-5.1-bugteam branch (joro:3380) Bug#41057
View as plain text  
#At file:///Users/kgeorge/mysql/work/B41057-5.1-bugteam/ based on revid:joro@stripped

 3380 Georgi Kodinov	2010-03-09
      Bug #41057: mysql_update fails FATAL ERROR: Failed to create temporary file for defaults
      mysql_upgrade was passing an non-initialized non-null tmpdir to create_temp_file() if no 
      --tmpdir was specified. This prevents create_temp_file() from taking the system 
      temporary file path and as a result mysql_upgrade was trying to open a file in a 
      directory that it may not have write access to.
      Fixed by making sure mysql_upgrade will pass a zero length temp dir string to 
      create_temp_file() if no --tmpdir is specified.

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2010-02-04 12:39:42 +0000
+++ b/client/mysql_upgrade.c	2010-03-09 09:18:46 +0000
@@ -44,7 +44,7 @@ static DYNAMIC_STRING conn_args;
 static char *opt_password= 0;
 static my_bool tty_password= 0;
-static char opt_tmpdir[FN_REFLEN];
+static char opt_tmpdir[FN_REFLEN] = "";
 #ifndef DBUG_OFF
 static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
@@ -459,7 +459,8 @@ static int run_query(const char *query, 
   DBUG_PRINT("enter", ("query: %s", query));
-  if ((fd= create_temp_file(query_file_path, opt_tmpdir,
+  if ((fd= create_temp_file(query_file_path, 
+                            opt_tmpdir[0] ? opt_tmpdir : NULL,
                             "sql", O_CREAT | O_SHARE | O_RDWR,
                             MYF(MY_WME))) < 0)
     die("Failed to create temporary file for defaults");

Attachment: [text/bzr-bundle] bzr/
bzr commit into mysql-5.1-bugteam branch (joro:3380) Bug#41057Georgi Kodinov9 Mar