diff options
author | Igor Babaev <igor@askmonty.org> | 2013-10-13 18:10:19 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-10-13 18:10:19 -0700 |
commit | ddc46740a56bf3885ae33dc21e281c063d189abf (patch) | |
tree | 95de2e32ed970c1370e9c3fa15290b88d13955da /sql/item_cmpfunc.cc | |
parent | d61cffa6b1dd8b25dbae2536af1b0b59091b9f06 (diff) | |
parent | c7db46a2427e933a379d0a8c62221c344a29ea06 (diff) | |
download | mariadb-git-ddc46740a56bf3885ae33dc21e281c063d189abf.tar.gz |
Merge 5.5->10.0-base
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2f1592a5f3d..6814e8a8012 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1435,6 +1435,7 @@ bool Item_in_optimizer::eval_not_null_tables(uchar *opt_arg) return FALSE; } + bool Item_in_optimizer::fix_left(THD *thd) { if ((!args[0]->fixed && args[0]->fix_fields(thd, args)) || @@ -2205,6 +2206,15 @@ bool Item_func_between::eval_not_null_tables(uchar *opt_arg) } +bool Item_func_between::count_sargable_conds(uchar *arg) +{ + SELECT_LEX *sel= (SELECT_LEX *) arg; + sel->cond_count++; + sel->between_count++; + return 0; +} + + void Item_func_between::fix_after_pullout(st_select_lex *new_parent, Item **ref) { /* This will re-calculate attributes of the arguments */ @@ -4802,6 +4812,7 @@ longlong Item_func_isnull::val_int() return args[0]->is_null() ? 1: 0; } + longlong Item_is_not_null_test::val_int() { DBUG_ASSERT(fixed == 1); @@ -5006,6 +5017,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) return FALSE; } + void Item_func_like::cleanup() { canDoTurboBM= FALSE; @@ -5696,7 +5708,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; } @@ -5727,6 +5740,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; } @@ -6127,6 +6141,14 @@ void Item_equal::update_used_tables() } +bool Item_equal::count_sargable_conds(uchar *arg) +{ + SELECT_LEX *sel= (SELECT_LEX *) arg; + uint m= equal_items.elements; + sel->cond_count+= m*(m-1); + return 0; +} + /** @brief |