Skip to content

Commit

Permalink
Correctly handle mr @> mr predicate (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoema authored Aug 2, 2024
1 parent dd1039e commit 0a4c2c6
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/multirangetypes_mest.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ PG_FUNCTION_INFO_V1(mspg_multirange_compress);
PGDLLEXPORT Datum
mspg_multirange_compress(PG_FUNCTION_ARGS)
{
MultirangeType *mr = PG_GETARG_MULTIRANGE_P(0);
PG_RETURN_POINTER(mr);
RangeType *r = PG_GETARG_RANGE_P(0);
PG_RETURN_POINTER(r);
}

/*****************************************************************************/
Expand Down Expand Up @@ -678,8 +678,17 @@ mspg_multirange_quad_inner_consistent(PG_FUNCTION_ARGS)
if (!empty)
{
which &= (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4);
maxLower = &lower;
minUpper = &upper;
if (mr)
{
/* If the query is a multirange, apply 'overlaps' */
maxLower = &upper;
minUpper = &lower;
}
else
{
maxLower = &lower;
minUpper = &upper;
}
}
break;

Expand Down

0 comments on commit 0a4c2c6

Please sign in to comment.