Initialize count_agg_clauses argument to 0.

count_agg_clause *adds* the cost of the aggregates to the state
variable, it doesn't reinitialize it. That is intentional, as it is used
to incrementally add costs in some places.
pull/834/head
Andres Freund 2016-09-27 17:20:37 -07:00
parent a6150c2916
commit 6d050bc9f8
1 changed files with 1 additions and 0 deletions

View File

@ -134,6 +134,7 @@ BuildAggregatePlan(Query *masterQuery, Plan *subPlan)
Assert(masterQuery->hasAggs || masterQuery->groupClause); Assert(masterQuery->hasAggs || masterQuery->groupClause);
aggregateTargetList = masterQuery->targetList; aggregateTargetList = masterQuery->targetList;
memset(&aggregateCosts, 0, sizeof(AggClauseCosts));
count_agg_clauses(NULL, (Node *) aggregateTargetList, &aggregateCosts); count_agg_clauses(NULL, (Node *) aggregateTargetList, &aggregateCosts);
/* /*