diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2015-08-10 21:45:11 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-09-04 10:33:55 +0200 |
commit | 21daa7b9298d31ab1c6ddd1159dba29acea8d868 (patch) | |
tree | 7fcfa36605879c82f757ad3add0e6184f36487c3 /sql/set_var.h | |
parent | b85a00161e91080cb82b99e812c18eafb6467737 (diff) | |
download | mariadb-git-21daa7b9298d31ab1c6ddd1159dba29acea8d868.tar.gz |
MDEV-6066: Merge new defaults from 5.6 and 5.7 (autoset)
--autoset- command line prefix added
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index d10edb07133..b3538559fbb 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -62,7 +62,7 @@ public: LEX_CSTRING name; enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023, READONLY=1024, ALLOCATED=2048, PARSE_EARLY=4096, - NO_SET_STATEMENT=8192}; + NO_SET_STATEMENT=8192, AUTO_SET=16384}; enum { NO_GETOPT=-1, GETOPT_ONLY_HELP=-2 }; enum where { CONFIG, AUTO, SQL, COMPILE_TIME, ENV }; @@ -89,6 +89,12 @@ protected: const char *const deprecation_substitute; bool is_os_charset; ///< true if the value is in character_set_filesystem + inline void fix_auto_flag() + { + if (flags & AUTO_SET) + option.var_type|= GET_AUTO; + } + public: sys_var(sys_var_chain *chain, const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, int getopt_id, @@ -389,10 +395,17 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list, bool free); #define SYSVAR_AUTOSIZE(VAR,VAL) \ do { \ VAR= (VAL); \ - mark_sys_var_value_origin(&VAR, sys_var::AUTO); \ + set_sys_var_value_origin(&VAR, sys_var::AUTO); \ } while(0) -void mark_sys_var_value_origin(void *ptr, enum sys_var::where here); +void set_sys_var_value_origin(void *ptr, enum sys_var::where here); + +enum sys_var::where get_sys_var_value_origin(void *ptr); +inline bool IS_SYSVAR_AUTOSIZE(void *ptr) +{ + enum sys_var::where res= get_sys_var_value_origin(ptr); + return (res == sys_var::AUTO || res == sys_var::COMPILE_TIME); +} bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type); |