From 744ad45a4972455d308063af9dd3aaef7640117e Mon Sep 17 00:00:00 2001 From: gurkanindibay Date: Thu, 18 Jan 2024 20:41:47 +0300 Subject: [PATCH] Fixes review issues --- src/backend/distributed/commands/comment.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/backend/distributed/commands/comment.c b/src/backend/distributed/commands/comment.c index b3a4729ac..e18a5c5cc 100644 --- a/src/backend/distributed/commands/comment.c +++ b/src/backend/distributed/commands/comment.c @@ -83,8 +83,6 @@ GetCommentForObject(Oid classOid, Oid objectOid) scanKey); if ((tuple = systable_getnext(scan)) != NULL) { - Form_pg_shdescription shdesc = (Form_pg_shdescription) GETSTRUCT(tuple); - bool isNull = false; TupleDesc tupdesc = RelationGetDescr(shdescRelation); @@ -92,19 +90,15 @@ GetCommentForObject(Oid classOid, Oid objectOid) Datum descDatum = heap_getattr(tuple, Anum_pg_shdescription_description, tupdesc, &isNull); - /* Check if the objoid matches the databaseOid */ - if (shdesc->objoid == objectOid && shdesc->classoid == classOid) + + /* Add the command to the list */ + if (!isNull) { - /* Add the command to the list */ - if (!isNull) - { - comment = TextDatumGetCString(descDatum); - } - else - { - comment = NULL; - } - break; + comment = TextDatumGetCString(descDatum); + } + else + { + comment = NULL; } }