Skip to content

Commit 04ae11f

Browse files
committed
Remove bogus code to apply PathTargets to partial paths.
The partial paths that get modified may already have been used as part of a GatherPath which appears in the path list, so modifying them is not a good idea at this stage - especially because this code has no check that the PathTarget is in fact parallel-safe. When partial aggregation is being performed, this is actually harmless because we'll end up replacing the pathtargets here with the correct ones within create_grouping_paths(). But if we've got a query tree containing only scan/join operations then this can result in incorrectly pushing down parallel-restricted target list entries. If those are, for example, references to subqueries, that can crash the server; but it's wrong in any event. Amit Kapila
1 parent cac8321 commit 04ae11f

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/backend/optimizer/plan/planner.c

-13
Original file line numberDiff line numberDiff line change
@@ -1758,19 +1758,6 @@ grouping_planner(PlannerInfo *root, bool inheritance_update,
17581758
}
17591759
}
17601760

1761-
/*
1762-
* Likewise for any partial paths, although this case is simpler, since
1763-
* we don't track the cheapest path.
1764-
*/
1765-
foreach(lc, current_rel->partial_pathlist)
1766-
{
1767-
Path *subpath = (Path *) lfirst(lc);
1768-
1769-
Assert(subpath->param_info == NULL);
1770-
lfirst(lc) = apply_projection_to_path(root, current_rel,
1771-
subpath, scanjoin_target);
1772-
}
1773-
17741761
/*
17751762
* Save the various upper-rel PathTargets we just computed into
17761763
* root->upper_targets[]. The core code doesn't use this, but it

0 commit comments

Comments
 (0)