PageIterator always skips the first page
Status: Alpha
Brought to you by:
d_milne
While i was trying to create a graph with the wikipedia links, i faced a "non existing vertex" problem just after to start adding edges. After some minutes of debugging and SQL manual checking, I found out that the PageIterator class always skips the first page of the database. I fixed my local version, here is the tip:
Looking to the PageIterator.fillBuffer() method, you can see a loop like:
while(rs.next())
The problem is that before this loop, there is a rs.first() call which moves the cursor to the first result row... When the rs.next() is checked in the first while loop iteration, the cursor is moved again, skipping the first result.
To solve the problem just use do..while() instead of while()...
Bye!
In fact, everytime it calls fillBuffer the first row of the query result is skipped. So, many pages will be missed by this iterator, not just one.