List:Commits« Previous MessageNext Message »
From:tim Date:October 18 2007 10:25pm
Subject:bk commit into 5.0 tree (tsmith:1.2538) BUG#25177
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tsmith. When tsmith 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@stripped, 2007-10-18 16:25:30-06:00, tsmith@stripped +2 -0
  Bug #25177: New error codes without error message
  
  Add new messages to perror.c, and also add some checks to prevent
  perror.c from compiling if it is not updated when new handler errors
  are added to my_base.h.

  extra/perror.c@stripped, 2007-10-18 16:25:29-06:00, tsmith@stripped +47 -43
    Use symbolic error names from my_base.h, instead of duplicating
    the hard-coded constants, in ha_errlist.
    
    Add errors 153 through 163, which were missing.
    
    Remove the BDB errors, which had not been kept in sync with the
    real values in bdb/dbinc/db.in.
    
    Add a compile-time check that the last error number in ha_errlist
    matches the last error in my_base.h.

  include/my_base.h@stripped, 2007-10-18 16:25:29-06:00, tsmith@stripped +11 -4
    Add comment that perror.c must be updated whenever a new HA_ERR_*
    error number is added.

diff -Nrup a/extra/perror.c b/extra/perror.c
--- a/extra/perror.c	2007-03-28 11:46:36 -06:00
+++ b/extra/perror.c	2007-10-18 16:25:29 -06:00
@@ -18,6 +18,7 @@
 #define PERROR_VERSION "2.10"
 
 #include <my_global.h>
+#include <my_base.h>
 #include <my_sys.h>
 #include <m_string.h>
 #include <errno.h>
@@ -64,53 +65,56 @@ typedef struct ha_errors {
   const char *msg;
 } HA_ERRORS;
 
