Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.1.8
-
None
-
Windows 7 64bit, connecting to a MySQL 5.5.25 server
Description
When "rewriteBatchedStatements=true" is used and executeBatch() is called twice with no addBatch() calls between them, there is a bug in the rewrittenBatch() method in class MySQLPreparedStatement.
At the end of the first call to executeBatch(), the clearBatch() method is called which sets
"firstRewrite = null; isRewriteable = true;"
On the second call to executeBatch(), the conditional statement in rewrittenBatch() only checks if "isRewriteable" is true, which is true from the call to clearBatch(). However, if no addBatch calls were made, firstRewrite is null, and the line "result.append(firstRewrite);", results in "result" being set to the string "null". The last character is eventually removed, so the method rewrittenBatch() returns the string "nul". An exception is eventually thrown when the query "nul" is executed.