1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Remove Query->qry_aggs and qry_numaggs and replace with Query->hasAggs.

Pass List* of Aggregs into executor, and create needed array there.
No longer need to double-processs Aggregs with second copy in Query.

Fix crash when doing:

	select sum(x+1) from test where 1 > 0;
This commit is contained in:
Bruce Momjian
1998-01-15 19:00:16 +00:00
parent f22d8e6668
commit 763ff8aef8
20 changed files with 173 additions and 272 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.17 1997/12/29 04:31:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.18 1998/01/15 18:59:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -185,8 +185,7 @@ plan_union_queries(Query *parse)
parse->uniqueFlag = NULL;
parse->havingQual = NULL;
parse->qry_numAgg = 0;
parse->qry_aggs = NULL;
parse->hasAggs = false;
return (make_append(union_plans,
union_rts,
@@ -267,11 +266,9 @@ plan_inherit_query(List *relids,
new_root->uniqueFlag = NULL;
new_root->sortClause = NULL;
new_root->groupClause = NULL;
if (new_root->qry_numAgg != 0)
if (new_root->hasAggs)
{
new_root->qry_numAgg = 0;
pfree(new_root->qry_aggs);
new_root->qry_aggs = NULL;
new_root->hasAggs = false;
del_agg_tlist_references(new_root->targetList);
}
fix_parsetree_attnums(rt_index,