Skip to content

Commit

Permalink
Add assert that pruned list is non-empty
Browse files Browse the repository at this point in the history
If DistributedQueryShardList ever returns an empty list, it's because
no shards exist that can satisfy the given query. This shouldn't be
possible if everything is working correctly, so we want an Assert here
instead of error checking.
  • Loading branch information
jasonmp85 committed Jan 13, 2015
1 parent f1490b4 commit a9564eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pg_shard.c
Expand Up @@ -563,6 +563,9 @@ DistributedQueryShardList(Query *query)
prunedShardList = PruneShardList(distributedTableId, restrictClauseList,
shardIntervalList);

/* shouldn't be an empty list, but assert in case something's very wrong */
Assert(prunedShardList != NIL);

return prunedShardList;
}

Expand Down

0 comments on commit a9564eb

Please sign in to comment.