Hi,
I'm unable to install this module with MariaDB 5.5.56 and a character set of utf8mb4. Here's the error I'm receiving:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1709 Index column size
too large. The maximum column size is 767 bytes.: CREATE TABLE {nodeaccess} (
`nid` INT unsigned NOT NULL DEFAULT 0,
`gid` INT unsigned NOT NULL DEFAULT 0,
`realm` VARCHAR(255) NOT NULL DEFAULT '',
`grant_view` TINYINT unsigned NOT NULL DEFAULT 0,
`grant_update` TINYINT unsigned NOT NULL DEFAULT 0,
`grant_delete` TINYINT unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`nid`, `gid`, `realm`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4;
Upon further investigation I found this page: http://mysql.rjweb.org/doc.php/index_cookbook_mysql#limitations
In 5.6 / 10.0, you may not include a column that equates to bigger than 767 bytes: VARCHAR(255) CHARACTER SET utf8 or VARCHAR(191) CHARACTER SET utf8mb4
I can confirm that changing the column length to 191 works.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2945214-2.patch | 359 bytes | nathandentzau |
Comments
Comment #2
nathandentzauA quick glance at the module's codebase I don't see in anyway where a realm could even be close to 191 characters. So here's my patch.
Comment #3
nathandentzauComment #4
nathandentzauComment #5
gceja commentedWe have a similar error when trying to install Nodeaccess 8.x-1.0-beta1:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: CREATE TABLE {nodeaccess} ( `nid` INT unsigned NOT NULL DEFAULT 0, `gid` INT unsigned NOT NULL DEFAULT 0, `realm` VARCHAR(255) NOT NULL DEFAULT '', `grant_view` TINYINT unsigned NOT NULL DEFAULT 0, `grant_update` TINYINT unsigned NOT NULL DEFAULT 0, `grant_delete` TINYINT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`nid`, `gid`, `realm`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4; Array ( ) in drupal_install_schema()Using:
Drupal core 8.4.5
MariaDB
Will this patch fix all these issues? @nathandentzau
Thank you.
Comment #6
oakulm commentedYes this patch seems to fix the problem
Comment #8
mukila commentedApplied patch in 8.x-1.0-beta2 release