Page MenuHomePhabricator

[Contest] Contest.sql : Error: 1071 Specified key was too long; max key length is 767 bytes
Closed, DeclinedPublic

Description

When running MySQL/MariaDB with charset utf8mb4, a character is 4 bytes. Hence a key created on a VARCHAR(255) takes 255 characters * 4 bytes/characters = 1020 bytes. However Innodb defaults to a maximum of 767 bytes for an index.

The extension fails to install on Debian Stretch which uses utf8mb4 as the default charset:

Query: CREATE UNIQUE INDEX contests_name ON `contests` (contest_name)

Function: Wikimedia\Rdbms\Database::sourceFile( /workspace/src/extensions/Contest/Contest.sql )
Error: 1071 Specified key was too long; max key length is 767 bytes (localhost:/tmp/quibble-mysql-peszq8_b/socket)

Event Timeline

hashar created this task.May 1 2018, 7:21 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 1 2018, 7:21 PM
Vvjjkkii renamed this task from [Contest] Contest.sql : Error: 1071 Specified key was too long; max key length is 767 bytes to 6udaaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
1339861mzb renamed this task from 6udaaaaaaa to [Contest] Contest.sql : Error: 1071 Specified key was too long; max key length is 767 bytes.Jul 1 2018, 10:47 AM
1339861mzb updated the task description. (Show Details)
1339861mzb updated the task description. (Show Details)
Zoranzoki21 closed this task as Declined.Dec 31 2018, 5:05 AM
Zoranzoki21 added a subscriber: Zoranzoki21.

Closing as declined because of archival per T205053.