Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
051a5461
Commit
051a5461
authored
Jul 08, 2004
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed Bug #4378 "create database IF NOT EXISTS thing" returns an error
parent
2be661a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
sql/sql_db.cc
sql/sql_db.cc
+3
-2
No files found.
sql/sql_db.cc
View file @
051a5461
...
@@ -171,6 +171,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
...
@@ -171,6 +171,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
int
error
=
0
;
int
error
=
0
;
MY_STAT
stat_info
;
MY_STAT
stat_info
;
uint
create_options
=
create_info
?
create_info
->
options
:
0
;
uint
create_options
=
create_info
?
create_info
->
options
:
0
;
uint
path_len
;
DBUG_ENTER
(
"mysql_create_db"
);
DBUG_ENTER
(
"mysql_create_db"
);
VOID
(
pthread_mutex_lock
(
&
LOCK_mysql_create_db
));
VOID
(
pthread_mutex_lock
(
&
LOCK_mysql_create_db
));
...
@@ -184,7 +185,8 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
...
@@ -184,7 +185,8 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
/* Check directory */
/* Check directory */
strxmov
(
path
,
mysql_data_home
,
"/"
,
db
,
NullS
);
strxmov
(
path
,
mysql_data_home
,
"/"
,
db
,
NullS
);
unpack_dirname
(
path
,
path
);
// Convert if not unix
path_len
=
unpack_dirname
(
path
,
path
);
// Convert if not unix
path
[
path_len
-
1
]
=
0
;
// Remove last '/' from path
if
(
my_stat
(
path
,
&
stat_info
,
MYF
(
0
)))
if
(
my_stat
(
path
,
&
stat_info
,
MYF
(
0
)))
{
{
...
@@ -203,7 +205,6 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
...
@@ -203,7 +205,6 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
my_error
(
EE_STAT
,
MYF
(
0
),
path
,
my_errno
);
my_error
(
EE_STAT
,
MYF
(
0
),
path
,
my_errno
);
goto
exit
;
goto
exit
;
}
}
strend
(
path
)[
-
1
]
=
0
;
// Remove last '/' from path
if
(
my_mkdir
(
path
,
0777
,
MYF
(
0
))
<
0
)
if
(
my_mkdir
(
path
,
0777
,
MYF
(
0
))
<
0
)
{
{
my_error
(
ER_CANT_CREATE_DB
,
MYF
(
0
),
db
,
my_errno
);
my_error
(
ER_CANT_CREATE_DB
,
MYF
(
0
),
db
,
my_errno
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment