Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.3.0
-
None
Description
@Test
|
public void test() throws SQLException { |
Connection con = null; |
Statement stmt = null; |
ResultSet rs = null; |
con = DriverManager.getConnection("jdbc:mariadb://localhost:3366/test69?user=user&password=password"); |
stmt = con.createStatement(1004, 1008, 2); |
stmt.addBatch("DROP TABLE IF EXISTS table0_0;"); |
stmt.addBatch("CREATE TABLE table0_0(id INT AUTO_INCREMENT PRIMARY KEY,value INT);"); |
stmt.addBatch("INSERT INTO table0_0 VALUES(1, -179653912)"); |
stmt.addBatch("INSERT INTO table0_0 VALUES(2, 1207965915)"); |
stmt.executeBatch();
|
stmt.executeUpdate("INSERT INTO table0_0 (value) VALUES(667711856)", Statement.RETURN_GENERATED_KEYS); |
rs = stmt.getGeneratedKeys();
|
System.out.println(stmt.getResultSetType()); // 1004 |
System.out.println(rs.getType()); // 1003 |
}
|
When a Statement is created with a specific ResultSet type 1004, the expectation is that any ResultSet derived from this Statement should have the same type. However, in the provided test case, the ResultSet obtained from getGeneratedKeys() reports a type of ResultSet.TYPE_FORWARD_ONLY (1003), which is inconsistent with the type specified when creating the Statement.