diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
index 70df7b1..2196cfe 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
@@ -596,7 +596,7 @@ protected function getEntitySchemaData(ContentEntityTypeInterface $entity_type,
     $unused_keys = array_flip(array('description', 'fields', 'foreign keys'));
 
     // Collect all possible field schema identifiers for shared table fields.
-    // These will be used to detect entity schema data in the following loop.
+    // These will be used to detect entity schema data in the subsequent loop.
     $field_schema_identifiers = [];
     $storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
     $table_mapping = $this->storage->getTableMapping($storage_definitions);
diff --git a/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php b/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php
index a9f2b73..7d14aa3 100644
--- a/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php
+++ b/core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php
@@ -105,6 +105,20 @@ protected function addBaseField($type = 'string') {
   }
 
   /**
+   * Adds a long-named base field to the 'entity_test_update' entity type.
+   */
+  protected function addLongNameBaseField() {
+    $key = 'entity_test_update.additional_base_field_definitions';
+    $definitions = $this->state->get($key, []);
+    $definitions['new_long_named_entity_reference_base_field'] = BaseFieldDefinition::create('entity_reference')
+      ->setName('new_long_named_entity_reference_base_field')
+      ->setLabel(t('A new long-named base field'))
+      ->setSetting('target_type', 'user')
+      ->setSetting('handler', 'default');
+    $this->state->set($key, $definitions);
+  }
+
+  /**
    * Adds a new revisionable base field to the 'entity_test_update' entity type.
    *
    * @param string $type
diff --git a/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php b/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
index af9ccbc..a2a6b81 100644
--- a/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
@@ -18,6 +18,7 @@
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Field\FieldStorageDefinitionEvents;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\entity_test\Entity\EntityTestUpdate;
 
 /**
  * Tests EntityDefinitionUpdateManager functionality.
@@ -796,4 +797,17 @@ public function testBaseFieldEntityKeyUpdateWithExistingData() {
     }
   }
 
+  /**
+   * Check that field schema is are correctly handled with long-named fields.
+   */
+  function testLongNameFieldIndexes() {
+    $this->addLongNameBaseField();
+    $entity_type_id = 'entity_test_update';
+    $entity_type = $this->entityManager->getDefinition($entity_type_id);
+    $definitions = EntityTestUpdate::baseFieldDefinitions($entity_type);
+    $name = 'new_long_named_entity_reference_base_field';
+    $this->entityDefinitionUpdateManager->installFieldStorageDefinition($name, $entity_type_id, 'entity_test', $definitions[$name]);
+    $this->assertFalse($this->entityDefinitionUpdateManager->needsUpdates(), 'Entity and field schema data are correctly detected.');
+  }
+
 }
