Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | minifyjs_utf8_support-2897908-1.patch | 408 bytes | KevinVb |
Comments
Comment #2
KevinVb CreditAttribution: KevinVb at Dropsolid commentedThis patch fixes the installation issue.
Comment #3
slydevil CreditAttribution: slydevil commentedOut of the box, the longest file name is 129 for drupal 8, so a length of 191 should be more than enough. Thanks!
Comment #5
slydevil CreditAttribution: slydevil commentedComment #6
slydevil CreditAttribution: slydevil commented