pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/64dec8060c84b9b08c85fe5a757f10a4480ec484

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f0d55b68ef920b5ed22c3788a5dfc15fe1f70be7

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/387883f68c851e716476975229c539c938d1f206

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/992a18f5161cf36147eedaf7ac1d0af8a89646dc

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/276cdd4cc37845b31fb9048c4f32eeb33ae60e1a

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fd2ab03fea23ad6183fe694e750c901c6ff38479

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix incorrect lack of Datum conversion in _int_matchsel()
@ 2025-08-08 10:17  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2025-08-08 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a3906b44c5b920cd7beb569a097660f487adf883

Modified Files
--------------
contrib/intarray/_int_selfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2025-08-08 10:17 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>
2025-08-08 10:17 pgsql: Fix incorrect lack of Datum conversion in _int_matchsel() Peter Eisentraut <peter@eisentraut.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox