diff options
Diffstat (limited to 'src/backend/optimizer/plan/createplan.c')
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 4186e20d564..165a9e9b8e7 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -579,10 +579,10 @@ create_scan_plan(PlannerInfo *root, Path *best_path, int flags) tlist = copyObject(((IndexPath *) best_path)->indexinfo->indextlist); /* - * Transfer any sortgroupref data to the replacement tlist, unless - * we don't care because the gating Result will handle it. + * Transfer sortgroupref data to the replacement tlist, if + * requested (use_physical_tlist checked that this will work). */ - if (!gating_clauses) + if (flags & CP_LABEL_TLIST) apply_pathtarget_labeling_to_tlist(tlist, best_path->pathtarget); } else @@ -596,7 +596,7 @@ create_scan_plan(PlannerInfo *root, Path *best_path, int flags) else { /* As above, transfer sortgroupref data to replacement tlist */ - if (!gating_clauses) + if (flags & CP_LABEL_TLIST) apply_pathtarget_labeling_to_tlist(tlist, best_path->pathtarget); } } @@ -1639,7 +1639,7 @@ create_projection_plan(PlannerInfo *root, ProjectionPath *best_path, int flags) */ subplan = create_plan_recurse(root, best_path->subpath, 0); tlist = subplan->targetlist; - if ((flags & CP_LABEL_TLIST) != 0) + if (flags & CP_LABEL_TLIST) apply_pathtarget_labeling_to_tlist(tlist, best_path->path.pathtarget); } |