Fix replace_agg_clause() for unary operators.

This commit is contained in:
Vadim B. Mikheev 1997-06-12 17:26:15 +00:00
parent 8f846a321c
commit 0f576413bc

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.3 1997/04/24 15:54:52 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.4 1997/06/12 17:26:15 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -690,10 +690,13 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
* This is an operator. Recursively call this routine * This is an operator. Recursively call this routine
* for both its left and right operands * for both its left and right operands
*/ */
replace_agg_clause((Node*)get_leftop((Expr*)clause), Node *left = (Node*)get_leftop((Expr*)clause);
subplanTargetList); Node *right = (Node*)get_rightop((Expr*)clause);
replace_agg_clause((Node*)get_rightop((Expr*)clause),
subplanTargetList); if ( left != (Node*) NULL )
replace_agg_clause(left, subplanTargetList);
if ( right != (Node*) NULL )
replace_agg_clause(right, subplanTargetList);
} else if (IsA(clause,Param) || IsA(clause,Const)) { } else if (IsA(clause,Param) || IsA(clause,Const)) {
/* do nothing! */ /* do nothing! */
} else { } else {