mirror of https://github.com/citusdata/citus.git
Return a deep copy shard list from ColocatedShardIntervalList()
parent
7cff8719c2
commit
ed77260aa1
|
@ -841,7 +841,11 @@ ColocatedShardIntervalList(ShardInterval *shardInterval)
|
||||||
if ((partitionMethod == DISTRIBUTE_BY_APPEND) ||
|
if ((partitionMethod == DISTRIBUTE_BY_APPEND) ||
|
||||||
(partitionMethod == DISTRIBUTE_BY_RANGE))
|
(partitionMethod == DISTRIBUTE_BY_RANGE))
|
||||||
{
|
{
|
||||||
colocatedShardList = lappend(colocatedShardList, shardInterval);
|
ShardInterval *copyShardInterval = CitusMakeNode(ShardInterval);
|
||||||
|
CopyShardInterval(shardInterval, copyShardInterval);
|
||||||
|
|
||||||
|
colocatedShardList = lappend(colocatedShardList, copyShardInterval);
|
||||||
|
|
||||||
return colocatedShardList;
|
return colocatedShardList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,6 +861,7 @@ ColocatedShardIntervalList(ShardInterval *shardInterval)
|
||||||
DistTableCacheEntry *colocatedTableCacheEntry =
|
DistTableCacheEntry *colocatedTableCacheEntry =
|
||||||
DistributedTableCacheEntry(colocatedTableId);
|
DistributedTableCacheEntry(colocatedTableId);
|
||||||
ShardInterval *colocatedShardInterval = NULL;
|
ShardInterval *colocatedShardInterval = NULL;
|
||||||
|
ShardInterval *copyShardInterval = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since we iterate over co-located tables, shard count of each table should be
|
* Since we iterate over co-located tables, shard count of each table should be
|
||||||
|
@ -868,7 +873,10 @@ ColocatedShardIntervalList(ShardInterval *shardInterval)
|
||||||
colocatedShardInterval =
|
colocatedShardInterval =
|
||||||
colocatedTableCacheEntry->sortedShardIntervalArray[shardIntervalIndex];
|
colocatedTableCacheEntry->sortedShardIntervalArray[shardIntervalIndex];
|
||||||
|
|
||||||
colocatedShardList = lappend(colocatedShardList, colocatedShardInterval);
|
copyShardInterval = CitusMakeNode(ShardInterval);
|
||||||
|
CopyShardInterval(colocatedShardInterval, copyShardInterval);
|
||||||
|
|
||||||
|
colocatedShardList = lappend(colocatedShardList, copyShardInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert(list_length(colocatedTableList) == list_length(colocatedShardList));
|
Assert(list_length(colocatedTableList) == list_length(colocatedShardList));
|
||||||
|
|
Loading…
Reference in New Issue