diff --git a/core/lib/Drupal/Core/Database/SchemaIndexSizeException.php b/core/lib/Drupal/Core/Database/SchemaIndexSizeException.php
new file mode 100644
index 0000000..72ae046
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/SchemaIndexSizeException.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\Core\Database\SchemaIndexSizeException.
+ */
+
+namespace Drupal\Core\Database;
+
+/**
+ * Exception thrown if a schema contains an index that is too long.
+ *
+ * @see Drupal\Core\Database\Schema::MAX_INDEX_LENGTH
+ */
+class SchemaIndexSizeException extends SchemaException implements DatabaseException { }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
index fb4d2a1..b87feaf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Database;
 
 use Drupal\Core\Database\Database;
+use Drupal\Core\Database\SchemaIndexSizeException;
 use Drupal\simpletest\UnitTestBase;
 
 use Exception;
@@ -146,6 +147,60 @@ function testSchema() {
   }
 
   /**
+   * Tests schema definitions that exceed the maximum allowed size.
+   */
+  function testSchemaMaxIndexSize() {
+    // Define a table structure with an index that is too large.
+    $table_specification = array(
+      'description' => 'Test schema table.',
+      'fields' => array(
+        // Allotted 765 bytes.
+        'text_field_1'  => array(
+          'type' => 'text',
+          'default' => NULL,
+          'length' => 255,
+        ),
+        // Allotted 765 bytes.
+        'text_field_2'  => array(
+          'type' => 'text',
+          'default' => NULL,
+          'length' => 128,
+        ),
+        // Allotted 29 bytes.
+        'numeric_field'  => array(
+          'type' => 'numeric',
+          'default' => NULL,
+        ),
+        // Allotted 8 bytes.
+        'int_field' => array(
+          'type' => 'int',
+          'default' => NULL,
+        ),
+      ),
+      'primary key' => array('text_field_1', 'text_field_2', 'numeric_field', 'int_field'),
+    );
+    try {
+      db_create_table('test_table', $table_specification);
+      $this->fail('Exception thrown when attempting to create a table with an index that is too large.');
+    }
+    catch (SchemaIndexSizeException $e) {
+      $this->pass('Exception thrown when attempting to create a table with an index that is too large.');
+    }
+
+    // Reduce the size of the index to exactly the maximum.
+    // (255 + 66) * 3 + 29 + 8 = 1000
+    $table_definition['fields']['text_field_2']['length'] = 66;
+    try {
+      db_create_table('test_table', $table_specification);
+      $this->pass('Exception not thrown when attempting to create a table with an index that is the maximum size.');
+    }
+    catch (SchemaIndexSizeException $e) {
+      $this->fail('Exception not thrown when attempting to create a table with an index that is the maximum size.');
+    }
+
+  }
+
+  /**
    * Tests inserting data into an existing table.
    *
    * @param $table
