Commit 0f576413 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

Fix replace_agg_clause() for unary operators.

parent 8f846a32
...@@ -7,7 +7,7 @@ ...@@ -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) ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment