Skip to content

Commit 29da3f5

Browse files
committed
pathman: issue with large partitions number fixed
1 parent 9972224 commit 29da3f5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

contrib/pg_pathman/pg_pathman.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
429429
* Expand simple_rte_array and simple_rel_array
430430
*/
431431

432-
if (ranges)
433-
{
432+
if (ranges)
433+
{
434434
len = irange_list_length(ranges);
435435

436436
/* Expand simple_rel_array and simple_rte_array */
@@ -536,7 +536,6 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
536536
parent_size += childrel->width * childrel->rows;
537537
}
538538

539-
Assert(parent_rows > 0);
540539
rel->rows = parent_rows;
541540
rel->width = rint(parent_size / parent_rows);
542541
// for (i = 0; i < nattrs; i++)
@@ -803,8 +802,8 @@ change_varno_walker(Node *node, change_varno_context *context)
803802
change_varno_walker((Node *) em->em_expr, context);
804803
if (bms_is_member(context->old_varno, em->em_relids))
805804
{
806-
bms_del_member(em->em_relids, context->old_varno);
807-
bms_add_member(em->em_relids, context->new_varno);
805+
em->em_relids = bms_del_member(em->em_relids, context->old_varno);
806+
em->em_relids = bms_add_member(em->em_relids, context->new_varno);
808807
}
809808
return false;
810809

0 commit comments

Comments
 (0)