Commit eb00bdf2 authored by Tom Lane's avatar Tom Lane

Insert a test for missing targetlist entry in replace_agg_clause.

parent 26db8187
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -599,9 +599,11 @@ replace_result_clause(Node *clause,
*/ */
subplanVar = match_varid((Var *) clause, subplanTargetList); 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. * Change the varno & varattno fields of the var node.
*
*/ */
((Var *) clause)->varno = (Index) OUTER; ((Var *) clause)->varno = (Index) OUTER;
((Var *) clause)->varattno = subplanVar->resdom->resno; ((Var *) clause)->varattno = subplanVar->resdom->resno;
...@@ -754,10 +756,11 @@ replace_agg_clause(Node *clause, List *subplanTargetList) ...@@ -754,10 +756,11 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
*/ */
subplanVar = match_varid((Var *) clause, 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. * Change the varno & varattno fields of the var node.
* Note we assume match_varid() will succeed ...
*
*/ */
((Var *) clause)->varattno = subplanVar->resdom->resno; ((Var *) clause)->varattno = subplanVar->resdom->resno;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment