safely error out in DistributedTableCacheEntry function

pull/3554/head
Onur Tirtir 2020-02-29 14:53:48 +03:00
parent 17d9b934c3
commit cf718ffe77
1 changed files with 10 additions and 1 deletions

View File

@ -790,9 +790,18 @@ DistributedTableCacheEntry(Oid distributedRelationId)
else else
{ {
char *relationName = get_rel_name(distributedRelationId); char *relationName = get_rel_name(distributedRelationId);
if (relationName == NULL)
{
ereport(ERROR, (errmsg("relation with OID %u does not exist",
distributedRelationId)));
}
else
{
ereport(ERROR, (errmsg("relation %s is not distributed", relationName))); ereport(ERROR, (errmsg("relation %s is not distributed", relationName)));
} }
} }
}
/* /*