Skip to content

Commit

Permalink
[misc] correct batch for mysql server
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Aug 2, 2023
1 parent e05fc3d commit 7ddcd9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/mariadb/jdbc/ClientPreparedStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ private boolean executeInternalPreparedBatch() throws SQLException {
checkNotClosed();
checkIfInsertCommand();
Configuration conf = con.getContext().getConf();
if (((isCommandInsert && (conf.useBulkStmts() || conf.useBulkStmtsForInserts()))
if (con.getContext().hasServerCapability(STMT_BULK_OPERATIONS)
&& ((isCommandInsert && (conf.useBulkStmts() || conf.useBulkStmtsForInserts()))
|| (!isCommandInsert && conf.useBulkStmts()))
&& batchParameters.size() > 1
&& autoGeneratedKeys != Statement.RETURN_GENERATED_KEYS) {
Expand Down
1 change: 0 additions & 1 deletion src/test/java/org/mariadb/jdbc/integration/BatchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ public void largeBatch() throws SQLException {
useCompression,
useBulkStmtsForInserts);
try (Connection con = createCon(confString)) {
System.out.println("########################################" + confString);
largeBatch(con);
}
}
Expand Down

0 comments on commit 7ddcd9e

Please sign in to comment.