Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
3.4.0, 3.4.1, 3.5.0
-
None
Description
Batched INSERT ... ON DUPLICATE KEY UPDATE statements are no longer execute with `executeBatchBulk`:
String insertQuery = """ |
INSERT INTO
|
test.table
|
(id, text)
|
VALUES
|
(?, ?)
|
ON DUPLICATE KEY UPDATE
|
text = VALUES(text)
|
"""; |
|
PreparedStatement stmt = conn.prepareStatement(insertQuery);
|
|
for (int i = 0; i < 20; i++) { |
stmt.setInteger(1, i); |
stmt.setString(2, "text"); |
stmt.addBatch();
|
}
|
|
stmt.executeBatch();
|
With version 3.3.3, this sample statement was executed with `executeBatchBulk`. Since 3.4.0, `executeBatchBulk` will not be used for INSERT ... ON DUPLICATE KEY UPDATE anymore:
...
|
boolean isNormalInsert = clientParser.isInsert() && !clientParser.isInsertDuplicate(); |
|
if (con.getContext().hasServerCapability(STMT_BULK_OPERATIONS) |
&& ((isNormalInsert && (conf.useBulkStmts() || conf.useBulkStmtsForInserts()))
|
|| (!clientParser.isInsert() && conf.useBulkStmts()))
|
...
|
Is there a parameter I haven't found yet to execute these kinds of statements as bulk?
Attachments
Issue Links
- is caused by
-
CONJ-1173 Bulk implementation returning individual results
- Closed