提交 55a5e522 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix MergeUsing.isTargetRowFound() error handling for lazy results

上级 e1f63550
...@@ -261,9 +261,16 @@ public class MergeUsing extends Prepared { ...@@ -261,9 +261,16 @@ public class MergeUsing extends Prepared {
// and should not be repeated // and should not be repeated
targetRowidsRemembered.put(targetRowId, sourceQueryRowNumber); targetRowidsRemembered.put(targetRowId, sourceQueryRowNumber);
if (rows.next()) { if (rows.next()) {
int rowCount;
if (rows.isLazy()) {
for (rowCount = 2; rows.next(); rowCount++) {
}
} else {
rowCount = rows.getRowCount();
}
throw DbException.get(ErrorCode.DUPLICATE_KEY_1, throw DbException.get(ErrorCode.DUPLICATE_KEY_1,
"Duplicate key updated " "Duplicate key updated "
+ rows.getRowCount() + rowCount
+ " rows at once, only 1 expected:_ROWID_=" + " rows at once, only 1 expected:_ROWID_="
+ targetRowId + ":in:" + targetRowId + ":in:"
+ targetTableFilter.getTable() + targetTableFilter.getTable()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论