diff options
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index 752f275c9f2..3fcbd283833 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -49,8 +49,6 @@ public: const char *name; sys_after_update_func after_update; - sys_var() - {} sys_var(const char *name_arg) :name(name_arg),after_update(0) {} sys_var(const char *name_arg,sys_after_update_func func) @@ -190,9 +188,6 @@ public: class sys_var_thd :public sys_var { public: - sys_var_thd() - :sys_var() - {} sys_var_thd(const char *name_arg) :sys_var(name_arg) {} @@ -560,46 +555,26 @@ public: }; -class sys_var_datetime_format :public sys_var_thd +class sys_var_thd_date_time_format :public sys_var_thd { + DATE_TIME_FORMAT *SV::*offset; + enum timestamp_type date_time_type; public: - enum datetime_format_types format_type; - DATETIME_FORMAT datetime_format; - sys_var_datetime_format(): sys_var_thd() + sys_var_thd_date_time_format(const char *name_arg, + DATE_TIME_FORMAT *SV::*offset_arg, + timestamp_type date_time_type_arg) + :sys_var_thd(name_arg), offset(offset_arg), + date_time_type(date_time_type_arg) {} - - void clean() - { - my_free(datetime_format.format, MYF(MY_ALLOW_ZERO_PTR)); - datetime_format.format=0; - } - - /* - It's for copying of global_system_variables structure - in THD constructor. - */ - inline sys_var_datetime_format& operator= (sys_var_datetime_format& s) - { - if (&s != this) - { - name= s.name; name_length= s.name_length; - datetime_format= s.datetime_format; - datetime_format.format= (my_strdup_with_length - (s.datetime_format.format, - s.datetime_format. - format_length, MYF(0))); - format_type= s.format_type; - } - return *this; - } - SHOW_TYPE type() { return SHOW_CHAR; } bool check_update_type(Item_result type) { return type != STRING_RESULT; /* Only accept strings */ } bool check_default(enum_var_type type) { return 0; } + bool check(THD *thd, set_var *var); bool update(THD *thd, set_var *var); + void update2(THD *thd, enum_var_type type, DATE_TIME_FORMAT *new_value); byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); void set_default(THD *thd, enum_var_type type); }; @@ -657,6 +632,7 @@ public: CHARSET_INFO *charset; ulong ulong_value; ulonglong ulonglong_value; + DATE_TIME_FORMAT *date_time_format; } save_result; LEX_STRING base; /* for structs */ |