diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2019-03-13 14:16:49 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-05-03 14:14:18 +0400 |
commit | 19d5ddccfde04c6b336bb4974407ecde4fb6fbc6 (patch) | |
tree | 5c7608d445e033b506513ef0e27b050d96046899 /sql/session_tracker.h | |
parent | 8f594b3384f5c68f530730a037a7e74fa215b67d (diff) | |
download | mariadb-git-19d5ddccfde04c6b336bb4974407ecde4fb6fbc6.tar.gz |
Cleanup session tracker redundancy
- m_enabled is initialised by the base class constructor
- removed unused schema_track_inited
- moved Transaction_state_tracker constructor to declaration
- common enable()
- removed unused Session_sysvars_tracker::check_str()
- classes are "private" by default
- don't even try to compile for embedded
Part of MDEV-14984 - regression in connect performance
Diffstat (limited to 'sql/session_tracker.h')
-rw-r--r-- | sql/session_tracker.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/session_tracker.h b/sql/session_tracker.h index 2452183acd4..1d0f55c252a 100644 --- a/sql/session_tracker.h +++ b/sql/session_tracker.h @@ -90,7 +90,7 @@ public: void reset_changed() { m_changed= false; } /** Called in the constructor of THD*/ - virtual bool enable(THD *thd)= 0; + virtual bool enable(THD *thd) { return update(thd, 0); } /** To be invoked when the tracker's system variable is updated (ON_UPDATE).*/ virtual bool update(THD *thd, set_var *var)= 0; @@ -119,7 +119,6 @@ bool sysvartrack_value_construct(THD *thd, char *val, size_t len); class Session_tracker { -private: State_tracker *m_trackers[SESSION_TRACKER_END]; /* The following two functions are private to disable copying. */ @@ -234,14 +233,16 @@ enum enum_session_track_transaction_info { class Transaction_state_tracker : public State_tracker { -private: /** Helper function: turn table info into table access flag */ enum_tx_state calc_trx_state(THD *thd, thr_lock_type l, bool has_trx); public: /** Constructor */ - Transaction_state_tracker(); - bool enable(THD *thd) - { return update(thd, NULL); } + Transaction_state_tracker(): tx_changed(TX_CHG_NONE), + tx_curr_state(TX_EMPTY), + tx_reported_state(TX_EMPTY), + tx_read_flags(TX_READ_INHERIT), + tx_isol_level(TX_ISOL_INHERIT) {} + bool update(THD *thd, set_var *var); bool store(THD *thd, String *buf); |