Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)
Date: 2022-09-04 12:39:25
Message-ID: CAEudQApAWDRRYrnvSW19Jq+UO=0qG5Y3L8BERmwud6MBdBfELg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em sáb., 3 de set. de 2022 às 19:39, Daniel Gustafsson <daniel(at)yesql(dot)se>
escreveu:

> > On 3 Sep 2022, at 09:36, Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
>
> > Yeah, there are unfortunately a lot of problems around those and NaN,
> with
> > multiple reports in the past (I recall [1] and [2] but there were
> others).
>
> NaNs are indeed incredibly complicated, but I think we are sort of in a
> good
> place here given it's testing for equality in floats. The commit message
> of
> c4c34008854654279ec30067d72fc5d174d2f42f carries an explanation:
>
> The float datatypes consider NaNs values to be equal and greater
> than
> all non-NaN values. This change considers NaNs equal only for
> equality
> operators. The placement operators, contains, overlaps,
> left/right of
> etc. continue to return false when NaNs are involved.
>
> From testing and reading I believe the fix in this thread is correct, but
> since
> NaNs are involved I will take another look at this with fresh eyes before
> going
> ahead.
>
Yeah, the fix is correct.

But with Windows 10 build, I got this diff result:

diff -w -U3
C:/dll/postgres_dev/postgres_master/src/test/regress/expected/geometry.out
C:/dll/postgres_dev/postgres_master/src/test/regress/results/geometry.out
---
C:/dll/postgres_dev/postgres_master/src/test/regress/expected/geometry.out
2022-09-01 08:05:03.685931000 -0300
+++
C:/dll/postgres_dev/postgres_master/src/test/regress/results/geometry.out
2022-09-04 09:27:47.133617800 -0300
@@ -4380,9 +4380,8 @@
<(100,200),10> | <(100,200),10>
<(100,1),115> | <(100,1),115>
<(3,5),0> | <(3,5),0>
- <(3,5),NaN> | <(3,5),0>
<(3,5),NaN> | <(3,5),NaN>
-(9 rows)
+(8 rows)

-- Overlap with circle
SELECT c1.f1, c2.f1 FROM CIRCLE_TBL c1, CIRCLE_TBL c2 WHERE c1.f1 && c2.f1;

Not sure why.

regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2022-09-04 12:58:34 Latest build fails
Previous Message Tomas Vondra 2022-09-04 12:24:15 Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)