diff --git wp-admin/includes/upgrade.php wp-admin/includes/upgrade.php
index 7ba271a..8c8e3be 100644
--- wp-admin/includes/upgrade.php
+++ wp-admin/includes/upgrade.php
@@ -404,6 +404,8 @@ function upgrade_all() {
 
 	maybe_disable_link_manager();
 
+	maybe_wp_tt_primary_key_parent();
+
 	maybe_disable_automattic_widgets();
 
 	update_option( 'db_version', $wp_db_version );
@@ -1953,6 +1955,20 @@ function maybe_disable_link_manager() {
 }
 
 /**
+ * Alter UNIQUE KEY for wp_term_taxonomy to include parent
+ *
+ * @since 3.6.0
+ */
+function maybe_wp_tt_primary_key_parent() {
+	global $wp_current_db_version, $wpdb;
+
+	$keys = $wpdb->get_results( "SHOW KEYS FROM $wpdb->term_taxonomy WHERE Key_name = 'term_id_taxonomy'" );
+
+	if ( $wp_current_db_version >= 22441 && count( $keys ) )
+		$wpdb->query("ALTER TABLE $wpdb->term_taxonomy DROP INDEX term_id_taxonomy, ADD UNIQUE INDEX term_id_taxonomy_parent (`term_id`, `taxonomy`, `parent`)");
+}
+
+/**
  * Runs before the schema is upgraded.
  *
  * @since 2.9.0
diff --git wp-includes/taxonomy.php wp-includes/taxonomy.php
index d527ee1..b7e179b 100644
--- wp-includes/taxonomy.php
+++ wp-includes/taxonomy.php
@@ -2084,7 +2084,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
 	}
 
 	if ( $term_id = term_exists($slug) ) {
-		$existing_term = $wpdb->get_row( $wpdb->prepare( "SELECT name FROM $wpdb->terms WHERE term_id = %d", $term_id), ARRAY_A );
+		$existing_term = $wpdb->get_row( $wpdb->prepare( "SELECT term_id, name FROM $wpdb->terms WHERE term_id = %d", $term_id), ARRAY_A );
 		// We've got an existing term in the same taxonomy, which matches the name of the new term:
 		if ( is_taxonomy_hierarchical($taxonomy) && $existing_term['name'] == $name && $exists = term_exists( (int) $term_id, $taxonomy ) ) {
 			// Hierarchical, and it matches an existing term, Do not allow same "name" in the same level.
@@ -2092,10 +2092,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
 			if ( in_array($name, $siblings) ) {
 				return new WP_Error('term_exists', __('A term with the name provided already exists with this parent.'), $exists['term_id']);
 			} else {
-				$slug = wp_unique_term_slug($slug, (object) $args);
-				if ( false === $wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) ) )
-					return new WP_Error('db_insert_error', __('Could not insert term into the database'), $wpdb->last_error);
-				$term_id = (int) $wpdb->insert_id;
+				$term_id = (int) $existing_term['term_id'];
 			}
 		} elseif ( $existing_term['name'] != $name ) {
 			// We've got an existing term, with a different name, Create the new term.
@@ -2123,7 +2120,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
 		do_action( 'edited_terms', $term_id );
 	}
 
-	$tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) );
+	$tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d AND tt.parent = %d", $taxonomy, $term_id, $parent ) );
 
 	if ( !empty($tt_id) )
 		return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
