aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeFunctionscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeFunctionscan.c')
-rw-r--r--src/backend/executor/nodeFunctionscan.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/backend/executor/nodeFunctionscan.c b/src/backend/executor/nodeFunctionscan.c
index f7ca022f1c7..d3d9886e3c3 100644
--- a/src/backend/executor/nodeFunctionscan.c
+++ b/src/backend/executor/nodeFunctionscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.42 2007/01/05 22:19:28 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.43 2007/02/19 02:23:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,7 +118,6 @@ FunctionScanState *
ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
{
FunctionScanState *scanstate;
- RangeTblEntry *rte;
Oid funcrettype;
TypeFuncClass functypclass;
TupleDesc tupdesc = NULL;
@@ -162,16 +161,10 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
(PlanState *) scanstate);
/*
- * get info about function
- */
- rte = rt_fetch(node->scan.scanrelid, estate->es_range_table);
- Assert(rte->rtekind == RTE_FUNCTION);
-
- /*
* Now determine if the function returns a simple or composite type, and
* build an appropriate tupdesc.
*/
- functypclass = get_expr_result_type(rte->funcexpr,
+ functypclass = get_expr_result_type(node->funcexpr,
&funcrettype,
&tupdesc);
@@ -185,7 +178,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
else if (functypclass == TYPEFUNC_SCALAR)
{
/* Base data type, i.e. scalar */
- char *attname = strVal(linitial(rte->eref->colnames));
+ char *attname = strVal(linitial(node->funccolnames));
tupdesc = CreateTemplateTupleDesc(1, false);
TupleDescInitEntry(tupdesc,
@@ -197,9 +190,9 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
}
else if (functypclass == TYPEFUNC_RECORD)
{
- tupdesc = BuildDescFromLists(rte->eref->colnames,
- rte->funccoltypes,
- rte->funccoltypmods);
+ tupdesc = BuildDescFromLists(node->funccolnames,
+ node->funccoltypes,
+ node->funccoltypmods);
}
else
{
@@ -221,7 +214,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
* Other node-specific setup
*/
scanstate->tuplestorestate = NULL;
- scanstate->funcexpr = ExecInitExpr((Expr *) rte->funcexpr,
+ scanstate->funcexpr = ExecInitExpr((Expr *) node->funcexpr,
(PlanState *) scanstate);
scanstate->ss.ps.ps_TupFromTlist = false;