diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2019-09-20 22:52:00 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-09-24 15:49:35 +0400 |
commit | ad77e3ac0930a68e61378790a232f1056f0a8e7c (patch) | |
tree | 7594a673d37662b643fa7585a103d6877ed4f6f7 /sql/session_tracker.cc | |
parent | edef6a007428599fd249815f1dc59a02428090f4 (diff) | |
download | mariadb-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/session_tracker.cc')
-rw-r--r-- | sql/session_tracker.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc index 5ba0c73e042..fe5cd3a5d61 100644 --- a/sql/session_tracker.cc +++ b/sql/session_tracker.cc @@ -24,7 +24,7 @@ #include "sql_plugin.h" #include "set_var.h" -void State_tracker::mark_as_changed(THD *thd, LEX_CSTRING *tracked_item_name) +void State_tracker::set_changed(THD *thd) { m_changed= true; thd->lex->safe_to_cache_query= 0; @@ -506,11 +506,12 @@ bool Session_sysvars_tracker::store(THD *thd, String *buf) @param [IN] pointer on a variable */ -void Session_sysvars_tracker::mark_as_changed(THD *thd, - LEX_CSTRING *var) +void Session_sysvars_tracker::mark_as_changed(THD *thd, const sys_var *var) { sysvar_node_st *node; - sys_var *svar= (sys_var *)var; + + if (!is_enabled()) + return; if (!m_parsed) { @@ -529,10 +530,10 @@ void Session_sysvars_tracker::mark_as_changed(THD *thd, Check if the specified system variable is being tracked, if so mark it as changed and also set the class's m_changed flag. */ - if (orig_list.is_enabled() && (node= orig_list.insert_or_search(svar))) + if (orig_list.is_enabled() && (node= orig_list.insert_or_search(var))) { node->m_changed= true; - State_tracker::mark_as_changed(thd, var); + set_changed(thd); } } @@ -679,7 +680,7 @@ bool Transaction_state_tracker::update(THD *thd, set_var *) } if (thd->variables.session_track_transaction_info == TX_TRACK_CHISTICS) tx_changed |= TX_CHG_CHISTICS; - mark_as_changed(thd, NULL); + set_changed(thd); } else m_enabled= false; @@ -1112,7 +1113,7 @@ void Transaction_state_tracker::set_read_flags(THD *thd, { tx_read_flags = flags; tx_changed |= TX_CHG_CHISTICS; - mark_as_changed(thd, NULL); + set_changed(thd); } } @@ -1131,7 +1132,7 @@ void Transaction_state_tracker::set_isol_level(THD *thd, { tx_isol_level = level; tx_changed |= TX_CHG_CHISTICS; - mark_as_changed(thd, NULL); + set_changed(thd); } } |