summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-09-20 22:52:00 +0400
committerSergey Vojtovich <svoj@mariadb.org>2019-09-24 15:49:35 +0400
commitad77e3ac0930a68e61378790a232f1056f0a8e7c (patch)
tree7594a673d37662b643fa7585a103d6877ed4f6f7 /sql/set_var.cc
parentedef6a007428599fd249815f1dc59a02428090f4 (diff)
downloadmariadb-git-ad77e3ac0930a68e61378790a232f1056f0a8e7c.tar.gz
Cleanup session tracker
- call current_schema::mark_as_changed() directly - call state_change::mark_as_changed() directly - replaced SESSION_TRACKER_CHANGED with dummy tracker - replaced Session_tracker::mark_as_changed() with State_tracker::mark_as_changed() - hide and devirtualize original State_tracker::mark_as_changed(), rename it to set_changed() - all implementations of mark_as_changed() now check is_enabled() for consistency - no argument casts anymore
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc29
1 files changed, 11 insertions, 18 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index f81e2753ac1..84431d1f7a8 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -220,13 +220,12 @@ bool sys_var::update(THD *thd, set_var *var)
*/
if ((var->type == OPT_SESSION) && (!ret))
{
- SESSION_TRACKER_CHANGED(thd, SESSION_SYSVARS_TRACKER,
- (LEX_CSTRING*)var->var);
+ thd->session_tracker.sysvars.mark_as_changed(thd, var->var);
/*
Here MySQL sends variable name to avoid reporting change of
the tracker itself, but we decided that it is not needed
*/
- SESSION_TRACKER_CHANGED(thd, SESSION_STATE_CHANGE_TRACKER, NULL);
+ thd->session_tracker.state_change.mark_as_changed(thd);
}
return ret;
@@ -907,7 +906,7 @@ int set_var_user::update(THD *thd)
return -1;
}
- SESSION_TRACKER_CHANGED(thd, SESSION_STATE_CHANGE_TRACKER, NULL);
+ thd->session_tracker.state_change.mark_as_changed(thd);
return 0;
}
@@ -957,8 +956,7 @@ int set_var_role::update(THD *thd)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
int res= acl_setrole(thd, role.str, access);
if (!res)
- thd->session_tracker.mark_as_changed(thd, SESSION_STATE_CHANGE_TRACKER,
- NULL);
+ thd->session_tracker.state_change.mark_as_changed(thd);
return res;
#else
return 0;
@@ -1015,18 +1013,13 @@ int set_var_collation_client::update(THD *thd)
character_set_results);
/* Mark client collation variables as changed */
-#ifndef EMBEDDED_LIBRARY
- if (thd->session_tracker.sysvars.is_enabled())
- {
- thd->session_tracker.sysvars.
- mark_as_changed(thd, (LEX_CSTRING*)Sys_character_set_client_ptr);
- thd->session_tracker.sysvars.
- mark_as_changed(thd, (LEX_CSTRING*)Sys_character_set_results_ptr);
- thd->session_tracker.sysvars.
- mark_as_changed(thd, (LEX_CSTRING*)Sys_character_set_connection_ptr);
- }
- thd->session_tracker.mark_as_changed(thd, SESSION_STATE_CHANGE_TRACKER, NULL);
-#endif //EMBEDDED_LIBRARY
+ thd->session_tracker.sysvars.mark_as_changed(thd,
+ Sys_character_set_client_ptr);
+ thd->session_tracker.sysvars.mark_as_changed(thd,
+ Sys_character_set_results_ptr);
+ thd->session_tracker.sysvars.mark_as_changed(thd,
+ Sys_character_set_connection_ptr);
+ thd->session_tracker.state_change.mark_as_changed(thd);
thd->protocol_text.init(thd);
thd->protocol_binary.init(thd);