diff options
author | Sinisa@sinisa.nasamreza.org <> | 2001-12-26 17:42:06 +0200 |
---|---|---|
committer | Sinisa@sinisa.nasamreza.org <> | 2001-12-26 17:42:06 +0200 |
commit | 4ed4546004cc06c43606f6810c409feb208fdf0b (patch) | |
tree | 89ec1a3a0a7c33283b19588a9a564d110058eed0 /sql/item_timefunc.h | |
parent | 0111030d4588053cd797fbf70fe58d852b64adaf (diff) | |
parent | 038db406c15f3ebe90639218a447d98467749796 (diff) | |
download | mariadb-git-4ed4546004cc06c43606f6810c409feb208fdf0b.tar.gz |
Changes for the BitKeeper resolve.
One more notice:
limiting number of queries per hour for different users has been done
on 4.0.1 , but I can port it to 3.23.*
This will require only certain changes, like number of columns in user
table.
I will also make a test case for it, after it is approved by Monty,
as result file will depend on the error message text.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index bb33e4541aa..fbf3b7f05e0 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -229,6 +229,23 @@ public: const char *func_name() const { return "date"; } void fix_length_and_dec() { decimals=0; max_length=10; } bool save_in_field(Field *to); + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_DATE); + } +}; + + +class Item_date_func :public Item_str_func +{ +public: + Item_date_func() :Item_str_func() {} + Item_date_func(Item *a) :Item_str_func(a) {} + Item_date_func(Item *a,Item *b) :Item_str_func(a,b) {} + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_DATETIME); + } }; @@ -247,6 +264,10 @@ public: { str_value.set(buff,buff_length); return &str_value; } const char *func_name() const { return "curtime"; } void fix_length_and_dec(); + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_TIME); + } }; @@ -263,15 +284,15 @@ public: }; -class Item_func_now :public Item_func +class Item_func_now :public Item_date_func { longlong value; char buff[20]; uint buff_length; TIME ltime; public: - Item_func_now() :Item_func() {} - Item_func_now(Item *a) :Item_func(a) {} + Item_func_now() :Item_date_func() {} + Item_func_now(Item *a) :Item_date_func(a) {} enum Item_result result_type () const { return STRING_RESULT; } double val() { return (double) value; } longlong val_int() { return value; } @@ -307,16 +328,16 @@ public: }; -class Item_func_from_unixtime :public Item_func +class Item_func_from_unixtime :public Item_date_func { public: - Item_func_from_unixtime(Item *a) :Item_func(a) {} + Item_func_from_unixtime(Item *a) :Item_date_func(a) {} double val() { return (double) Item_func_from_unixtime::val_int(); } longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } void fix_length_and_dec() { decimals=0; max_length=19; } - enum Item_result result_type () const { return STRING_RESULT; } +// enum Item_result result_type () const { return STRING_RESULT; } bool get_date(TIME *res,bool fuzzy_date); }; @@ -330,6 +351,10 @@ public: String *val_str(String *); void fix_length_and_dec() { maybe_null=1; max_length=13; } const char *func_name() const { return "sec_to_time"; } + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_TIME); + } }; enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY, @@ -339,7 +364,7 @@ enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND, INTERVAL_MINUTE_SECOND}; -class Item_date_add_interval :public Item_str_func +class Item_date_add_interval :public Item_date_func { const interval_type int_type; String value; @@ -347,7 +372,7 @@ class Item_date_add_interval :public Item_str_func public: Item_date_add_interval(Item *a,Item *b,interval_type type_arg,bool neg_arg) - :Item_str_func(a,b),int_type(type_arg), date_sub_interval(neg_arg) {} + :Item_date_func(a,b),int_type(type_arg), date_sub_interval(neg_arg) {} String *val_str(String *); const char *func_name() const { return "date_add_interval"; } void fix_length_and_dec() { maybe_null=1; max_length=19; value.alloc(32);} |