summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-02-02 16:58:15 +0300
committerKonstantin Osipov <kostja@sun.com>2010-02-02 16:58:15 +0300
commitc2fe19883e624ddd0e37768f860fa0853848adb3 (patch)
tree0aec0b83266060d9cc4c9c65ee047b5fd7a83d96 /mysys
parent3147bdd0ac34a5c62158b8c28da6ca77e0901f08 (diff)
parentece5ad57e9b2505732be4b043440d9e5a5dc3b9a (diff)
downloadmariadb-git-c2fe19883e624ddd0e37768f860fa0853848adb3.tar.gz
Merge next-mr -> next-4284.
Fix Bug#50555 "handler commands crash server in my_hash_first()" as a post-merge fix (the new handler tests are not passing otherwise). - in hash.c, don't call calc_hash if ! my_hash_inited(). - add tests and results for the test case for Bug#50555
Diffstat (limited to 'mysys')
-rw-r--r--mysys/hash.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/mysys/hash.c b/mysys/hash.c
index 5fa804ce7ce..39f3ad8d31e 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -232,6 +232,8 @@ my_hash_value_type my_calc_hash(const HASH *hash,
{
return calc_hash(hash, key, length ? length : hash->key_length);
}
+
+
/*
Search after a record based on a key
@@ -242,11 +244,17 @@ my_hash_value_type my_calc_hash(const HASH *hash,
uchar* my_hash_first(const HASH *hash, const uchar *key, size_t length,
HASH_SEARCH_STATE *current_record)
{
- return my_hash_first_from_hash_value(hash,
- calc_hash(hash, key, length ? length : hash->key_length),
- key, length, current_record);
+ uchar *res;
+ if (my_hash_inited(hash))
+ res= my_hash_first_from_hash_value(hash,
+ calc_hash(hash, key, length ? length : hash->key_length),
+ key, length, current_record);
+ else
+ res= 0;
+ return res;
}
-
+
+
uchar* my_hash_first_from_hash_value(const HASH *hash,
my_hash_value_type hash_value,
const uchar *key,