summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 2557318e6ee..372e5564574 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2081,6 +2081,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
pthread_mutex_unlock(&mysys_var->mutex);
/* INFO */
+ /* Lock THD mutex that protects its data when looking at it. */
+ pthread_mutex_lock(&tmp->LOCK_thd_data);
if (tmp->query())
{
table->field[7]->store(tmp->query(),
@@ -2088,6 +2090,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
tmp->query_length()), cs);
table->field[7]->set_notnull();
}
+ pthread_mutex_unlock(&tmp->LOCK_thd_data);
/* TIME_MS */
table->field[8]->store((double)(utime / 1000.0));