diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc index 4f65dbd65f4..f4bdbdeac5a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2943,7 +2943,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, key_part->key_part_flag|= field->key_part_flag(); uint16 key_part_length_bytes= field->key_part_length_bytes(); key_part->store_length+= key_part_length_bytes; - keyinfo->key_length+= key_part_length_bytes; + if (i < keyinfo->user_defined_key_parts) + keyinfo->key_length+= key_part_length_bytes; if (i == 0 && key != primary_key) field->flags |= (((keyinfo->flags & HA_NOSAME || @@ -3037,7 +3038,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, set_if_bigger(share->max_key_length,keyinfo->key_length+ keyinfo->user_defined_key_parts); - share->total_key_length+= keyinfo->key_length; /* MERGE tables do not have unique indexes. But every key could be an unique index on the underlying MyISAM table. (Bug #10400) |