mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fix for bug #3691 (libmysqld reports error 2 on CREATE DATABASE
but database is created) handling of CREATE DATABASE errors changed sql/sql_db.cc: now we check my_stat errors in mysql_create_db
This commit is contained in:
parent
d4c67b6099
commit
f94e0386b2
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue