diff options
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c660af38118..0e06ea9a717 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6058,15 +6058,26 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array, KEY_FIELD *key_field) KEY *keyinfo= form->key_info+key; uint key_parts= form->actual_n_key_parts(keyinfo); + if (keyinfo->algorithm == HA_KEY_ALG_LONG_HASH) + { + re_setup_keyinfo_hash(keyinfo); + key_parts= keyinfo->user_defined_key_parts; + } for (uint part=0 ; part < key_parts ; part++) { if (field->eq(form->key_info[key].key_part[part].field) && field->can_optimize_keypart_ref(key_field->cond, key_field->val)) { if (add_keyuse(keyuse_array, key_field, key, part)) + { + if (keyinfo->algorithm == HA_KEY_ALG_LONG_HASH) + setup_keyinfo_hash(keyinfo); return TRUE; + } } } + if (keyinfo->algorithm == HA_KEY_ALG_LONG_HASH) + setup_keyinfo_hash(keyinfo); } if (field->hash_join_is_possible() && (key_field->optimize & KEY_OPTIMIZE_EQ) && |