1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug #38883 (reopened): thd_security_context is not thread safe, crashes?

manual merge 5.0-->5.1, updating InnoDB plugin.
This commit is contained in:
Gleb Shchepa
2009-12-01 14:38:40 +04:00
11 changed files with 9 additions and 139 deletions

View File

@@ -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;