Use list_length() != 1 in SingleReplicatedTable().

ShardPlacementList's implementation can return NIL. In previous implementation
we got a segmentation fault in this case. The relation can be dropped after
getting distributed table list but before calling SingleReplicatedTable().
pull/1751/head
Hadi Moshayedi 2017-10-31 21:38:20 -04:00 committed by Hadi Moshayedi
parent 7691991cb5
commit 7280774cf4
1 changed files with 1 additions and 1 deletions

View File

@ -390,7 +390,7 @@ SingleReplicatedTable(Oid relationId)
uint64 shardId = (*shardIdPointer);
List *shardPlacementList = ShardPlacementList(shardId);
if (shardPlacementList->length > 1)
if (list_length(shardPlacementList) != 1)
{
return false;
}