Commit 31e52b16 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Optimize charset tracking a bit.

parent 517d7182
...@@ -1016,24 +1016,12 @@ int set_var_collation_client::update(THD *thd) ...@@ -1016,24 +1016,12 @@ int set_var_collation_client::update(THD *thd)
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->is_enabled()) if (thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->is_enabled())
{ {
sys_var *svar; thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->
mysql_mutex_lock(&LOCK_plugin); mark_as_changed(thd, (LEX_CSTRING*)Sys_character_set_client_ptr);
if ((svar= find_sys_var_ex(thd, "character_set_client", thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->
sizeof("character_set_client") - 1, mark_as_changed(thd, (LEX_CSTRING*)Sys_character_set_results_ptr);
false, true))) thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->
thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)-> mark_as_changed(thd, (LEX_CSTRING*)Sys_character_set_connection_ptr);
mark_as_changed(thd, (LEX_CSTRING*)svar);
if ((svar= find_sys_var_ex(thd, "character_set_results",
sizeof("character_set_results") - 1,
false, true)))
thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->
mark_as_changed(thd, (LEX_CSTRING*)svar);
if ((svar= find_sys_var_ex(thd, "character_set_connection",
sizeof("character_set_connection") - 1,
false, true)))
thd->session_tracker.get_tracker(SESSION_SYSVARS_TRACKER)->
mark_as_changed(thd, (LEX_CSTRING*)svar);
mysql_mutex_unlock(&LOCK_plugin);
} }
thd->session_tracker.mark_as_changed(thd, SESSION_STATE_CHANGE_TRACKER, NULL); thd->session_tracker.mark_as_changed(thd, SESSION_STATE_CHANGE_TRACKER, NULL);
#endif //EMBEDDED_LIBRARY #endif //EMBEDDED_LIBRARY
......
...@@ -430,7 +430,9 @@ sql_mode_t expand_sql_mode(sql_mode_t sql_mode); ...@@ -430,7 +430,9 @@ sql_mode_t expand_sql_mode(sql_mode_t sql_mode);
bool sql_mode_string_representation(THD *thd, sql_mode_t sql_mode, LEX_STRING *ls); bool sql_mode_string_representation(THD *thd, sql_mode_t sql_mode, LEX_STRING *ls);
int default_regex_flags_pcre(const THD *thd); int default_regex_flags_pcre(const THD *thd);
extern sys_var *Sys_autocommit_ptr, *Sys_last_gtid_ptr; extern sys_var *Sys_autocommit_ptr, *Sys_last_gtid_ptr,
*Sys_character_set_client_ptr, *Sys_character_set_connection_ptr,
*Sys_character_set_results_ptr;
CHARSET_INFO *get_old_charset_by_name(const char *old_name); CHARSET_INFO *get_old_charset_by_name(const char *old_name);
......
...@@ -673,6 +673,8 @@ static Sys_var_struct Sys_character_set_client( ...@@ -673,6 +673,8 @@ static Sys_var_struct Sys_character_set_client(
offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_cs_client), NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_cs_client),
ON_UPDATE(fix_thd_charset)); ON_UPDATE(fix_thd_charset));
// for check changing
export sys_var *Sys_character_set_client_ptr= &Sys_character_set_client;
static Sys_var_struct Sys_character_set_connection( static Sys_var_struct Sys_character_set_connection(
"character_set_connection", "The character set used for " "character_set_connection", "The character set used for "
...@@ -682,6 +684,8 @@ static Sys_var_struct Sys_character_set_connection( ...@@ -682,6 +684,8 @@ static Sys_var_struct Sys_character_set_connection(
offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null), NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null),
ON_UPDATE(fix_thd_charset)); ON_UPDATE(fix_thd_charset));
// for check changing
export sys_var *Sys_character_set_connection_ptr= &Sys_character_set_connection;
static Sys_var_struct Sys_character_set_results( static Sys_var_struct Sys_character_set_results(
"character_set_results", "The character set used for returning " "character_set_results", "The character set used for returning "
...@@ -689,6 +693,8 @@ static Sys_var_struct Sys_character_set_results( ...@@ -689,6 +693,8 @@ static Sys_var_struct Sys_character_set_results(
SESSION_VAR(character_set_results), NO_CMD_LINE, SESSION_VAR(character_set_results), NO_CMD_LINE,
offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info), offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset)); NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset));
// for check changing
export sys_var *Sys_character_set_results_ptr= &Sys_character_set_results;
static Sys_var_struct Sys_character_set_filesystem( static Sys_var_struct Sys_character_set_filesystem(
"character_set_filesystem", "The filesystem character set", "character_set_filesystem", "The filesystem character set",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment