summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2004-09-15 23:52:46 -0700
committerigor@rurik.mysql.com <>2004-09-15 23:52:46 -0700
commitcfbd2b7f7a41c2aecc9b75e5182b3873d42ee2b9 (patch)
tree432052783e108895bc14c78cedf97a732e6dd1ca /sql/opt_sum.cc
parentdab891864737a916f8593c6e668f6dfaa557fe58 (diff)
downloadmariadb-git-cfbd2b7f7a41c2aecc9b75e5182b3873d42ee2b9.tar.gz
opt_sum.cc:
Slightly improved the fix for bug #5406.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 538f5c6097d..613b2a4aec1 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -191,9 +191,8 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
range_fl & NEAR_MIN ?
HA_READ_AFTER_KEY :
HA_READ_KEY_OR_NEXT);
- if ((!error || error == HA_ERR_KEY_NOT_FOUND) &&
- reckey_in_range(0, &ref, item_field->field,
- conds, range_fl, prefix_len))
+ if (!error && reckey_in_range(0, &ref, item_field->field,
+ conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
if (table->key_read)
{
@@ -264,9 +263,8 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
range_fl & NEAR_MAX ?
HA_READ_BEFORE_KEY :
HA_READ_PREFIX_LAST_OR_PREV);
- if ((!error || error == HA_ERR_KEY_NOT_FOUND) &&
- reckey_in_range(1, &ref, item_field->field,
- conds, range_fl, prefix_len))
+ if (!error && reckey_in_range(1, &ref, item_field->field,
+ conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
if (table->key_read)
{