[Fix](planner)fix delete stmt contains where but delete all data. (#22563)
This commit is contained in:
@ -125,6 +125,7 @@ public class DeleteStmt extends DdlStmt {
|
||||
if (!(((OlapTable) targetTable).getKeysType() == KeysType.UNIQUE_KEYS)) {
|
||||
throw new AnalysisException(e.getMessage(), e.getCause());
|
||||
}
|
||||
wherePredicate.reset();
|
||||
constructInsertStmt();
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -112,7 +112,7 @@ public class DeleteCommand extends Command implements ForwardWithSync, Explainab
|
||||
logicalQuery = new LogicalProject<>(selectLists, logicalQuery);
|
||||
|
||||
boolean isPartialUpdate = false;
|
||||
if (((OlapTable) targetTable).getEnableUniqueKeyMergeOnWrite()
|
||||
if (targetTable.getEnableUniqueKeyMergeOnWrite()
|
||||
&& cols.size() < targetTable.getColumns().size()) {
|
||||
isPartialUpdate = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user