diff options
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index ac4c230f312..23cdf7082cf 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -119,6 +119,7 @@ public: { return (null_value=args[0]->get_time(ltime)); } + bool is_null() { (void) val_int(); return null_value; } friend class udf_handler; }; @@ -147,6 +148,7 @@ public: longlong val_int() { return (longlong) val(); } enum Item_result result_type () const { return hybrid_type; } void fix_length_and_dec() { fix_num_length_and_dec(); } + bool is_null() { (void) val(); return null_value; } }; @@ -161,6 +163,7 @@ class Item_num_op :public Item_func enum Item_result result_type () const { return hybrid_type; } void fix_length_and_dec() { fix_num_length_and_dec(); find_num_type(); } void find_num_type(void); + bool is_null() { (void) val(); return null_value; } }; @@ -859,34 +862,53 @@ class Item_func_match :public Item_real_func { public: List<Item> fields; + String value; TABLE *table; - uint key; - bool join_key; Item_func_match *master; - FT_DOCLIST *ft_handler; + FT_INFO * ft_handler; + Item *concat; + byte *record; + uint key, mode; + bool join_key; Item_func_match(List<Item> &a, Item *b): Item_real_func(b), - fields(a), table(0), join_key(0), master(0), ft_handler(0) {} + fields(a), table(0), master(0), ft_handler(0), + concat(0), key(0), join_key(0) {} ~Item_func_match() { - if (!master) + if (!master && ft_handler) { - if (ft_handler) - { - ft_close_search(ft_handler); - if(join_key) - table->file->ft_handler=0; - } + ft_handler->please->close_search(ft_handler); + ft_handler=0; + if(join_key) + table->file->ft_handler=0; } + if (concat) delete concat; } - const char *func_name() const { return "match"; } enum Functype functype() const { return FT_FUNC; } void update_used_tables() {} bool fix_fields(THD *thd,struct st_table_list *tlist); bool eq(const Item *) const; - double val(); longlong val_int() { return val()!=0.0; } + double val(); bool fix_index(); void init_search(bool no_order); }; + +class Item_func_match_nl :public Item_func_match +{ +public: + Item_func_match_nl(List<Item> &a, Item *b): + Item_func_match(a,b) { mode=FT_NL; } + const char *func_name() const { return "match_nl"; } +}; + +class Item_func_match_bool :public Item_func_match +{ +public: + Item_func_match_bool(List<Item> &a, Item *b): + Item_func_match(a,b) { mode=FT_BOOL; } + const char *func_name() const { return "match_bool"; } +}; + |