Commit 1ced5948 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

low-level error messages cleanup

parent 9199252c
......@@ -59,8 +59,10 @@ static HA_ERRORS ha_errlist[]=
{ 121,"Duplicate key on write or update" },
{ 123,"Someone has changed the row since it was read; Update with is recoverable" },
{ 124,"Wrong index given to function" },
{ 126,"Index file is crashed / Wrong file format" },
{ 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" },
......@@ -73,7 +75,7 @@ static HA_ERRORS ha_errlist[]=
{ 140,"Wrong create options"},
{ 141,"Duplicate unique key or constraint on write or update"},
{ 142,"Unknown character set used"},
{ 143,"Conflicting table definition between MERGE and mapped table"},
{ 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"},
......@@ -81,6 +83,8 @@ static HA_ERRORS ha_errlist[]=
{ 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"},
......
......@@ -216,6 +216,7 @@ enum ha_base_keytype {
#define HA_ERR_CRASHED 126 /* Indexfile is crashed */
#define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */
#define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */
#define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */
#define HA_ERR_WRONG_COMMAND 131 /* Command not supported */
#define HA_ERR_OLD_FILE 132 /* old databasfile */
#define HA_ERR_NO_ACTIVE_RECORD 133 /* No record read in update() */
......@@ -228,7 +229,7 @@ enum ha_base_keytype {
#define HA_WRONG_CREATE_OPTION 140 /* Wrong create option */
#define HA_ERR_FOUND_DUPP_UNIQUE 141 /* Dupplicate unique on write */
#define HA_ERR_UNKNOWN_CHARSET 142 /* Can't open charset */
#define HA_ERR_WRONG_TABLE_DEF 143
#define HA_ERR_WRONG_MRG_TABLE_DEF 143 /* conflicting MyISAM tables in MERGE */
#define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */
#define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */
#define HA_ERR_LOCK_WAIT_TIMEOUT 146
......
......@@ -114,7 +114,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
DBUG_PRINT("error",("Wrong header in %s",name_buff));
DBUG_DUMP("error_dump",(char*) share->state.header.file_version,
head_length);
my_errno=HA_ERR_WRONG_TABLE_DEF;
my_errno=HA_ERR_NOT_A_TABLE;
goto err;
}
share->options= mi_uint2korr(share->state.header.options);
......
......@@ -735,7 +735,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
case HA_ERR_CRASHED:
mi_check_print_error(param,"'%s' doesn't have a correct index definition. You need to recreate it before you can do a repair",filename);
break;
case HA_ERR_WRONG_TABLE_DEF:
case HA_ERR_NOT_A_TABLE:
mi_check_print_error(param,"'%s' is not a MyISAM-table",filename);
break;
case HA_ERR_CRASHED_ON_USAGE:
......
......@@ -84,7 +84,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
last_isam=isam;
if (info.reclength && info.reclength != isam->s->base.reclength)
{
my_errno=HA_ERR_WRONG_IN_RECORD;
my_errno=HA_ERR_WRONG_MRG_TABLE_DEF;
goto err;
}
info.reclength=isam->s->base.reclength;
......
......@@ -231,7 +231,7 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_COL_APPEARS_TWICE_IN_INDEX) {
return(HA_ERR_WRONG_TABLE_DEF);
return(HA_ERR_CRASHED);
} else if (error == (int) DB_OUT_OF_FILE_SPACE) {
......
......@@ -35,7 +35,7 @@
*****************************************************************************/
const char **ha_isam::bas_ext() const
{ static const char *ext[]= { ".ISD",".ISM", NullS }; return ext; }
{ static const char *ext[]= { ".ISM",".ISD", NullS }; return ext; }
int ha_isam::open(const char *name, int mode, uint test_if_locked)
......
......@@ -117,7 +117,7 @@ void mi_check_print_warning(MI_CHECK *param, const char *fmt,...)
}
const char **ha_myisam::bas_ext() const
{ static const char *ext[]= { ".MYD",".MYI", NullS }; return ext; }
{ static const char *ext[]= { ".MYI",".MYD", NullS }; return ext; }
const char *ha_myisam::index_type(uint key_number)
......
......@@ -69,7 +69,7 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
err:
myrg_close(file);
file=0;
return (my_errno= HA_ERR_WRONG_TABLE_DEF);
return (my_errno= HA_ERR_WRONG_MRG_TABLE_DEF);
}
int ha_myisammrg::close(void)
......
......@@ -679,7 +679,7 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_END_OF_FILE:
textno=ER_KEY_NOT_FOUND;
break;
case HA_ERR_WRONG_TABLE_DEF:
case HA_ERR_WRONG_MRG_TABLE_DEF:
textno=ER_WRONG_MRG_TABLE;
break;
case HA_ERR_FOUND_DUPP_KEY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment