diff options
author | Igor Babaev <igor@askmonty.org> | 2013-10-11 23:24:57 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-10-11 23:24:57 -0700 |
commit | 78b580b77965d63d4292a72a3ba12d0cc83b01a3 (patch) | |
tree | 59075c51767ff2726dbfedc428206d6b1485b2f8 /sql/item_cmpfunc.cc | |
parent | 092a238864591bc540beb00145759fa6af5f2746 (diff) | |
download | mariadb-git-78b580b77965d63d4292a72a3ba12d0cc83b01a3.tar.gz |
Fixed bug mdev-5132.
Objects of the classes Item_func_isnull and Item_func_isnotnull
must have the flag sargable set to TRUE.
Set the value of the flag sargable only in constructors of the
classes inherited from Item_int_func.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 514b0fe4580..d1075c3c47f 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -539,8 +539,6 @@ void Item_bool_func2::fix_length_and_dec() to the collation of A. */ - sargable= true; - DTCollation coll; if (args[0]->result_type() == STRING_RESULT && args[1]->result_type() == STRING_RESULT && @@ -2185,7 +2183,6 @@ void Item_func_between::fix_length_and_dec() THD *thd= current_thd; max_length= 1; compare_as_dates= 0; - sargable= true; /* As some compare functions are generated after sql_yacc, @@ -3865,7 +3862,6 @@ void Item_func_in::fix_length_and_dec() uint found_types= 0; uint type_cnt= 0, i; Item_result cmp_type= STRING_RESULT; - sargable= true; left_result_type= args[0]->cmp_type(); if (!(found_types= collect_cmp_types(args, arg_count, true))) return; @@ -5491,7 +5487,8 @@ Item_equal::Item_equal(Item *f1, Item *f2, bool with_const_item) equal_items.push_back(f1); equal_items.push_back(f2); compare_as_dates= with_const_item && f2->cmp_type() == TIME_RESULT; - upper_levels= NULL; + upper_levels= NULL; + sargable= TRUE; } @@ -5521,6 +5518,7 @@ Item_equal::Item_equal(Item_equal *item_equal) compare_as_dates= item_equal->compare_as_dates; cond_false= item_equal->cond_false; upper_levels= item_equal->upper_levels; + sargable= TRUE; } @@ -5944,7 +5942,6 @@ void Item_equal::fix_length_and_dec() Item *item= get_first(NO_PARTICULAR_TAB, NULL); eval_item= cmp_item::get_comparator(item->cmp_type(), item, item->collation.collation); - sargable= true; } |