summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.homeip.net>2005-02-17 14:22:44 +0100
committerunknown <msvensson@neptunus.homeip.net>2005-02-17 14:22:44 +0100
commit329076db748e99e8ce7970094582e5e156db6d3f (patch)
treec7ec2f3d181a0fbc063ad96824be7fea3735a9bd /sql/sql_table.cc
parent841a9c3885d2967677118f59a044857ba702dbdb (diff)
downloadmariadb-git-329076db748e99e8ce7970094582e5e156db6d3f.tar.gz
BUG#8547: Wrong errormessage when dropping table that does not exist in NDB
- Added tescases - Added handling of HA_ERR_NO_SUCH_TABLE in mysql_rm_table_part2 so that error messages now are consistent mysql-test/r/ndb_autodiscover.result: Added tess for dropping tables that does not exists in engine mysql-test/t/ndb_autodiscover.test: Added tess for dropping tables that does not exists in engine sql/ha_ndbcluster.cc: Updated delete_table and drop_table to retrn HA_ERR_NO_SUCH_TABLE if table was not found in engine. Clear error after calling mysql_rm_table_part2 from mysql_find_files sql/sql_table.cc: Added handling of the case when table does not exist in storage engine but on disk as .frm file.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index d7cefb3dceb..025d3c757a8 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -249,6 +249,21 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (!(error=my_delete(path,MYF(MY_WME))))
some_tables_deleted=1;
}
+ if (error == HA_ERR_NO_SUCH_TABLE)
+ {
+ /* The table did not exist in engine */
+ if (if_exists)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
+ table->table_name);
+ error= 0;
+ }
+ /* Delete the table definition file */
+ strmov(end,reg_ext);
+ if (!(my_delete(path,MYF(MY_WME))))
+ some_tables_deleted=1;
+ }
}
if (error)
{