mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user