From 59b3711986a8b016628d5d87289e9b66b1758787 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Dec 2002 21:55:53 +0200 Subject: _NEW_ IN/ALL/ANY/SOME behaviour with NULL (SCRUM related) optimization of left expression evaluation more descriptive method name mysql-test/r/func_in.result: test of _NEW_ IN behaviour with NULL mysql-test/r/subselect.result: test of _NEW_ IN/ALL/ANY/SOME behaviour with NULL mysql-test/t/func_in.test: test of _NEW_ IN behaviour with NULL mysql-test/t/subselect.test: test of _NEW_ IN/ALL/ANY/SOME behaviour with NULL sql/item.cc: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item.h: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_cmpfunc.cc: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_cmpfunc.h: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_subselect.cc: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/item_subselect.h: _NEW_ IN/ALL/ANY/SOME behaviour with NULL optimization of left expression evaluation sql/sql_class.cc: more descriptive method name sql/sql_union.cc: more descriptive method name --- sql/item_cmpfunc.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'sql/item_cmpfunc.h') diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 83d1050dd9c..a18f5179169 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -87,6 +87,27 @@ public: void fix_length_and_dec() { decimals=0; max_length=1; } }; +class Item_in_optimizer: public Item_bool_func +{ +protected: + char buffer[80]; + longlong int_cache; + double flt_cache; + String str_cache_buff, *str_cache; + bool int_cache_ok, flt_cache_ok, str_cache_ok; +public: + Item_in_optimizer(Item *a,Item *b): + Item_bool_func(a,b), int_cache_ok(0), flt_cache_ok(0), str_cache_ok(0) {} + bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); } + longlong val_int(); + + double get_cache(); + longlong get_cache_int(); + String *get_cache_str(String *s); + + friend class Item_ref_in_optimizer; +}; + class Item_bool_func2 :public Item_int_func { /* Bool with 2 string args */ protected: @@ -488,9 +509,10 @@ class Item_func_in :public Item_int_func Item *item; in_vector *array; cmp_item *in_item; + bool have_null; public: Item_func_in(Item *a,List &list) - :Item_int_func(list),item(a),array(0),in_item(0) {} + :Item_int_func(list), item(a), array(0), in_item(0), have_null(0) {} longlong val_int(); bool fix_fields(THD *thd, struct st_table_list *tlist, Item **ref) { -- cgit v1.2.1