Index: pgjdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java =================================================================== --- pgjdbc.orig/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java +++ pgjdbc/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/org/postgresql/test/jdbc2/StatementTest.java =================================================================== --- pgjdbc.orig/org/postgresql/test/jdbc2/StatementTest.java +++ pgjdbc/org/postgresql/test/jdbc2/StatementTest.java @@ -502,4 +502,15 @@ public class StatementTest extends TestC timer.cancel(); } } + + 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); + } }