Skip to content

Commit 4d73380

Browse files
committed
pathman: bugfix for 32bit systems
1 parent c980be9 commit 4d73380

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

contrib/pg_pathman/pl_funcs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ check_overlap(PG_FUNCTION_ARGS)
327327
FmgrInfo cmp_func_1;
328328
FmgrInfo cmp_func_2;
329329
int i;
330+
bool byVal;
330331

331332
prel = get_pathman_relation_info(parent_oid, NULL);
332333
rangerel = get_pathman_range_relation(parent_oid, NULL);
@@ -338,11 +339,14 @@ check_overlap(PG_FUNCTION_ARGS)
338339
cmp_func_1 = *get_cmp_func(p1_type, prel->atttype);
339340
cmp_func_2 = *get_cmp_func(p2_type, prel->atttype);
340341

342+
byVal = rangerel->by_val;
341343
ranges = (RangeEntry *) dsm_array_get_pointer(&rangerel->ranges);
342344
for (i=0; i<rangerel->ranges.length; i++)
343345
{
344-
bool c1 = FunctionCall2(&cmp_func_1, p1, ranges[i].max);
345-
bool c2 = FunctionCall2(&cmp_func_2, p2, ranges[i].min);
346+
bool c1 = FunctionCall2(&cmp_func_1, p1,
347+
PATHMAN_GET_DATUM(ranges[i].max, byVal));
348+
bool c2 = FunctionCall2(&cmp_func_2, p2,
349+
PATHMAN_GET_DATUM(ranges[i].min, byVal));
346350

347351
if (c1 < 0 && c2 > 0)
348352
PG_RETURN_BOOL(true);

0 commit comments

Comments
 (0)