List:Commits« Previous MessageNext Message »
From:msvensson Date:January 24 2006 4:46pm
Subject:bk commit into 5.1 tree (msvensson:1.2073)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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
  1.2073 06/01/24 17:46:13 msvensson@neptunus.(none) +1 -0
  Merge bk-internal:/home/bk/mysql-5.1-new
  into  neptunus.(none):/home/msvensson/mysql/bug15020/my51-bug15020

  sql/table.cc
    1.204 06/01/24 17:46:07 msvensson@neptunus.(none) +0 -0
    Auto merged

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug15020/my51-bug15020/RESYNC

--- 1.203/sql/table.cc	2006-01-24 10:31:28 +01:00
+++ 1.204/sql/table.cc	2006-01-24 17:46:07 +01:00
@@ -270,7 +270,32 @@
 
   strxmov(path, share->normalized_path.str, reg_ext, NullS);
   if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
-    goto err_not_open;
+  {
+    /* Try unecoded 5.0 name */
+    uint length;
+    strxnmov(path, sizeof(path)-1,
+             mysql_data_home, "/", share->db.str, "/",
+             share->table_name.str, reg_ext, NullS);
+    length= unpack_filename(path, path) - reg_ext_length;
+    /*
+      The following is a safety test and should never fail
+      as the old file name should never be longer than the new one.
+    */
+    DBUG_ASSERT(length <= share->normalized_path.length);
+    /*
+      If the old and the new names have the same length,
+      then table name does not have tricky characters,
+      so no need to check the old file name.
+    */
+    if (length == share->normalized_path.length ||
+        ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0))
+      goto err_not_open;
+
+    /* Unencoded 5.0 table name found */
+    path[length]= '\0'; // Remove .frm extension
+    strmov(share->normalized_path.str, path);
+    share->normalized_path.length= length;
+  }
 
   error= 4;
   if (my_read(file,(byte*) head, 64, MYF(MY_NABP)))
Thread
bk commit into 5.1 tree (msvensson:1.2073)msvensson24 Jan