mirror of https://github.com/citusdata/citus.git
Set table size to zero if no size is read (#5049)
* Set table size to zero if no size is read * Add comment to relation size bug fixpull/5045/head
parent
2511c4c045
commit
5115100db0
|
@ -644,7 +644,19 @@ DistributedTableSizeOnWorker(WorkerNode *workerNode, Oid relationId,
|
||||||
StringInfo tableSizeStringInfo = (StringInfo) linitial(sizeList);
|
StringInfo tableSizeStringInfo = (StringInfo) linitial(sizeList);
|
||||||
char *tableSizeString = tableSizeStringInfo->data;
|
char *tableSizeString = tableSizeStringInfo->data;
|
||||||
|
|
||||||
*tableSize = SafeStringToUint64(tableSizeString);
|
if (strlen(tableSizeString) > 0)
|
||||||
|
{
|
||||||
|
*tableSize = SafeStringToUint64(tableSizeString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This means the shard is moved or dropped while citus_total_relation_size is
|
||||||
|
* being executed. For this case we get an empty string as table size.
|
||||||
|
* We can take that as zero to prevent any unnecessary errors.
|
||||||
|
*/
|
||||||
|
*tableSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
PQclear(result);
|
PQclear(result);
|
||||||
ClearResults(connection, failOnError);
|
ClearResults(connection, failOnError);
|
||||||
|
|
Loading…
Reference in New Issue