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,7 +790,16 @@ DistributedTableCacheEntry(Oid distributedRelationId)
else
{
char *relationName = get_rel_name(distributedRelationId);
ereport(ERROR, (errmsg("relation %s is not distributed", relationName)));
if (relationName == NULL)
{
ereport(ERROR, (errmsg("relation with OID %u does not exist",
distributedRelationId)));
}
else
{
ereport(ERROR, (errmsg("relation %s is not distributed", relationName)));
}
}
}