diff options
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index a7a64090f6c..f6c316c15c6 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -1,3 +1,6 @@ +#ifndef ITEM_TIMEFUNC_INCLUDED +#define ITEM_TIMEFUNC_INCLUDED + /* Copyright (C) 2000-2006 MySQL AB This program is free software; you can redistribute it and/or modify @@ -73,6 +76,33 @@ public: }; +class Item_func_to_seconds :public Item_int_func +{ +public: + Item_func_to_seconds(Item *a) :Item_int_func(a) {} + longlong val_int(); + const char *func_name() const { return "to_seconds"; } + void fix_length_and_dec() + { + decimals=0; + max_length=6*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null=1; + } + enum_monotonicity_info get_monotonicity_info() const; + longlong val_int_endpoint(bool left_endp, bool *incl_endp); + bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} + + bool intro_version(uchar *int_arg) + { + int *input_version= (int*)int_arg; + /* This function was introduced in 5.5 */ + int output_version= (*input_version, 50500); + *input_version= output_version; + return 0; + } +}; + + class Item_func_dayofmonth :public Item_int_func { public: @@ -881,6 +911,7 @@ public: { decimals=0; max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; } longlong val_int(); }; @@ -1035,4 +1066,11 @@ public: Item_func_last_day(Item *a) :Item_date(a) {} const char *func_name() const { return "last_day"; } bool get_date(MYSQL_TIME *res, uint fuzzy_date); + void fix_length_and_dec() + { + Item_date::fix_length_and_dec(); + maybe_null= 1; + } }; + +#endif /* ITEM_TIMEFUNC_INCLUDED */ |