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:
@ -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,7 +1574,10 @@ 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);
|
||||
mysql_create_db(thd,(lower_case_table_names == 2 ? alias : db),0,0);
|
||||
bzero(&create_info, sizeof(create_info));
|
||||
if (mysql_create_db(thd, (lower_case_table_names == 2 ? alias : db),
|
||||
&create_info, 0) < 0)
|
||||
send_error(thd, thd->killed ? ER_SERVER_SHUTDOWN : 0);
|
||||
break;
|
||||
}
|
||||
case COM_DROP_DB: // QQ: To be removed
|
||||
@ -1594,7 +1598,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
break;
|
||||
}
|
||||
mysql_log.write(thd,command,db);
|
||||
mysql_rm_db(thd, (lower_case_table_names == 2 ? alias : db), 0, 0);
|
||||
if (mysql_rm_db(thd, (lower_case_table_names == 2 ? alias : db),
|
||||
0, 0) < 0)
|
||||
send_error(thd, thd->killed ? ER_SERVER_SHUTDOWN : 0);
|
||||
break;
|
||||
}
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
|
Reference in New Issue
Block a user