List:Internals« Previous MessageNext Message »
From:reggie Date:March 14 2005 10:49pm
Subject:bk commit into 4.1 tree (reggie:1.2113) 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.2113 05/03/14 16:47:35 reggie@mdk10.(none) +2 -0
  Bug #6660  mysqldump creates bad pathnames on Windows
  
  This really should not happen on Windows and part of the problem not fixed here is why show create table includes data directory when being run on Windows.  However, this patch fixes the bug in mysqldump.c
  
  mysqldump.c:
    Added fixPaths function to convert \ to / in data directory and index directory entries only on Windows

  BitKeeper/etc/logging_ok
    1.368 05/03/14 16:47:33 reggie@mdk10.(none) +1 -0
    Logging to logging@stripped accepted

  client/mysqldump.c
    1.179 05/03/14 16:45:17 reggie@mdk10.(none) +22 -0
    Added fixPaths function to convert \ to / in data directory and index directory entries only 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.178/client/mysqldump.c	2005-03-05 14:05:59 -06:00
+++ 1.179/client/mysqldump.c	2005-03-14 16:45:17 -06:00
@@ -1080,6 +1080,27 @@
   check_io(xml_file);
 }
 
+
+/*  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.
@@ -1159,6 +1180,7 @@
 
       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.367/BitKeeper/etc/logging_ok	2005-03-14 05:07:49 -06:00
+++ 1.368/BitKeeper/etc/logging_ok	2005-03-14 16:47:33 -06:00
@@ -190,6 +190,7 @@
 ranger@stripped
 rburnett@stripped
 reggie@bob.(none)
+reggie@mdk10.(none)
 root@home.(none)
 root@mc04.(none)
 root@stripped
Thread
bk commit into 4.1 tree (reggie:1.2113) BUG#6660reggie14 Mar