-
 static HA_ERRORS ha_errlist[]=
 {
-  { 120,"Didn't find key on read or update" },
-  { 121,"Duplicate key on write or update" },
-  { 123,"Someone has changed the row since it was read (while the table was locked to prevent it)" },
-  { 124,"Wrong index given to function" },
-  { 126,"Index file is crashed" },
-  { 127,"Record-file is crashed" },
-  { 128,"Out of memory" },
-  { 130,"Incorrect file format" },
-  { 131,"Command not supported by database" },
-  { 132,"Old database file" },
-  { 133,"No record read before update" },
-  { 134,"Record was already deleted (or record file crashed)" },
-  { 135,"No more room in record file" },
-  { 136,"No more room in index file" },
-  { 137,"No more records (read after end of file)" },
-  { 138,"Unsupported extension used for table" },
-  { 139,"Too big row"},
-  { 140,"Wrong create options"},
-  { 141,"Duplicate unique key or constraint on write or update"},
-  { 142,"Unknown character set used"},
-  { 143,"Conflicting table definitions in sub-tables of MERGE table"},
-  { 144,"Table is crashed and last repair failed"},
-  { 145,"Table was marked as crashed and should be repaired"},
-  { 146,"Lock timed out; Retry transaction"},
-  { 147,"Lock table is full;  Restart program with a larger locktable"},
-  { 148,"Updates are not allowed under a read only transactions"},
-  { 149,"Lock deadlock; Retry transaction"},
-  { 150,"Foreign key constraint is incorrectly formed"},
-  { 151,"Cannot add a child row"},
-  { 152,"Cannot delete a parent row"},
-  { -30999, "DB_INCOMPLETE: Sync didn't finish"},
-  { -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
-  { -30997, "DB_KEYEXIST: The key/data pair already exists"},
-  { -30996, "DB_LOCK_DEADLOCK: Deadlock"},
-  { -30995, "DB_LOCK_NOTGRANTED: Lock unavailable"},
-  { -30994, "DB_NOSERVER: Server panic return"},
-  { -30993, "DB_NOSERVER_HOME: Bad home sent to server"},
-  { -30992, "DB_NOSERVER_ID: Bad ID sent to server"},
-  { -30991, "DB_NOTFOUND: Key/data pair not found (EOF)"},
-  { -30990, "DB_OLD_VERSION: Out-of-date version"},
-  { -30989, "DB_RUNRECOVERY: Panic return"},
-  { -30988, "DB_VERIFY_BAD: Verify failed; bad format"},
+  { HA_ERR_KEY_NOT_FOUND, "Didn't find key on read or update" },
+  { HA_ERR_FOUND_DUPP_KEY, "Duplicate key on write or update" },
+  { HA_ERR_RECORD_CHANGED, "Someone has changed the row since it was read (while the table was locked to prevent it)" },
+  { HA_ERR_WRONG_INDEX, "Wrong index given to function" },
+  { HA_ERR_CRASHED, "Index file is crashed" },
+  { HA_ERR_WRONG_IN_RECORD, "Record-file is crashed" },
+  { HA_ERR_OUT_OF_MEM, "Out of memory" },
+  { HA_ERR_NOT_A_TABLE, "Incorrect file format" },
+  { HA_ERR_WRONG_COMMAND, "Command not supported by database" },
+  { HA_ERR_OLD_FILE, "Old database file" },
+  { HA_ERR_NO_ACTIVE_RECORD, "No record read before update" },
+  { HA_ERR_RECORD_DELETED, "Record was already deleted (or record file crashed)" },
+  { HA_ERR_RECORD_FILE_FULL, "No more room in record file" },
+  { HA_ERR_INDEX_FILE_FULL, "No more room in index file" },
+  { HA_ERR_END_OF_FILE, "No more records (read after end of file)" },
+  { HA_ERR_UNSUPPORTED, "Unsupported extension used for table" },
+  { HA_ERR_TO_BIG_ROW, "Too big row" },
+  { HA_WRONG_CREATE_OPTION, "Wrong create options" },
+  { HA_ERR_FOUND_DUPP_UNIQUE, "Duplicate unique key or constraint on write or update" },
+  { HA_ERR_UNKNOWN_CHARSET, "Unknown character set used" },
+  { HA_ERR_WRONG_MRG_TABLE_DEF, "Conflicting table definitions in sub-tables of MERGE table" },
+  { HA_ERR_CRASHED_ON_REPAIR, "Table is crashed and last repair failed" },
+  { HA_ERR_CRASHED_ON_USAGE, "Table was marked as crashed and should be repaired" },
+  { HA_ERR_LOCK_WAIT_TIMEOUT, "Lock timed out; Retry transaction" },
+  { HA_ERR_LOCK_TABLE_FULL, "Lock table is full;  Restart program with a larger locktable" },
+  { HA_ERR_READ_ONLY_TRANSACTION, "Updates are not allowed under a read only transactions" },
+  { HA_ERR_LOCK_DEADLOCK, "Lock deadlock; Retry transaction" },
+  { HA_ERR_CANNOT_ADD_FOREIGN, "Foreign key constraint is incorrectly formed" },
+  { HA_ERR_NO_REFERENCED_ROW, "Cannot add a child row" },
+  { HA_ERR_ROW_IS_REFERENCED, "Cannot delete a parent row" },
+  { HA_ERR_NO_SAVEPOINT, "No savepoint with that name" },
+  { HA_ERR_NON_UNIQUE_BLOCK_SIZE, "Non-unique key block size" },
+  { HA_ERR_NO_SUCH_TABLE, "The table does not exist in engine" },
+  { HA_ERR_TABLE_EXIST, "The table already existed in storage engine" },
+  { HA_ERR_NO_CONNECTION, "Could not connect to storage engine" },
+  { HA_ERR_NULL_IN_SPATIAL, "NULLs are not supported in spatial index" },
+  { HA_ERR_TABLE_DEF_CHANGED, "The table changed in storage engine" },
+  { HA_ERR_TABLE_NEEDS_UPGRADE, "The table changed in storage engine" },
+  { HA_ERR_TABLE_READONLY, "The table is not writable" },
+  { HA_ERR_AUTOINC_READ_FAILED, "Failed to get the next autoinc value" },
+  { HA_ERR_AUTOINC_ERANGE, "Failed to set the row autoinc value" },
+#define LAST_ERROR HA_ERR_AUTOINC_ERANGE
   { 0,NullS },
 };
+
+#if LAST_ERROR != HA_ERR_LAST
+#error List of errors is not in sync with my_base.h
+#endif
 
 
 #include <help_start.h>
diff -Nrup a/include/my_base.h b/include/my_base.h
--- a/include/my_base.h	2007-07-11 02:59:44 -06:00
+++ b/include/my_base.h	2007-10-18 16:25:29 -06:00
@@ -332,9 +332,13 @@ enum ha_base_keytype {
 
 	/* Errorcodes given by functions */
 
-/* opt_sum_query() assumes these codes are > 1 */
-/* Do not add error numbers before HA_ERR_FIRST. */
-/* If necessary to add lower numbers, change HA_ERR_FIRST accordingly. */
+/*
+  opt_sum_query() assumes these codes are > 1.  Do not add error numbers
+  before HA_ERR_FIRST.  If necessary to add lower numbers, change HA_ERR_FIRST
+  accordingly.
+
+  Always update extra/perror.c when a new error number is added.
+*/
 #define HA_ERR_FIRST            120 /*Copy first error nr.*/
 #define HA_ERR_KEY_NOT_FOUND	120	/* Didn't find key on read or update */
 #define HA_ERR_FOUND_DUPP_KEY	121	/* Dupplicate key on write */
@@ -379,7 +383,10 @@ enum ha_base_keytype {
 #define HA_ERR_AUTOINC_ERANGE    163  /* Failed to set the row autoinc value */
 
 #define HA_ERR_LAST              163  /*Copy last error nr.*/
-/* Add error numbers before HA_ERR_LAST and change it accordingly. */
+/*
+  Add error numbers before HA_ERR_LAST and change it accordingly.
+  Always update extra/perror.c when a new error number is added.
+*/
 #define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)
 
 	/* Other constants */
Thread
bk commit into 5.0 tree (tsmith:1.2538) BUG#25177tim19 Oct
  • Re: bk commit into 5.0 tree (tsmith:1.2538) BUG#25177Sergei Golubchik19 Oct