1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-22719 Long unique keys are not created when individual key_part->length < max_key_length but SUM(key_parts->length) > max_key_length

Make UNIQUE HASH key in case when key_info->key_length > max_key_length
This commit is contained in:
Sachin
2020-06-03 13:36:36 +05:30
parent e208f91ba8
commit eb14e073ea
3 changed files with 25 additions and 0 deletions

View File

@ -4168,6 +4168,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::UNIQUE && !(key_info->flags & HA_NULL_PART_KEY))
unique_key=1;
key_info->key_length=(uint16) key_length;
if (key_info->key_length > max_key_length && key->type == Key::UNIQUE)
is_hash_field_needed= true;
if (key_length > max_key_length && key->type != Key::FULLTEXT &&
!is_hash_field_needed)
{