summaryrefslogtreecommitdiff
path: root/src/btree/bt_split.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/btree/bt_split.c')
-rw-r--r--src/btree/bt_split.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c
index 82a4dac226f..d2861e5237e 100644
--- a/src/btree/bt_split.c
+++ b/src/btree/bt_split.c
@@ -960,17 +960,11 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
result_entries = (parent_entries + new_entries) - deleted_entries;
/*
- * If the entire (sub)tree is empty, leave the first ref in place,
- * deleted.
+ * If the entire (sub)tree is empty, give up: we can't leave an empty
+ * internal page.
*/
- if (result_entries == 0) {
- next_ref = pindex->index[0];
- WT_ASSERT(session, next_ref->state == WT_REF_SPLIT ||
- (next_ref == ref && ref->state == WT_REF_LOCKED));
- next_ref->state = WT_REF_DELETED;
- --deleted_entries;
- result_entries = 1;
- }
+ if (result_entries == 0)
+ return (0);
/*
* Allocate and initialize a new page index array for the parent, then
@@ -1016,6 +1010,9 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
*alloc_refp++ = next_ref;
}
+ /* Check that we filled in all the entries. */
+ WT_ASSERT(session, alloc_refp - alloc_index->index == result_entries);
+
/*
* Update the parent page's index: this update makes the split visible
* to threads descending the tree.