Re: patch: fix exceptions from ResultSet.getArray()

From: Barry Lind <blind(at)xythos(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: patch: fix exceptions from ResultSet.getArray()
Date: 2003-08-11 21:34:09
Message-ID: 3F380BD1.6000808@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-08-11 23:42:58 Re: patch: clean up ant test infrastructure
Previous Message Barry Lind 2003-08-11 21:28:10 Re: patch: avoid ant warnings about never-empty jarfiles