Ported the two bug fixes from r14063 (in BPlusTree::RemoveDuplicate()) to the R5 version of BFS.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14064 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-08-25 23:19:41 +00:00
parent 4dcc6e972e
commit 0f4453363f
@@ -1218,9 +1218,11 @@ BPlusTree::RemoveDuplicate(Transaction *transaction, bplustree_node *node, Cache
bplustree_node::FragmentIndex(oldValue), duplicateOffset, array->count));
return B_BAD_DATA;
}
if (!array->Remove(value))
if (!array->Remove(value)) {
FATAL(("Oh no, value %Ld not found in fragments of node %Ld...\n",
value, duplicateOffset));
return B_ENTRY_NOT_FOUND;
}
// remove the array from the fragment node if it is empty
if (array->count == 1) {
@@ -1307,6 +1309,7 @@ BPlusTree::RemoveDuplicate(Transaction *transaction, bplustree_node *node, Cache
// If the next node is the last node, we need to free that node
// and convert the duplicate entry back into a normal entry
array = duplicate->DuplicateArray();
if (right == BPLUSTREE_NULL && duplicate->LeftLink() == BPLUSTREE_NULL
&& duplicate->DuplicateArray()->count <= NUM_FRAGMENT_VALUES) {
duplicateOffset = left;