Fix security definer functions with polymorphic arguments. This case has
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 Jul 2007 15:50:17 +0000 (15:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 Jul 2007 15:50:17 +0000 (15:50 +0000)
never worked because fmgr_security_definer() neglected to pass the fn_expr
information through.  Per report from Viatcheslav Kalinin.

src/backend/utils/fmgr/fmgr.c

index 14956301ab0881f1b5d0d59e470cd56c2a2fb315..5d8afc34f4bae77a68e08756706fcf837ddd4a9e 100644 (file)
@@ -859,6 +859,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
 
                fmgr_info_cxt_security(fcinfo->flinfo->fn_oid, &fcache->flinfo,
                                                           fcinfo->flinfo->fn_mcxt, true);
+               fcache->flinfo.fn_expr = fcinfo->flinfo->fn_expr;
 
                tuple = SearchSysCache(PROCOID,
                                                           ObjectIdGetDatum(fcinfo->flinfo->fn_oid),