diff options
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index f43d3b75cee..5fb883e8b86 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -873,6 +873,28 @@ public: byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; + +/** + * @brief This is a specialization of sys_var_thd_ulong that implements a + read-only session variable. The class overrides check() and check_default() + to achieve the read-only property for the session part of the variable. + */ +class sys_var_thd_ulong_session_readonly : public sys_var_thd_ulong +{ +public: + sys_var_thd_ulong_session_readonly(const char *name_arg, ulong SV::*offset_arg, + sys_check_func c_func= NULL, + sys_after_update_func au_func= NULL): + sys_var_thd_ulong(name_arg, offset_arg, c_func, au_func) + { } + bool check(THD *thd, set_var *var); + bool check_default(enum_var_type type) + { + return type != OPT_GLOBAL || !option_limits; + } +}; + + class sys_var_trust_routine_creators :public sys_var_bool_ptr { /* We need a derived class only to have a warn_deprecated() */ |