No need to other informations, i found the issue.
Gerrit use https://gerrit.googlesource.com/gwtorm internally.
When executing batch, gerrit verify if update result is has expected : https://gerrit.googlesource.com/gwtorm/+/a89d98dbcc1ac117ef0f6fb4c2a3ec875d325b1b/src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java#456
update results is set by https://gerrit.googlesource.com/gwtorm/+/a89d98dbcc1ac117ef0f6fb4c2a3ec875d325b1b/src/main/java/com/google/gwtorm/schema/sql/SqlDialect.java#435
Has JDBC executeBatch required, the int[] result can contain :
- A number greater than or equal to zero – indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
- A value of SUCCESS_NO_INFO – indicates that the command was processed successfully but that the number of rows affected is unknown
- A value of EXECUTE_FAILED – indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails
in 2.1.0 version, driver will use a new protocol with server bulk protocol for batch insert when possible. (batch without Statement.RETURN_GENERATED_KEYS and streams) to have much faster batch when server MariaDB >= 10.2.7. According to environment, this can be 10 times faster.
When used, all inserts / updates are handled by bulk, driver then doesn't know individual row change, and return array of SUCCESS_NO_INFO ( =-2).
Hibernate do that sort of check too : https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/jdbc/Expectations.java#L58 but check -2 (SUCCESS_NO_INFO) and -3 (EXECUTE_FAILED) values.
This new "bulk" functionality can be disabled setting option "useBulkStmts" to false.
And issue has to be created on gerrit/gwtorm
Can you provide some additional informations :