summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/prepunion.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-01-15 19:00:16 +0000
committerBruce Momjian <bruce@momjian.us>1998-01-15 19:00:16 +0000
commit763ff8aef848d71da079049890786edffc3302d6 (patch)
treea1aed2a633c409071dd6d724b6db2bc7bf4fcb75 /src/backend/optimizer/prep/prepunion.c
parentf22d8e6668e36a5855c35b04cc21a4d1593298d9 (diff)
downloadpostgresql-763ff8aef848d71da079049890786edffc3302d6.tar.gz
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;
Diffstat (limited to 'src/backend/optimizer/prep/prepunion.c')
-rw-r--r--src/backend/optimizer/prep/prepunion.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c
index e942173a74..119e054578 100644
--- a/src/backend/optimizer/prep/prepunion.c
+++ b/src/backend/optimizer/prep/prepunion.c
@@ -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,