pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator
Date
Msg-id E1i72tk-0001Qd-Im@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix handling Inf and Nan values in GiST pairing heap comparator

Previously plain float comparison was used in GiST pairing heap.  Such
comparison doesn't provide proper ordering for value sets containing Inf and Nan
values.  This commit fixes that by usage of float8_cmp_internal().  Note, there
is remaining problem with NULL distances, which are represented as Inf in
pairing heap.  It would be fixes in subsequent commit.

Backpatch to all supported versions.

Reported-by: Andrey Borodin
Discussion: https://postgr.es/m/CAPpHfdsNvNdA0DBS%2BwMpFrgwT6C3-q50sFVGLSiuWnV3FqOJuQ%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Heikki Linnakangas
Backpatch-through: 9.4

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8f724002e2fe0e415f5a603462440d2f297f287c

Modified Files
--------------
src/backend/access/gist/gistscan.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Alexander Korotkov
Date:
Subject: pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Fix handling of NULL distances in KNN-GiST