A new bug is found in the Btree---the delete operation does not work when the number of elements exceeds the block size.
We have set the block size to 10. We first insert 30 items to the CountedBTree and the delete items 10 to 19. But if we call getIDs() after deletion. only item 10 and 15 is shown to be deleted., the rest are not deleted. Now, if we reinsert the "supposedly" deleted elements in the tree. we now have redundant entries---items 11 to 19 appear twice.
This use case appears when we want to delete a range of elements in the tree, sort them by a different order and reinsert them at their original position. The result of the running test:
A new bug is found in the Btree---the delete operation does not work when the number of elements exceeds the block size.
We have set the block size to 10. We first insert 30 items to the CountedBTree and the delete items 10 to 19. But if we call getIDs() after deletion. only item 10 and 15 is shown to be deleted., the rest are not deleted. Now, if we reinsert the "supposedly" deleted elements in the tree. we now have redundant entries---items 11 to 19 appear twice.
This use case appears when we want to delete a range of elements in the tree, sort them by a different order and reinsert them at their original position. The result of the running test:
The test code can be found here