1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Only set thd->query to 0 if LOCK_thread_count is hold

This fixes a possible core dump problem in SHOW PROCESSLIST
This commit is contained in:
monty@mashka.mysql.fi
2003-01-18 23:38:55 +02:00
parent 9fb477569b
commit dd4d4cc8b5
3 changed files with 40 additions and 21 deletions

View File

@@ -89,9 +89,9 @@ void mysql_create_db(THD *thd, char *db, uint create_options)
}
if (!thd->query)
{
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);
@@ -103,8 +103,9 @@ void mysql_create_db(THD *thd, char *db, uint create_options)
}
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);
@@ -178,9 +179,9 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
if (!thd->query)
{
thd->query = 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())
@@ -190,8 +191,9 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
}
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);
}