diff --git a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
index 8641fd3..0d90d02 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\KernelTests\Core\Database;
 
 use Drupal\Core\Database\Database;
+use Drupal\Core\Database\DatabaseExceptionWrapper;
 use Drupal\Core\Database\SchemaException;
 use Drupal\Core\Database\SchemaObjectDoesNotExistException;
 use Drupal\Core\Database\SchemaObjectExistsException;
@@ -696,6 +697,47 @@ function testSchemaChangeField() {
   }
 
   /**
+   * Tests changing columns shorten the index.
+   */
+  public function testSchemaChangeShortenIndex() {
+    if (db_driver() != 'mysql') {
+      $this->pass('This is a MySQL only test');
+      return;
+    }
+    try {
+      db_query('SET GLOBAL innodb_large_prefix=ON;');
+      db_query('SET GLOBAL innodb_file_format=Barracuda');
+      db_query('SET GLOBAL innodb_file_per_table=ON;');
+    }
+    catch (DatabaseExceptionWrapper $e) {
+      // We were trying to set up a modern MySQL environemnt, it is possible
+      // those variables got removed in a >5.7 release, there's nothing to do
+      // then, it's modern by default.
+    }
+    $table_spec = [
+      'fields' => [
+        'f1' => [
+          'type' => 'int',
+        ],
+      ],
+      'indexes' => [
+        'test' => ['f1'],
+      ],
+    ];
+    db_create_table('test_table', $table_spec);
+    db_query('ALTER TABLE {test_table} ROW_FORMAT = DYNAMIC');
+    db_change_field('test_table', 'f1', 'f1', ['type' => 'varchar', 'length' => 191]);
+    db_change_field('test_table', 'f1', 'f1', ['type' => 'varchar', 'length' => 192]);
+    db_query('ALTER TABLE {test_table} ROW_FORMAT = COMPACT');
+    // This does not allow for large indexes but since innodb_large_prefix is
+    // ON, an error should be raised.
+    db_change_field('test_table', 'f1', 'f1', ['type' => 'varchar', 'length' => 191]);
+    db_change_field('test_table', 'f1', 'f1', ['type' => 'varchar', 'length' => 192]);
+    $index = db_query('SHOW INDEX FROM {test_table}')->fetch();
+    $this->assertSame(191, $index->Sub_part);
+  }
+
+  /**
    * Asserts that a field can be changed from one spec to another.
    *
    * @param $old_spec
