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.

Comments

znerol’s picture

Lets reduce the collection name column to 63 characters.

znerol’s picture

Status: Active » Needs review
znerol’s picture

znerol’s picture

This one comes with an update function, altering the length of the collection-column to 63 on existing installations.

znerol’s picture

Status: Needs review » Fixed

Committed and pushed: e70f90b.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.