[Neos] Migrations: Specified key was too long; max key length is 767 bytes

Christian Müller christian.mueller at typo3.org
Wed Dec 18 22:35:13 CET 2013


Short update, see below...

Christian Müller wrote:

> But this problem is just the tip of the iceberg so to speak. Because I
> got another report about
>
> "CREATE TABLE flow3_resource_resourcepointer (hash VARCHAR(255) NOT
> NULL, PRIMARY KEY(hash)) ENGINE = InnoDB"
>
> in TYPO3.Flow "Version20110613223837".
>
> This normally isn't a problem unless the charset is utf8mb4 (available
> in newer versions) which reserves 4 bytes per character (utf8 uses 3).
> So with default utf8 you are at 765 bytes just below the limit but with
> 4 bytes you are far above the limit. Interestingly this happened on a
> default Debian Wheezy and variables say the charset is utf8 not utf8mb4
> so I cannot explain myself why it happend. I am investigating this now.
> Setting [2] helped in that case but I guess we should think about those
> scenarios as well.
> See also some of the discussion in here [3] (warning some of the info in
> there is not really accurate).

Actually we know the content of the hash column. It is a hash, so it 
will never contain UTF8 characters. We could avoid that problem in a 
future proof way (as in the future probably more people will use 
utf8mb4) we could define this column (and if we have also similar 
columns that need an index) as simple latin1.

Cheers,
Christian


More information about the Neos mailing list