summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 5d5132e7fee..ab587b8b279 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -408,7 +408,7 @@ int opt_sum_query(THD *thd,
if (!error && reckey_in_range(is_max, &ref, item_field->field,
conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
- table->disable_keyread();
+ table->file->ha_end_keyread();
table->file->ha_index_end();
if (error)
{
@@ -470,7 +470,7 @@ int opt_sum_query(THD *thd,
{
if (recalc_const_item)
item->update_used_tables();
- if (!item->const_item())
+ if (!item->const_item() && item->type() != Item::WINDOW_FUNC_ITEM)
const_result= 0;
}
}
@@ -977,7 +977,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
converted (for example to upper case)
*/
if (field->part_of_key.is_set(idx))
- table->enable_keyread();
+ table->file->ha_start_keyread(idx);
DBUG_RETURN(TRUE);
}
}