mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Insert a test for missing targetlist entry in replace_agg_clause.
This commit is contained in:
parent
26db818710
commit
eb00bdf237
@ -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,
|
|||||||
*/
|
*/
|
||||||
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)
|
|||||||
*/
|
*/
|
||||||
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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user