1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +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

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.6 1998/01/04 04:31:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.7 1998/01/15 19:00:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -95,7 +95,6 @@ thisLockWasTriggered(int varno,
AttrNumber attnum,
Query *parsetree)
{
int i;
if (nodeThisLockWasTriggered(parsetree->qual, varno, attnum))
return true;
@ -103,10 +102,6 @@ thisLockWasTriggered(int varno,
if (nodeThisLockWasTriggered((Node *) parsetree->targetList, varno, attnum))
return true;
for(i=0; i < parsetree->qry_numAgg; i++)
if (nodeThisLockWasTriggered(parsetree->qry_aggs[i]->target,
varno, attnum))
return true;
return false;
}

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.9 1998/01/04 04:31:29 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.10 1998/01/15 19:00:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -420,16 +420,12 @@ HandleRIRAttributeRule(Query *parsetree,
int *modified,
int *badsql)
{
int i;
nodeHandleRIRAttributeRule((Node **) (&(parsetree->targetList)), rtable,
targetlist, rt_index, attr_num,
modified, badsql);
nodeHandleRIRAttributeRule(&parsetree->qual, rtable, targetlist,
rt_index, attr_num, modified, badsql);
for(i=0; i < parsetree->qry_numAgg; i++)
nodeHandleRIRAttributeRule(&parsetree->qry_aggs[i]->target, rtable,
targetlist, rt_index, attr_num, modified, badsql);
}
@ -521,13 +517,9 @@ HandleViewRule(Query *parsetree,
int rt_index,
int *modified)
{
int i;
nodeHandleViewRule(&parsetree->qual, rtable, targetlist, rt_index,
modified);
nodeHandleViewRule((Node **) (&(parsetree->targetList)), rtable, targetlist,
rt_index, modified);
for(i=0; i < parsetree->qry_numAgg; i++)
nodeHandleViewRule(&parsetree->qry_aggs[i]->target, rtable, targetlist, rt_index,
modified);
}