summaryrefslogtreecommitdiff
path: root/sql/ha_heap.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-10-23 03:30:27 +0300
committerunknown <monty@mysql.com>2004-10-23 03:30:27 +0300
commit08c39dd283a8723912f5ce798701af3d25aa2747 (patch)
tree1f64399a0e4969a64a4f1500ed9f131f3cc00bf5 /sql/ha_heap.cc
parent371301d78675214f5bea1c66cb24796882792de4 (diff)
downloadmariadb-git-08c39dd283a8723912f5ce798701af3d25aa2747.tar.gz
Fixed wrong range test code for HEAP tables. This caused a crash when doing a range test with a key that didn't have lower or upper bound (Bug #6082)
More test cases mysql-test/r/heap.result: Test for bug #6082 (delete with NOT NULL) mysql-test/r/key.result: More tests for BUG#6151 - myisam index corruption mysql-test/r/ps.result: Test of bug #6047 "Permission problem when executing mysql_stmt_execute with derived table" mysql-test/t/heap.test: Test for bug #6082 (delete with NOT NULL) mysql-test/t/key.test: More tests for BUG#6151 - myisam index corruption mysql-test/t/ps.test: Test of bug #6047 "Permission problem when executing mysql_stmt_execute with derived table" sql/ha_heap.cc: Fixed wrong range test code for HEAP tables. This caused a crash when doing a range test with a key that didn't have lower or upper bound
Diffstat (limited to 'sql/ha_heap.cc')
-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)