Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2754119

Browse files
committed
Fix ill-chosen use of "private" as an argument and struct field name.
"private" is a keyword in C++, so this breaks the poorly-enforced policy that header files should be include-able in C++ code. Per report from Craig Ringer and some investigation with cpluspluscheck.
1 parent c7f0038 commit 2754119

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/backend/utils/fmgr/fmgr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ struct fmgr_security_definer_cache
863863
FmgrInfo flinfo; /* lookup info for target function */
864864
Oid userid; /* userid to set, or InvalidOid */
865865
ArrayType *proconfig; /* GUC values to set, or NULL */
866-
Datum private; /* private usage for plugin modules */
866+
Datum arg; /* passthrough argument for plugin modules */
867867
};
868868

869869
/*
@@ -949,7 +949,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
949949

950950
/* function manager hook */
951951
if (fmgr_hook)
952-
(*fmgr_hook)(FHET_START, &fcache->flinfo, &fcache->private);
952+
(*fmgr_hook)(FHET_START, &fcache->flinfo, &fcache->arg);
953953

954954
/*
955955
* We don't need to restore GUC or userid settings on error, because the
@@ -980,7 +980,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
980980
{
981981
fcinfo->flinfo = save_flinfo;
982982
if (fmgr_hook)
983-
(*fmgr_hook)(FHET_ABORT, &fcache->flinfo, &fcache->private);
983+
(*fmgr_hook)(FHET_ABORT, &fcache->flinfo, &fcache->arg);
984984
PG_RE_THROW();
985985
}
986986
PG_END_TRY();
@@ -992,7 +992,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
992992
if (OidIsValid(fcache->userid))
993993
SetUserIdAndSecContext(save_userid, save_sec_context);
994994
if (fmgr_hook)
995-
(*fmgr_hook)(FHET_END, &fcache->flinfo, &fcache->private);
995+
(*fmgr_hook)(FHET_END, &fcache->flinfo, &fcache->arg);
996996

997997
return result;
998998
}

src/include/fmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ typedef enum FmgrHookEventType
563563
typedef bool (*needs_fmgr_hook_type)(Oid fn_oid);
564564

565565
typedef void (*fmgr_hook_type)(FmgrHookEventType event,
566-
FmgrInfo *flinfo, Datum *private);
566+
FmgrInfo *flinfo, Datum *arg);
567567

568568
extern PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook;
569569
extern PGDLLIMPORT fmgr_hook_type fmgr_hook;

0 commit comments

Comments
 (0)