BPlusTree: Fix fCurrentKey in backward TreeIterator traversal.
When reaching the next node the current key should be set to the next valid index within that node (0 for forward and NumKeys() - 1 for backward). This did not cause any harm as BFS uses forward traversal only.
This commit is contained in:
@@ -2715,7 +2715,7 @@ TreeIterator::Traverse(int8 direction, void* key, uint16* keyLength,
|
||||
RETURN_ERROR(B_ERROR);
|
||||
|
||||
// reset current key
|
||||
fCurrentKey = forward ? 0 : node->NumKeys();
|
||||
fCurrentKey = forward ? 0 : node->NumKeys() - 1;
|
||||
} else {
|
||||
// there are no nodes left, so turn back to the last key
|
||||
fCurrentNodeOffset = savedNodeOffset;
|
||||
|
||||
Reference in New Issue
Block a user