diff -u b/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php --- b/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -145,9 +145,6 @@ ->setLabel(t('Title')) ->setDescription(t('The name of the feed (or the name of the website providing the feed).')) ->setRequired(TRUE) - // We have a unique constraint on the title field, which has the utf8mb4 - // character set in MySQL so we can't have more than 191 characters. - ->setSetting('max_length', 191) ->setDisplayOptions('form', array( 'type' => 'string_textfield', 'weight' => -5, diff -u b/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php --- b/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -22,7 +22,7 @@ * bundle_label = @Translation("Custom block type"), * handlers = { * "storage" = "Drupal\Core\Entity\Sql\SqlContentEntityStorage", - * "storage_schema" = "Drupal\block_content\BlockContentStorageSchema", + * "storage_schema" = "Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema", * "access" = "Drupal\block_content\BlockContentAccessControlHandler", * "list_builder" = "Drupal\block_content\BlockContentListBuilder", * "view_builder" = "Drupal\block_content\BlockContentViewBuilder", @@ -187,10 +187,7 @@ 'type' => 'string_textfield', 'weight' => -5, )) - ->setDisplayConfigurable('form', TRUE) - // We have a unique constraint on the info field, which has the utf8mb4 - // character set in MySQL so we can't have more than 191 characters. - ->setSetting('max_length', 191); + ->setDisplayConfigurable('form', TRUE); $fields['type'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Block type')) diff -u b/core/scripts/dump-database-d6.sh b/core/scripts/dump-database-d6.sh --- b/core/scripts/dump-database-d6.sh +++ b/core/scripts/dump-database-d6.sh @@ -52,6 +52,7 @@ // 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') { only in patch2: unchanged: --- a/core/modules/aggregator/src/FeedStorageSchema.php +++ b/core/modules/aggregator/src/FeedStorageSchema.php @@ -33,7 +33,7 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st break; case 'title': - $this->addSharedTableFieldUniqueKey($storage_definition, $schema); + $this->addSharedTableFieldIndex($storage_definition, $schema); break; } } only in patch2: unchanged: --- a/core/modules/block_content/src/BlockContentStorageSchema.php +++ /dev/null @@ -1,52 +0,0 @@ - array('info', 'langcode'), - ); - - return $schema; - } - - /** - * {@inheritdoc} - */ - protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping) { - $schema = parent::getSharedTableFieldSchema($storage_definition, $table_name, $column_mapping); - $field_name = $storage_definition->getName(); - - if ($table_name == 'block_content_field_data') { - switch ($field_name) { - case 'info': - // Improves the performance of the block_content__info index defined - // in getEntitySchema(). - $schema['fields'][$field_name]['not null'] = TRUE; - break; - } - } - - return $schema; - } - -} only in patch2: unchanged: --- a/core/modules/system/src/Tests/Database/RegressionTest.php +++ b/core/modules/system/src/Tests/Database/RegressionTest.php @@ -26,15 +26,15 @@ class RegressionTest extends DatabaseTestBase { */ function testRegression_310447() { // That's a 255 character UTF-8 string. - $name = str_repeat("é", 255); + $job = str_repeat("é", 255); db_insert('test') ->fields(array( - 'name' => $name, + 'name' => $this->randomMachineName(), 'age' => 20, - 'job' => 'Dancer', + 'job' => $job, ))->execute(); - $from_database = db_query('SELECT name FROM {test} WHERE name = :name', array(':name' => $name))->fetchField(); + $from_database = db_query('SELECT job FROM {test} WHERE job = :job', array(':job' => $job))->fetchField(); $this->assertIdentical($name, $from_database, 'The database handles UTF-8 characters cleanly.'); }