MySQL 5.6.14 Source Code Document
|
#include <set_var.h>
Public Types | |
enum | flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK = 1023, READONLY = 1024, ALLOCATED = 2048, INVISIBLE = 4096 } |
enum | binlog_status_enum { VARIABLE_NOT_IN_BINLOG, SESSION_VARIABLE_IN_BINLOG } |
Public Member Functions | |
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) | |
virtual void | cleanup () |
virtual sys_var_pluginvar * | cast_pluginvar () |
bool | check (THD *thd, set_var *var) |
uchar * | value_ptr (THD *thd, enum_var_type type, LEX_STRING *base) |
virtual void | update_default (longlong new_def_value) |
bool | set_default (THD *thd, set_var *var) |
bool | update (THD *thd, set_var *var) |
SHOW_TYPE | show_type () |
int | scope () const |
const CHARSET_INFO * | charset (THD *thd) |
bool | is_readonly () const |
bool | not_visible () const |
bool | is_struct () |
bool | is_written_to_binlog (enum_var_type type) |
virtual bool | check_update_type (Item_result type)=0 |
bool | check_type (enum_var_type type) |
bool | register_option (std::vector< my_option > *array, int parse_flags) |
void | do_deprecated_warning (THD *thd) |
Public Attributes | |
sys_var * | next |
LEX_CSTRING | name |
enum sys_var::binlog_status_enum | binlog_status |
Static Public Attributes | |
static const int | PARSE_EARLY = 1 |
static const int | PARSE_NORMAL = 2 |
Protected Types | |
typedef bool(* | on_check_function )(sys_var *self, THD *thd, set_var *var) |
typedef bool(* | on_update_function )(sys_var *self, THD *thd, enum_var_type type) |
Protected Member Functions | |
virtual uchar * | session_value_ptr (THD *thd, LEX_STRING *base) |
virtual uchar * | global_value_ptr (THD *thd, LEX_STRING *base) |
uchar * | session_var_ptr (THD *thd) |
uchar * | global_var_ptr () |
Protected Attributes | |
int | flags |
or'ed flag_enum values | |
int | m_parse_flag |
either PARSE_EARLY or PARSE_NORMAL. | |
const SHOW_TYPE | show_val_type |
what value_ptr() returns for sql_show.cc | |
my_option | option |
min, max, default values are stored here | |
PolyLock * | guard |
second lock that protects the variable | |
ptrdiff_t | offset |
offset to the value from global_system_variables | |
on_check_function | on_check |
on_update_function | on_update |
const char *const | deprecation_substitute |
bool | is_os_charset |
true if the value is in character_set_filesystem |
A class representing one system variable - that is something that can be accessed as @global.variable_name or @session.variable_name, visible in SHOW xxx VARIABLES and in INFORMATION_SCHEMA.xxx_VARIABLES, optionally it can be assigned to, optionally it can have a command-line counterpart with the same name.
sys_var::sys_var | ( | sys_var_chain * | chain, |
const char * | name_arg, | ||
const char * | comment, | ||
int | flags_arg, | ||
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 constructor
chain | variables are linked into chain for mysql_add_sys_var_chain() |
name_arg | the name of the variable. Must be 0-terminated and exist for the liftime of the sys_var object. |
comment | shown in mysqld –help, |
flags_arg | or'ed flag_enum values |
off | offset of the global variable value from the &global_system_variables. |
getopt_id | -1 for no command-line option, otherwise |
getopt_arg_type |
show_val_type_arg | what value_ptr() returns for sql_show.cc |
def_val | default value, |
lock | mutex or rw_lock that protects the global variable in addition to LOCK_global_system_variables. |
binlog_status_enum |
on_check_func | a function to be called at the end of sys_var::check, put your additional checks here |
on_update_func | a function to be called at the end of sys_var::update, any post-update activity should happen here |
substitute | If non-NULL, this variable is deprecated and the string describes what one should use instead. If an empty string, the variable is deprecated but no replacement is offered. |
parse_flag | either PARSE_EARLY or PARSE_NORMAL |
Definition at line 135 of file set_var.cc.
|
inlinevirtual |
downcast for sys_var_pluginvar. Returns this if it's an instance of sys_var_pluginvar, and 0 otherwise.
Reimplemented in sys_var_pluginvar.
|
inlinevirtual |
All the cleanup procedures should be performed here
Reimplemented in Sys_var_charptr.
|
inline |
|
protectedvirtual |
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 in Sys_var_gtid_purged, Sys_var_charptr_func, Sys_var_gtid_specification, Sys_var_tz, Sys_var_struct, Sys_var_have, Sys_var_session_special_double, Sys_var_session_special, Sys_var_bit, Sys_var_plugin, Sys_var_set, Sys_var_flagset, Sys_var_max_user_conn, Sys_var_dbug, Sys_var_external_user, Sys_var_proxy_user, Sys_var_enum, and sys_var_pluginvar.
Definition at line 201 of file set_var.cc.
|
inlineprotected |
A pointer to a storage area of the variable, to the raw data. Typically it's the same as session_value_ptr(), but it's different, for example, for ENUM, that is printed as a string, but stored as a number.
Definition at line 174 of file set_var.h.
bool sys_var::set_default | ( | THD * | thd, |
set_var * | var | ||
) |
Update the system variable with the default value from either session or global scope. The default value is stored in the 'var' argument. Return false when successful.
Definition at line 251 of file set_var.cc.