diff options
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index dd858aba034..8d013f5b1af 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -1341,8 +1341,6 @@ postgresGetForeignPlan(PlannerInfo *root, */ if (outer_plan) { - ListCell *lc; - /* * Right now, we only consider grouping and aggregation beyond * joins. Queries involving aggregates or grouping do not require @@ -6272,10 +6270,10 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel, */ foreach(l, aggvars) { - Expr *expr = (Expr *) lfirst(l); + Expr *aggref = (Expr *) lfirst(l); - if (IsA(expr, Aggref)) - tlist = add_to_flat_tlist(tlist, list_make1(expr)); + if (IsA(aggref, Aggref)) + tlist = add_to_flat_tlist(tlist, list_make1(aggref)); } } } @@ -6289,8 +6287,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel, */ if (havingQual) { - ListCell *lc; - foreach(lc, (List *) havingQual) { Expr *expr = (Expr *) lfirst(lc); @@ -6324,7 +6320,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel, if (fpinfo->local_conds) { List *aggvars = NIL; - ListCell *lc; foreach(lc, fpinfo->local_conds) { |