Specified key was too long when creating an index
after performing an update from an clean TYPO3 7.6.21 to 8.7.4 (maybe also when installing a clean 8.7.4) the Database Analyzer shows the following error:
Specified key was too long; max key length is 3072 bytes.
The query "CREATE INDEX `getDomainStartPage` ON `sys_domain` (pid, hidden, domainName)" fails, because domainName has varchar(80).
utf8 works, utf8mb4 not. I think varchar(80) should be raised or the index limited - https://github.com/TYPO3/TYPO3.CMS/blob/b66275c83818ddc02bda04ab67c53bf901cad54d/typo3/sysext/frontend/ext_tables.sql#L163.
What do you think? :)
#2 Updated by Tymoteusz Motylewski about 1 month ago
Raising the domainName length will not make the issue disappear but will make it worse.
utf8mb4 uses 4 bytes per char, while "standard" utf8 collation uses 3 bytes per char.
This is why it fails on utf8mb4 and doesn't exceed the limit with plain utf8