Page MenuHomePhabricator

[MultimediaViewer] sql/create_counts.sql : Error: 1071 Specified key was too long; max key length is 767 bytes
Open, Needs TriagePublic

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 table if not exists `betafeatures_user_counts` (
 `feature`          varchar(255) primary key not null, 
 `number`           integer not null default 0
 ) ENGINE=InnoDB    

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

Event Timeline

hashar created this task.May 1 2018, 7:30 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptMay 1 2018, 7:30 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Vvjjkkii renamed this task from [MultimediaViewer] sql/create_counts.sql : Error: 1071 Specified key was too long; max key length is 767 bytes to yudaaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
1339861mzb renamed this task from yudaaaaaaa to [MultimediaViewer] sql/create_counts.sql : Error: 1071 Specified key was too long; max key length is 767 bytes .Jul 1 2018, 10:46 AM
1339861mzb updated the task description. (Show Details)
JJMC89 renamed this task from [MultimediaViewer] sql/create_counts.sql : Error: 1071 Specified key was too long; max key length is 767 bytes to [MultimediaViewer] sql/create_counts.sql : Error: 1071 Specified key was too long; max key length is 767 bytes.Jul 1 2018, 4:49 PM
JJMC89 raised the priority of this task from High to Needs Triage.
JJMC89 updated the task description. (Show Details)
JJMC89 added a subscriber: Aklapper.