Skip to content

Commit e2c16b2

Browse files
committed
pathman: bugfixes
1 parent aec8e37 commit e2c16b2

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

contrib/pathman/pathman.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,9 @@ handle_boolexpr(const BoolExpr *expr, const PartRelationInfo *prel)
649649
List *ret = ALL;
650650
List *b = ALL;
651651

652+
if (expr->boolop == AND_EXPR)
653+
ret = list_make1_int(make_range(0, RANGE_INFINITY));
654+
652655
foreach (lc, expr->args)
653656
{
654657
b = walk_expr_tree((Expr*)lfirst(lc), prel);

contrib/pathman/rangeset.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,23 @@ intersect_ranges(List *a, List *b)
7070
List *new_list = NIL;
7171
int low, high;
7272

73+
/* if a or b (or both) are empty then intersections is also empty */
74+
if (!a || !b)
75+
{
76+
if (a)
77+
pfree(a);
78+
if (b)
79+
pfree(b);
80+
return NIL;
81+
}
82+
7383
foreach(lcb, b)
7484
{
7585
IndexRange rb = (IndexRange)lfirst_int(lcb);
7686

7787
/* if "a" is empty then initialize it with infinite range */
78-
if (a == NIL)
79-
a = list_make1_int(make_range(0, RANGE_INFINITY));
88+
// if (a == NIL)
89+
// a = list_make1_int(make_range(0, RANGE_INFINITY));
8090

8191
/* intersect entry from "b" and every entry in "a" */
8292
foreach(lca, a)

0 commit comments

Comments
 (0)