Re: Bug in ResultSet.moveToCurrentRow

From: Barry Lind <blind(at)xythos(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Darin Ohashi <DOhashi(at)maplesoft(dot)com>, "'pgsql-jdbc(at)postgresql(dot)org'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug in ResultSet.moveToCurrentRow
Date: 2003-06-30 16:41:38
Message-ID: 3F006842.5020504@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Patch applied.

thanks,
--Barry

Kris Jurka wrote:
>
> On Tue, 17 Jun 2003, Darin Ohashi wrote:
>
>
>>I believe there is a bug in ResultSet.moveToCurrentRow with pgsql 7.3.3 and
>>pgsql-jdbc 7.3.3 build 110. If the current row of the result set is the
>>beforeFirst() row, call moveToInsertRow() and then moveToCurrentRow(). The
>>moveToCurrentRow throws an ArrayIndexOutOfBoundsException.
>>
>
>
> This patch against cvs fixes the problem. Thanks for the report and
> complete example.
>
> Kris Jurka
>
>
> ------------------------------------------------------------------------
>
> 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.19
> diff -c -r1.19 AbstractJdbc2ResultSet.java
> *** src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java 3 May 2003 20:40:45 -0000 1.19
> --- src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java 29 Jun 2003 07:09:07 -0000
> ***************
> *** 687,696 ****
> throw new PSQLException( "postgresql.updateable.notupdateable" );
> }
>
> ! this_row = (byte[][]) rows.elementAt(current_row);
>
> ! rowBuffer = new byte[this_row.length][];
> ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
>
> onInsertRow = false;
> doingUpdates = false;
> --- 687,701 ----
> throw new PSQLException( "postgresql.updateable.notupdateable" );
> }
>
> ! if (current_row < 0) {
> ! this_row = null;
> ! rowBuffer = null;
> ! } else {
> ! this_row = (byte[][]) rows.elementAt(current_row);
>
> ! rowBuffer = new byte[this_row.length][];
> ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
> ! }
>
> onInsertRow = false;
> doingUpdates = false;
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-06-30 16:44:16 Re: Allow setObject(x,y,Types.BIT) if y is a Number &
Previous Message Barry Lind 2003-06-30 16:41:17 Re: [PATCHES] IPv6 patch doesn't work fine