1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug #2699 UTF8 breaks primary keys for cols > 85 characters

This commit is contained in:
unknown
2004-02-13 17:58:02 +04:00
parent f03296b6dc
commit 82364214ec
3 changed files with 15 additions and 1 deletions

View File

@@ -877,7 +877,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
column->field_name);
DBUG_RETURN(-1);
}
key_part_info->length=(uint8) length;
if (length > file->max_key_part_length())
{
my_error(ER_WRONG_SUB_KEY,MYF(0));
DBUG_RETURN(-1);
}
key_part_info->length=(uint16) length;
/* Use packed keys for long strings on the first column */
if (!(db_options & HA_OPTION_NO_PACK_KEYS) &&
(length >= KEY_DEFAULT_PACK_LENGTH &&