diff options
| author | Peter Eisentraut | 2025-08-08 10:06:06 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2025-08-08 10:06:06 +0000 |
| commit | fd2ab03fea23ad6183fe694e750c901c6ff38479 (patch) | |
| tree | 9c346e166ddc0996320dfd802178607377524e1e /contrib/intarray/_int_selfuncs.c | |
| parent | 9e63f83a7e7f8211581bfe9e9d05b72695261f4f (diff) | |
Fix incorrect lack of Datum conversion in _int_matchsel()
The code used
return (Selectivity) 0.0;
where
PG_RETURN_FLOAT8(0.0);
would be correct.
On 64-bit systems, these are pretty much equivalent, but on 32-bit
systems, PG_RETURN_FLOAT8() correctly produces a pointer, but the old
wrong code would return a null pointer, possibly leading to a crash
elsewhere.
We think this code is actually not reachable because bqarr_in won't
accept an empty query, and there is no other function that will
create query_int values. But better be safe and not let such
incorrect code lie around.
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/8246d7ff-f4b7-4363-913e-827dadfeb145%40eisentraut.org
Diffstat (limited to 'contrib/intarray/_int_selfuncs.c')
| -rw-r--r-- | contrib/intarray/_int_selfuncs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c index 6c3b7ace146..9bf64486242 100644 --- a/contrib/intarray/_int_selfuncs.c +++ b/contrib/intarray/_int_selfuncs.c @@ -177,7 +177,7 @@ _int_matchsel(PG_FUNCTION_ARGS) if (query->size == 0) { ReleaseVariableStats(vardata); - return (Selectivity) 0.0; + PG_RETURN_FLOAT8(0.0); } /* |
