Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0E090B5DC35 for ; Fri, 16 Sep 2011 10:22:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 97751-03 for ; Fri, 16 Sep 2011 13:22:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from auth-smtp.nebula.fi (auth-smtp.nebula.fi [217.30.180.105]) by mail.postgresql.org (Postfix) with ESMTP id AE5DAB5DC0F for ; Fri, 16 Sep 2011 10:22:27 -0300 (ADT) Received: from quadvadis.localdomain (gw.nitor.fi [83.145.228.24]) (authenticated bits=0) by auth-smtp.nebula.fi (8.13.4/8.13.4) with ESMTP id p8GDEUMs007825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Sep 2011 16:14:30 +0300 Message-ID: <4E734BB7.9000908@nitorcreations.com> Date: Fri, 16 Sep 2011 16:14:31 +0300 From: Mikko Tiihonen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Binary transfer support [5/7] - more tests Content-Type: multipart/mixed; boundary="------------090908010407010604060307" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/40 X-Sequence-Number: 22158 This is a multi-part message in MIME format. --------------090908010407010604060307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit --------------090908010407010604060307 Content-Type: text/plain; name="more-tests.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="more-tests.patch" Index: pgjdbc.tmp3/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java =================================================================== --- pgjdbc.tmp3.orig/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java +++ pgjdbc.tmp3/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java @@ -53,6 +53,19 @@ public class ServerPreparedStmtTest exte TestUtil.closeDB(con); } + public void testEmptyResults() throws Exception + { + PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = ?"); + ((PGStatement)pstmt).setUseServerPrepare(true); + for (int i=0; i<10; ++i) { + pstmt.setInt(1, -1); + ResultSet rs = pstmt.executeQuery(); + assertFalse(rs.next()); + rs.close(); + } + pstmt.close(); + } + public void testPreparedExecuteCount() throws Exception { PreparedStatement pstmt = con.prepareStatement("UPDATE testsps SET id = id + 44"); Index: pgjdbc.tmp3/org/postgresql/test/jdbc2/StatementTest.java =================================================================== --- pgjdbc.tmp3.orig/org/postgresql/test/jdbc2/StatementTest.java +++ pgjdbc.tmp3/org/postgresql/test/jdbc2/StatementTest.java @@ -478,4 +478,14 @@ public class StatementTest extends TestC } catch (SQLException sqle) { } } + public void testResultSetTwice() throws SQLException + { + Statement stmt = con.createStatement(); + + ResultSet rs = stmt.executeQuery("select {fn abs(-2.3)} as abs "); + assertNotNull(rs); + + ResultSet rsOther = stmt.getResultSet(); + assertNotNull(rsOther); + } } --------------090908010407010604060307--