diff options
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r-- | src/backend/optimizer/plan/planner.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 401299e5420..ca3b7f29e18 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -3351,7 +3351,7 @@ extract_rollup_sets(List *groupingSets) while (lc1 && lfirst(lc1) == NIL) { ++num_empty; - lc1 = lnext(lc1); + lc1 = lnext(groupingSets, lc1); } /* bail out now if it turns out that all we had were empty sets. */ @@ -3385,7 +3385,7 @@ extract_rollup_sets(List *groupingSets) j = 0; i = 1; - for_each_cell(lc, lc1) + for_each_cell(lc, groupingSets, lc1) { List *candidate = (List *) lfirst(lc); Bitmapset *candidate_set = NULL; @@ -4243,7 +4243,7 @@ consider_groupingsets_paths(PlannerInfo *root, { unhashed_rollup = lfirst_node(RollupData, l_start); exclude_groups = unhashed_rollup->numGroups; - l_start = lnext(l_start); + l_start = lnext(gd->rollups, l_start); } hashsize = estimate_hashagg_tablesize(path, @@ -4264,7 +4264,7 @@ consider_groupingsets_paths(PlannerInfo *root, */ sets_data = list_copy(gd->unsortable_sets); - for_each_cell(lc, l_start) + for_each_cell(lc, gd->rollups, l_start) { RollupData *rollup = lfirst_node(RollupData, lc); @@ -4425,7 +4425,7 @@ consider_groupingsets_paths(PlannerInfo *root, * below, must use the same condition. */ i = 0; - for_each_cell(lc, lnext(list_head(gd->rollups))) + for_each_cell(lc, gd->rollups, list_second_cell(gd->rollups)) { RollupData *rollup = lfirst_node(RollupData, lc); @@ -4459,7 +4459,7 @@ consider_groupingsets_paths(PlannerInfo *root, rollups = list_make1(linitial(gd->rollups)); i = 0; - for_each_cell(lc, lnext(list_head(gd->rollups))) + for_each_cell(lc, gd->rollups, list_second_cell(gd->rollups)) { RollupData *rollup = lfirst_node(RollupData, lc); @@ -4672,7 +4672,7 @@ create_one_window_path(PlannerInfo *root, -1.0); } - if (lnext(l)) + if (lnext(activeWindows, l)) { /* * Add the current WindowFuncs to the output target for this @@ -5333,7 +5333,7 @@ postprocess_setop_tlist(List *new_tlist, List *orig_tlist) Assert(orig_tlist_item != NULL); orig_tle = lfirst_node(TargetEntry, orig_tlist_item); - orig_tlist_item = lnext(orig_tlist_item); + orig_tlist_item = lnext(orig_tlist, orig_tlist_item); if (orig_tle->resjunk) /* should not happen */ elog(ERROR, "resjunk output columns are not implemented"); Assert(new_tle->resno == orig_tle->resno); |