Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2754119

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 policythat header files should be include-able in C++ code. Per report fromCraig Ringer and some investigation with cpluspluscheck.
1 parentc7f0038 commit2754119

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
FmgrInfoflinfo;/* lookup info for target function */
864864
Oiduserid;/* userid to set, or InvalidOid */
865865
ArrayType*proconfig;/* GUC values to set, or NULL */
866-
Datumprivate;/*private usage for plugin modules */
866+
Datumarg;/*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
returnresult;
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
typedefbool (*needs_fmgr_hook_type)(Oidfn_oid);
564564

565565
typedefvoid (*fmgr_hook_type)(FmgrHookEventTypeevent,
566-
FmgrInfo*flinfo,Datum*private);
566+
FmgrInfo*flinfo,Datum*arg);
567567

568568
externPGDLLIMPORTneeds_fmgr_hook_typeneeds_fmgr_hook;
569569
externPGDLLIMPORTfmgr_hook_typefmgr_hook;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp