diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 838d7700d04..51ea0bf72da 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -153,6 +153,19 @@ static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache, NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), \ NULL, sys_var::PARSE_EARLY + +static Sys_var_enum Sys_log_timestamps( + "log_timestamps", + "UTC to timestamp log files in zulu time, for more concise timestamps " + "and easier correlation of logs from servers from multiple time zones, " + "or SYSTEM to use the system's local time. " + "This affects only log files, not log tables, as the timestamp columns " + "of the latter can be converted at will.", + GLOBAL_VAR(opt_log_timestamps), + CMD_LINE(REQUIRED_ARG), + timestamp_type_names, DEFAULT(0),sys_var::PARSE_EARLY, + NO_MUTEX_GUARD, NOT_IN_BINLOG); + static Sys_var_mybool Sys_pfs_enabled( "performance_schema", "Enable the performance schema.", @@ -2040,17 +2053,6 @@ static Sys_var_ulong Sys_log_error_verbosity( VALID_RANGE(1, 3), DEFAULT(3), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_log_error_verbosity)); -static Sys_var_enum Sys_log_timestamps( - "log_timestamps", - "UTC to timestamp log files in zulu time, for more concise timestamps " - "and easier correlation of logs from servers from multiple time zones, " - "or SYSTEM to use the system's local time. " - "This affects only log files, not log tables, as the timestamp columns " - "of the latter can be converted at will.", - GLOBAL_VAR(opt_log_timestamps), - CMD_LINE(REQUIRED_ARG), - timestamp_type_names, DEFAULT(0), - NO_MUTEX_GUARD, NOT_IN_BINLOG); static Sys_var_mybool Sys_log_statements_unsafe_for_binlog( "log_statements_unsafe_for_binlog", diff --git a/sql/sys_vars.h b/sql/sys_vars.h index c662148689c..d587a187c52 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -362,6 +362,28 @@ public: DBUG_ASSERT(def_val < typelib.count); DBUG_ASSERT(size == sizeof(ulong)); } + + Sys_var_enum(const char *name_arg, + const char *comment, int flag_args, ptrdiff_t off, size_t size, + CMD_LINE getopt, + const char *values[], uint def_val,int parse_flag, PolyLock *lock=0, + enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, + + on_check_function on_check_func=0, + on_update_function on_update_func=0, + const char *substitute=0) + : Sys_var_typelib(name_arg, comment, flag_args, off, getopt, + SHOW_CHAR, values, def_val, lock, + binlog_status_arg, on_check_func, on_update_func, + substitute,parse_flag) + { + option.var_type= GET_ENUM; + global_var(ulong)= def_val; + DBUG_ASSERT(def_val < typelib.count); + DBUG_ASSERT(size == sizeof(ulong)); + } + + bool session_update(THD *thd, set_var *var) { session_var(thd, ulong)=