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
cac90852
Commit
cac90852
authored
Oct 22, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge of fix for bug #6081 "Call to deprecated mysql_create_db()
function crashes server" with main tree.
parents
2f8b0ab3
1b142600
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
sql/sql_parse.cc
sql/sql_parse.cc
+3
-1
tests/client_test.c
tests/client_test.c
+26
-0
No files found.
sql/sql_parse.cc
View file @
cac90852
...
...
@@ -1562,6 +1562,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case
COM_CREATE_DB
:
// QQ: To be removed
{
char
*
db
=
thd
->
strdup
(
packet
),
*
alias
;
HA_CREATE_INFO
create_info
;
statistic_increment
(
com_stat
[
SQLCOM_CREATE_DB
],
&
LOCK_status
);
// null test to handle EOM
...
...
@@ -1573,8 +1574,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if
(
check_access
(
thd
,
CREATE_ACL
,
db
,
0
,
1
,
0
))
break
;
mysql_log
.
write
(
thd
,
command
,
packet
);
bzero
(
&
create_info
,
sizeof
(
create_info
));
if
(
mysql_create_db
(
thd
,
(
lower_case_table_names
==
2
?
alias
:
db
),
0
,
0
)
<
0
)
&
create_info
,
0
)
<
0
)
send_error
(
thd
,
thd
->
killed
?
ER_SERVER_SHUTDOWN
:
0
);
break
;
}
...
...
tests/client_test.c
View file @
cac90852
...
...
@@ -10688,6 +10688,31 @@ static void test_bug6046()
}
/*
Altough mysql_create_db(), mysql_rm_db() are deprecated since 4.0 they
should not crash server and should not hang in case of errors.
Since those functions can't be seen in modern API (unless client library
was compiled with USE_OLD_FUNCTIONS define) we use simple_command() macro.
*/
static
void
test_bug6081
()
{
int
rc
;
myheader
(
"test_bug6081"
);
rc
=
simple_command
(
mysql
,
COM_DROP_DB
,
current_db
,
(
ulong
)
strlen
(
current_db
),
0
);
myquery
(
rc
);
rc
=
simple_command
(
mysql
,
COM_DROP_DB
,
current_db
,
(
ulong
)
strlen
(
current_db
),
0
);
myquery_r
(
rc
);
rc
=
simple_command
(
mysql
,
COM_CREATE_DB
,
current_db
,
(
ulong
)
strlen
(
current_db
),
0
);
myquery
(
rc
);
rc
=
simple_command
(
mysql
,
COM_CREATE_DB
,
current_db
,
(
ulong
)
strlen
(
current_db
),
0
);
myquery_r
(
rc
);
}
/*
...
...
@@ -11004,6 +11029,7 @@ int main(int argc, char **argv)
test_bug6058
();
/* check support for 0000-00-00 dates */
test_bug6059
();
/* correct metadata for SELECT ... INTO OUTFILE */
test_bug6046
();
/* NATURAL JOIN transformation works in PS */
test_bug6081
();
/* test of mysql_create_db()/mysql_rm_db() */
/*
XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST
DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH.
...
...
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