mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.0
This commit is contained in:
@ -220,7 +220,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
|
||||
if (!thd->query) // Only in replication
|
||||
{
|
||||
query= path;
|
||||
query_length= (uint) (strxmov(path,"create database ", db, NullS) -
|
||||
query_length= (uint) (strxmov(path,"create database `", db, "`", NullS) -
|
||||
path);
|
||||
}
|
||||
else
|
||||
@ -231,7 +231,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
|
||||
mysql_update_log.write(thd, query, query_length);
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
Query_log_event qinfo(thd, query, query_length);
|
||||
Query_log_event qinfo(thd, query, query_length, 0);
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
send_ok(thd, result);
|
||||
@ -346,23 +346,26 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
|
||||
query_cache_invalidate1(db);
|
||||
if (!silent)
|
||||
{
|
||||
const char *query;
|
||||
ulong query_length;
|
||||
if (!thd->query)
|
||||
{
|
||||
thd->query = path;
|
||||
thd->query_length = (uint) (strxmov(path,"drop database ", db, NullS)-
|
||||
path);
|
||||
/* The client used the old obsolete mysql_drop_db() call */
|
||||
query= path;
|
||||
query_length = (uint) (strxmov(path,"drop database `", db, "`",
|
||||
NullS)- path);
|
||||
}
|
||||
mysql_update_log.write(thd, thd->query, thd->query_length);
|
||||
else
|
||||
{
|
||||
query=thd->query;
|
||||
query_length=thd->query_length;
|
||||
}
|
||||
mysql_update_log.write(thd, query, query_length);
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length);
|
||||
Query_log_event qinfo(thd, query, query_length, 0);
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
if (thd->query == path)
|
||||
{
|
||||
thd->query = 0; // just in case
|
||||
thd->query_length = 0;
|
||||
}
|
||||
send_ok(thd,(ulong) deleted);
|
||||
}
|
||||
error = 0;
|
||||
|
Reference in New Issue
Block a user