MySQL 8.0.39
Source Code Documentation
Sys_var_alias Class Reference

A sys_var that is an alias for another sys_var. More...

#include <sys_vars.h>

Inheritance diagram for Sys_var_alias:
[legend]

Public Member Functions

 Sys_var_alias (const char *name_arg, sys_var &base_var)
 
sys_varget_base_var ()
 
void cleanup () override
 All the cleanup procedures should be performed here. More...
 
sys_var_pluginvarcast_pluginvar () override
 downcast for sys_var_pluginvar. More...
 
void update_default (longlong new_def_value) override
 
longlong get_default () override
 
longlong get_min_value () override
 
ulonglong get_max_value () override
 
ulong get_var_type () override
 Returns variable type. More...
 
void set_arg_source (get_opt_arg_source *arg_source) override
 
void set_is_plugin (bool is_plugin) override
 
bool is_non_persistent () override
 
void saved_value_to_string (THD *thd, set_var *var, char *def_val) override
 This function converts value stored in save_result to string. More...
 
bool check_update_type (Item_result type) override
 
enum_variable_source get_source () override
 
const char * get_source_name () override
 
void set_source (enum_variable_source src) override
 
bool set_source_name (const char *path) override
 
bool set_user (const char *usr) override
 
const char * get_user () override
 
const char * get_host () override
 
bool set_host (const char *hst) override
 
ulonglong get_timestamp () const override
 
void set_user_host (THD *thd) override
 
void set_timestamp () override
 
void set_timestamp (ulonglong ts) override
 
- Public Member Functions inherited from sys_var
 sys_var (sys_var_chain *chain, const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, int getopt_id, enum get_opt_arg_type getopt_arg_type, SHOW_TYPE show_val_type_arg, longlong def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, on_update_function on_update_func, const char *substitute, int parse_flag, sys_var *persisted_alias=nullptr, bool is_persisted_deprecated=false)
 sys_var constructor More...
 
virtual ~sys_var ()=default
 
const char * get_deprecation_substitute ()
 
bool check (THD *thd, set_var *var)
 
const ucharvalue_ptr (THD *running_thd, THD *target_thd, enum_var_type type, std::string_view keycache_name)
 
const ucharvalue_ptr (THD *thd, enum_var_type type, std::string_view keycache_name)
 
my_optionget_option ()
 
bool set_default (THD *thd, set_var *var)
 Update the system variable with the default value from either session or global scope. More...
 
bool update (THD *thd, set_var *var)
 
SHOW_TYPE show_type ()
 
int scope () const
 
const CHARSET_INFOcharset (THD *thd)
 
bool is_readonly () const
 
bool not_visible () const
 
bool is_trilevel () const
 
bool is_persist_readonly () const
 
bool is_parse_early () const
 
bool is_sensitive () const
 
bool is_hint_updateable () const
 Check if the variable can be set using SET_VAR hint. More...
 
bool is_struct ()
 the following is only true for keycache variables, that support the syntax @keycache_name.variable_name More...
 
bool is_written_to_binlog (enum_var_type type)
 
bool check_scope (enum_var_type query_type)
 Return true for success if: Global query and variable scope is GLOBAL or SESSION, or Session query and variable scope is SESSION or ONLY_SESSION. More...
 
bool is_global_persist (enum_var_type type)
 
bool is_settable_at_command_line ()
 Return true if settable at the command line. More...
 
bool register_option (std::vector< my_option > *array, int parse_flags)
 
void do_deprecated_warning (THD *thd)
 
Itemcopy_value (THD *thd)
 Create item from system variable value. More...
 
void save_default (THD *thd, set_var *var)
 
bool check_if_sensitive_in_context (THD *, bool suppress_errors=true) const
 

Protected Member Functions

 Sys_var_alias (const char *name_arg, sys_var &base_var, const char *deprecation_substitute_arg, sys_var *persisted_alias, bool is_persisted_deprecated)
 Special constructor used to implement Sys_var_deprecated alias. More...
 
const ucharsession_value_ptr (THD *running_thd, THD *target_thd, std::string_view keycache_name) override
 A pointer to a value of the variable for SHOW. More...
 
const ucharglobal_value_ptr (THD *thd, std::string_view keycache_name) override
 
- Protected Member Functions inherited from sys_var
ucharsession_var_ptr (THD *thd)
 A pointer to a storage area of the variable, to the raw data. More...
 
