Insert a test for missing targetlist entry in replace_agg_clause.

This commit is contained in:
Tom Lane 1999-04-26 00:37:46 +00:00
parent 26db818710
commit eb00bdf237
1 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.41 1999/04/19 01:43:12 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.42 1999/04/26 00:37:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -599,9 +599,11 @@ replace_result_clause(Node *clause,
*/
subplanVar = match_varid((Var *) clause, subplanTargetList);
if (! subplanVar)
elog(ERROR, "replace_result_clause: variable not in target list");
/*
* Change the varno & varattno fields of the var node.
*
*/
((Var *) clause)->varno = (Index) OUTER;
((Var *) clause)->varattno = subplanVar->resdom->resno;
@ -754,10 +756,11 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
*/
subplanVar = match_varid((Var *) clause, subplanTargetList);
if (! subplanVar)
elog(ERROR, "replace_agg_clause: variable not in target list");
/*
* Change the varno & varattno fields of the var node.
* Note we assume match_varid() will succeed ...
*
*/
((Var *) clause)->varattno = subplanVar->resdom->resno;