1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Manual merge of fix for bug #6081 "Call to deprecated mysql_create_db()

function crashes server" with main tree.
This commit is contained in:
dlenev@mysql.com
2004-10-22 22:51:55 +04:00
2 changed files with 29 additions and 1 deletions

View File

@ -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;
}