summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2004-05-14 16:48:56 +0300
committerheikki@hundin.mysql.fi <>2004-05-14 16:48:56 +0300
commit02f51ccf2d16bd3525e1446553ab74c00af695f1 (patch)
treeb754d8cebf93bbb70cb8401e05e31ea14aeecf85 /sql/sql_show.cc
parentb4ae2577f03888995cb5a78a4bd532d0272349f6 (diff)
downloadmariadb-git-02f51ccf2d16bd3525e1446553ab74c00af695f1.tar.gz
Many files:
Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 63f3afab128..7f52e52c849 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1141,7 +1141,11 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
thd_info->query=0;
if (tmp->query)
{
- /* query_length is always set before tmp->query */
+ /*
+ query_length is always set to 0 when we set query = NULL; see
+ the comment in sql_class.h why this prevents crashes in possible
+ races with query_length
+ */
uint length= min(max_query_length, tmp->query_length);
thd_info->query=(char*) thd->memdup(tmp->query,length+1);
thd_info->query[length]=0;