diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-09-09 03:48:17 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-09-09 03:48:17 +0000 |
commit | 9a2949e5dd92f9584d6f8e496e3e64b83814f72b (patch) | |
tree | 3761f0114af05ec2e203c601e8a429b060d3b3bd /src/backend/parser/parse_agg.c | |
parent | 04abb54197860c8882390db9af9606d7a50fb41b (diff) | |
download | postgresql-9a2949e5dd92f9584d6f8e496e3e64b83814f72b.tar.gz postgresql-9a2949e5dd92f9584d6f8e496e3e64b83814f72b.zip |
Fix using GroupBy/non-GroupBy expressions in HAVING.
Diffstat (limited to 'src/backend/parser/parse_agg.c')
-rw-r--r-- | src/backend/parser/parse_agg.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c index bb8d87d383b..eef2808f50d 100644 --- a/src/backend/parser/parse_agg.c +++ b/src/backend/parser/parse_agg.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.13 1998/09/01 04:30:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.14 1998/09/09 03:48:17 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -104,7 +104,8 @@ exprIsAggOrGroupCol(Node *expr, List *groupClause) List *gl; if (expr == NULL || IsA(expr, Const) || - IsA(expr, Param) ||IsA(expr, Aggreg)) + IsA(expr, Param) || IsA(expr, Aggreg) || + IsA(expr, SubLink)) /* can't handle currently !!! */ return TRUE; foreach(gl, groupClause) @@ -207,13 +208,10 @@ parseCheckAggregates(ParseState *pstate, Query *qry) * the expression specified in the HAVING clause has the same * restriction as those in the target list. */ -/* - * Need to change here when we get HAVING works. Currently - * qry->havingQual is NULL. - vadim 04/05/97 + if (!exprIsAggOrGroupCol(qry->havingQual, qry->groupClause)) elog(ERROR, "parser: illegal use of aggregates or non-group column in HAVING clause"); - */ return; } |