only in patch2: unchanged: --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -261,6 +261,12 @@ protected function ensureTables() { foreach ($this->migration->getSourcePlugin()->getIds() as $id_definition) { $mapkey = 'sourceid' . $count++; $source_id_schema[$mapkey] = $this->getFieldSchema($id_definition); + + // With InnoDB, utf8mb4-based primary keys can't be over 191 characters. + // Use ASCII-based primary keys instead. + if (isset($source_id_schema[$mapkey]['type']) && $source_id_schema[$mapkey]['type'] == 'varchar') { + $source_id_schema[$mapkey]['type'] = 'varchar_ascii'; + } $pks[] = $mapkey; } only in patch2: unchanged: --- a/core/modules/migrate_drupal/src/Tests/Table/d6/System.php +++ b/core/modules/migrate_drupal/src/Tests/Table/d6/System.php @@ -6,7 +6,7 @@ * * THIS IS A GENERATED FILE. DO NOT EDIT. * - * @see cores/scripts/dump-database-d6.sh + * @see core/scripts/dump-database-d6.sh * @see https://www.drupal.org/sandbox/benjy/2405029 */ @@ -26,7 +26,7 @@ public function load() { ), 'fields' => array( 'filename' => array( - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'not null' => TRUE, 'length' => '255', 'default' => '', only in patch2: unchanged: --- a/core/modules/system/tests/modules/database_test/database_test.install +++ b/core/modules/system/tests/modules/database_test/database_test.install @@ -24,7 +24,7 @@ function database_test_schema() { ), 'name' => array( 'description' => "A person's name", - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'length' => 255, 'not null' => TRUE, 'default' => '', @@ -75,7 +75,7 @@ function database_test_schema() { ), 'job' => array( 'description' => "The person's job", - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'length' => 255, 'not null' => TRUE, 'default' => '', @@ -106,7 +106,7 @@ function database_test_schema() { ), 'job' => array( 'description' => "The person's job", - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'length' => 255, 'not null' => TRUE, 'default' => '', @@ -197,7 +197,7 @@ function database_test_schema() { ), 'name' => array( 'description' => "A person's name.", - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'length' => 255, 'not null' => FALSE, 'default' => '', only in patch2: unchanged: --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php @@ -45,7 +45,10 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['id'] = BaseFieldDefinition::create('string') ->setLabel(t('ID')) ->setDescription(t('The ID of the test entity.')) - ->setReadOnly(TRUE); + ->setReadOnly(TRUE) + // In order to work around the InnoDB 191 character limit on utf8mb4 + // primary keys, we set the character set for the field to ASCII. + ->setSetting('is_ascii', TRUE); return $fields; } only in patch2: unchanged: --- a/core/modules/views/src/Tests/ViewTestData.php +++ b/core/modules/views/src/Tests/ViewTestData.php @@ -75,7 +75,7 @@ public static function schemaDefinition() { ), 'name' => array( 'description' => "A person's name", - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'length' => 255, 'not null' => TRUE, 'default' => '', only in patch2: unchanged: --- a/core/scripts/dump-database-d6.sh +++ b/core/scripts/dump-database-d6.sh @@ -52,7 +52,11 @@ // Get the current schema, order it by table name. $schema = drupal_get_schema(); ksort($schema); - +// Override the field type of the filename primary key to bypass the +// InnoDB 191 character limitation. +if ($schema['system']['primary key'] == 'filename' && $schema['system']['fields']['filename']['type'] == 'varchar') { + $schema['system']['fields']['filename']['type'] = 'varchar_ascii'; +} // Export all the tables in the schema. foreach ($schema as $table => $data) { // Remove descriptions to save time and code. only in patch2: unchanged: --- a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php +++ b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php @@ -176,7 +176,7 @@ public function routingTableDefinition() { 'fields' => array( 'name' => array( 'description' => 'Primary Key: Machine name of this route', - 'type' => 'varchar', + 'type' => 'varchar_ascii', 'length' => 255, 'not null' => TRUE, 'default' => '',