MySQL 9.1.0
Source Code Documentation
Session_sysvars_tracker::vars_list Class Reference

Public Member Functions

 vars_list (const CHARSET_INFO *char_set)
 
void claim_memory_ownership (bool claim)
 
 ~vars_list ()
 
sysvar_node_stsearch (sysvar_node_st *node, const LEX_CSTRING &tmp)
 
sysvar_map::iterator begin () const
 
sysvar_map::iterator end () const
 
const CHARSET_INFOchar_set () const
 
bool insert (sysvar_node_st *node, const LEX_CSTRING &var)
 Inserts the variable to be tracked into m_registered_sysvars hash. More...
 
void reset ()
 
bool update (vars_list *from, THD *thd)
 This function is used to update the members of one vars_list object with the members from the other. More...
 
bool parse_var_list (THD *thd, LEX_STRING var_list, bool throw_error, const CHARSET_INFO *char_set, bool session_created)
 Parse the specified system variables list. More...
 

Private Types

using sysvar_map = collation_unordered_map< std::string, unique_ptr_my_free< sysvar_node_st > >
 Registered system variables. More...
 

Private Member Functions

void init (const CHARSET_INFO *char_set)
 
void free_hash ()
 
sysvar_node_stsearch (const uchar *token, size_t length)
 

Private Attributes

std::unique_ptr< sysvar_mapm_registered_sysvars
 
char * variables_list
 
bool track_all
 The boolean which when set to true, signifies that every variable is to be tracked. More...
 
const CHARSET_INFOm_char_set
 

Member Typedef Documentation

◆ sysvar_map

Registered system variables.

(@session_track_system_variables) A hash to store the name of all the system variables specified by the user.

Constructor & Destructor Documentation

◆ vars_list()

Session_sysvars_tracker::vars_list::vars_list ( const CHARSET_INFO char_set)
inline

◆ ~vars_list()

Session_sysvars_tracker::vars_list::~vars_list ( )
inline

Member Function Documentation

◆ begin()

sysvar_map::iterator Session_sysvars_tracker::vars_list::begin ( void  ) const
inline

◆ char_set()

const CHARSET_INFO * Session_sysvars_tracker::vars_list::char_set ( ) const
inline

◆ claim_memory_ownership()

void Session_sysvars_tracker::vars_list::claim_memory_ownership ( bool  claim)
inline

◆ end()

sysvar_map::iterator Session_sysvars_tracker::vars_list::end ( void  ) const
inline

◆ free_hash()

void Session_sysvars_tracker::vars_list::free_hash ( )
inlineprivate

◆ init()

void Session_sysvars_tracker::vars_list::init ( const CHARSET_INFO char_set)
inlineprivate

◆ insert()

bool Session_sysvars_tracker::vars_list::insert ( sysvar_node_st node,
const LEX_CSTRING var 
)

Inserts the variable to be tracked into m_registered_sysvars hash.

@param node Node to be inserted. @param var LEX_STRING which has the name of variable.

@return false success true error

◆ parse_var_list()

bool Session_sysvars_tracker::vars_list::parse_var_list ( THD thd,
LEX_STRING  var_list,
bool  throw_error,
const CHARSET_INFO char_set,
bool  session_created 
)

Parse the specified system variables list.

While parsing raise warning/error on invalid/duplicate entries.

In case of duplicate entry ER_DUP_LIST_ENTRY is raised. In case of invalid entry a warning is raised per invalid entry. This is done in order to handle 'potentially' valid system variables from uninstalled plugins which might get installed in future.

Value of @session_track_system_variables is initially put into variables_list. This string is used to update the hash with valid system variables.

Parameters
thdThe thd handle.
var_listSystem variable list.
throw_errorbool when set to true, returns an error in case of invalid/duplicate values.
char_setcharacter set information used for string manipulations.
session_createdbool variable which says if the parse is already executed once. The mutex on variables is not acquired if this variable is false.
Returns
true Error false Success

◆ reset()

void Session_sysvars_tracker::vars_list::reset ( void  )

◆ search() [1/2]

sysvar_node_st * Session_sysvars_tracker::vars_list::search ( const uchar token,
size_t  length 
)
inlineprivate

◆ search() [2/2]

sysvar_node_st * Session_sysvars_tracker::vars_list::search ( sysvar_node_st node,
const LEX_CSTRING tmp 
)
inline

◆ update()

bool Session_sysvars_tracker::vars_list::update ( vars_list from,
THD thd 
)

This function is used to update the members of one vars_list object with the members from the other.

@param from Source vars_list object. @param thd THD handle to retrieve the charset in use.

@return true if the m_registered_sysvars hash has any records. Else the value of track_all.

Member Data Documentation

◆ m_char_set

const CHARSET_INFO* Session_sysvars_tracker::vars_list::m_char_set
private

◆ m_registered_sysvars

std::unique_ptr<sysvar_map> Session_sysvars_tracker::vars_list::m_registered_sysvars
private

◆ track_all

bool Session_sysvars_tracker::vars_list::track_all
private

The boolean which when set to true, signifies that every variable is to be tracked.

◆ variables_list

char* Session_sysvars_tracker::vars_list::variables_list
private

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