diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2009-12-01 14:38:40 +0400 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2009-12-01 14:38:40 +0400 |
commit | 60b76cd7296e3c8be363d5ca2e10c439d1d457ef (patch) | |
tree | 6c4e2c06804e3bc8ba86257835dc29db96a55e7a /sql/sql_class.cc | |
parent | 0dde5599bd2e2304b578856771c8c29b19577ceb (diff) | |
parent | ee136e3fa5d4d229b36eb079d1b4bb894d3084ff (diff) | |
download | mariadb-git-60b76cd7296e3c8be363d5ca2e10c439d1d457ef.tar.gz |
Bug #38883 (reopened): thd_security_context is not thread safe, crashes?
manual merge 5.0-->5.1, updating InnoDB plugin.
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 a12b0198c98..7b37a3f6e93 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -376,6 +376,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) @@ -385,6 +387,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; |