Problem/Motivation
When upgrading from 3.1.0-rc1 to -rc2, I get this error:
SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes: CREATE INDEX imaestro_queue_token ON "maestro_queue" (token) COMMENT '' ALGORITHM DEFAULT LOCK DEFAULT; Array
This is because:
- We are using MariaDB 10.3.38 (which is a little old, but 10.3.7+ is still supported by Drupal)
- The new 'token' field is 255 characters long
- The charset is
utf8mb4, which uses up to 4 bytes per character (1020 bytes total) maestro_update_8006tries to create an index on that column, but the maximum index length allowed in that version of MariaDB was 767 bytes
(It was increased in later versions, I believe.)
Steps to reproduce
- Use MariaDB 10.3
- Set the default charset for the database to
utf8mb4 - Run
drush updb
Proposed resolution
As a workaround, until we upgrade, I could change the MariaDB configuration...
But I don't think the token column actually needs to be 255 characters - it looks like it is filled using Crypt::randomBytesBase64() which returns only 43 characters. Reducing the column size to 191 characters or less would solve this for anyone else still using an older version.
Thanks!
Comments
Comment #3
_randy commented@mi-dave
Can you test this patch/update please? This should shrink the size of the field to 100 characters.
Comment #6
mi-dave commentedLooks good to me, thanks!
Comment #7
_randy commented