facebook/phabricator — pull request #183 by yunake (2012-08-15 23:09:51+00:00)
Title: Make quickstart.sql apply correctly on older MySQL instances

On older MySQL, specifically on the one shipped with RHEL5x (aye, ancient...) this bit fails:

CREATE TABLE `user_oauthinfo` (
....
`oauthProvider` varchar(255) NOT NULL,
`oauthUID` varchar(255) NOT NULL,
....
UNIQUE KEY `oauthProvider` (`oauthProvider`,`oauthUID`)

with the following error:

[2012-08-15 14:02:35] EXCEPTION: (AphrontQueryException) #1071: Specified key was too long; max key length is 1000 bytes at /var/www/html/ph/libphutil/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnectionBase.php:252]

Since the two fields use UTF8, MySQL thinks they can result in more than 1000 bytes.

I don't think these fields can ever contain non-latin1 characters so this "fix" should not break anything, right?

The other possibilities are: decrease the length of these fields, forget about old MySQL.