|
According to JDBC specifications, setting a fetch size with a negative value on a ResultSet should result in an SQLException.
However, in the provided test case, when the fetch size is set to -2 on a ResultSet, the connector accepts this value without throwing any exception, which is contrary to the expected behavior.
@Test
|
public void test5() throws SQLException {
|
Connection con = null;
|
Statement stmt = null;
|
ResultSet rs = null;
|
con = DriverManager.getConnection("jdbc:mariadb://localhost:3366/test968?user=user&password=password");
|
stmt = con.createStatement();
|
stmt.execute("CREATE TABLE t0(id INT PRIMARY KEY AUTO_INCREMENT,value FLOAT);");
|
stmt = con.createStatement();
|
stmt.addBatch("INSERT INTO t0 (value) VALUES(0.05)");
|
stmt.addBatch("DELETE FROM t0 WHERE id <= 2");
|
stmt.addBatch("INSERT INTO t0 (value) VALUES(0.03)");
|
stmt.executeBatch();
|
rs = stmt.getGeneratedKeys();
|
rs.setFetchSize(-2); // not throw error
|
}
|
|