diff options
Diffstat (limited to 'src/backend/optimizer/plan/createplan.c')
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 12fba56285d..c6b8553a083 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -2211,10 +2211,9 @@ create_groupingsets_plan(PlannerInfo *root, GroupingSetsPath *best_path) chain = NIL; if (list_length(rollups) > 1) { - ListCell *lc2 = lnext(list_head(rollups)); bool is_first_sort = ((RollupData *) linitial(rollups))->is_hashed; - for_each_cell(lc, lc2) + for_each_cell(lc, rollups, list_second_cell(rollups)) { RollupData *rollup = lfirst(lc); AttrNumber *new_grpColIdx; @@ -4261,7 +4260,7 @@ create_mergejoin_plan(PlannerInfo *root, elog(ERROR, "outer pathkeys do not match mergeclauses"); opathkey = (PathKey *) lfirst(lop); opeclass = opathkey->pk_eclass; - lop = lnext(lop); + lop = lnext(outerpathkeys, lop); if (oeclass != opeclass) elog(ERROR, "outer pathkeys do not match mergeclauses"); } @@ -4288,7 +4287,7 @@ create_mergejoin_plan(PlannerInfo *root, if (ieclass == ipeclass) { /* successful first match to this inner pathkey */ - lip = lnext(lip); + lip = lnext(innerpathkeys, lip); first_inner_match = true; } } @@ -4820,7 +4819,7 @@ fix_indexqual_operand(Node *node, IndexOptInfo *index, int indexcol) else elog(ERROR, "index key does not match expected index column"); } - indexpr_item = lnext(indexpr_item); + indexpr_item = lnext(index->indexprs, indexpr_item); } } |