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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user