Index: src/wp-admin/includes/upgrade.php
===================================================================
--- src/wp-admin/includes/upgrade.php	(revision 39564)
+++ src/wp-admin/includes/upgrade.php	(working copy)
@@ -2216,7 +2216,7 @@
 			continue;
 
 		// Clear the field and index arrays.
-		$cfields = $indices = array();
+		$cfields = $indices = $indices_without_subparts = array();
 
 		// Get all of the field names in the query from between the parentheses.
 		preg_match("|\((.*)\)|ms", $qry, $match2);
@@ -2289,10 +2289,10 @@
 					$index_name = ( 'PRIMARY KEY' === $index_type ) ? '' : '`' . strtolower( $index_matches['index_name'] ) . '`';
 
 					// Parse the columns. Multiple columns are separated by a comma.
-					$index_columns = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
+					$index_columns = $index_columns_without_subparts = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
 
 					// Normalize columns.
-					foreach ( $index_columns as &$index_column ) {
+					foreach ( $index_columns as $id => &$index_column ) {
 						// Extract column name and number of indexed characters (sub_part).
 						preg_match(
 							  '/'
@@ -2319,6 +2319,9 @@
 						// Escape the column name with backticks.
 						$index_column = '`' . $index_column_matches['column_name'] . '`';
 
+						// We don't need to add the subpart to $index_columns_without_subparts
+						$index_columns_without_subparts[ $id ] = $index_column;
+
 						// Append the optional sup part with the number of indexed characters.
 						if ( isset( $index_column_matches['sub_part'] ) ) {
 							$index_column .= '(' . $index_column_matches['sub_part'] . ')';
@@ -2327,9 +2330,10 @@
 
 					// Build the normalized index definition and add it to the list of indices.
 					$indices[] = "{$index_type} {$index_name} (" . implode( ',', $index_columns ) . ")";
+					$indices_without_subparts[] = "{$index_type} {$index_name} (" . implode( ',', $index_columns_without_subparts ) . ")";
 
 					// Destroy no longer needed variables.
-					unset( $index_column, $index_column_matches, $index_matches, $index_type, $index_name, $index_columns );
+					unset( $index_column, $index_column_matches, $index_matches, $index_type, $index_name, $index_columns, $index_columns_without_subparts );
 
 					break;
 			}
@@ -2446,25 +2450,14 @@
 
 					// Add the field to the column list string.
 					$index_columns .= '`' . $column_data['fieldname'] . '`';
-					if ($column_data['subpart'] != '') {
-						$index_columns .= '('.$column_data['subpart'].')';
-					}
 				}
 
-				// The alternative index string doesn't care about subparts
-				$alt_index_columns = preg_replace( '/\([^)]*\)/', '', $index_columns );
-
 				// Add the column list to the index create string.
-				$index_strings = array(
-					"$index_string ($index_columns)",
-					"$index_string ($alt_index_columns)",
-				);
-
-				foreach ( $index_strings as $index_string ) {
-					if ( ! ( ( $aindex = array_search( $index_string, $indices ) ) === false ) ) {
-						unset( $indices[ $aindex ] );
-						break;
-					}
+				$index_string .= " ($index_columns)";
+
+				if ( ! ( ( $aindex = array_search( $index_string, $indices_without_subparts ) ) === false ) ) {
+					unset( $indices_without_subparts[ $aindex ] );
+					unset( $indices[ $aindex ] );
 				}
 			}
 		}
Index: tests/phpunit/tests/dbdelta.php
===================================================================
--- tests/phpunit/tests/dbdelta.php	(revision 39564)
+++ tests/phpunit/tests/dbdelta.php	(working copy)
@@ -826,6 +826,29 @@
 	}
 
 	/**
+	 * @ticket 34870
+	 */
+	function test_unchanged_key_lengths_do_not_recreate_index() {
+		global $wpdb;
+
+		$updates = dbDelta(
+			"
+			CREATE TABLE {$wpdb->prefix}dbdelta_test (
+				id bigint(20) NOT NULL AUTO_INCREMENT,
+				column_1 varchar(255) NOT NULL,
+				column_2 text,
+				column_3 blob,
+				PRIMARY KEY  (id),
+				KEY key_1 (column_1(255)),
+				KEY compound_key (id,column_1),
+				FULLTEXT KEY fulltext_key (column_1)
+			) ENGINE=MyISAM
+			", false );
+
+		$this->assertEmpty( $updates );
+	}
+
+	/**
 	 * @ticket 31679
 	 */
 	function test_column_type_change_with_hyphens_in_name() {
