MediaWikiTestCaseSchemaTest.sql comes with two varchar(255) combined
into a PRIMARY KEY.
That caused the testsuite to fail creating that imagelinks table with:
Error: 1071 Specified key was too long; max key length is 767 bytes
That is the limit for innodb and when using UTF8 it allows up to 3 bytes
per characters. Hence the key can be (255+255)*3 = 1530.
One can tune MySQL to bump the limit to ~ 3k with:
innodb_large_prefix = 1
Seems easier to just use smaller fields.
Change-Id: Ic4965b9eddc7ad9105c896e678ab9048ce0be8ef
CREATE TABLE /*_*/imagelinks (
il_from int NOT NULL DEFAULT 0,
il_from_namespace int NOT NULL DEFAULT 0,
- il_to varchar(255) NOT NULL DEFAULT '',
- il_frobniz varchar(255) NOT NULL DEFAULT 'FROB',
+ il_to varchar(127) NOT NULL DEFAULT '',
+ il_frobniz varchar(127) NOT NULL DEFAULT 'FROB',
PRIMARY KEY (il_from,il_to)
) /*$wgDBTableOptions*/;