pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator
Дата
Msg-id E1i72tY-0001PR-Ia@gemulon.postgresql.org
обсуждение исходный текст
Список 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_12_STABLE

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

Modified Files
--------------
src/backend/access/gist/gistscan.c         |  7 +++++--
src/test/regress/expected/create_index.out | 10 +++++-----
2 files changed, 10 insertions(+), 7 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Fix handling of NULL distances in KNN-GiST
Следующее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Fix handling Inf and Nan values in GiST pairing heap comparator