Add missing fix_expr_references() step for the funcexpr of a

FunctionScan plan node.
This commit is contained in:
Tom Lane 2002-05-18 00:42:55 +00:00
parent 22d641a7d4
commit 0a757154bd
1 changed files with 12 additions and 3 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.76 2002/05/12 20:10:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.77 2002/05/18 00:42:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -23,6 +23,7 @@
#include "optimizer/planmain.h"
#include "optimizer/tlist.h"
#include "optimizer/var.h"
#include "parser/parsetree.h"
typedef struct
@ -121,8 +122,16 @@ set_plan_references(Query *root, Plan *plan)
set_plan_references(root, ((SubqueryScan *) plan)->subplan);
break;
case T_FunctionScan:
fix_expr_references(plan, (Node *) plan->targetlist);
fix_expr_references(plan, (Node *) plan->qual);
{
RangeTblEntry *rte;
fix_expr_references(plan, (Node *) plan->targetlist);
fix_expr_references(plan, (Node *) plan->qual);
rte = rt_fetch(((FunctionScan *) plan)->scan.scanrelid,
root->rtable);
Assert(rte->rtekind == RTE_FUNCTION);
fix_expr_references(plan, rte->funcexpr);
}
break;
case T_NestLoop:
set_join_references(root, (Join *) plan);