ucharglobal_var_ptr ()
 

Private Member Functions

bool do_check (THD *thd, set_var *var) override
 
void session_save_default (THD *thd, set_var *var) override
 save the session default value of the variable in var More...
 
void global_save_default (THD *thd, set_var *var) override
 save the global default value of the variable in var More...
 
bool session_update (THD *thd, set_var *var) override
 
bool global_update (THD *thd, set_var *var) override
 

Private Attributes

sys_varm_base_var
 

Additional Inherited Members

- Public Types inherited from sys_var
enum  flag_enum {
  GLOBAL = 0x0001 , SESSION = 0x0002 , ONLY_SESSION = 0x0004 , SCOPE_MASK = 0x03FF ,
  READONLY = 0x0400 , ALLOCATED = 0x0800 , INVISIBLE = 0x1000 , TRI_LEVEL = 0x2000 ,
  NOTPERSIST = 0x4000 , HINT_UPDATEABLE = 0x8000 , PERSIST_AS_READ_ONLY = 0x10000 , SENSITIVE = 0x20000
}
 
enum  binlog_status_enum { VARIABLE_NOT_IN_BINLOG , SESSION_VARIABLE_IN_BINLOG }
 Enumeration type to indicate for a system variable whether it will be written to the binlog or not. More...
 
- Public Attributes inherited from sys_var
sys_varnext
 
LEX_CSTRING name
 
sys_varm_persisted_alias
 If the variable has an alias in the persisted variables file, this should point to it. More...
 
bool m_is_persisted_deprecated
 If m_persist_alias is set, and the current variable is deprecated and m_persist_alias is the recommended substitute, then this flag should be set to true. More...
 
enum sys_var::binlog_status_enum binlog_status
 
- Static Public Attributes inherited from sys_var
static const int PARSE_EARLY = 1
 
static const int PARSE_NORMAL = 2
 
- Protected Types inherited from sys_var
typedef bool(* on_check_function) (sys_var *self, THD *thd, set_var *var)
 
typedef bool(* pre_update_function) (sys_var *self, THD *thd, set_var *var)
 
typedef bool(* on_update_function) (sys_var *self, THD *thd, enum_var_type type)
 
- Protected Attributes inherited from sys_var
int flags
 or'ed flag_enum values More...
 
int m_parse_flag
 either PARSE_EARLY or PARSE_NORMAL. More...
 
const SHOW_TYPE show_val_type
 what value_ptr() returns for sql_show.cc More...
 
my_option option
 min, max, default values are stored here More...
 
PolyLockguard
 second lock that protects the variable More...
 
ptrdiff_t offset
 offset to the value from global_system_variables More...
 
on_check_function on_check
 
pre_update_function pre_update
 Pointer to function to be invoked before updating system variable (but after calling on_check hook), while we do not hold any locks yet. More...
 
on_update_function on_update
 
const char *const deprecation_substitute
 
bool is_os_charset
 true if the value is in character_set_filesystem More...
 
struct get_opt_arg_source source
 
char user [USERNAME_CHAR_LENGTH+1]
 
char host [HOSTNAME_LENGTH+1]
 
ulonglong timestamp
 

Detailed Description

A sys_var that is an alias for another sys_var.

The two variables effectively share (almost) all members, so whenever you change one of them, it affects both.

Usually you want to use Sys_var_deprecated_alias instead.

Constructor & Destructor Documentation

◆ Sys_var_alias() [1/2]

Sys_var_alias::Sys_var_alias ( const char *  name_arg,
sys_var base_var,
const char *  deprecation_substitute_arg,
sys_var persisted_alias,
bool  is_persisted_deprecated 
)
inlineprotected

Special constructor used to implement Sys_var_deprecated alias.

Parameters
name_argThe name of this sys_var.
base_varThe "parent" sys_var that this sys_var is an alias for.
deprecation_substitute_argThe deprecation_substitute to use for this variable. While other fields in the created variable are inherited from real_var, the deprecation_substitute can be set using this parameter.
persisted_aliasWhen this variable is persisted, it will duplicate the entry in the persisted variables file: It will be stored both using the variable name name_arg, and the name of persisted_alias.
is_persisted_deprecatedIf true, this variable is deprecated when appearing in the persisted variables file.

◆ Sys_var_alias() [2/2]

Sys_var_alias::Sys_var_alias ( const char *  name_arg,
sys_var base_var 
)
inline

