summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2003-01-28 17:42:08 +0100
committerunknown <serg@serg.mysql.com>2003-01-28 17:42:08 +0100
commit73284c938465e9266ca7456e8b1112e2bbc1d9a5 (patch)
tree37e31feff36633416e5c16cb0499afefcd9336c4
parenta29d85072d7f6cd45586e0931affd053a1db94bd (diff)
downloadmariadb-git-73284c938465e9266ca7456e8b1112e2bbc1d9a5.tar.gz
low-level error messages cleanup
extra/perror.c: error messages fixups include/my_base.h: error codes fixups myisam/mi_open.c: correct error reported myisam/myisamchk.c: correct error reported myisammrg/myrg_open.c: correct error reported sql/ha_innodb.cc: correct error reported sql/ha_isam.cc: reorder table file extensions to get better error on "cannot open the table" sql/ha_myisam.cc: reorder table file extensions to get better error on "cannot open the table" sql/ha_myisammrg.cc: correct error reported sql/handler.cc: correct error reported
-rw-r--r--extra/perror.c8
-rw-r--r--include/my_base.h5
-rw-r--r--myisam/mi_open.c2
-rw-r--r--myisam/myisamchk.c2
-rw-r--r--myisammrg/myrg_open.c2
-rw-r--r--sql/ha_innodb.cc2
-rw-r--r--sql/ha_isam.cc2
-rw-r--r--sql/ha_myisam.cc2
-rw-r--r--sql/ha_myisammrg.cc2
-rw-r--r--sql/handler.cc2
10 files changed, 17 insertions, 12 deletions
diff --git a/extra/perror.c b/extra/perror.c
index e22ce467949..a2951bff66a 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -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"},
diff --git a/include/my_base.h b/include/my_base.h
index feb5259ef08..e1761eac8f9 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -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,10 +229,10 @@ 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
+#define HA_ERR_LOCK_WAIT_TIMEOUT 146
#define HA_ERR_LOCK_TABLE_FULL 147
#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */
#define HA_ERR_LOCK_DEADLOCK 149
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 0da5ebabf40..077d8c7da3a 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -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);
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index f5bae72396a..6c541a444b7 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -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:
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index f996277d287..7ff00270c68 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -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;
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index a25aedaa89f..58a6faa7ef8 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -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) {
diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc
index 6fa54d18aac..7371628890f 100644
--- a/sql/ha_isam.cc
+++ b/sql/ha_isam.cc
@@ -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)
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 19e97c60dd3..81b04cf5ba7 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -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)
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index a93d2e5ed43..616248b2cf3 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -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)
diff --git a/sql/handler.cc b/sql/handler.cc
index d4fd45613d4..fb33888e91e 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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: