Fix security definer functions with polymorphic arguments. This case has
authorTom Lane <[email protected]>
Tue, 31 Jul 2007 15:49:54 +0000 (15:49 +0000)
committerTom Lane <[email protected]>
Tue, 31 Jul 2007 15:49:54 +0000 (15:49 +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 0846f8c924d0fb582ce3568da8b47be2e19fe3fe..ff5417dda167bfd4c2c8e452857283e701ed9d0b 100644 (file)
@@ -793,6 +793,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),