summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_heap.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index 9344bfc0c8c..19b15c6fbcc 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -378,7 +378,8 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
if (key->algorithm == HA_KEY_ALG_BTREE)
return hp_rb_records_in_range(file, inx, min_key, max_key);
- if (min_key->length != max_key->length ||
+ if (!min_key || !max_key ||
+ min_key->length != max_key->length ||
min_key->length != key->key_length ||
min_key->flag != HA_READ_KEY_EXACT ||
max_key->flag != HA_READ_AFTER_KEY)