diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-06-26 17:46:34 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-06-26 17:46:34 +0400 |
commit | 40e5aceaff6bbf71ea212ff514dabb41a929d496 (patch) | |
tree | 44430fd7befc47206989710fc9ea1a0d4fe13597 /sql/item_cmpfunc.cc | |
parent | 436411860ec54fda959910a3c88a1e393e1cee59 (diff) | |
download | mariadb-git-40e5aceaff6bbf71ea212ff514dabb41a929d496.tar.gz |
Removing Item_int_func::sargable. Adding virtual implementations of
count_sargable_conds() instead for Item_func_in, Item_func_null_predicate,
Item_bool_func2. There other Item_int_func descendants that used to set
"sargable" to true (Item_func_between, Item_equal) already have their
own implementation of count_sargable_conds(). There is no sense to
have two parallel coding models for the same thing.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 60708432bed..9920aa40542 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3827,6 +3827,13 @@ cmp_item *cmp_item_datetime::make_same() } +bool Item_func_in::count_sargable_conds(uchar *arg) +{ + ((SELECT_LEX*) arg)->cond_count++; + return 0; +} + + bool Item_func_in::nulls_in_row() { Item **arg,**arg_end; @@ -4729,6 +4736,13 @@ Item *and_expressions(Item *a, Item *b, Item **org_item) } +bool Item_func_null_predicate::count_sargable_conds(uchar *arg) +{ + ((SELECT_LEX*) arg)->cond_count++; + return 0; +} + + longlong Item_func_isnull::val_int() { DBUG_ASSERT(fixed == 1); @@ -4781,6 +4795,13 @@ void Item_func_isnotnull::print(String *str, enum_query_type query_type) } +bool Item_bool_func2::count_sargable_conds(uchar *arg) +{ + ((SELECT_LEX*) arg)->cond_count++; + return 0; +} + + longlong Item_func_like::val_int() { DBUG_ASSERT(fixed == 1); @@ -5638,7 +5659,6 @@ Item_equal::Item_equal(THD *thd_arg, Item *f1, Item *f2, bool with_const_item) equal_items.push_back(f2, thd_arg->mem_root); compare_as_dates= with_const_item && f2->cmp_type() == TIME_RESULT; upper_levels= NULL; - sargable= TRUE; } @@ -5669,7 +5689,6 @@ Item_equal::Item_equal(THD *thd_arg, 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; } |