diff options
author | hf@deer.(none) <> | 2004-05-24 12:23:52 +0500 |
---|---|---|
committer | hf@deer.(none) <> | 2004-05-24 12:23:52 +0500 |
commit | 098d8dd01f70bb4c6af75a916daecc429f0c9303 (patch) | |
tree | ded4a10c9daabd5707b1a929c9c9627a5b40a4a2 /sql/sql_db.cc | |
parent | cb07a07ed9b21aa5f3573464e221f57fff5af62c (diff) | |
download | mariadb-git-098d8dd01f70bb4c6af75a916daecc429f0c9303.tar.gz |
Fix for bug #3691 (libmysqld reports error 2 on CREATE DATABASE
but database is created)
handling of CREATE DATABASE errors changed
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index bddaebdc0f2..bdec7b61168 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -18,6 +18,7 @@ /* create and drop of databases */ #include "mysql_priv.h" +#include <mysys_err.h> #include "sql_acl.h" #include <my_dir.h> #include <m_ctype.h> @@ -185,7 +186,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, strxmov(path, mysql_data_home, "/", db, NullS); unpack_dirname(path,path); // Convert if not unix - if (my_stat(path,&stat_info,MYF(MY_WME))) + if (my_stat(path,&stat_info,MYF(0))) { if (!(create_options & HA_LEX_CREATE_IF_NOT_EXISTS)) { @@ -197,6 +198,11 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, } else { + if (my_errno != ENOENT) + { + my_error(EE_STAT, MYF(0),path,my_errno); + goto exit; + } strend(path)[-1]=0; // Remove last '/' from path if (my_mkdir(path,0777,MYF(0)) < 0) { |