提交 2930bbae 编写于 作者: S serge-rider

Batch processing statistics fix

上级 10de76bc
......@@ -213,6 +213,15 @@ public abstract class ExecuteBatchImpl implements DBSDataManipulator.ExecuteBatc
statistics.addExecuteTime(System.currentTimeMillis() - startTime);
if (!ArrayUtils.isEmpty(updatedRows)) {
for (int rows : updatedRows) {
if (rows < 0) {
// In some cases (e.g. JDBC API) negative means "unknown".
// "Statement.SUCCESS_NO_INFO — the command was processed successfully, but the number of rows affected is unknown"
// But we are quite sure that it has to be 1 (because each statement inserts/deletes/updates a single row)
// The only exception is bulk delete (without WHERE condition)
if (!ArrayUtils.isEmpty(attributes)) {
rows = 1;
}
}
statistics.addRowsUpdated(rows);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册