mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -15,7 +15,6 @@
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
#include "sql_plugin.h"
|
||||
#include "session_tracker.h"
|
||||
|
||||
@ -60,8 +59,6 @@ public:
|
||||
|
||||
class Session_sysvars_tracker : public State_tracker
|
||||
{
|
||||
private:
|
||||
|
||||
struct sysvar_node_st {
|
||||
sys_var *m_svar;
|
||||
bool *test_load;
|
||||
@ -216,7 +213,6 @@ public:
|
||||
}
|
||||
|
||||
bool enable(THD *thd);
|
||||
bool check_str(THD *thd, LEX_STRING *val);
|
||||
bool update(THD *thd, set_var *var);
|
||||
bool store(THD *thd, String *buf);
|
||||
void mark_as_changed(THD *thd, LEX_CSTRING *tracked_item_name);
|
||||
@ -239,18 +235,7 @@ public:
|
||||
|
||||
class Current_schema_tracker : public State_tracker
|
||||
{
|
||||
private:
|
||||
bool schema_track_inited;
|
||||
|
||||
public:
|
||||
|
||||
Current_schema_tracker()
|
||||
{
|
||||
schema_track_inited= false;
|
||||
}
|
||||
|
||||
bool enable(THD *thd)
|
||||
{ return update(thd, NULL); }
|
||||
bool update(THD *thd, set_var *var);
|
||||
bool store(THD *thd, String *buf);
|
||||
};
|
||||
@ -272,8 +257,6 @@ public:
|
||||
class Session_state_change_tracker : public State_tracker
|
||||
{
|
||||
public:
|
||||
bool enable(THD *thd)
|
||||
{ return update(thd, NULL); };
|
||||
bool update(THD *thd, set_var *var);
|
||||
bool store(THD *thd, String *buf);
|
||||
};
|
||||
@ -654,27 +637,6 @@ bool Session_sysvars_tracker::enable(THD *thd)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Check system variable name(s).
|
||||
|
||||
@note This function is called from the ON_CHECK() function of the
|
||||
session_track_system_variables' sys_var class.
|
||||
|
||||
@param thd [IN] The thd handle.
|
||||
@param var [IN] A pointer to set_var holding the specified list of
|
||||
system variable names.
|
||||
|
||||
@retval true Error
|
||||
@retval false Success
|
||||
*/
|
||||
|
||||
inline bool Session_sysvars_tracker::check_str(THD *thd, LEX_STRING *val)
|
||||
{
|
||||
return Session_sysvars_tracker::check_var_list(thd, *val, true,
|
||||
thd->charset(), true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Once the value of the @@session_track_system_variables has been
|
||||
successfully updated, this function calls
|
||||
@ -936,17 +898,6 @@ bool Current_schema_tracker::store(THD *thd, String *buf)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Transaction_state_tracker::Transaction_state_tracker()
|
||||
{
|
||||
m_enabled = false;
|
||||
tx_changed = TX_CHG_NONE;
|
||||
tx_curr_state =
|
||||
tx_reported_state= TX_EMPTY;
|
||||
tx_read_flags = TX_READ_INHERIT;
|
||||
tx_isol_level = TX_ISOL_INHERIT;
|
||||
}
|
||||
|
||||
/**
|
||||
Enable/disable the tracker based on @@session_track_transaction_info.
|
||||
|
||||
@ -1597,5 +1548,3 @@ void Session_tracker::store(THD *thd, String *buf)
|
||||
|
||||
net_store_length(data - 1, length);
|
||||
}
|
||||
|
||||
#endif //EMBEDDED_LIBRARY
|
||||
|
Reference in New Issue
Block a user