You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on #935, I have just found a bug in batch execution, the driver silently accept SELECT statements in executeBatch(), but the specification clearly reads:
The method executeBatch throws a BatchUpdateException if any of the commands in
the batch fail to execute properly or if a command attempts to return a result set.
Throws BatchUpdateException (a subclass of SQLException) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
You should not add a query (a SELECT statement) to a batch of SQL commands because the method executeBatch, which returns an array of update counts, expects an update count from each SQL statement that executes successfully. This means that only commands that return an update count (commands such as INSERT INTO, UPDATE, DELETE) or that return 0 (such as CREATE TABLE, DROP TABLE, ALTER TABLE) can be successfully executed as a batch with the executeBatch method.
The bug was introduced in #503, while it should not be a big deal, the specification is very clear about this, and must be corrected.
The text was updated successfully, but these errors were encountered:
Working on #935, I have just found a bug in batch execution, the driver silently accept SELECT statements in
executeBatch()
, but the specification clearly reads:The JavaDoc for executeBatch:
And the Java Tutorials:
The bug was introduced in #503, while it should not be a big deal, the specification is very clear about this, and must be corrected.
The text was updated successfully, but these errors were encountered: