Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 961eb57

Browse files
author
Peter Mount
committed
Fixed minor bug in ResultSet for jdbc2 reported by Matthew Denner that absolute doesnt handle negative row numbers correctly.
1 parent 6d7f1d3 commit 961eb57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,14 +839,14 @@ public boolean absolute(int index) throws SQLException
839839

840840
//if index<0, count from the end of the result set, but check
841841
//to be sure that it is not beyond the first index
842-
if (index<0)
842+
if (index<0) {
843843
if (index>=-rows.size())
844844
internalIndex=rows.size()+index;
845845
else {
846846
beforeFirst();
847847
return false;
848848
}
849-
849+
} else {
850850
//must be the case that index>0,
851851
//find the correct place, assuming that
852852
//the index is not too large
@@ -856,6 +856,7 @@ public boolean absolute(int index) throws SQLException
856856
afterLast();
857857
return false;
858858
}
859+
}
859860

860861
current_row=internalIndex;
861862
this_row = (byte [][])rows.elementAt(internalIndex);

0 commit comments

Comments
 (0)