Commit e80ad58d authored by Monty's avatar Monty

Improve mysys/hash by caching hash_nr

This is done without using any additional memory
Added internal test case

This is similar to MDEV-7716
parent 67034b6d
......@@ -82,6 +82,7 @@ mysql-test/mysql-test-run
mysql-test/var
mysql-test-gcov.err
mysql-test-gcov.msg
mysys/test_hash
mysys/thr_lock
mysys/thr_timer
packaging/rpm-oel/mysql.spec
......
......@@ -42,7 +42,7 @@ extern "C" {
#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
#define HASH_THREAD_SPECIFIC 2 /* Mark allocated memory THREAD_SPECIFIC */
typedef uint my_hash_value_type;
typedef uint32 my_hash_value_type;
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
typedef my_hash_value_type (*my_hash_function)(CHARSET_INFO *,
const uchar *, size_t);
......
......@@ -96,6 +96,10 @@ ADD_EXECUTABLE(thr_timer thr_timer.c)
TARGET_LINK_LIBRARIES(thr_timer mysys)
SET_TARGET_PROPERTIES(thr_timer PROPERTIES COMPILE_FLAGS "-DMAIN")
ADD_EXECUTABLE(test_hash hash.c)
TARGET_LINK_LIBRARIES(test_hash mysys)
SET_TARGET_PROPERTIES(test_hash PROPERTIES COMPILE_FLAGS "-DMAIN")
IF(MSVC)
INSTALL_DEBUG_TARGET(mysys DESTINATION ${INSTALL_LIBDIR}/debug)
ENDIF()
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment