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:
@@ -1218,9 +1218,11 @@ BPlusTree::RemoveDuplicate(Transaction *transaction, bplustree_node *node, Cache
|
|||||||
bplustree_node::FragmentIndex(oldValue), duplicateOffset, array->count));
|
bplustree_node::FragmentIndex(oldValue), duplicateOffset, array->count));
|
||||||
return B_BAD_DATA;
|
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",
|
FATAL(("Oh no, value %Ld not found in fragments of node %Ld...\n",
|
||||||
value, duplicateOffset));
|
value, duplicateOffset));
|
||||||
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
// remove the array from the fragment node if it is empty
|
// remove the array from the fragment node if it is empty
|
||||||
if (array->count == 1) {
|
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
|
// If the next node is the last node, we need to free that node
|
||||||
// and convert the duplicate entry back into a normal entry
|
// and convert the duplicate entry back into a normal entry
|
||||||
|
array = duplicate->DuplicateArray();
|
||||||
if (right == BPLUSTREE_NULL && duplicate->LeftLink() == BPLUSTREE_NULL
|
if (right == BPLUSTREE_NULL && duplicate->LeftLink() == BPLUSTREE_NULL
|
||||||
&& duplicate->DuplicateArray()->count <= NUM_FRAGMENT_VALUES) {
|
&& duplicate->DuplicateArray()->count <= NUM_FRAGMENT_VALUES) {
|
||||||
duplicateOffset = left;
|
duplicateOffset = left;
|
||||||
|
|||||||
Reference in New Issue
Block a user