tests: fix Specified key was too long; in a schema
authorAntoine Musso <hashar@free.fr>
Thu, 15 Mar 2018 21:23:40 +0000 (22:23 +0100)
committerAntoine Musso <hashar@free.fr>
Thu, 15 Mar 2018 21:28:41 +0000 (22:28 +0100)
commit46e0b8761ead1e9ac24d6b39385644c3678ac39c
tree401b8c5a4fee2a99888121df5e94fc07ad1fdb78
parent2e209fbec1ec73c3887de3cd7feb7e88e12c3c4a
tests: fix Specified key was too long; in a schema

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
tests/phpunit/tests/MediaWikiTestCaseSchemaTest.sql