summaryrefslogtreecommitdiff
path: root/mysys/hash.c
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-10-16 11:00:07 +0000
committerSergei Petrunia <psergey@askmonty.org>2016-10-16 11:00:07 +0000
commit274e5be1942aa0b6533d78b43454a7ed940b6628 (patch)
tree1485748a65984ca2a22414ff43280f71505da27c /mysys/hash.c
parentf456532c62b227832c0a0c4107e4ee542d1e5b30 (diff)
downloadmariadb-git-274e5be1942aa0b6533d78b43454a7ed940b6628.tar.gz
MariaRocks: port my_hash_const_element
"Add new function my_hash_const_element(), the const equivalent of my_hash_element()" - comes from facebook/mysql-5.6, 7c869d34b9fa2262b941efd6363a260b7c37948f
Diffstat (limited to 'mysys/hash.c')
-rw-r--r--mysys/hash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysys/hash.c b/mysys/hash.c
index dc03ea9a4dc..580e21b77d0 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -721,6 +721,14 @@ uchar *my_hash_element(HASH *hash, ulong idx)
}
+const uchar *my_hash_const_element(const HASH *hash, ulong idx)
+{
+ if (idx < hash->records)
+ return dynamic_element(&hash->array,idx,const HASH_LINK*)->data;
+ return 0;
+}
+
+
/*
Replace old row with new row. This should only be used when key
isn't changed