summaryrefslogtreecommitdiff
path: root/sql/set_var.h
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-11-03 22:48:03 +0200
committerunknown <monty@narttu.mysql.fi>2003-11-03 22:48:03 +0200
commit30c97ed1755b50f14f294108d93bd37d2094010c (patch)
tree68c6948d4fbd18bb59fa1aeafdce4a07a41b835f /sql/set_var.h
parent78ee8de22df90d4c0d21887c67e0d0e51b210727 (diff)
parent4cb95b8dfdcd511d9e3f0a164747a5181686d2c7 (diff)
downloadmariadb-git-30c97ed1755b50f14f294108d93bd37d2094010c.tar.gz
Merge
BitKeeper/etc/ignore: auto-union include/m_ctype.h: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/func_compress.result: Auto merged mysql-test/t/date_formats.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_create.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.h: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged strings/ctype-bin.c: Auto merged include/mysqld_error.h: Merge error messages mysql-test/r/date_formats.result: merge sql/derror.cc: Fixed wront return value sql/item_timefunc.cc: merge sql/item_timefunc.h: merge sql/mysqld.cc: merge sql/share/czech/errmsg.txt: Merge error messages sql/share/danish/errmsg.txt: Merge error messages sql/share/dutch/errmsg.txt: Merge error messages sql/share/english/errmsg.txt: Merge error messages sql/share/estonian/errmsg.txt: Merge error messages sql/share/french/errmsg.txt: Merge error messages sql/share/german/errmsg.txt: Merge error messages sql/share/greek/errmsg.txt: Merge error messages sql/share/hungarian/errmsg.txt: Merge error messages sql/share/italian/errmsg.txt: Merge error messages sql/share/japanese/errmsg.txt: Merge error messages sql/share/korean/errmsg.txt: Merge error messages sql/share/norwegian-ny/errmsg.txt: Merge error messages sql/share/norwegian/errmsg.txt: Merge error messages sql/share/polish/errmsg.txt: Merge error messages sql/share/portuguese/errmsg.txt: Merge error messages sql/share/romanian/errmsg.txt: Merge error messages sql/share/russian/errmsg.txt: Merge error messages sql/share/serbian/errmsg.txt: Merge error messages sql/share/slovak/errmsg.txt: Merge error messages sql/share/spanish/errmsg.txt: Merge error messages sql/share/swedish/errmsg.txt: Merge error messages sql/share/ukrainian/errmsg.txt: Merge error messages
Diffstat (limited to 'sql/set_var.h')
-rw-r--r--sql/set_var.h46
1 files changed, 11 insertions, 35 deletions
diff --git a/sql/set_var.h b/sql/set_var.h
index 16b2c1d5d37..c799eec750a 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -54,8 +54,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)
@@ -195,9 +193,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)
{}
@@ -621,46 +616,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);
};
@@ -718,6 +693,7 @@ public:
CHARSET_INFO *charset;
ulong ulong_value;
ulonglong ulonglong_value;
+ DATE_TIME_FORMAT *date_time_format;
} save_result;
LEX_STRING base; /* for structs */