Description:
StatementsTest.testBatchRewriteErrors inserts several batches of values into a table with a primary key. First 4096 values are unique, but the last one in the last batch is not.
The test expects all unique values to be inserted, including those in the last batch preceding the duplicate key.
It does not work this way for InnoDB -- being a transactional engine, it rolls back the entire statement upon an error. It causes row count assertion failure.
expected:<4096> but was:<4059>
junit.framework.AssertionFailedError: expected:<4096> but was:<4059>
at testsuite.simple.StatementsTest.testBatchRewriteErrors(StatementsTest.java:1620)
The test fails with server 5.5 on all platforms because it has default storage engine InnoDB, and with 5.1 in release tests on Windows because the Windows installer sets InnoDB as a default engine if not asked otherwise.
How to repeat:
Run simple.StatementsTest.testBatchRewriteErrors test with default engine InnoDB on the server, or inspect the code.
Suggested fix:
Provide explicit ENGINE value in the table definition, or check which engine is default and set up the assertion dynamically.