summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2011-09-08 16:57:46 +0300
committerunknown <sanja@askmonty.org>2011-09-08 16:57:46 +0300
commitb80641b36cb43206a118ee84fccd90d08fbb8df4 (patch)
tree711d4c248c7ab3622b2acdbd2f48d35b734e0a7f /sql/opt_sum.cc
parent8b062c1fefd14cfa22e625d098b92c8ac3c1b28f (diff)
downloadmariadb-git-b80641b36cb43206a118ee84fccd90d08fbb8df4.tar.gz
LP BUG#813418 fix.
The problem was that optimization code did not take into account later feature when instad of NOT before BETWEEN it has negated flag into the Item_func_between inherited from Item_func_neg_opt. So optimizer tried process NOT BETWEEN as BETWEEN. The patch just switches off the optimisation for NOT BETWEEN as it was before when NOT function was really used.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 0ed31675f24..eaa3e88abbb 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -657,6 +657,8 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
case Item_func::GE_FUNC:
break;
case Item_func::BETWEEN:
+ if (((Item_func_between*) cond)->negated)
+ DBUG_RETURN(FALSE);
between= 1;
break;
case Item_func::MULT_EQUAL_FUNC: