diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-08-08 10:18:43 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-08 10:18:43 +0200 |
commit | 8e8d42ddf0291b2364fef8e3224e65d596ef4202 (patch) | |
tree | 056e6f1c489477cb7e1c285924e88f8f02e5918b /sql/sql_class.cc | |
parent | 2395adfbfd6b4425981053f074865769414b5614 (diff) | |
parent | ef2e51c39637ace64b66fa82b834e31f0e4ef38a (diff) | |
download | mariadb-git-8e8d42ddf0291b2364fef8e3224e65d596ef4202.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 63663cdd037..4df257b96a4 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -691,12 +691,6 @@ extern "C" @param buffer pointer to preferred result buffer @param length length of buffer @param max_query_len how many chars of query to copy (0 for all) - - @req LOCK_thread_count - - @note LOCK_thread_count mutex is not necessary when the function is invoked on - the currently running thread (current_thd) or if the caller in some other - way guarantees that access to thd->query is serialized. @return Pointer to string */ @@ -710,6 +704,9 @@ char *thd_get_error_context_description(THD *thd, char *buffer, const Security_context *sctx= &thd->main_security_ctx; char header[256]; int len; + + mysql_mutex_lock(&LOCK_thread_count); + /* The pointers thd->query and thd->proc_info might change since they are being modified concurrently. This is acceptable for proc_info since its @@ -765,6 +762,7 @@ char *thd_get_error_context_description(THD *thd, char *buffer, } mysql_mutex_unlock(&thd->LOCK_thd_data); } + mysql_mutex_unlock(&LOCK_thread_count); if (str.c_ptr_safe() == buffer) return buffer; |