summaryrefslogtreecommitdiff
path: root/sql/set_var.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-04-09 11:14:57 +0200
committerSergei Golubchik <serg@mariadb.org>2015-04-09 19:41:59 +0200
commiteb29a63e4508359a44a29c192fae347196d5a6d3 (patch)
treeb81e5632a8c8193b8bebbea594f286157f37ece0 /sql/set_var.h
parent0a9052f591a04e617ad58ee1b19dfc3ed7084147 (diff)
downloadmariadb-git-eb29a63e4508359a44a29c192fae347196d5a6d3.tar.gz
SET STATEMENT timestamp=xxx ....
fix sys_var->is_default() method (that was using default_val property in a global sys_var object to track per-session state): * move timestamp to a dedicated Sys_var_timestamp class (in fact, rename Sys_var_session_special_double to Sys_var_timestamp) * make session_is_default a virtual method with a special implementation for timestamps * other variables don't have a special behavior for default values and can have session_is_default() to be always false.
Diffstat (limited to 'sql/set_var.h')
-rw-r--r--sql/set_var.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/set_var.h b/sql/set_var.h
index 15c89f1e2b4..0215a452c07 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -88,7 +88,6 @@ 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,
@@ -194,8 +193,15 @@ 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; }
+ /**
+ whether session value of a sysvar is a default one.
+
+ in this simple implementation we don't distinguish between default
+ and non-default values. for most variables it's ok, they don't treat
+ default values specially. this method is overwritten in descendant
+ classes as necessary.
+ */
+ virtual bool session_is_default(THD *thd) { return false; }
virtual uchar *default_value_ptr(THD *thd)
{ return (uchar*)&option.def_value; }