mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Make the behavior of HAVING without GROUP BY conform to the SQL spec.
Formerly, if such a clause contained no aggregate functions we mistakenly treated it as equivalent to WHERE. Per spec it must cause the query to be treated as a grouped query of a single group, the same as appearance of aggregate functions would do. Also, the HAVING filter must execute after aggregate function computation even if it itself contains no aggregate functions.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.272 2005/01/27 03:18:42 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.273 2005/03/10 23:21:24 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -128,6 +128,7 @@ typedef struct Query
|
||||
List *in_info_list; /* list of InClauseInfos */
|
||||
List *query_pathkeys; /* desired pathkeys for query_planner() */
|
||||
bool hasJoinRTEs; /* true if any RTEs are RTE_JOIN kind */
|
||||
bool hasHavingQual; /* true if havingQual was non-null */
|
||||
} Query;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user