summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <gni@dev3-221.dev.cn.tlan>2007-05-08 09:52:27 +0800
committerunknown <gni@dev3-221.dev.cn.tlan>2007-05-08 09:52:27 +0800
commitae4e628e5e6426b5d043d71d7c729b0ebea62a13 (patch)
treeb423c42d7750e95d88f0d57fa69c3bde1d77a31a /sql/sql_table.cc
parent1ea37dd55527f33e42d6365206ac70a8f70cd004 (diff)
parentdeca8bd3d5a8532cc556592758211328b13719c2 (diff)
downloadmariadb-git-ae4e628e5e6426b5d043d71d7c729b0ebea62a13.tar.gz
Merge dev3-221.dev.cn.tlan:/home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb-bj
into dev3-221.dev.cn.tlan:/home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb mysql-test/t/disabled.def: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_table.cc: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged storage/ndb/src/ndbapi/ndberror.c: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged storage/ndb/tools/restore/restore_main.cpp: Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 1047b1ec35d..d29e00351ba 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3514,15 +3514,25 @@ bool mysql_create_table_internal(THD *thd,
{
bool create_if_not_exists =
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
-
- if (ha_table_exists_in_engine(thd, db, table_name))
+ int retcode = ha_table_exists_in_engine(thd, db, table_name);
+ DBUG_PRINT("info", ("exists_in_engine: %u",retcode));
+ switch (retcode)
{
- DBUG_PRINT("info", ("Table with same name already existed in handler"));
+ case HA_ERR_NO_SUCH_TABLE:
+ /* Normal case, no table exists. we can go and create it */
+ break;
+ case HA_ERR_TABLE_EXIST:
+ DBUG_PRINT("info", ("Table existed in handler"));
- if (create_if_not_exists)
- goto warn;
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
- goto unlock_and_end;
+ if (create_if_not_exists)
+ goto warn;
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
+ goto unlock_and_end;
+ break;
+ default:
+ DBUG_PRINT("info", ("error: %u from storage engine", retcode));
+ my_error(retcode, MYF(0),table_name);
+ goto unlock_and_end;
}
}