When using utf8mb4 encoding characters can be 1,2,3 or 4 bytes long.
Mysql unique indexes only can index a maximum of 767 bytes which results in a incorrect length for unique keys:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: CREATE TABLE
{minifyjs_file} (
`fid` INT unsigned NOT NULL auto_increment COMMENT 'The file id of the javascript file.', 
`uri` VARCHAR(255) NOT NULL COMMENT 'Original file uri.', 
`size` INT unsigned NOT NULL COMMENT 'Original file size.', 
`modified` INT unsigned NOT NULL COMMENT 'Original file last modified date.', 
`minified_uri` VARCHAR(255) DEFAULT '' COMMENT 'Minified file uri.', 
`minified_size` INT unsigned DEFAULT 0 COMMENT 'Minified file size.', 
`minified_modified` INT unsigned DEFAULT 0 COMMENT 'Minified file last modified date.', 
PRIMARY KEY (`fid`), 
UNIQUE KEY `uri` (`uri`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Store a list of all javascript files and their minified…'; Array
(
)

The maximum length should be 191 when using utf8mb4 encoding.

CommentFileSizeAuthor
#2 minifyjs_utf8_support-2897908-1.patch408 bytesKevinVb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KevinVb created an issue. See original summary.

KevinVb’s picture

Assigned: KevinVb » Unassigned
Status: Active » Needs review
FileSize
408 bytes

This patch fixes the installation issue.

slydevil’s picture

Version: 8.x-1.x-dev » 8.x-1.1
Assigned: Unassigned » slydevil

Out of the box, the longest file name is 129 for drupal 8, so a length of 191 should be more than enough. Thanks!

  • slydevil committed a2bbc38 on 8.x-1.x authored by KevinVb
    Issue #2897908 by KevinVb: MinifyJS can't be installed with mysql...
slydevil’s picture

Status: Needs review » Fixed
slydevil’s picture

Status: Fixed » Closed (fixed)