Closed GoogleCodeExporter closed 9 years ago
Original comment by d.majum...@gmail.com
on 12 Apr 2009 at 10:08
Original comment by d.majum...@gmail.com
on 12 Apr 2009 at 10:08
It is possible for the search to hit EOF on a leaf node that is an indirect
child of
its parent, and not hit EOF for the search. The previous assertion that assumed
that
this can only occur when the last leaf page is accessed is not true, and caused
a
failure. The assertion is removed; instead we recognise this condition and set
EOF if
the next page is non existent.
Fixed in 1.0.13-BETA
Original comment by d.majum...@gmail.com
on 12 Apr 2009 at 2:54
Need to refix as the solution implemented isn't correct.
Original comment by d.majum...@gmail.com
on 13 Apr 2009 at 3:32
Refixed in 1.0.14.
Just for the record, the use case is when there is an indirect child which is a
leaf
page and isn't the last leaf page of the tree. Also, the high key of the leaf
page is
greater than all the keys in the page - maybe because some keys have been
deleted. In
this situation, if a fetch tries to look for one of the deleted keys, the
correct
action is to move to the right sibling of the indirect child that would have
contained the key, and position the cursor on the first key of the right
sibling. We
therefore have a use case where the search can actually move across three leaf
pages
- the left direct child, the indirect child, and finally the right sibling of
the
indirect child.
See the test data
[http://simpledbm.googlecode.com/svn/trunk/simpledbm-rss/code/simpledbm-rss/src/
test/resources/org/simpledbm/rss/impl/im/btree/issue71.xml
issue71.xml] for a sample tree that demonstrates this use case. A search for
'b4' and
'24' should result in the cursor being positioned on 'c1' and '31'.
Original comment by d.majum...@gmail.com
on 13 Apr 2009 at 4:21
Original issue reported on code.google.com by
d.majum...@gmail.com
on 11 Apr 2009 at 11:41