diff options
author | unknown <gni/root@dev3-221.dev.cn.tlan> | 2007-04-03 18:44:29 +0800 |
---|---|---|
committer | unknown <gni/root@dev3-221.dev.cn.tlan> | 2007-04-03 18:44:29 +0800 |
commit | 5203ea6ccb349aae5e53e3f0247256a9fc60208e (patch) | |
tree | f54056d12cacaac1d0a887906fd01c6d9ab2c9b9 /sql/ha_ndbcluster.cc | |
parent | 1f7b3e569df0212219c0741aa70f240f09e02772 (diff) | |
download | mariadb-git-5203ea6ccb349aae5e53e3f0247256a9fc60208e.tar.gz |
BUG#18676 when cluster storage engine is down, misleading error message on create table with 4009.
mysql-test/r/ndb_autodiscover.result:
changes ndbd error code to mysqld error code when no cluster connection
sql/ha_ndbcluster.cc:
map 4009 error code to mysql not connected error
sql/handler.cc:
define return codes to ha_table_exists_in_engine to something useful
NOTE: in 5.1 this should call a handlerton method, not horrible ifdef ndb stuff
sql/sql_table.cc:
clearly define what happens on create table if exits/not exists/not connected to engine
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7a9c7d0d021..ead7343db88 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -203,6 +203,8 @@ static const err_code_mapping err_map[]= { 284, HA_ERR_TABLE_DEF_CHANGED, 0 }, + {4009, HA_ERR_NO_CONNECTION, 1 }, + { 0, 1, 0 }, { -1, -1, 1 } @@ -5042,14 +5044,11 @@ int ndbcluster_table_exists_in_engine(THD* thd, const char *db, const char *name dict->invalidateTable(name); if (!(tab= dict->getTable(name))) { - const NdbError err= dict->getNdbError(); - if (err.code == 709) - DBUG_RETURN(0); - ERR_RETURN(err); + ERR_RETURN(dict->getNdbError()); } DBUG_PRINT("info", ("Found table %s", tab->getName())); - DBUG_RETURN(1); + DBUG_RETURN(HA_ERR_TABLE_EXIST); } @@ -5234,7 +5233,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, DBUG_PRINT("info", ("%s existed on disk", name)); // The .ndb file exists on disk, but it's not in list of tables in ndb // Verify that handler agrees table is gone. - if (ndbcluster_table_exists_in_engine(thd, db, file_name) == 0) + if (ndbcluster_table_exists_in_engine(thd, db, file_name) == HA_ERR_NO_SUCH_TABLE) { DBUG_PRINT("info", ("NDB says %s does not exists", file_name)); it.remove(); |