Bug #41161 PreparedStatement.addBatch() does not check for all parameters being set
Submitted: 1 Dec 2008 21:33 Modified: 9 Dec 2008 14:35
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:All OS:Any
Assigned to: Mark Matthews CPU Architecture:Any

[1 Dec 2008 21:33] Mark Matthews
Description:
PreparedStatement.addBatch() does not check for all parameters being set, which leads to inconsistent behavior in executeBatch(), especially when rewriting batched statements into multi-value INSERTs.

How to repeat:
Create a prepared statement, don't set all of the parameters, call addBatch() and attempt to execute it on a connection that has been configured to rewrite batched statements....NPE ensues.
[1 Dec 2008 21:55] Mark Matthews
Fixed for 5.1.8.
[9 Dec 2008 14:35] Tony Bedford
An entry was added to the 5.1.8 changelog:

PreparedStatement.addBatch() did not check for all parameters being set, which led to inconsistent behavior in executeBatch(), especially when rewriting batched statements into multi-value INSERTs.