1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

When positioned before the start of a ResultSet issuing relative(0)

results in an exception being thrown when it really should be a
no-op.
This commit is contained in:
Kris Jurka
2005-04-18 18:25:11 +00:00
parent 2a35291952
commit e1d55f7917

View File

@ -9,7 +9,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25.2.9 2004/09/13 07:14:26 jurka Exp $
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25.2.10 2005/04/18 18:25:11 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@ -176,8 +176,10 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
// index is 1-based, but internally we use 0-based indices
int internalIndex;
if (index == 0)
throw new SQLException("Cannot move to index of 0");
if (index == 0) {
beforeFirst();
return false;
}
final int rows_size = rows.size();