From cc6c0cf7eb5f08803f5d60778cc7b3c9ba213e82 Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Sun, 16 Jan 2022 16:55:28 +0300 Subject: [PATCH] Address review --- src/backend/distributed/worker/worker_drop_protocol.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/backend/distributed/worker/worker_drop_protocol.c b/src/backend/distributed/worker/worker_drop_protocol.c index 25fdb4ba6..946f2ea71 100644 --- a/src/backend/distributed/worker/worker_drop_protocol.c +++ b/src/backend/distributed/worker/worker_drop_protocol.c @@ -156,9 +156,6 @@ worker_drop_distributed_table_only(PG_FUNCTION_ARGS) text *relationName = PG_GETARG_TEXT_P(0); Oid relationId = ResolveRelationId(relationName, true); - ObjectAddress distributedTableObject = { InvalidOid, InvalidOid, 0 }; - char relationKind = '\0'; - if (!OidIsValid(relationId)) { ereport(NOTICE, (errmsg("relation %s does not exist, skipping", @@ -170,13 +167,14 @@ worker_drop_distributed_table_only(PG_FUNCTION_ARGS) /* first check the relation type */ Relation distributedRelation = relation_open(relationId, AccessShareLock); - relationKind = distributedRelation->rd_rel->relkind; + char relationKind = distributedRelation->rd_rel->relkind; EnsureRelationKindSupported(relationId); /* close the relation since we do not need anymore */ relation_close(distributedRelation, AccessShareLock); /* prepare distributedTableObject for dropping the table */ + ObjectAddress distributedTableObject = { InvalidOid, InvalidOid, 0 }; distributedTableObject.classId = RelationRelationId; distributedTableObject.objectId = relationId; distributedTableObject.objectSubId = 0;