List:Commits« Previous MessageNext Message »
From:bar Date:January 24 2006 1:33pm
Subject:bk commit into 5.1 tree (bar:1.2072)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of bar. When bar 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.2072 06/01/24 17:33:39 bar@stripped +1 -0
  table.cc:
    Try to open an old 5.0 table name
    if encoded name doesn't exist.
    This makes SELECT working without having
    to rename tables with tricky characters
    in name into 5.1 format (simpliefies upgrade).

  sql/table.cc
    1.203 06/01/24 17:31:07 bar@stripped +26 -1
    Try to open an old 5.0 table name
    if encoded name doesn't exist.
    This makes SELECT working without having
    to rename tables with tricky characters
    in name into 5.1 format (simpliefies upgrade).

# 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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-5.1-new.fscs

--- 1.202/sql/table.cc	2006-01-20 15:33:53 +04:00
+++ 1.203/sql/table.cc	2006-01-24 17:31:07 +04: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 (bar:1.2072)bar24 Jan