summaryrefslogtreecommitdiff
path: root/src/backend/access/brin/brin_minmax_multi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/brin/brin_minmax_multi.c')
-rw-r--r--src/backend/access/brin/brin_minmax_multi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c
index 8e4e6c2fc8a..e9ce0f2a1be 100644
--- a/src/backend/access/brin/brin_minmax_multi.c
+++ b/src/backend/access/brin/brin_minmax_multi.c
@@ -2602,7 +2602,7 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
for (keyno = 0; keyno < nkeys; keyno++)
{
- Datum matches;
+ bool matches;
ScanKey key = keys[keyno];
/* NULL keys are handled and filtered-out in bringetbitmap */
@@ -2618,7 +2618,7 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
finfo = minmax_multi_get_strategy_procinfo(bdesc, attno, subtype,
key->sk_strategy);
/* first value from the array */
- matches = FunctionCall2Coll(finfo, colloid, minval, value);
+ matches = DatumGetBool(FunctionCall2Coll(finfo, colloid, minval, value));
break;
case BTEqualStrategyNumber:
@@ -2664,18 +2664,18 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
finfo = minmax_multi_get_strategy_procinfo(bdesc, attno, subtype,
key->sk_strategy);
/* last value from the array */
- matches = FunctionCall2Coll(finfo, colloid, maxval, value);
+ matches = DatumGetBool(FunctionCall2Coll(finfo, colloid, maxval, value));
break;
default:
/* shouldn't happen */
elog(ERROR, "invalid strategy number %d", key->sk_strategy);
- matches = 0;
+ matches = false;
break;
}
/* the range has to match all the scan keys */
- matching &= DatumGetBool(matches);
+ matching &= matches;
/* once we find a non-matching key, we're done */
if (!matching)
@@ -2686,7 +2686,7 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
* have we found a range matching all scan keys? if yes, we're done
*/
if (matching)
- PG_RETURN_DATUM(BoolGetDatum(true));
+ PG_RETURN_BOOL(true);
}
/*
@@ -2703,7 +2703,7 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
for (keyno = 0; keyno < nkeys; keyno++)
{
- Datum matches;
+ bool matches;
ScanKey key = keys[keyno];
/* we've already dealt with NULL keys at the beginning */
@@ -2723,18 +2723,18 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
finfo = minmax_multi_get_strategy_procinfo(bdesc, attno, subtype,
key->sk_strategy);
- matches = FunctionCall2Coll(finfo, colloid, val, value);
+ matches = DatumGetBool(FunctionCall2Coll(finfo, colloid, val, value));
break;
default:
/* shouldn't happen */
elog(ERROR, "invalid strategy number %d", key->sk_strategy);
- matches = 0;
+ matches = false;
break;
}
/* the range has to match all the scan keys */
- matching &= DatumGetBool(matches);
+ matching &= matches;
/* once we find a non-matching key, we're done */
if (!matching)
@@ -2743,10 +2743,10 @@ brin_minmax_multi_consistent(PG_FUNCTION_ARGS)
/* have we found a range matching all scan keys? if yes, we're done */
if (matching)
- PG_RETURN_DATUM(BoolGetDatum(true));
+ PG_RETURN_BOOL(true);
}
- PG_RETURN_DATUM(BoolGetDatum(false));
+ PG_RETURN_BOOL(false);
}
/*