summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-01-19 01:31:43 +0200
committerunknown <monty@mashka.mysql.fi>2003-01-19 01:31:43 +0200
commitb2ba400f07d843903ab6efd946940a6e6e76fc3c (patch)
tree1511dd7f34610f206624b1626c7e8cffb903dd07 /sql/sql_db.cc
parent43523184f2c3664b221ef64c5b23dd7710e02bef (diff)
parente7193c63ceb339bede6775d563be53aae63c78c2 (diff)
downloadmariadb-git-b2ba400f07d843903ab6efd946940a6e6e76fc3c.tar.gz
Merge with 3.23 to get bug fix for SHOW PROCESSLIST + running thread
myisam/mi_create.c: Auto merged sql/log.cc: Auto merged innobase/btr/btr0sea.c: Merge with 3.23 (use local file) sql/slave.cc: merge with 3.23 sql/sql_db.cc: Merge with 3.23 sql/sql_parse.cc: Merge with 3.23
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc15
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);
}