summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-07-24 21:04:55 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-07-24 21:04:55 +0500
commit9c72a7bfeac53a3402621bc451f25c81d0713811 (patch)
tree999d090b1f7c4cb9c23b5e41592e0cec56389c5f /sql/sql_show.cc
parentb33704f8a0c7e8adf260924b418f8d50d92c62b6 (diff)
parent6aea4cebfc2eb6d39ccfe4f7fc53ac0dd1fc9ac5 (diff)
downloadmariadb-git-9c72a7bfeac53a3402621bc451f25c81d0713811.tar.gz
Merge from 5.0
****** manual merge 5.0-bugteam --> 5.1-bugteam (bug 38816)
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a1f6798244e..35dbb64dfef 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1768,16 +1768,14 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
thd_info->start_time= tmp->start_time;
thd_info->query=0;
+ /* Lock THD mutex that protects its data when looking at it. */
+ pthread_mutex_lock(&tmp->LOCK_thd_data);
if (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->strmake(tmp->query,length);
}
+ pthread_mutex_unlock(&tmp->LOCK_thd_data);
thread_infos.append(thd_info);
}
}