Skip to content

Commit 3bfe957

Browse files
committed
Fix logic error in add_paths_to_partial_grouping_rel.
Commit 3bf05e0 sometimes uses the cheapest_partial_path variable in this function to mean the cheapest one from the input rel and at other times the cheapest one from the partially grouped rel, but it never resets it, so we can end up with bad plans, leading to "ERROR: Aggref found in non-Agg plan node". Jeevan Chalke, per a report from Andreas Joseph Krogh and a separate off-list report from Rajkumar Raghuwanshi Discussion: http://postgr.es/m/CAM2+6=X9kxQoL2ZqZ00E6asBt9z+rfyWbOmhXJ0+8fPAyMZ9Jg@mail.gmail.com
1 parent be42eb9 commit 3bfe957

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6339,6 +6339,9 @@ add_paths_to_partial_grouping_rel(PlannerInfo *root,
63396339
*/
63406340
generate_gather_paths(root, partially_grouped_rel, true);
63416341

6342+
/* Get cheapest partial path from partially_grouped_rel */
6343+
cheapest_partial_path = linitial(partially_grouped_rel->partial_pathlist);
6344+
63426345
/*
63436346
* generate_gather_paths won't consider sorting the cheapest path to match
63446347
* the group keys and then applying a Gather Merge node to the result;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy