Page MenuHomePhabricator

[Video] sql/video.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 `video` (
 `video_name` varchar(255) NOT NULL PRIMARY KEY default '',
 `video_url` varchar(255) NOT NULL default '',
 `video_type` varchar(255) default 'unknown',
 `video_user_id` int(11) NOT NULL default '0',
 `video_user_name` varchar(255) NOT NULL default '',
 `video_timestamp` varchar(14) NOT NULL default ''
 )ENGINE=InnoDB
 
Function: Wikimedia\Rdbms\Database::sourceFile( /workspace/src/extensions/Video/includes/../sql/video.sql )
Error: 1071 Specified key was too long; max key length is 767 bytes (localhost:/tmp/quibble-mysql-2zh95mun/socket)

Event Timeline

hashar created this task.May 1 2018, 7:41 PM
Restricted Application added a project: Social-Tools. · View Herald TranscriptMay 1 2018, 7:41 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Vvjjkkii renamed this task from [Video] sql/video.sql : Error: 1071 Specified key was too long; max key length is 767 bytes to kudaaaaaaa.Jul 1 2018, 1:12 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from kudaaaaaaa to [Video] sql/video.sql : Error: 1071 Specified key was too long; max key length is 767 bytes.Jul 1 2018, 10:00 AM
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
CommunityTechBot raised the priority of this task from High to Needs Triage.Jul 3 2018, 1:55 AM