diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2014-10-24 10:13:08 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2014-11-11 11:48:50 +0100 |
commit | 1827d9e6d188e3ad53e057a583ebed02767b65ac (patch) | |
tree | 83cbcb5d6e4284149e9a16803884ed4e4766b23d /sql/set_var.h | |
parent | a03dd94be804a4b8b1406696920834bb2c0bedbd (diff) | |
download | mariadb-git-1827d9e6d188e3ad53e057a583ebed02767b65ac.tar.gz |
MDEV-5231: Per query variables from Percona Server (rewritten)
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index fe2a0d8e953..47f19f0ff96 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -61,7 +61,8 @@ public: sys_var *next; LEX_CSTRING name; enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023, - READONLY=1024, ALLOCATED=2048, PARSE_EARLY=4096 }; + READONLY=1024, ALLOCATED=2048, PARSE_EARLY=4096, + NO_SET_STATEMENT=8192}; enum { NO_GETOPT=-1, GETOPT_ONLY_HELP=-2 }; enum where { CONFIG, AUTO, SQL, COMPILE_TIME, ENV }; @@ -87,6 +88,7 @@ protected: on_update_function on_update; const char *const deprecation_substitute; bool is_os_charset; ///< true if the value is in character_set_filesystem + bool default_val; public: sys_var(sys_var_chain *chain, const char *name_arg, const char *comment, @@ -133,6 +135,7 @@ public: that support the syntax @@keycache_name.variable_name */ bool is_struct() { return option.var_type & GET_ASK_ADDR; } + bool is_set_stmt_ok() const { return !(flags & NO_SET_STATEMENT); } bool is_written_to_binlog(enum_var_type type) { return type != OPT_GLOBAL && binlog_status == SESSION_VARIABLE_IN_BINLOG; } bool check_update_type(Item_result type) @@ -191,6 +194,8 @@ public: return insert_dynamic(array, (uchar*)&option); } void do_deprecated_warning(THD *thd); + bool is_default() { return default_val; } + void set_is_default(bool def) { default_val= def; } virtual uchar *default_value_ptr(THD *thd) { return (uchar*)&option.def_value; } @@ -249,6 +254,7 @@ public: virtual int check(THD *thd)=0; /* To check privileges etc. */ virtual int update(THD *thd)=0; /* To set the value */ virtual int light_check(THD *thd) { return check(thd); } /* for PS */ + virtual bool is_system() { return FALSE; } }; @@ -290,6 +296,7 @@ public: else value=value_arg; } + virtual bool is_system() { return 1; } int check(THD *thd); int update(THD *thd); int light_check(THD *thd); @@ -388,7 +395,7 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type); int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond); sys_var *find_sys_var(THD *thd, const char *str, uint length=0); -int sql_set_variables(THD *thd, List<set_var_base> *var_list); +int sql_set_variables(THD *thd, List<set_var_base> *var_list, bool free); #define SYSVAR_AUTOSIZE(VAR,VAL) \ do { \ |