diff options
author | monty@mashka.mysql.fi <> | 2003-01-19 01:31:43 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-01-19 01:31:43 +0200 |
commit | fb4572a498ca852514648e0b51510f50172d29f6 (patch) | |
tree | 1511dd7f34610f206624b1626c7e8cffb903dd07 /sql/sql_db.cc | |
parent | 8fc51bb42776e4463923413b6a4371a5812c5de0 (diff) | |
parent | 1f8ad81ef9e396bfbea32d44b88367aa859564ea (diff) | |
download | mariadb-git-fb4572a498ca852514648e0b51510f50172d29f6.tar.gz |
Merge with 3.23 to get bug fix for SHOW PROCESSLIST + running thread
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e805cf74f19..ffb02cd36c1 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -78,9 +78,9 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent) if (!thd->query) { /* The client used the old obsolete mysql_create_db() call */ - thd->query = path; thd->query_length = (uint) (strxmov(path,"create database `", db, "`", NullS) - path); + thd->query = path; } { mysql_update_log.write(thd,thd->query, thd->query_length); @@ -92,8 +92,9 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent) } if (thd->query == path) { + VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query = 0; // just in case - thd->query_length = 0; + VOID(pthread_mutex_unlock(&LOCK_thread_count)); } send_ok(&thd->net, result); } @@ -167,9 +168,10 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { if (!thd->query) { - thd->query = path; - thd->query_length = (uint) (strxmov(path,"drop database ", db, NullS)- - path); + thd->query_length= (uint) (strxmov(path,"drop database `", db, "`", + NullS)- + path); + thd->query= path; } mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) @@ -179,8 +181,9 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) } if (thd->query == path) { + VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query = 0; // just in case - thd->query_length = 0; + VOID(pthread_mutex_unlock(&LOCK_thread_count)); } send_ok(&thd->net,(ulong) deleted); } |