diff options
author | unknown <Justin.He/justin.he@dev3-240.dev.cn.tlan> | 2007-04-05 11:30:19 +0800 |
---|---|---|
committer | unknown <Justin.He/justin.he@dev3-240.dev.cn.tlan> | 2007-04-05 11:30:19 +0800 |
commit | bb8fb9e9e6653fd9c69db33785bfe2f9ab7bf602 (patch) | |
tree | 031cd24f0a6fdc5efc6c72a6f82b9d00edba3d2a /sql/sql_table.cc | |
parent | b651aa038c1a7fa5197c2746672bd22863b12132 (diff) | |
parent | 5203ea6ccb349aae5e53e3f0247256a9fc60208e (diff) | |
download | mariadb-git-bb8fb9e9e6653fd9c69db33785bfe2f9ab7bf602.tar.gz |
Merge dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.0/mysql-5.0-ndb
into dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.0/mysql-5.0-ndb-bj.merge
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_table.cc:
Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8b3028f5370..d44aba090b1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1697,6 +1697,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, alias); DBUG_RETURN(FALSE); } + DBUG_PRINT("info",("1")); my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias); DBUG_RETURN(TRUE); } @@ -1707,6 +1708,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, { if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS) goto warn; + DBUG_PRINT("info",("2")); my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name); goto end; } @@ -1725,14 +1727,25 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, { 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 end; + if (create_if_not_exists) + goto warn; + my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name); + goto end; + break; + default: + DBUG_PRINT("info", ("error: %u from storage engine", retcode)); + my_error(retcode, MYF(0),table_name); + goto end; } } |