diff options
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 68d1d4619f4..a288cad88d7 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2007,6 +2007,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(), @@ -2014,6 +2016,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)); |