Commit 593e8697 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: reserve one keypart for for LONG_UNIQUE_HASH_FIELD

parent 387b690e
...@@ -2551,6 +2551,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -2551,6 +2551,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
uint length_bytes= 0, len_null_byte= 0, ext_key_length= 0; uint length_bytes= 0, len_null_byte= 0, ext_key_length= 0;
Field *field; Field *field;
if ((keyinfo-1)->algorithm == HA_KEY_ALG_LONG_HASH)
new_key_part++; // reserved for the hash value
/* /*
Do not extend the key that contains a component Do not extend the key that contains a component
defined over the beginning of a field. defined over the beginning of a field.
...@@ -2615,10 +2618,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -2615,10 +2618,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
} }
share->ext_key_parts+= keyinfo->ext_key_parts; share->ext_key_parts+= keyinfo->ext_key_parts;
} }
if (new_key_part != keyinfo->key_part && if (new_key_part != keyinfo->key_part)
/* Dont override hash_keypart */
!(new_key_part->field &&
new_key_part->field->flags & LONG_UNIQUE_HASH_FIELD))
{ {
memmove(new_key_part, keyinfo->key_part, memmove(new_key_part, keyinfo->key_part,
sizeof(KEY_PART_INFO) * keyinfo->ext_key_parts); sizeof(KEY_PART_INFO) * keyinfo->ext_key_parts);
......
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