pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator
Date: Sun, 08 Sep 2019 19:31:12 +0000
Message-ID: <E1i72u0-0001Sk-E5@gemulon.postgresql.org> (raw)

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
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/111fb7e42e335bbe104939418ec44c903d3b2329

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



view thread (7+ messages)

Message-ID: <E1i72u0-0001Sk-E5@gemulon.postgresql.org>
Permalink:  ../E1i72u0-0001Sk-E5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1i72u0-0001Sk-E5@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator
  In-Reply-To: <E1i72u0-0001Sk-E5@gemulon.postgresql.org>
  References: <E1i72u0-0001Sk-E5@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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