1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Long Index is only allowed for unique keys not normal index.

This commit is contained in:
sachin
2019-02-25 00:46:48 +05:30
committed by Sergei Golubchik
parent 8084eeaa66
commit 0477e80522
3 changed files with 92 additions and 3 deletions

View File

@ -3941,13 +3941,15 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
column->length= MAX_LEN_GEOM_POINT_FIELD;
if (!column->length)
{
if (key->type == Key::PRIMARY)
if (key->type == Key::UNIQUE)
is_hash_field_needed= true;
else if (key->type == Key::MULTIPLE)
column->length= file->max_key_length() + 1;
else
{
my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
else
is_hash_field_needed= true;
}
}
#ifdef HAVE_SPATIAL