Commit 0a757154 authored by Tom Lane's avatar Tom Lane

Add missing fix_expr_references() step for the funcexpr of a

FunctionScan plan node.
parent 22d641a7
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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 @@ ...@@ -23,6 +23,7 @@
#include "optimizer/planmain.h" #include "optimizer/planmain.h"
#include "optimizer/tlist.h" #include "optimizer/tlist.h"
#include "optimizer/var.h" #include "optimizer/var.h"
#include "parser/parsetree.h"
typedef struct typedef struct
...@@ -121,8 +122,16 @@ set_plan_references(Query *root, Plan *plan) ...@@ -121,8 +122,16 @@ set_plan_references(Query *root, Plan *plan)
set_plan_references(root, ((SubqueryScan *) plan)->subplan); set_plan_references(root, ((SubqueryScan *) plan)->subplan);
break; break;
case T_FunctionScan: case T_FunctionScan:
{
RangeTblEntry *rte;
fix_expr_references(plan, (Node *) plan->targetlist); fix_expr_references(plan, (Node *) plan->targetlist);
fix_expr_references(plan, (Node *) plan->qual); 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; break;
case T_NestLoop: case T_NestLoop:
set_join_references(root, (Join *) plan); set_join_references(root, (Join *) plan);
......
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