List:Internals« Previous MessageNext Message »
From:msvensson Date:April 7 2005 8:17pm
Subject:bk commit into 5.0 tree (msvensson:1.1879) BUG#6762
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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.1879 05/04/07 20:17:37 msvensson@neptunus.(none) +5 -0
  BUG#6762 ALTER TABLE gives weird results and error message
   - Removed hardcoded error message from 4.1

  sql/share/errmsg.txt
    1.22 05/04/07 20:17:34 msvensson@neptunus.(none) +3 -0
    Adding error message for the case when table definition has changed in storage engine

  sql/handler.cc
    1.158 05/04/07 20:17:34 msvensson@neptunus.(none) +4 -0
    Adding error message for the case when table definition has changed in storage engine

  sql/ha_ndbcluster.cc
    1.171 05/04/07 20:17:34 msvensson@neptunus.(none) +3 -10
    Add mapping for ndb error 284 to HA_ERR_TABLE_DEF_CHANGED, this error will occur when
the table definition has been changed by another MySQL Server connected to the cluster.
    Remove hardcoded errormessage from 4.1 

  mysql-test/t/ndb_alter_table.test
    1.20 05/04/07 20:17:34 msvensson@neptunus.(none) +1 -1
    Updated testresult to expect new error code

  include/my_base.h
    1.69 05/04/07 20:17:33 msvensson@neptunus.(none) +3 -1
    Adding error message for the case when table definition has changed in storage engine

# 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/mysql-5.0

--- 1.68/include/my_base.h	2005-02-18 13:14:26 +01:00
+++ 1.69/include/my_base.h	2005-04-07 20:17:33 +02:00
@@ -312,7 +312,9 @@
 #define HA_ERR_TABLE_EXIST       156  /* The table existed in storage engine */
 #define HA_ERR_NO_CONNECTION     157  /* Could not connect to storage engine */
 #define HA_ERR_NULL_IN_SPATIAL   158  /* NULLs are not supported in spatial index */
-#define HA_ERR_LAST              158  /*Copy last error nr.*/
+#define HA_ERR_TABLE_DEF_CHANGED 159  /* The table changed in storage engine */
+
+#define HA_ERR_LAST              159  /*Copy last error nr.*/
 /* Add error numbers before HA_ERR_LAST and change it accordingly. */
 #define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)
 

--- 1.157/sql/handler.cc	2005-04-05 16:55:15 +02:00
+++ 1.158/sql/handler.cc	2005-04-07 20:17:34 +02:00
@@ -304,6 +304,7 @@
   SETMSG(HA_ERR_NO_SUCH_TABLE,          "No such table: '%.64s'");
   SETMSG(HA_ERR_TABLE_EXIST,            ER(ER_TABLE_EXISTS_ERROR));
   SETMSG(HA_ERR_NO_CONNECTION,          "Could not connect to storage engine");
+  SETMSG(HA_ERR_TABLE_DEF_CHANGED,      ER(ER_TABLE_DEF_CHANGED));
 
   /* Register the error messages for use with my_error(). */
   return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
@@ -1645,6 +1646,9 @@
     break;
   case HA_ERR_NO_REFERENCED_ROW:
     textno=ER_NO_REFERENCED_ROW;
+    break;
+  case HA_ERR_TABLE_DEF_CHANGED:
+    textno=ER_TABLE_DEF_CHANGED;
     break;
   case HA_ERR_NO_SUCH_TABLE:
   {

--- 1.21/sql/share/errmsg.txt	2005-04-03 09:31:45 +02:00
+++ 1.22/sql/share/errmsg.txt	2005-04-07 20:17:34 +02:00
@@ -5336,3 +5336,6 @@
 	eng "You are not allowed to create a user with GRANT"
 ER_WRONG_VALUE_FOR_TYPE  
 	eng "Incorrect %-.32s value: '%-.128s' for function %-.32s"
+ER_TABLE_DEF_CHANGED
+	eng "Table definition has changed, please retry transaction"
+

--- 1.19/mysql-test/t/ndb_alter_table.test	2005-04-05 21:31:52 +02:00
+++ 1.20/mysql-test/t/ndb_alter_table.test	2005-04-07 20:17:34 +02:00
@@ -147,7 +147,7 @@
 connection server1;
 alter table t1 drop index c;
 connection server2;
---error 1105
+--error 1412
 select * from t1 where b = 'two';
 select * from t1 where b = 'two';
 connection server1;

--- 1.170/sql/ha_ndbcluster.cc	2005-04-05 21:31:52 +02:00
+++ 1.171/sql/ha_ndbcluster.cc	2005-04-07 20:17:34 +02:00
@@ -192,6 +192,8 @@
   { 827, HA_ERR_RECORD_FILE_FULL, 1 },
   { 832, HA_ERR_RECORD_FILE_FULL, 1 },
 
+  { 284, HA_ERR_TABLE_DEF_CHANGED, 0 },
+
   { 0, 1, 0 },
 
   { -1, -1, 1 }
@@ -470,16 +472,7 @@
         if (err.code != 709)
           DBUG_RETURN(1);
       }
-      else
-      {
-        DBUG_PRINT("info", ("Table exist but must have changed"));
-        /* In 5.0, this should be replaced with a mapping to a mysql error */
-        my_printf_error(ER_UNKNOWN_ERROR,
-                        "Table definition has changed, "\
-                        "please retry transaction",
-                        MYF(0));
-        DBUG_RETURN(1);
-      }
+      DBUG_PRINT("info", ("Table exists but must have changed"));
     }
     break;
   default:
Thread
bk commit into 5.0 tree (msvensson:1.1879) BUG#6762msvensson7 Apr