Don't modify cache entry in RelationShardListForShardCreate()

pull/2833/head
Hadi Moshayedi 2019-07-09 12:44:48 -07:00
parent 70434bc716
commit 91d8a41ecd
1 changed files with 6 additions and 2 deletions

View File

@ -728,11 +728,15 @@ RelationShardListForShardCreate(ShardInterval *shardInterval)
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(relationId);
List *referencedRelationList = cacheEntry->referencedRelationsViaForeignKey;
List *referencingRelationList = cacheEntry->referencingRelationsViaForeignKey;
List *allForeignKeyRelations =
list_concat_unique_oid(referencedRelationList, referencingRelationList);
List *allForeignKeyRelations = NIL;
int shardIndex = -1;
ListCell *fkeyRelationIdCell = NULL;
/* list_concat_*() modifies the first arg, so make a copy first */
allForeignKeyRelations = list_copy(referencedRelationList);
allForeignKeyRelations = list_concat_unique_oid(allForeignKeyRelations,
referencingRelationList);
/* record the placement access of the shard itself */
relationShard = CitusMakeNode(RelationShard);
relationShard->relationId = relationId;