summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/test
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2002-11-20 07:34:32 +0000
committerBarry Lind <barry@xythos.com>2002-11-20 07:34:32 +0000
commit54bc3b6b8be32e246a40af44583b22072cee8cde (patch)
tree0de16a17667fe2b3d41dba2dea0ff74d964c5d51 /src/interfaces/jdbc/org/postgresql/test
parentb60be3f2f8d094da79e04c6eda888f401b09dc39 (diff)
Fixed bug reported by Marko Strukelj and Keith Wannamaker. Using executeBatch
on a preparedStatement would reset the prepared statment causing subsequent uses of the preparedStatement to fail (i.e. the following series of calls would fail: addBatch() executeBatch() addBatch() executBatch()). This is a regression from 7.2 where this worked correctly. The regression test has also been modified to explicitly test for this case. Modified Files: jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/test')
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java
index 1c2569296be..e7f27ed575e 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java
@@ -157,11 +157,19 @@ public class BatchExecuteTest extends TestCase
pstmt.executeBatch();
assertCol1HasValue(7);
- con.commit();
+ //now test to see that we can still use the statement after the execute
+ pstmt.setInt(1, 3);
+ pstmt.addBatch();
assertCol1HasValue(7);
+ pstmt.executeBatch();
+ assertCol1HasValue(10);
+
+ con.commit();
+ assertCol1HasValue(10);
+
con.rollback();
- assertCol1HasValue(7);
+ assertCol1HasValue(10);
pstmt.close();
}