MySQL 8.0.40
Source Code Documentation
sys_vars_shared.h File Reference

"protected" interface to sys_var - server configuration variables. More...

Go to the source code of this file.

Classes

class  PolyLock
 wrapper to hide a mutex and an rwlock under a common interface More...
 
class  PolyLock_mutex
 
class  PolyLock_rwlock
 
class  PolyLock_lock_log
 
class  AutoWLock
 
class  AutoRLock
 

Functions

bool throw_bounds_warning (THD *thd, const char *name, bool fixed, bool is_unsigned, longlong v)
 Throw warning (error in STRICT mode) if value for variable needed bounding. More...
 
bool throw_bounds_warning (THD *thd, const char *name, bool fixed, double v)
 
sys_varfind_static_system_variable (const std::string &name)
 Find a static system variable. More...
 
sys_varfind_dynamic_system_variable (const std::string &name)
 Find a dynamic system variable. More...
 
sys_varintern_find_sys_var (const char *str, size_t length)
 Find a system variable, either static or dynamic. More...
 

Detailed Description

"protected" interface to sys_var - server configuration variables.

This header is included by files implementing support and utility functions of sys_var's (set_var.cc) and files implementing classes in the sys_var hierarchy (sql_plugin.cc)

Function Documentation

◆ find_dynamic_system_variable()

sys_var * find_dynamic_system_variable ( const std::string &  name)

Find a dynamic system variable.

Parameters
nameName of system variable to find
Return values
pointerpointer to variable definitions
nullptr1. Unknown static variable (error message is given).
  1. Invisible static variable (no error message).
Note
Requires an external lock on LOCK_system_variable_hash.

◆ find_static_system_variable()

sys_var * find_static_system_variable ( const std::string &  name)

Find a static system variable.

Parameters
nameName of system variable to find
Return values
pointerpointer to variable definitions
nullptr1. Unknown static variable (error message is given).
  1. Invisible static variable (no error message).
Note
Unlike intern_find_sys_var() and find_dynamic_system_variable(), an external lock on LOCK_system_variable_hash is not necessary.

◆ intern_find_sys_var()

sys_var * intern_find_sys_var ( const char *  str,
size_t  length 
)

Find a system variable, either static or dynamic.

Parameters
strName of system variable to find
lengthLength of variable. zero means that we should use strlen() on the variable
Return values
pointerpointer to variable definitions
nullptr1. Unknown variable (error message is given).
  1. Invisible variable (no error message).
Note
Requires an external lock on LOCK_system_variable_hash.

◆ throw_bounds_warning() [1/2]

bool throw_bounds_warning ( THD thd,
const char *  name,
bool  fixed,
bool  is_unsigned,
longlong  v 
)

Throw warning (error in STRICT mode) if value for variable needed bounding.

Plug-in interface also uses this.

Parameters
thdthread handle
namevariable's name
fixeddid we have to correct the value? (throw warn/err if so)
is_unsignedis value's type unsigned?
vvariable's value
Return values
trueon error, false otherwise (warning or ok)

◆ throw_bounds_warning() [2/2]

bool throw_bounds_warning ( THD thd,
const char *  name,
bool  fixed,
double  v 
)