List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:May 7 2005 10:57pm
Subject:bk commit into 4.1 tree (jimw:1.2244) BUG#10435
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jimw. When jimw 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.2244 05/05/07 13:57:22 jimw@stripped +1 -0
  Add special error message for .frm files with an un-understood version, like
  those from 5.0 with new datatypes. (Bug #10435)

  sql/table.cc
    1.128 05/05/07 13:54:07 jimw@stripped +13 -2
    Print distinct version mismatch message when encountering a .frm file with
    a version that is not understood.

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.1-10435

--- 1.127/sql/table.cc	2005-04-01 08:50:36 -08:00
+++ 1.128/sql/table.cc	2005-05-07 13:54:07 -07:00
@@ -59,6 +59,7 @@
    3    Wrong data in .frm file
    4    Error (see frm_error)
    5    Error (see frm_error: charset unavailable)
+   6    Unknown .frm version
 */
 
 int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
@@ -118,9 +119,13 @@
   *fn_ext(outparam->path)='\0';		// Remove extension
 
   if (my_read(file,(byte*) head,64,MYF(MY_NABP))) goto err_not_open;
-  if (head[0] != (uchar) 254 || head[1] != 1 ||
-      (head[2] != FRM_VER && head[2] != FRM_VER+1 && head[2] !=
FRM_VER+3))
+  if (head[0] != (uchar) 254 || head[1] != 1)
     goto err_not_open;				/* purecov: inspected */
+  if (head[2] != FRM_VER && head[2] != FRM_VER+1 && head[2] != FRM_VER+3)
+  {
+    error= 6;
+    goto err_not_open;				/* purecov: inspected */
+  }
   new_field_pack_flag=head[27];
   new_frm_ver= (head[2] - FRM_VER);
   field_pack_length= new_frm_ver < 2 ? 11 : 17;
@@ -1033,6 +1038,12 @@
                     MYF(0), csname, form->real_name);
     break;
   }
+  case 6:
+    my_printf_error(ER_NOT_FORM_FILE,
+                    "Table '%-.64s' was created with a different version "
+                    "of MySQL and cannot be read",
+                    MYF(0), name);
+    break;
   default:				/* Better wrong error than none */
   case 4:
     my_error(ER_NOT_FORM_FILE,errortype,
Thread
bk commit into 4.1 tree (jimw:1.2244) BUG#10435Jim Winstead7 May