mirror of https://github.com/citusdata/citus.git
Merge pull request #3857 from citusdata/use_RelationGetPartitionDesc
use RelationGetPartitionDesc to be more safepull/3863/head
commit
dca09e998f
|
@ -287,14 +287,14 @@ PartitionList(Oid parentRelationId)
|
||||||
|
|
||||||
ereport(ERROR, (errmsg("\"%s\" is not a parent table", relationName)));
|
ereport(ERROR, (errmsg("\"%s\" is not a parent table", relationName)));
|
||||||
}
|
}
|
||||||
|
PartitionDesc partDesc = RelationGetPartitionDesc(rel);
|
||||||
|
Assert(partDesc != NULL);
|
||||||
|
|
||||||
Assert(rel->rd_partdesc != NULL);
|
int partitionCount = partDesc->nparts;
|
||||||
|
|
||||||
int partitionCount = rel->rd_partdesc->nparts;
|
|
||||||
for (int partitionIndex = 0; partitionIndex < partitionCount; ++partitionIndex)
|
for (int partitionIndex = 0; partitionIndex < partitionCount; ++partitionIndex)
|
||||||
{
|
{
|
||||||
partitionList =
|
partitionList =
|
||||||
lappend_oid(partitionList, rel->rd_partdesc->oids[partitionIndex]);
|
lappend_oid(partitionList, partDesc->oids[partitionIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* keep the lock */
|
/* keep the lock */
|
||||||
|
|
Loading…
Reference in New Issue