[fix](partial update) Fix NPE when the query statement of an update statement is a point query in OriginPlanner (#26881)

close #26882
We should not use the singleNodePlan to generate the rootPlanFragment if the query is inside a insert statement or distributedPlanner will be null.
introduced in #15491
This commit is contained in:
bobhan1
2023-11-13 22:08:06 +08:00
committed by GitHub
parent 9bb46f4c0f
commit 2853efd4ee
3 changed files with 47 additions and 1 deletions

View File

@ -211,7 +211,7 @@ public class OriginalPlanner extends Planner {
}
checkAndSetTopnOpt(singleNodePlan);
if (queryOptions.num_nodes == 1 || queryStmt.isPointQuery()) {
if ((queryOptions.num_nodes == 1 || queryStmt.isPointQuery()) && !(statement instanceof InsertStmt)) {
// single-node execution; we're almost done
singleNodePlan = addUnassignedConjuncts(analyzer, singleNodePlan);
fragments.add(new PlanFragment(plannerContext.getNextFragmentId(), singleNodePlan,