Fix redundant comments in fmgr.c

Started by houzj.fnst@fujitsu.comover 4 years ago2 messages
#1houzj.fnst@fujitsu.com
houzj.fnst@fujitsu.com
1 attachment(s)

Hi,

I found some possible redundant comments in fmgr.c

1.
fmgr_symbol(Oid functionId, char **mod, char **fn)
{
HeapTuple procedureTuple;
Form_pg_proc procedureStruct;
bool isnull;
Datum prosrcattr;
Datum probinattr;
- /* Otherwise we need the pg_proc entry */
procedureTuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(functionId));

I guess the comment here was miscopied from fmgr_info_cxt_security:

2.
if (!HeapTupleIsValid(procedureTuple))
elog(ERROR, "cache lookup failed for function %u", functionId);
procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple);
- /*
- */

Best regards,
houzj

Attachments:

0001-fix-comment-in-fmgr.c.patchapplication/octet-stream; name=0001-fix-comment-in-fmgr.c.patchDownload
From 7b06c6635e69a5e1264123c8fa4dfab48c328c36 Mon Sep 17 00:00:00 2001
From: houzj <houzj.fnst@fujitsu.com>
Date: Thu, 22 Apr 2021 19:36:24 +0800
Subject: [PATCH] fix comment in fmgr.c

---
 src/backend/utils/fmgr/fmgr.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c
index b6835c2..984e99a 100644
--- a/src/backend/utils/fmgr/fmgr.c
+++ b/src/backend/utils/fmgr/fmgr.c
@@ -288,14 +288,11 @@ fmgr_symbol(Oid functionId, char **mod, char **fn)
 	Datum		prosrcattr;
 	Datum		probinattr;
 
-	/* Otherwise we need the pg_proc entry */
 	procedureTuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(functionId));
 	if (!HeapTupleIsValid(procedureTuple))
 		elog(ERROR, "cache lookup failed for function %u", functionId);
 	procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple);
 
-	/*
-	 */
 	if (procedureStruct->prosecdef ||
 		!heap_attisnull(procedureTuple, Anum_pg_proc_proconfig, NULL) ||
 		FmgrHookIsNeeded(functionId))
-- 
2.7.2.windows.1

#2Michael Paquier
michael@paquier.xyz
In reply to: houzj.fnst@fujitsu.com (#1)
Re: Fix redundant comments in fmgr.c

On Thu, Apr 22, 2021 at 11:44:10AM +0000, houzj.fnst@fujitsu.com wrote:

I found some possible redundant comments in fmgr.c

Thanks, fixed. I have noticed one extra inconsistency at the top of
fmgr_symbol().

I guess the comment here was miscopied from fmgr_info_cxt_security:

Right, coming right from the fast path in the other function.
--
Michael