diff options
author | gluh@gluh.mysql.r18.ru <> | 2003-10-20 13:24:18 +0500 |
---|---|---|
committer | gluh@gluh.mysql.r18.ru <> | 2003-10-20 13:24:18 +0500 |
commit | 62b0b8b800be5316d73f1642e6cc3f0cf562e171 (patch) | |
tree | a0500a3926dc01176082cc42ad87fbaed18113b3 /sql/item_timefunc.h | |
parent | f434b329f58a0ae60b40d0fe41a8cab68162cbaa (diff) | |
download | mariadb-git-62b0b8b800be5316d73f1642e6cc3f0cf562e171.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; + } +}; |