diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index b5e4b1d8c8437d8f32af21f38e2d1adab6f9be9c..c980144a0c1da8952752b3069e07b97ac22e4b5e 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -411,7 +411,7 @@ SS_process_sublinks(Node *expr) * Otherwise aggregate functions will fail later on (at execution * time!) Reason: The rewite System makes several copies of the * VAR nodes and in this case it should not do so :-( */ - if(expr->lefthand != NULL) + if(((SubLink *) expr)->lefthand != NULL) { lfirst(((Expr *) lfirst(((SubLink *)expr)->oper))->args) = lfirst(((SubLink *)expr)->lefthand);