Member Function Documentation

◆ cast_pluginvar()

sys_var_pluginvar * Sys_var_alias::cast_pluginvar ( )
inlineoverridevirtual

downcast for sys_var_pluginvar.

Returns this if it's an instance of sys_var_pluginvar, and 0 otherwise.

Reimplemented from sys_var.

◆ check_update_type()

bool Sys_var_alias::check_update_type ( Item_result  type)
inlineoverridevirtual

Implements sys_var.

◆ cleanup()

void Sys_var_alias::cleanup ( void  )
inlineoverridevirtual

All the cleanup procedures should be performed here.

Reimplemented from sys_var.

◆ do_check()

bool Sys_var_alias::do_check ( THD thd,
set_var var 
)
inlineoverrideprivatevirtual

Implements sys_var.

◆ get_base_var()

sys_var & Sys_var_alias::get_base_var ( )
inline

◆ get_default()

longlong Sys_var_alias::get_default ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_host()

const char * Sys_var_alias::get_host ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_max_value()

ulonglong Sys_var_alias::get_max_value ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_min_value()

longlong Sys_var_alias::get_min_value ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_source()

enum_variable_source Sys_var_alias::get_source ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_source_name()

const char * Sys_var_alias::get_source_name ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_timestamp()

ulonglong Sys_var_alias::get_timestamp ( ) const
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_user()

const char * Sys_var_alias::get_user ( void  )
inlineoverridevirtual

Reimplemented from sys_var.

◆ get_var_type()

ulong Sys_var_alias::get_var_type ( )
inlineoverridevirtual

Returns variable type.

Returns
variable type

Reimplemented from sys_var.

◆ global_save_default()

void Sys_var_alias::global_save_default ( THD thd,
set_var var 
)
inlineoverrideprivatevirtual

save the global default value of the variable in var

Implements sys_var.

◆ global_update()

bool Sys_var_alias::global_update ( THD thd,
set_var var 
)
inlineoverrideprivatevirtual

Implements sys_var.

◆ global_value_ptr()

const uchar * Sys_var_alias::global_value_ptr ( THD thd,
std::string_view  keycache_name 
)
inlineoverrideprotectedvirtual

Reimplemented from sys_var.

◆ is_non_persistent()

bool Sys_var_alias::is_non_persistent ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ saved_value_to_string()

void Sys_var_alias::saved_value_to_string ( THD thd,
set_var var,
char *  def_val 
)
inlineoverridevirtual

This function converts value stored in save_result to string.

This function must be called after calling save_default() as save_default() will store default value to save_result.

Implements sys_var.

◆ session_save_default()

void Sys_var_alias::session_save_default ( THD thd,
set_var var 
)
inlineoverrideprivatevirtual

save the session default value of the variable in var

Implements sys_var.

◆ session_update()

bool Sys_var_alias::session_update ( THD thd,
set_var var 
)
inlineoverrideprivatevirtual

Implements sys_var.

◆ session_value_ptr()

const uchar * Sys_var_alias::session_value_ptr ( THD running_thd,
THD target_thd,
std::string_view  keycache_name 
)
inlineoverrideprotectedvirtual

A pointer to a value of the variable for SHOW.

It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT, longlong for SHOW_LONGLONG, etc).

Reimplemented from sys_var.

◆ set_arg_source()

void Sys_var_alias::set_arg_source ( get_opt_arg_source arg_source)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_host()

bool Sys_var_alias::set_host ( const char *  hst)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_is_plugin()

void Sys_var_alias::set_is_plugin ( bool  is_plugin)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_source()

void Sys_var_alias::set_source ( enum_variable_source  src)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_source_name()

bool Sys_var_alias::set_source_name ( const char *  path)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_timestamp() [1/2]

void Sys_var_alias::set_timestamp ( )
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_timestamp() [2/2]

void Sys_var_alias::set_timestamp ( ulonglong  ts)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_user()

bool Sys_var_alias::set_user ( const char *  usr)
inlineoverridevirtual

Reimplemented from sys_var.

◆ set_user_host()

void Sys_var_alias::set_user_host ( THD thd)
inlineoverridevirtual

Reimplemented from sys_var.

◆ update_default()

void Sys_var_alias::update_default ( longlong  new_def_value)
inlineoverridevirtual

Reimplemented from sys_var.

Member Data Documentation

◆ m_base_var

sys_var& Sys_var_alias::m_base_var
private

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