Re: Bug in GiST paring heap comparator - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Bug in GiST paring heap comparator
Date
Msg-id FB746354-B9E7-4CF4-9C26-F2471EEC5900@yandex-team.ru
Whole thread Raw
In response to Bug in GiST paring heap comparator  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers

> 2 сент. 2019 г., в 9:54, Alexander Korotkov <a.korotkov@postgrespro.ru> написал(а):
>
> It appears to be related to implementation of comparison function in
> pairing heap used as priority queue for KNN.  It used plain float
> comparison, which doesn't handle Inf and Nan values well.  Attached
> patch replaced it with float8_cmp_internal().

Thanks! This patch fixes tests of my new GiST build :)

While patch looks good to me, I want to add that that there's a lot of <= and > comparisons in gistproc.c in function:

static float8
computeDistance(bool isLeaf, BOX *box, Point *point)

Should we fix this too? Or add comment why current code is safe.

Thanks!

Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: amul sul
Date:
Subject: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join
Next
From: Heikki Linnakangas
Date:
Subject: Re: Bug in GiST paring heap comparator