MySQL 9.0.0
Source Code Documentation
Current_schema_tracker Class Reference
Inheritance diagram for Current_schema_tracker:
[legend]

Public Member Functions

 Current_schema_tracker ()
 Constructor. More...
 
bool enable (THD *thd) override
 Called in the constructor of THD. More...
 
bool check (THD *, set_var *) override
 To be invoked when the tracker's system variable is checked (ON_CHECK). More...
 
bool update (THD *thd) override
 Enable/disable the tracker based on @session_track_schema's value. More...
 
bool store (THD *thd, String &buf) override
 Store the schema name as length-encoded string in the specified buffer. More...
 
void mark_as_changed (THD *thd, LEX_CSTRING tracked_item_name) override
 Mark the tracker as changed. More...
 
- Public Member Functions inherited from State_tracker
 State_tracker ()
 Constructor. More...
 
virtual ~State_tracker ()=default
 Destructor. More...
 
bool is_enabled () const
 Getters. More...
 
bool is_changed () const
 
virtual void claim_memory_ownership (bool claim)
 

Private Member Functions

void reset ()
 Reset the m_changed flag for next statement. More...
 

Private Attributes

bool schema_track_inited
 

Additional Inherited Members

- Protected Attributes inherited from State_tracker
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

Current_schema_tracker

This is a tracker class that enables & manages the tracking of current schema for a particular connection.

Constructor & Destructor Documentation

◆ Current_schema_tracker()

Current_schema_tracker::Current_schema_tracker ( )
inline

Constructor.

Member Function Documentation

◆ check()

bool Current_schema_tracker::check ( THD thd,
set_var var 
)
inlineoverridevirtual

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

Implements State_tracker.

◆ enable()

bool Current_schema_tracker::enable ( THD thd)
inlineoverridevirtual

Called in the constructor of THD.

Implements State_tracker.

◆ mark_as_changed()

void Current_schema_tracker::mark_as_changed ( THD thd,
LEX_CSTRING  tracked_item_name 
)
overridevirtual

Mark the tracker as changed.

Parameters
thdCurrent thread
tracked_item_nameAlways null (unused).

Implements State_tracker.

◆ reset()

void Current_schema_tracker::reset ( void  )
private

Reset the m_changed flag for next statement.

◆ store()

bool Current_schema_tracker::store ( THD thd,
String buf 
)
overridevirtual

Store the schema name as length-encoded string in the specified buffer.

Once the data is stored, we reset the flags related to state-change (see reset()).

Parameters
thdThe thd handle.
[in,out]bufBuffer to store the information to.
Returns
false Success true Error

Implements State_tracker.

◆ update()

bool Current_schema_tracker::update ( THD thd)
overridevirtual

Enable/disable the tracker based on @session_track_schema's value.

Parameters
thdThe thd handle.
Returns
false (always)

Implements State_tracker.

Member Data Documentation

◆ schema_track_inited

bool Current_schema_tracker::schema_track_inited
private

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