Address review

velioglu/wo_seq_test_1
Burak Velioglu 2022-01-16 16:55:28 +03:00
parent 04511cc5e0
commit cc6c0cf7eb
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
1 changed files with 2 additions and 4 deletions

View File

@ -156,9 +156,6 @@ worker_drop_distributed_table_only(PG_FUNCTION_ARGS)
text *relationName = PG_GETARG_TEXT_P(0); text *relationName = PG_GETARG_TEXT_P(0);
Oid relationId = ResolveRelationId(relationName, true); Oid relationId = ResolveRelationId(relationName, true);
ObjectAddress distributedTableObject = { InvalidOid, InvalidOid, 0 };
char relationKind = '\0';
if (!OidIsValid(relationId)) if (!OidIsValid(relationId))
{ {
ereport(NOTICE, (errmsg("relation %s does not exist, skipping", 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 */ /* first check the relation type */
Relation distributedRelation = relation_open(relationId, AccessShareLock); Relation distributedRelation = relation_open(relationId, AccessShareLock);
relationKind = distributedRelation->rd_rel->relkind; char relationKind = distributedRelation->rd_rel->relkind;
EnsureRelationKindSupported(relationId); EnsureRelationKindSupported(relationId);
/* close the relation since we do not need anymore */ /* close the relation since we do not need anymore */
relation_close(distributedRelation, AccessShareLock); relation_close(distributedRelation, AccessShareLock);
/* prepare distributedTableObject for dropping the table */ /* prepare distributedTableObject for dropping the table */
ObjectAddress distributedTableObject = { InvalidOid, InvalidOid, 0 };
distributedTableObject.classId = RelationRelationId; distributedTableObject.classId = RelationRelationId;
distributedTableObject.objectId = relationId; distributedTableObject.objectId = relationId;
distributedTableObject.objectSubId = 0; distributedTableObject.objectSubId = 0;