← Back to team overview

maria-discuss team mailing list archive

Re: 10.2.7 - Specified key was too long; max key length is 1000 bytes

 

On 7/31/2017 6:59 AM, Reindl Harald wrote:
> what the hell is this when the MYISAM database has a utf8 charset
> while this don't happen with latin1_german1_ci - this seems to be a
> regression in 10.2 and wasted an hour of time to realize what is going
> on just because anotehr guy did not take care of the database charset   
>
> create table `cms1_formmailer_generic_cc` (`fg_key` mediumint(7)
> unsigned not null auto_increment, `fg_form` varchar(255) not null
> default '', `fg_email` varchar(255) not null default '', primary
> key(`fg_key`), key`fg_key` (`fg_form`, `fg_email`)) - Specified key
> was too long; max key length is 1000 bytes
>

A UTF8 character takes 3 bytes (or 4 bytes with utf8mb4).  Your
secondary key is 255 * 3 * 2 or 1530 bytes.

Brian


Follow ups

References