diff options
author | Igor Babaev <igor@askmonty.org> | 2010-12-22 00:37:35 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-12-22 00:37:35 -0800 |
commit | a095346a9d32ca583d211d07075e805881fdb4e5 (patch) | |
tree | 72c52f60b7509706564838db8130bb2e8828de54 /sql/sql_join_cache.h | |
parent | 4f28dcbe327139d9d5cb71afc9f4ce99cecec25a (diff) | |
download | mariadb-git-a095346a9d32ca583d211d07075e805881fdb4e5.tar.gz |
Fixed LP bug #670380.
Lifted the limitation that hash join could not be used over
varchar fields with non-binary collation.
Diffstat (limited to 'sql/sql_join_cache.h')
-rw-r--r-- | sql/sql_join_cache.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index ea84a50c885..cd9acfe595c 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. */ |