Bug in getFirstLargerThan in FreePhysicalRowIdPage.java
The algorithm in getFirstLargerThan(int size) (FreePhysicalRowIdPage.java) has
a bug:
If a slot was found which points to a record whose size is far greater than the
searched size (i.e. waste > wasteMargin) then the wrong information is stored
in bestSlotSize.
Line 185 should say:
bestSlotSize = theSize
and not:
bestSlotSize = size
Also the condition in 179 should be:
(bestSlotSize >= theSize)
and not:
(bestSlotSize >= size)
The current algorithm basically ignores wasteMargin2 and returns the first
record which fits regardless of the wasted space.
To make the algorithm a bit better I suggest to store the bestSlotWaste rather
than the bestSlotSize
Original issue reported on code.google.com by matth...@ladkau.de on 19 Dec 2011 at 12:47
Original issue reported on code.google.com by
matth...@ladkau.de
on 19 Dec 2011 at 12:47Attachments: