diff options
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r-- | sql/item_cmpfunc.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 4406eca7357..882f92465b1 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -68,6 +68,7 @@ class Arg_comparator: public Sql_alloc if (val1 == val2) return 0; return 1; } + NativeBuffer<STRING_BUFFER_USUAL_SIZE> m_native1, m_native2; public: /* Allow owner function to use string buffers. */ String value1, value2; @@ -89,6 +90,7 @@ public: bool set_cmp_func_string(); bool set_cmp_func_time(); bool set_cmp_func_datetime(); + bool set_cmp_func_native(); bool set_cmp_func_int(); bool set_cmp_func_real(); bool set_cmp_func_decimal(); @@ -121,6 +123,8 @@ public: int compare_e_datetime(); int compare_time(); int compare_e_time(); + int compare_native(); + int compare_e_native(); int compare_json_str_basic(Item *j, Item *s); int compare_json_str(); int compare_str_json(); @@ -935,6 +939,7 @@ public: longlong val_int_cmp_string(); longlong val_int_cmp_datetime(); longlong val_int_cmp_time(); + longlong val_int_cmp_native(); longlong val_int_cmp_int(); longlong val_int_cmp_real(); longlong val_int_cmp_decimal(); @@ -1013,6 +1018,7 @@ public: my_decimal *decimal_op(my_decimal *); bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); bool time_op(THD *thd, MYSQL_TIME *ltime); + bool native_op(THD *thd, Native *to); bool fix_length_and_dec() { if (aggregate_for_result(func_name(), args, arg_count, true)) @@ -1092,6 +1098,7 @@ public: my_decimal *decimal_op(my_decimal *); bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); bool time_op(THD *thd, MYSQL_TIME *ltime); + bool native_op(THD *thd, Native *to); bool fix_length_and_dec() { if (Item_func_case_abbreviation2::fix_length_and_dec2(args)) @@ -1150,6 +1157,11 @@ public: { return val_str_from_item(find_item(), str); } + bool native_op(THD *thd, Native *to) + { + return val_native_with_conversion_from_item(thd, find_item(), to, + type_handler()); + } }; @@ -1249,6 +1261,7 @@ public: longlong int_op(); String *str_op(String *str); my_decimal *decimal_op(my_decimal *); + bool native_op(THD *thd, Native *to); bool fix_length_and_dec(); bool walk(Item_processor processor, bool walk_subquery, void *arg); const char *func_name() const { return "nullif"; } @@ -1412,6 +1425,19 @@ public: }; +class in_timestamp :public in_vector +{ + Timestamp_or_zero_datetime tmp; +public: + in_timestamp(THD *thd, uint elements); + void set(uint pos,Item *item); + uchar *get_value(Item *item); + Item* create_item(THD *thd); + void value_to_item(uint pos, Item *item); + const Type_handler *type_handler() const { return &type_handler_timestamp2; } +}; + + /* Class to represent a vector of constant DATE/DATETIME values. */ @@ -1666,6 +1692,20 @@ public: cmp_item *make_same(); }; + +class cmp_item_timestamp: public cmp_item_scalar +{ + Timestamp_or_zero_datetime_native m_native; +public: + cmp_item_timestamp() :cmp_item_scalar() { } + void store_value(Item *item); + int cmp_not_null(const Value *val); + int cmp(Item *arg); + int compare(cmp_item *ci); + cmp_item *make_same(); +}; + + class cmp_item_real : public cmp_item_scalar { double value; @@ -2132,6 +2172,7 @@ public: my_decimal *decimal_op(my_decimal *); bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); bool time_op(THD *thd, MYSQL_TIME *ltime); + bool native_op(THD *thd, Native *to); bool fix_fields(THD *thd, Item **ref); table_map not_null_tables() const { return 0; } const char *func_name() const { return "case"; } |