Skip to content

Improve ErrTooLongKey #41272

@dveeden

Description

@dveeden

Enhancement

This is a bad user experience as the index prefix is specified in characters, but the limit in the error message is in bytes.

Here 1000 characters is 4000 bytes as UTF-8 takes up to 4 bytes per character.

sql> CREATE TABLE t1(id int primary key, c1 text, key(c1(1000)));
ERROR: 1071 (42000): Specified key was too long; max key length is 3072 bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions