提交 367cb540 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Forbid additional index conditions in MERGE USING

上级 7e2ec608
......@@ -318,6 +318,7 @@ public class MergeUsing extends Prepared {
// Prepare each of the sub-commands ready to aid in the MERGE
// collaboration
targetTableFilter.doneWithIndexConditions();
if (updateCommand != null) {
updateCommand.setSourceTableFilter(sourceTableFilter);
updateCommand.setCondition(appendOnCondition(updateCommand));
......
......@@ -82,6 +82,11 @@ public class TableFilter implements ColumnResolver {
*/
private final ArrayList<IndexCondition> indexConditions = Utils.newSmallArrayList();
/**
* Whether new window conditions should not be accepted.
*/
private boolean doneWithIndexConditions;
/**
* Additional conditions that can't be used for index lookup, but for row
* filter for this table (ID=ID, NAME LIKE '%X%')
......@@ -627,8 +632,17 @@ public class TableFilter implements ColumnResolver {
* @param condition the index condition
*/
public void addIndexCondition(IndexCondition condition) {
if (!doneWithIndexConditions) {
indexConditions.add(condition);
}
}
/**
* Used to reject all additional index conditions.
*/
public void doneWithIndexConditions() {
this.doneWithIndexConditions = true;
}
/**
* Add a filter condition.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论