When attempting to install Authcache Personalization API on MySQL using the MyISAM engine, the attempt to create the database table authcache_p13n_key_value
fails with the following error message:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes in includes/database/database.inc on line 2168
The reason is that this table defines a composite primary key consisting of two varchar
columns, each of them with a size of 255 bytes. When the utf8 character set is used on a varchar column, MySQL assumes that each character may use up to 3 bytes. Therefore the maximum combined length of a varchar index is 100/3 = 333.
The key size with the current column definitions is 2*255*3 = 1530. We need to cut back on this in order to run Authcache on MyISAM.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2161061-4-reduce-key-value-collection-name-length.patch | 713 bytes | znerol |
#3 | 2161061-2-reduce-key-value-collection-name-length.patch | 2.64 KB | znerol |
#1 | 2161061-reduce-key-value-collection-name-length.patch | 472 bytes | znerol |
Comments
Comment #1
znerol CreditAttribution: znerol commentedLets reduce the collection name column to 63 characters.
Comment #2
znerol CreditAttribution: znerol commentedComment #3
znerol CreditAttribution: znerol commentedComment #4
znerol CreditAttribution: znerol commentedThis one comes with an update function, altering the length of the collection-column to 63 on existing installations.
Comment #5
znerol CreditAttribution: znerol commentedCommitted and pushed: e70f90b.