pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Mike Fowler <mike@mlfowler.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Buildfarm: Test errors - StackOverFlowError
Date: Mon, 03 Oct 2011 22:31:30 +0100
Message-ID: <4E8A29B2.5030901@mlfowler.com> (raw )
In-Reply-To: <0f62add96a8e4382846be9ade823d7f9.squirrel@www.mlfowler.com >
References: <0f62add96a8e4382846be9ade823d7f9.squirrel@www.mlfowler.com >
On 03/10/11 16:01, I wrote:
>
> [junit] java.lang.StackOverflowError
> [junit] at
> org.postgresql.jdbc2.TypeInfoCache.getPGType(TypeInfoCache.java:270)
> [junit] at
> org.postgresql.jdbc2.TypeInfoCache.getSQLType(TypeInfoCache.java:176)
> [junit] at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getSQLType(AbstractJdbc2ResultSet.java:2776)
> [junit] at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1920)
> [junit] at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getFixedString(AbstractJdbc2ResultSet.java:2736)
> [junit] at
> org.postgresql.jdbc3g.Jdbc3gResultSet.createArray(Jdbc3gResultSet.java:59)
> [junit] at
The tests run for 1.6 but not 1.5 or 1.4. Turns out some code has been
added for the binary handling in Jdbc4Array and Jdbc4ResultSet that also
needed to be added to Jdbc3Array, Jdbc3ResultSet, Jdbc3gArray and
Jdbc3gReultSet. If you take out the different code in the 4 code you get
the same StackOverflowError. The attached patch resolves this.
Regards,
--
Mike Fowler
Registered Linux user: 379787
The Call for Papers for is open for FLOSS UK, contact postgresql2012 AT
flossuk DOT org for details.
Attachments:
stackOverflowError.patch (text/x-diff, 4.4K) download
Index: org/postgresql/jdbc3/Jdbc3Array.java
===================================================================
RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc3/Jdbc3Array.java,v
retrieving revision 1.7
diff -c -r1.7 Jdbc3Array.java
*** org/postgresql/jdbc3/Jdbc3Array.java 2 Aug 2011 13:49:01 -0000 1.7
--- org/postgresql/jdbc3/Jdbc3Array.java 3 Oct 2011 21:25:50 -0000
***************
*** 21,26 ****
--- 21,31 ----
super(conn, oid, fieldString);
}
+ public Jdbc3Array(BaseConnection conn, int oid, byte[] fieldBytes) throws SQLException
+ {
+ super(conn, oid, fieldBytes);
+ }
+
public Object getArray(Map map) throws SQLException
{
return getArrayImpl(map);
Index: org/postgresql/jdbc3/Jdbc3ResultSet.java
===================================================================
RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java,v
retrieving revision 1.18
diff -c -r1.18 Jdbc3ResultSet.java
*** org/postgresql/jdbc3/Jdbc3ResultSet.java 2 Aug 2011 13:49:01 -0000 1.18
--- org/postgresql/jdbc3/Jdbc3ResultSet.java 3 Oct 2011 21:25:50 -0000
***************
*** 1,9 ****
/*-------------------------------------------------------------------------
*
! * Copyright (c) 2004-2011, PostgreSQL Global Development Group
*
* IDENTIFICATION
! * $PostgreSQL: pgjdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java,v 1.18 2011/08/02 13:49:01 davecramer Exp $
*
*-------------------------------------------------------------------------
*/
--- 1,9 ----
/*-------------------------------------------------------------------------
*
! * Copyright (c) 2004-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
! * $PostgreSQL: pgjdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java,v 1.17 2008/01/08 06:56:29 jurka Exp $
*
*-------------------------------------------------------------------------
*/
***************
*** 56,61 ****
--- 56,64 ----
{
checkResultSet(i);
int oid = fields[i - 1].getOID();
+ if (isBinary(i)) {
+ return new Jdbc3Array(connection, oid, this_row[i - 1]);
+ }
String value = getFixedString(i);
return new Jdbc3Array(connection, oid, value);
}
Index: org/postgresql/jdbc3g/Jdbc3gArray.java
===================================================================
RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc3g/Jdbc3gArray.java,v
retrieving revision 1.7
diff -c -r1.7 Jdbc3gArray.java
*** org/postgresql/jdbc3g/Jdbc3gArray.java 2 Aug 2011 13:50:28 -0000 1.7
--- org/postgresql/jdbc3g/Jdbc3gArray.java 3 Oct 2011 21:25:50 -0000
***************
*** 21,26 ****
--- 21,31 ----
super(conn, oid, fieldString);
}
+ public Jdbc3gArray(BaseConnection conn, int oid, byte[] fieldBytes) throws SQLException
+ {
+ super(conn, oid, fieldBytes);
+ }
+
public Object getArray(Map < String, Class < ? >> map) throws SQLException
{
return getArrayImpl(map);
Index: org/postgresql/jdbc3g/Jdbc3gResultSet.java
===================================================================
RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc3g/Jdbc3gResultSet.java,v
retrieving revision 1.11
diff -c -r1.11 Jdbc3gResultSet.java
*** org/postgresql/jdbc3g/Jdbc3gResultSet.java 2 Aug 2011 13:50:28 -0000 1.11
--- org/postgresql/jdbc3g/Jdbc3gResultSet.java 3 Oct 2011 21:25:50 -0000
***************
*** 1,9 ****
/*-------------------------------------------------------------------------
*
! * Copyright (c) 2004-2011, PostgreSQL Global Development Group
*
* IDENTIFICATION
! * $PostgreSQL: pgjdbc/org/postgresql/jdbc3g/Jdbc3gResultSet.java,v 1.11 2011/08/02 13:50:28 davecramer Exp $
*
*-------------------------------------------------------------------------
*/
--- 1,9 ----
/*-------------------------------------------------------------------------
*
! * Copyright (c) 2004-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
! * $PostgreSQL: pgjdbc/org/postgresql/jdbc3g/Jdbc3gResultSet.java,v 1.10 2008/09/30 04:34:51 jurka Exp $
*
*-------------------------------------------------------------------------
*/
***************
*** 56,61 ****
--- 56,64 ----
{
checkResultSet(i);
int oid = fields[i - 1].getOID();
+ if (isBinary(i)) {
+ return new Jdbc3gArray(connection, oid, this_row[i - 1]);
+ }
String value = getFixedString(i);
return new Jdbc3gArray(connection, oid, value);
}
view thread (2+ messages)
Message-ID: <4E8A29B2.5030901@mlfowler.com>
Permalink: ../4E8A29B2.5030901@mlfowler.com/
Also on: postgresql.org/message-id/4E8A29B2.5030901@mlfowler.com
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: mike@mlfowler.com
Subject: Re: Buildfarm: Test errors - StackOverFlowError
In-Reply-To: <4E8A29B2.5030901@mlfowler.com>
References: <0f62add96a8e4382846be9ade823d7f9.squirrel@www.mlfowler.com> <4E8A29B2.5030901@mlfowler.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox