List:Internals« Previous MessageNext Message »
From:reggie Date:March 15 2005 6:35pm
Subject:bk commit into 4.1 tree (reggie:1.2114) BUG#6660
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of reggie. When reggie 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
  1.2114 05/03/15 11:33:06 reggie@mdk10.(none) +2 -0
  Bug #6660  mysqldump creates bad pathnames on Windows
  
  This is a modifiction of my previous patch after receiving feedback. This is a better
way to fix the problem.  With this patch, data directory and index directory will use
only forward slashes (/) when on Windows.
  
  mysqldump.c:
    Removed fixPaths routine.  Was improper fix for bug #6660
  sql_show.cc:
    Changed append_directory to convert backslashes to foward slashes when on Windows.

  client/mysqldump.c
    1.180 05/03/15 11:31:47 reggie@mdk10.(none) +0 -21
    Removed fixPaths routine.  Was improper fix for bug #6660

  sql/sql_show.cc
    1.195 05/03/15 11:31:24 reggie@mdk10.(none) +9 -0
    Changed append_directory to convert backslashes to foward slashes when on Windows.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	reggie
# Host:	mdk10.(none)
# Root:	/home/reggie/bk/mysql-4.1

--- 1.179/client/mysqldump.c	2005-03-14 16:45:17 -06:00
+++ 1.180/client/mysqldump.c	2005-03-15 11:31:47 -06:00
@@ -1081,26 +1081,6 @@
 }
 
 
-/*  fixPaths -- on Windows only, this function will iterate through the output
-  of show create table and change any \ characters that appear in the data directory
-  or index directory elements to be /  
-
-  RETURN    
-     void
-*/
-static void fixPaths(char *buf, int buflen) 
-{
-#ifdef __WIN__
-   int i = 0;
-   for (i=0; i < buflen; i++)
-   {
-      if (buf[i] != '\\') continue;
-      if (i != 0 && buf[i-1] == '\\') continue;
-      if (i != (buflen-1) && buf[i+1] == '\\') continue;
-      buf[i] = '/';}
-#endif
-}
-
 /*
   getStructure -- retrievs database structure, prints out corresponding
   CREATE statement and fills out insert_pat.
@@ -1180,7 +1160,6 @@
 
       tableRes=mysql_store_result(sock);
       row=mysql_fetch_row(tableRes);
-      fixPaths(row[1], strlen(row[1]));    // this really only does something on Windows
       fprintf(sql_file, "%s;\n", row[1]);
       check_io(sql_file);
       mysql_free_result(tableRes);

--- 1.194/sql/sql_show.cc	2005-02-28 09:49:32 -06:00
+++ 1.195/sql/sql_show.cc	2005-03-15 11:31:24 -06:00
@@ -1227,7 +1227,16 @@
     packet->append(' ');
     packet->append(dir_type);
     packet->append(" DIRECTORY='", 12);
+#ifdef __WIN__
+    char *winfilename = strdup(filename);
+    for (uint i=0; i < length; i++)
+	    if (winfilename[i] == '\\')
+		    winfilename[i] = '/';
+    packet->append(winfilename, length);
+    free(winfilename);
+#else
     packet->append(filename, length);
+#endif
     packet->append('\'');
   }
 }
Thread
bk commit into 4.1 tree (reggie:1.2114) BUG#6660reggie15 Mar