MySQL 8.3.0
Source Code Documentation
State_tracker Class Referenceabstract

#include <session_tracker.h>

Inheritance diagram for State_tracker:

Public Member Functions

 State_tracker ()
 Constructor. More...
virtual ~State_tracker ()=default
 Destructor. More...
bool is_enabled () const
 Getters. More...
bool is_changed () const
virtual bool enable (THD *thd)=0
 Called in the constructor of THD. More...
virtual bool check (THD *thd, set_var *var)=0
 To be invoked when the tracker's system variable is checked (ON_CHECK). More...
virtual bool update (THD *thd)=0
 To be invoked when the tracker's system variable is updated (ON_UPDATE). More...
virtual bool store (THD *thd, String &buf)=0
 Store changed data into the given buffer. More...
virtual void mark_as_changed (THD *thd, LEX_CSTRING name)=0
 Mark the entity as changed. More...
virtual void claim_memory_ownership (bool claim)

Protected Attributes

bool m_enabled
 Is tracking enabled for a particular session state type ? More...
bool m_changed
 Has the session state type changed ? More...

Detailed Description


An abstract class that defines the interface for any of the server's 'session state change tracker'. A tracker, however, is a sub- class of this class which takes care of tracking the change in value of a part- icular session state type and thus defines various methods listed in this interface. The change information is later serialized and transmitted to the client through protocol's OK packet.

Tracker system variables :- A tracker is normally mapped to a system variable. So in order to enable, disable or modify the sub-entities of a tracker, the user needs to modify the respective system variable either through SET command or via command line option. As required in system variable handling, this interface also includes two functions to help in the verification of the supplied value (ON_CHECK) and the updation (ON_UPDATE) of the tracker system variable, namely - check() and update().

Constructor & Destructor Documentation

◆ State_tracker()

State_tracker::State_tracker ( )


◆ ~State_tracker()

virtual State_tracker::~State_tracker ( )


Member Function Documentation

◆ check()

virtual bool State_tracker::check ( THD thd,
set_var var 
pure virtual

To be invoked when the tracker's system variable is checked (ON_CHECK).

Implemented in Current_schema_tracker, Session_gtids_tracker, Session_transaction_state, Session_state_change_tracker, Transaction_state_tracker, and Session_sysvars_tracker.

◆ claim_memory_ownership()

virtual void State_tracker::claim_memory_ownership ( bool  claim)

Reimplemented in Session_sysvars_tracker.

◆ enable()

virtual bool State_tracker::enable ( THD thd)
pure virtual

◆ is_changed()

bool State_tracker::is_changed ( ) const

◆ is_enabled()

bool State_tracker::is_enabled ( ) const


◆ mark_as_changed()

virtual void State_tracker::mark_as_changed ( THD thd,
pure virtual

◆ store()

virtual bool State_tracker::store ( THD thd,
String buf 
pure virtual

◆ update()

virtual bool State_tracker::update ( THD thd)
pure virtual

To be invoked when the tracker's system variable is updated (ON_UPDATE).

Implemented in Session_transaction_state, Session_sysvars_tracker, Current_schema_tracker, Session_gtids_tracker, Session_state_change_tracker, and Transaction_state_tracker.

Member Data Documentation

◆ m_changed

bool State_tracker::m_changed

Has the session state type changed ?

◆ m_enabled

bool State_tracker::m_enabled

Is tracking enabled for a particular session state type ?

The documentation for this class was generated from the following file: