mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Replace generic 'Illegal use of aggregates' error message with one that
shows the specific ungrouped variable being complained of. Perhaps this will reduce user confusion...
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.47 1999/11/15 02:00:07 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.48 1999/12/09 05:58:52 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -100,10 +100,7 @@ query_planner(Query *root,
|
||||
* Note we do NOT do this for subplans in WHERE; it's legal
|
||||
* there because WHERE is evaluated pre-GROUP.
|
||||
*/
|
||||
if (check_subplans_for_ungrouped_vars((Node *) tlist,
|
||||
root->groupClause,
|
||||
tlist))
|
||||
elog(ERROR, "Sub-SELECT must use only GROUPed attributes from outer SELECT");
|
||||
check_subplans_for_ungrouped_vars((Node *) tlist, root, tlist);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.71 1999/11/15 02:00:08 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.72 1999/12/09 05:58:52 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -344,10 +344,9 @@ union_planner(Query *parse)
|
||||
/* Expand SubLinks to SubPlans */
|
||||
parse->havingQual = SS_process_sublinks(parse->havingQual);
|
||||
/* Check for ungrouped variables passed to subplans */
|
||||
if (check_subplans_for_ungrouped_vars(parse->havingQual,
|
||||
parse->groupClause,
|
||||
parse->targetList))
|
||||
elog(ERROR, "Sub-SELECT must use only GROUPed attributes from outer SELECT");
|
||||
check_subplans_for_ungrouped_vars(parse->havingQual,
|
||||
parse,
|
||||
parse->targetList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user