diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index df9c113cfae..6f71bdd4e1a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -432,6 +432,8 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, str.append(proc_info); } + pthread_mutex_lock(&thd->LOCK_thd_data); + if (thd->query()) { if (max_query_len < 1) @@ -441,6 +443,9 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, str.append('\n'); str.append(thd->query(), len); } + + pthread_mutex_unlock(&thd->LOCK_thd_data); + if (str.c_ptr_safe() == buffer) return buffer; |