]> granicus.if.org Git - postgresql/commit
Fix handling Inf and Nan values in GiST pairing heap comparator
authorAlexander Korotkov <akorotkov@postgresql.org>
Sun, 8 Sep 2019 18:07:30 +0000 (21:07 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sun, 8 Sep 2019 18:47:34 +0000 (21:47 +0300)
commit8f724002e2fe0e415f5a603462440d2f297f287c
tree8cd96fec658865b08dd9d695af66c182e746aa18
parent7db45167ccf502f92ee6bf5ce8a2b8f0b2441128
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
src/backend/access/gist/gistscan.c