Index: src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java =================================================================== RCS file: /projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java,v retrieving revision 1.41 diff -c -r1.41 ResultSet.java *** src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java 2001/11/12 19:59:46 1.41 --- src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java 2001/11/13 21:22:01 *************** *** 836,841 **** --- 836,842 ---- //if index<0, count from the end of the result set, but check //to be sure that it is not beyond the first index if (index < 0) + { if (index >= -rows_size) internalIndex = rows_size + index; else *************** *** 843,858 **** beforeFirst(); return false; } ! ! //must be the case that index>0, ! //find the correct place, assuming that ! //the index is not too large ! if (index <= rows_size) ! internalIndex = index - 1; else { ! afterLast(); ! return false; } current_row = internalIndex; --- 844,862 ---- beforeFirst(); return false; } ! } else { ! //must be the case that index>0, ! //find the correct place, assuming that ! //the index is not too large ! if (index <= rows_size) ! internalIndex = index - 1; ! else ! { ! afterLast(); ! return false; ! } } current_row = internalIndex; *************** *** 1074,1079 **** --- 1078,1088 ---- public int getRow() throws SQLException { + final int rows_size = rows.size(); + + if (current_row < 0 || current_row >= rows_size) + return 0; + return current_row + 1; } Index: src/interfaces/jdbc/org/postgresql/test/JDBC2Tests.java =================================================================== RCS file: /projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/test/JDBC2Tests.java,v retrieving revision 1.8 diff -c -r1.8 JDBC2Tests.java *** src/interfaces/jdbc/org/postgresql/test/JDBC2Tests.java 2001/10/25 05:59:59 1.8 --- src/interfaces/jdbc/org/postgresql/test/JDBC2Tests.java 2001/11/13 21:22:01 *************** *** 205,210 **** --- 205,211 ---- // Connectivity/Protocols // ResultSet + suite.addTestSuite(ResultSetTest.class); // Time, Date, Timestamp suite.addTestSuite(DateTest.class);