Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D253FB5DBC0 for ; Mon, 3 Oct 2011 18:31:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 90476-01 for ; Mon, 3 Oct 2011 21:31:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from milan.hostgo.com (milan.hostgo.com [72.52.99.130]) by mail.postgresql.org (Postfix) with ESMTP id 82518B5D8C5 for ; Mon, 3 Oct 2011 18:31:39 -0300 (ADT) Received: from 5ac45e3f.bb.sky.com ([90.196.94.63] helo=[192.168.0.3]) by milan.hostgo.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1RAq6o-0002Tz-1L for pgsql-jdbc@postgresql.org; Mon, 03 Oct 2011 17:31:34 -0400 Message-ID: <4E8A29B2.5030901@mlfowler.com> Date: Mon, 03 Oct 2011 22:31:30 +0100 From: Mike Fowler User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Buildfarm: Test errors - StackOverFlowError References: <0f62add96a8e4382846be9ade823d7f9.squirrel@www.mlfowler.com> In-Reply-To: <0f62add96a8e4382846be9ade823d7f9.squirrel@www.mlfowler.com> Content-Type: multipart/mixed; boundary="------------040307030504010301080406" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - milan.hostgo.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mlfowler.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.89 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_FILL_THIS_FORM_SHORT=0.01 X-Spam-Level: X-Archive-Number: 201110/18 X-Sequence-Number: 22271 This is a multi-part message in MIME format. --------------040307030504010301080406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------040307030504010301080406 Content-Type: text/x-diff; name="stackOverflowError.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stackOverflowError.patch" 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); } --------------040307030504010301080406--