X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8FCC3D6F13 for ; Tue, 25 Oct 2005 05:18:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40675-01 for ; Tue, 25 Oct 2005 08:18:12 +0000 (GMT) Received: from webmail4.sea5.speakeasy.net (webmail4.speakeasy.net [69.17.117.51]) by svr1.postgresql.org (Postfix) with ESMTP id 0821ADACBC for ; Tue, 25 Oct 2005 05:18:11 -0300 (ADT) Received: (qmail 19362 invoked from network); 25 Oct 2005 08:18:13 -0000 Received: from localhost (HELO webmail4) ([127.0.0.1]) (envelope-sender ) by localhost (qmail-ldap-1.03) with SMTP for ; 25 Oct 2005 08:18:13 -0000 Received: from 64.81.50.168 (unverified [64.81.50.168]) by webmail4 (VisualMail 4.0) with WEBMAIL id 28598; Tue, 25 Oct 2005 08:18:13 +0000 From: kgeis@speakeasy.net To: pgsql-jdbc@postgresql.org Importance: Normal Sensitivity: Normal Message-ID: X-Mailer: Mintersoft VisualMail, Build 4.0.111601 X-Originating-IP: [64.81.50.168] Date: Tue, 25 Oct 2005 08:18:13 +0000 Subject: patch: ResultSetTest.java MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.855 required=5 tests=[AWL=-0.855, NO_REAL_NAME=0.178, RCVD_NUMERIC_HELO=1.531] X-Spam-Level: X-Archive-Number: 200510/120 X-Sequence-Number: 14051 Here are a couple of problems I ran across in ResultSetTest. The first section removes an assertion that is redundant and makes the (n= ot necessarily true) assumption that the field was returned by the databa= se in text format. From the Javadoc on java.sql.ResultSet.getBytes(): "T= he bytes represent the raw values returned by the driver." The second section has an unnecessarily complex query that caused me prob= lems because pg_database contains a column of type aclitem[] which does n= ot support binary transfer from the database. Ken =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/Resu= ltSetTest.java,v retrieving revision 1.25 diff -u -r1.25 ResultSetTest.java --- jdbc2/ResultSetTest.java=0911 Jan 2005 08:25:48 -0000=091.25 +++ jdbc2/ResultSetTest.java=0925 Oct 2005 08:09:13 -0000 @@ -170,14 +170,12 @@ //it should apply only to binary and char/varchar columns rs.next(); assertEquals("12345", rs.getString(1)); - assertEquals("12345", new String(rs.getBytes(1))); //max should apply to the following since the column is //a varchar column rs =3D stmt.executeQuery("select * from teststring"); rs.next(); assertEquals("12", rs.getString(1)); - assertEquals("12", new String(rs.getBytes(1))); } public void booleanTests(boolean useServerPrepare) throws SQLExcepti= on @@ -485,7 +483,7 @@ { Statement stmt =3D con.createStatement(ResultSet.TYPE_SCROLL_INS= ENSITIVE, ResultSet.CONCUR_UPDATABLE); // Create a one row result set. - ResultSet rs =3D stmt.executeQuery("SELECT * FROM pg_database WH= ERE datname=3D'template1'"); + ResultSet rs =3D stmt.executeQuery("SELECT 1"); assertTrue(rs.isBeforeFirst()); assertTrue(!rs.isAfterLast());