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:
@@ -898,36 +898,6 @@ convert_error_code_to_mysql(
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************//**
|
||||
If you want to print a thd that is not associated with the current thread,
|
||||
you must call this function before reserving the InnoDB kernel_mutex, to
|
||||
protect MySQL from setting thd->query NULL. If you print a thd of the current
|
||||
thread, we know that MySQL cannot modify thd->query, and it is not necessary
|
||||
to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release
|
||||
the kernel_mutex. */
|
||||
extern "C" UNIV_INTERN
|
||||
void
|
||||
innobase_mysql_prepare_print_arbitrary_thd(void)
|
||||
/*============================================*/
|
||||
{
|
||||
ut_ad(!mutex_own(&kernel_mutex));
|
||||
VOID(pthread_mutex_lock(&LOCK_thread_count));
|
||||
}
|
||||
|
||||
/*************************************************************//**
|
||||
Releases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
|
||||
In the InnoDB latching order, the mutex sits right above the
|
||||
kernel_mutex. In debug builds, we assert that the kernel_mutex is
|
||||
released before this function is invoked. */
|
||||
extern "C" UNIV_INTERN
|
||||
void
|
||||
innobase_mysql_end_print_arbitrary_thd(void)
|
||||
/*========================================*/
|
||||
{
|
||||
ut_ad(!mutex_own(&kernel_mutex));
|
||||
VOID(pthread_mutex_unlock(&LOCK_thread_count));
|
||||
}
|
||||
|
||||
/*************************************************************//**
|
||||
Prints info of a THD object (== user session thread) to the given file. */
|
||||
extern "C" UNIV_INTERN
|
||||
|
||||
Reference in New Issue
Block a user