summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-12-24 16:24:20 -0800
committerIgor Babaev <igor@askmonty.org>2010-12-24 16:24:20 -0800
commit1eb5e0e60388f460ab2c4d216a98f4088d9997b9 (patch)
treecb1fb6fd01bc2bfbc5a38b45c4ebd28e9e6c6675 /sql/sql_join_cache.h
parentf51a26885faa0106286e63fd15f18dae6f618508 (diff)
parenta095346a9d32ca583d211d07075e805881fdb4e5 (diff)
downloadmariadb-git-1eb5e0e60388f460ab2c4d216a98f4088d9997b9.tar.gz
Merge
Diffstat (limited to 'sql/sql_join_cache.h')
-rw-r--r--sql/sql_join_cache.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h
index fccd32e1319..546067fad24 100644
--- a/sql/sql_join_cache.h
+++ b/sql/sql_join_cache.h
@@ -738,6 +738,10 @@ public:
class JOIN_CACHE_HASHED: public JOIN_CACHE
{
+ typedef uint (JOIN_CACHE_HASHED::*Hash_func) (uchar *key, uint key_len);
+ typedef bool (JOIN_CACHE_HASHED::*Hash_cmp_func) (uchar *key1, uchar *key2,
+ uint key_len);
+
private:
/* Size of the offset of a key entry in the hash table */
@@ -761,8 +765,12 @@ private:
/* The offset of the data fields from the beginning of the record fields */
uint data_fields_offset;
-
- uint get_hash_idx(uchar* key, uint key_len);
+
+ inline uint get_hash_idx_simple(uchar *key, uint key_len);
+ inline uint get_hash_idx_complex(uchar *key, uint key_len);
+
+ inline bool equal_keys_simple(uchar *key1, uchar *key2, uint key_len);
+ inline bool equal_keys_complex(uchar *key1, uchar *key2, uint key_len);
int init_hash_table();
void cleanup_hash_table();
@@ -770,6 +778,28 @@ private:
protected:
/*
+ Index info on the TABLE_REF object used by the hash join
+ to look for matching records
+ */
+ KEY *ref_key_info;
+ /*
+ Number of the key parts the TABLE_REF object used by the hash join
+ to look for matching records
+ */
+ uint ref_used_key_parts;
+
+ /*
+ The hash function used in the hash table,
+ usually set by the init() method
+ */
+ Hash_func hash_func;
+ /*
+ The function to check whether two key entries in the hash table
+ are equal or not, usually set by the init() method
+ */
+ Hash_cmp_func hash_cmp_func;
+
+ /*
Length of a key value.
It is assumed that all key values have the same length.
*/