[fix](planner) Fix delete statement on MOR unique table (#28968)

add conditions for mor table removed in #26776
This commit is contained in:
bobhan1
2023-12-27 12:59:15 +08:00
committed by GitHub
parent e33395a0ee
commit 51bd402b58
4 changed files with 159 additions and 2 deletions

View File

@ -157,7 +157,7 @@ public class DeleteStmt extends DdlStmt {
expr = new BoolLiteral(true);
} else if (column.isKey()) {
expr = new SlotRef(targetTableRef.getAliasAsName(), column.getName());
} else if (!isMow && !column.isVisible()) {
} else if (!isMow && (!column.isVisible() || (!column.isAllowNull() && !column.hasDefaultValue()))) {
expr = new SlotRef(targetTableRef.getAliasAsName(), column.getName());
} else {
continue;

View File

@ -96,7 +96,7 @@ public class DeleteFromUsingCommand extends Command implements ForwardWithSync,
selectLists.add(new UnboundSlot(tableName, targetTable.getSequenceMapCol()));
} else if (column.isKey()) {
selectLists.add(new UnboundSlot(tableName, column.getName()));
} else if (!isMow && !column.isVisible()) {
} else if (!isMow && (!column.isVisible() || (!column.isAllowNull() && !column.hasDefaultValue()))) {
selectLists.add(new UnboundSlot(tableName, column.getName()));
} else {
continue;