From d368e1a2a7afad5a0fc711a2ab70a83c36fa57af Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 13 Dec 2010 18:58:31 -0500 Subject: Allow plugins to suppress inlining and hook function entry/exit/abort. This is intended as infrastructure to allow an eventual SE-Linux plugin to support trusted procedures. KaiGai Kohei --- src/backend/optimizer/util/clauses.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/backend/optimizer') diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 80dfaad736f..fa84164b068 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -3726,6 +3726,10 @@ inline_function(Oid funcid, Oid result_type, List *args, if (pg_proc_aclcheck(funcid, GetUserId(), ACL_EXECUTE) != ACLCHECK_OK) return NULL; + /* Check whether a plugin wants to hook function entry/exit */ + if (FmgrHookIsNeeded(funcid)) + return NULL; + /* * Make a temporary memory context, so that we don't leak all the stuff * that parsing might create. @@ -4158,6 +4162,10 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte) if (pg_proc_aclcheck(func_oid, GetUserId(), ACL_EXECUTE) != ACLCHECK_OK) return NULL; + /* Check whether a plugin wants to hook function entry/exit */ + if (FmgrHookIsNeeded(func_oid)) + return NULL; + /* * OK, let's take a look at the function's pg_proc entry. */ -- cgit v1.2.3