Remove never assigned colocatedRelation from CreateDistributedTable (#2479)

pull/2629/head
Hadi Moshayedi 2019-03-12 14:50:18 -07:00 committed by GitHub
parent 2e0860489f
commit f19feb742c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 14 deletions

View File

@ -323,8 +323,6 @@ CreateDistributedTable(Oid relationId, Var *distributionColumn, char distributio
Oid colocatedTableId = InvalidOid;
bool localTableEmpty = false;
Relation colocatedRelation = NULL;
replicationModel = AppropriateReplicationModel(distributionMethod, viaDeprecatedAPI);
/*
@ -358,13 +356,7 @@ CreateDistributedTable(Oid relationId, Var *distributionColumn, char distributio
*/
if (viaDeprecatedAPI)
{
/*
* We exit early but there is no need to close colocatedRelation. Because
* if viaDeprecatedAPI is true, we never open colocatedRelation in the first
* place.
*/
Assert(colocatedRelation == NULL);
Assert(colocateWithTableName == NULL);
return;
}
@ -417,11 +409,6 @@ CreateDistributedTable(Oid relationId, Var *distributionColumn, char distributio
CopyLocalDataIntoShards(relationId);
}
}
if (colocatedRelation != NULL)
{
relation_close(colocatedRelation, NoLock);
}
}