mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@ -3246,8 +3246,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
/* Align key length to multibyte char boundary */
|
||||
key_part_length-= key_part_length % sql_field->charset->mbmaxlen;
|
||||
}
|
||||
else
|
||||
is_hash_field_needed= true;
|
||||
}
|
||||
}
|
||||
// Catch invalid use of partial keys
|
||||
@ -3293,11 +3291,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key->type == Key::UNIQUE)
|
||||
{
|
||||
is_hash_field_needed= true;
|
||||
}
|
||||
else
|
||||
if (key->type != Key::UNIQUE)
|
||||
{
|
||||
key_part_length= MY_MIN(max_key_length, file->max_key_part_length());
|
||||
my_error(ER_TOO_LONG_KEY, MYF(0), key_part_length);
|
||||
@ -3306,6 +3300,11 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
}
|
||||
}
|
||||
|
||||
if (key->type == Key::UNIQUE
|
||||
&& key_part_length > MY_MIN(max_key_length,
|
||||
file->max_key_part_length()))
|
||||
is_hash_field_needed= true;
|
||||
|
||||
/* We can not store key_part_length more then 2^16 - 1 in frm */
|
||||
if (is_hash_field_needed && column->length > UINT_MAX16)
|
||||
{
|
||||
@ -3340,7 +3339,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
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;
|
||||
is_hash_field_needed= true; // for case "a BLOB UNIQUE"
|
||||
if (key_length > max_key_length && key->type != Key::FULLTEXT &&
|
||||
!is_hash_field_needed)
|
||||
{
|
||||
|
Reference in New Issue
Block a user