mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-8191 - THD::set_query() takes 0.07% in OLTP RO
Moved THD::set_query() definition to sql_class.h so that it can be inlined. Overhead change: THD::set_query 0.07% -> out of radar
This commit is contained in:
@ -5064,19 +5064,6 @@ void THD::set_command(enum enum_server_command command)
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Assign a new value to thd->query. */
|
||||
|
||||
void THD::set_query(const CSET_STRING &string_arg)
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_thd_data);
|
||||
set_query_inner(string_arg);
|
||||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
PSI_THREAD_CALL(set_thread_info)(query(), query_length());
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Assign a new value to thd->query and thd->query_id. */
|
||||
|
||||
void THD::set_query_and_id(char *query_arg, uint32 query_length_arg,
|
||||
|
@ -3704,7 +3704,16 @@ public:
|
||||
{
|
||||
set_query(CSET_STRING(query_arg, query_length_arg, charset()));
|
||||
}
|
||||
void set_query(const CSET_STRING &str); /* Mutex protected */
|
||||
void set_query(const CSET_STRING &string_arg)
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_thd_data);
|
||||
set_query_inner(string_arg);
|
||||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
PSI_THREAD_CALL(set_thread_info)(query(), query_length());
|
||||
#endif
|
||||
}
|
||||
void reset_query() /* Mutex protected */
|
||||
{ set_query(CSET_STRING()); }
|
||||
void set_query_and_id(char *query_arg, uint32 query_length_arg,
|
||||
|
Reference in New Issue
Block a user