My Project
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
sys_var Class Reference

#include <set_var.h>

Inheritance diagram for sys_var:
Sys_var_charptr Sys_var_charptr_func Sys_var_dbug Sys_var_double Sys_var_gtid_purged Sys_var_gtid_specification Sys_var_have Sys_var_integer< T, ARGT, SHOWT, SIGNED > Sys_var_plugin sys_var_pluginvar Sys_var_proxy_user Sys_var_struct Sys_var_typelib Sys_var_tz

List of all members.

Public Types

enum  flag_enum {
  READONLY = 1024, ALLOCATED = 2048, INVISIBLE = 4096

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_pluginvarcast_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

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
const SHOW_TYPE show_val_type
 what value_ptr() returns for
my_option option
 min, max, default values are stored here
 *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

Detailed Description

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.

Member Enumeration Documentation

Enumeration type to indicate for a system variable whether it will be written to the binlog or not.

Constructor & Destructor Documentation

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

chainvariables are linked into chain for mysql_add_sys_var_chain()
name_argthe name of the variable. Must be 0-terminated and exist for the liftime of the sys_var object.
See also:
commentshown in mysqld --help,
See also:
flags_argor'ed flag_enum values
offoffset of the global variable value from the &global_system_variables.
getopt_id-1 for no command-line option, otherwise
See also:
See also:
show_val_type_argwhat value_ptr() returns for
def_valdefault value,
See also:
lockmutex or rw_lock that protects the global variable in addition* to LOCK_global_system_variables.
See also:
on_check_funca function to be called at the end of sys_var::check, put your additional checks here
on_update_funca function to be called at the end of sys_var::update, any post-update activity should happen here
substituteIf 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_flageither PARSE_EARLY or PARSE_NORMAL

Member Function Documentation

virtual sys_var_pluginvar* sys_var::cast_pluginvar ( ) [inline, virtual]

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

Reimplemented in sys_var_pluginvar.

virtual void sys_var::cleanup ( ) [inline, virtual]

All the cleanup procedures should be performed here

Reimplemented in Sys_var_charptr.

bool sys_var::is_struct ( ) [inline]

the following is only true for keycache variables, that support the syntax @keycache_name.variable_name

uchar * sys_var::session_value_ptr ( THD *  thd,
LEX_STRING *  base 
) [protected, virtual]
uchar* sys_var::session_var_ptr ( THD *  thd) [inline, protected]

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.

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.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines