Re: patch: fix exceptions from ResultSet.getArray() - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: patch: fix exceptions from ResultSet.getArray()
Date
Msg-id 3F380BD1.6000808@xythos.com
Whole thread Raw
In response to patch: fix exceptions from ResultSet.getArray()  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Patch applied.

thanks,
--Barry


Oliver Jowett wrote:
> This patch adds a call to checkResultSet() that was missing from
> AbstractJdbc2ResultSet.getArray(), resulting in NPEs or
> ArrayIndexOutOfBounds on a bad use of getArray().
>
> -O
>
>
> ------------------------------------------------------------------------
>
> Index: src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v
> retrieving revision 1.20
> diff -u -c -r1.20 AbstractJdbc2ResultSet.java
> *** src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java    30 Jun 2003 16:38:30 -0000    1.20
> --- src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java    20 Jul 2003 13:04:18 -0000
> ***************
> *** 253,258 ****
> --- 253,260 ----
>
>       public java.sql.Array getArray(int i) throws SQLException
>       {
> +         checkResultSet( i );
> +
>           wasNullFlag = (this_row[i - 1] == null);
>           if (wasNullFlag)
>               return null;
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly



pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: patch: avoid ant warnings about never-empty jarfiles
Next
From: Barry Lind
Date:
Subject: Re: patch: clean up ant test infrastructure