summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-09-10 17:36:42 +0300
committerunknown <heikki@donna.mysql.fi>2001-09-10 17:36:42 +0300
commit341504b3c9770c450b8101784344b403bd0257cc (patch)
tree70fd99195e38281d965919518582883847779c34 /sql
parent1c404ff9e3ec640a45e4451aaf612aeb699ed357 (diff)
downloadmariadb-git-341504b3c9770c450b8101784344b403bd0257cc.tar.gz
handler.cc If CREATE TABLE fails for an InnoDB table, do not put the OS error number to the error message, because it is not the cause
sql/handler.cc: If CREATE TABLE fails for an InnoDB table, do not put the OS error number to the error message, because it is not the cause
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 2f6e3b11bdf..1c50634de1f 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -837,8 +837,15 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
}
error=table.file->create(name,&table,create_info);
VOID(closefrm(&table));
- if (error)
- my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno);
+ if (error) {
+ if (table.db_type == DB_TYPE_INNOBASE) {
+ /* Creation of InnoDB table cannot fail because of an OS error:
+ put error as the number */
+ my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error);
+ } else {
+ my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno);
+ }
+ }
DBUG_RETURN(error != 0);
}