diff -u b/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml --- b/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -445,9 +445,9 @@ case_sensitive: type: boolean label: 'Case sensitive' - is_alphanumeric: + is_trivial: type: boolean - label: 'US ASCII characters only' + label: 'Contains US ASCII characters only' field.field_settings.string: type: mapping diff -u b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php --- b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php @@ -44,7 +44,7 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { $properties['value'] = DataDefinition::create('string') ->setLabel(t('Language code')) - ->setSetting('is_alphanumeric', TRUE) + ->setSetting('is_trivial', TRUE) ->setRequired(TRUE); $properties['language'] = DataReferenceDefinition::create('language') @@ -76,6 +76,7 @@ 'value' => array( 'type' => 'varchar', 'length' => 12, + 'is_alphanumeric' => TRUE, ), ), ); diff -u b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php --- b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php @@ -46,7 +46,7 @@ 'type' => 'varchar', 'length' => (int) $field_definition->getSetting('max_length'), 'binary' => $field_definition->getSetting('case_sensitive'), - 'is_alphanumeric' => $field_definition->getSetting('is_alphanumeric'), + 'is_alphanumeric' => $field_definition->getSetting('is_trivial'), ), ), ); 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 @@ -226,7 +226,7 @@ $fields['hash'] = BaseFieldDefinition::create('string') ->setLabel(t('Hash')) - ->setSetting('is_alphanumeric', TRUE) + ->setSetting('is_trivial', TRUE) ->setDescription(t('Calculated hash of the feed data, used for validating cache.')); $fields['etag'] = BaseFieldDefinition::create('string') diff -u b/core/modules/aggregator/src/FeedInterface.php b/core/modules/aggregator/src/FeedInterface.php --- b/core/modules/aggregator/src/FeedInterface.php +++ b/core/modules/aggregator/src/FeedInterface.php @@ -170,8 +170,8 @@ * Sets the calculated hash of the feed data, used for validating cache. * * @param string $hash - * A string containing the calculated hash of the feed. Must be base64 - * encoded so it contains US ASCII characters only. + * A string containing the calculated hash of the feed. Must contain + * US ASCII characters only. * * @return \Drupal\aggregator\FeedInterface * The class instance that this method is called on. diff -u b/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php --- b/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -254,7 +254,7 @@ $fields['filemime'] = BaseFieldDefinition::create('string') ->setLabel(t('File MIME type')) - ->setSetting('is_alphanumeric', TRUE) + ->setSetting('is_trivial', TRUE) ->setDescription(t("The file's MIME type.")); $fields['filesize'] = BaseFieldDefinition::create('integer') diff -u b/core/modules/locale/locale.install b/core/modules/locale/locale.install --- b/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -188,6 +188,7 @@ 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, + 'is_alphanumeric' => TRUE, 'default' => '', 'description' => 'A unique short name to identify the project the file belongs to.', ), @@ -195,6 +196,7 @@ 'type' => 'varchar', 'length' => '12', 'not null' => TRUE, + 'is_alphanumeric' => TRUE, 'default' => '', 'description' => 'Language code of this translation. References {language}.langcode.', ), diff -u b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php --- b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -250,7 +250,7 @@ ->setLabel(t('Bundle')) ->setDescription(t('The content menu link bundle.')) ->setSetting('max_length', EntityTypeInterface::BUNDLE_MAX_LENGTH) - ->setSetting('is_alphanumeric', TRUE) + ->setSetting('is_trivial', TRUE) ->setReadOnly(TRUE); $fields['title'] = BaseFieldDefinition::create('string') @@ -293,7 +293,7 @@ ->setLabel(t('Menu name')) ->setDescription(t('The menu name. All links with the same menu name (such as "tools") are part of the same menu.')) ->setDefaultValue('tools') - ->setSetting('is_alphanumeric', TRUE); + ->setSetting('is_trivial', TRUE); $fields['link'] = BaseFieldDefinition::create('link') ->setLabel(t('Link')) diff -u b/core/modules/node/node.install b/core/modules/node/node.install --- b/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -79,6 +79,7 @@ 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, + 'is_alphanumeric' => TRUE, 'default' => '', ), 'grant_view' => array( diff -u b/core/modules/system/src/Tests/Database/SchemaTest.php b/core/modules/system/src/Tests/Database/SchemaTest.php --- b/core/modules/system/src/Tests/Database/SchemaTest.php +++ b/core/modules/system/src/Tests/Database/SchemaTest.php @@ -68,7 +68,7 @@ // Assert that the column comment has been set. $this->checkSchemaComment($table_specification['fields']['test_field']['description'], 'test_table', 'test_field'); - // Make sure that varchard fields have the correct collation. + // Make sure that varchar fields have the correct collation. $columns = db_query('SHOW FULL COLUMNS FROM {test_table}'); foreach ($columns as $column) { if ($column->Field == 'test_field_string') { only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -1603,6 +1603,7 @@ protected function getDedicatedTableSchema(FieldStorageDefinitionInterface $stor 'bundle' => array( 'type' => 'varchar', 'length' => 128, + 'is_alphanumeric' => TRUE, 'not null' => TRUE, 'default' => '', 'description' => 'The field instance bundle to which this row belongs, used when deleting a field instance', @@ -1619,6 +1620,7 @@ protected function getDedicatedTableSchema(FieldStorageDefinitionInterface $stor 'langcode' => array( 'type' => 'varchar', 'length' => 32, + 'is_alphanumeric' => TRUE, 'not null' => TRUE, 'default' => '', 'description' => 'The language code for this data item.', only in patch2: unchanged: --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php @@ -137,6 +137,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) // If the target entities act as bundles for another entity type, // their IDs should not exceed the maximum length for bundles. 'length' => $target_type_info->getBundleOf() ? EntityTypeInterface::BUNDLE_MAX_LENGTH : 255, + 'is_alphanumeric' => TRUE, ), ); } only in patch2: unchanged: --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -303,6 +303,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['entity_type'] = BaseFieldDefinition::create('string') ->setLabel(t('Entity type')) ->setDescription(t('The entity type to which this comment is attached.')) + ->setSetting('is_trivial', TRUE) ->setSetting('max_length', EntityTypeInterface::ID_MAX_LENGTH); $fields['comment_type'] = BaseFieldDefinition::create('entity_reference') @@ -313,6 +314,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['field_name'] = BaseFieldDefinition::create('string') ->setLabel(t('Comment field name')) ->setDescription(t('The field name through which this comment was added.')) + ->setSetting('is_trivial', TRUE) ->setSetting('max_length', FieldStorageConfig::NAME_MAX_LENGTH); return $fields; only in patch2: unchanged: --- a/core/modules/system/database.api.php +++ b/core/modules/system/database.api.php @@ -293,6 +293,9 @@ * 'varchar' or 'text' fields to use case-sensitive binary collation. * This has no effect on other database types for which case sensitivity * is already the default behavior. + * - 'is_alphanumeric': A boolean indicating that MySQL should use + * ASCII character encoding for the field. This helps index usage be + * more efficient, and should be used on machine name fields. * All parameters apart from 'type' are optional except that type * 'numeric' columns must specify 'precision' and 'scale', and type * 'varchar' must specify the 'length' parameter. only in patch2: unchanged: --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -23,6 +23,7 @@ function user_schema() { 'description' => 'The name of the module declaring the variable.', 'type' => 'varchar', 'length' => DRUPAL_EXTENSION_NAME_MAX_LENGTH, + 'is_alphanumeric' => TRUE, 'not null' => TRUE, 'default' => '', ), @@ -31,6 +32,7 @@ function user_schema() { 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, + 'is_alphanumeric' => TRUE, 'default' => '', ), 'value' => array(