File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.84 2004/09/13 01:44:46 neilc Exp $
11
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.85 2004/10/01 20:39:54 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -794,7 +794,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
794
794
{
795
795
Datum result ;
796
796
FmgrInfo * save_flinfo ;
797
- struct fmgr_security_definer_cache * fcache ;
797
+ struct fmgr_security_definer_cache * volatile fcache ;
798
798
AclId save_userid ;
799
799
HeapTuple tuple ;
800
800
@@ -821,14 +821,25 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
821
821
fcache = fcinfo -> flinfo -> fn_extra ;
822
822
823
823
save_flinfo = fcinfo -> flinfo ;
824
- fcinfo -> flinfo = & fcache -> flinfo ;
825
-
826
824
save_userid = GetUserId ();
827
- SetUserId (fcache -> userid );
828
- result = FunctionCallInvoke (fcinfo );
829
- SetUserId (save_userid );
825
+
826
+ PG_TRY ();
827
+ {
828
+ fcinfo -> flinfo = & fcache -> flinfo ;
829
+ SetUserId (fcache -> userid );
830
+
831
+ result = FunctionCallInvoke (fcinfo );
832
+ }
833
+ PG_CATCH ();
834
+ {
835
+ fcinfo -> flinfo = save_flinfo ;
836
+ SetUserId (save_userid );
837
+ PG_RE_THROW ();
838
+ }
839
+ PG_END_TRY ();
830
840
831
841
fcinfo -> flinfo = save_flinfo ;
842
+ SetUserId (save_userid );
832
843
833
844
return result ;
834
845
}
You can’t perform that action at this time.
0 commit comments