From f9e4f611a18f64fd9106a72ec9af9e2220075780 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 12 May 2002 20:10:05 +0000 Subject: First pass at set-returning-functions in FROM, by Joe Conway with some kibitzing from Tom Lane. Not everything works yet, and there's no documentation or regression test, but let's commit this so Joe doesn't need to cope with tracking changes in so many files ... --- src/backend/executor/execMain.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/backend/executor/execMain.c') diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 68fcb325a63..a2c43bc0359 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -27,7 +27,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.160 2002/04/27 21:24:34 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.161 2002/05/12 20:10:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -311,7 +311,7 @@ ExecCheckPlanPerms(Plan *plan, List *rangeTable, CmdType operation) /* Recursively check the subquery */ rte = rt_fetch(scan->scan.scanrelid, rangeTable); - Assert(rte->subquery != NULL); + Assert(rte->rtekind == RTE_SUBQUERY); ExecCheckQueryPerms(operation, rte->subquery, scan->subplan); break; } @@ -362,10 +362,12 @@ ExecCheckRTEPerms(RangeTblEntry *rte, CmdType operation) Oid userid; AclResult aclcheck_result; - /* - * If it's a subquery RTE, ignore it --- it will be checked when - * ExecCheckPlanPerms finds the SubqueryScan node for it. - */ + /* + * Only plain-relation RTEs need to be checked here. Subquery RTEs + * will be checked when ExecCheckPlanPerms finds the SubqueryScan node, + * and function RTEs are checked by init_fcache when the function is + * prepared for execution. Join and special RTEs need no checks. + */ if (rte->rtekind != RTE_RELATION) return; -- cgit v1.2.3