diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2003-10-20 13:24:18 +0500 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2003-10-20 13:24:18 +0500 |
commit | 299fc6a9f536571998f1fbc69a599800d3c95166 (patch) | |
tree | a0500a3926dc01176082cc42ad87fbaed18113b3 /sql/item_timefunc.h | |
parent | d6f15e9d02d7fb33627c937ff47c948dd9ae0b2e (diff) | |
download | mariadb-git-299fc6a9f536571998f1fbc69a599800d3c95166.tar.gz |
Scrum task 835 - text-to-datetime conversion function
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 6dcf7d00ce1..b7bf294b83d 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -763,3 +763,46 @@ public: maybe_null=1; } }; + + +enum datetime_format +{ + USA_FORMAT, JIS_FORMAT, ISO_FORMAT, EUR_FORMAT, INTERNAL_FORMAT +}; + + +enum datetime_format_types +{ + DATE_FORMAT_TYPE= 0, TIME_FORMAT_TYPE, DATETIME_FORMAT_TYPE +}; + + +class Item_func_get_format :public Item_str_func +{ + const datetime_format_types tm_format; +public: + Item_func_get_format(datetime_format_types type_arg1, Item *a) + :Item_str_func(a), tm_format(type_arg1) {} + String *val_str(String *str); + const char *func_name() const { return "get_format"; } + void fix_length_and_dec() + { + decimals=0; + max_length=17*MY_CHARSET_BIN_MB_MAXLEN; + } +}; + + +class Item_func_str_to_date :public Item_str_func +{ +public: + Item_func_str_to_date(Item *a, Item *b) + :Item_str_func(a, b) {} + String *val_str(String *str); + const char *func_name() const { return "str_to_date"; } + void fix_length_and_dec() + { + decimals=0; + max_length=29*MY_CHARSET_BIN_MB_MAXLEN; + } +}; |