Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.4
-
None
Description
The following test fails (same for prepared statements):
@Test |
public void executeGeneratedMulti() throws SQLException { |
Statement stmt = sharedConn.createStatement();
|
assertFalse(
|
stmt.execute(
|
"INSERT INTO executeGenerated(t2) values (100), (200)", Statement.RETURN_GENERATED_KEYS)); |
ResultSet rs = stmt.getGeneratedKeys();
|
assertTrue(rs.next());
|
assertEquals(1, rs.getInt(1)); |
assertTrue(rs.next());
|
assertEquals(2, rs.getInt(1)); |
assertFalse(rs.next());
|
}
|
I would expect it to succeed.
As in CONJ-735, CONJ-706 it seems that returning generated keys for multiple values is implemented in the driver as the database server only reports on the first inserted id. So one could argue that the behavior is ok, then I think it would be great to have this documented.
Attachments
Issue Links
- relates to
-
CONJ-735 Multi insert should return multi generated keys when using MyBatis
- Closed