Skip to content

Commit fd2ab03

Browse files
committed
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 <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/8246d7ff-f4b7-4363-913e-827dadfeb145%40eisentraut.org
1 parent 9e63f83 commit fd2ab03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/intarray/_int_selfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ _int_matchsel(PG_FUNCTION_ARGS)
177177
if (query->size == 0)
178178
{
179179
ReleaseVariableStats(vardata);
180-
return (Selectivity) 0.0;
180+
PG_RETURN_FLOAT8(0.0);
181181
}
182182

183183
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy