Re: BUG #18429: Inconsistent results on similar queries with join lateral

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "b(dot)ryder(at)ateme(dot)com" <b(dot)ryder(at)ateme(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18429: Inconsistent results on similar queries with join lateral
Date: 2024-04-12 13:52:54
Message-ID: CAKFQuwaTm7gWL7S3KVFJCit92-JSFBoQ3Ax-msU+5P5YAw=C2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Friday, April 12, 2024, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 18429
> Logged by: Benoît Ryder
> Email address: b(dot)ryder(at)ateme(dot)com
> PostgreSQL version: 15.6
> Operating system: Debian
> Description:
>
> -- `where` clause should return false: (14 - 6) / 4 = (12 - 6) / 4 → false
> select 1 from c2 where (14 - c2.t) / c2.d = (12 - c2.t) / c2.
>

You are doing integer division here and the right hand side equals, 1.5; I
suppose something may have used to round that up to the integer 2 which
would make both sides equals but now (v16) rounds it down (or more
accurately truncates it) to 1.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Benoit Ryder 2024-04-12 14:43:24 Re: BUG #18429: Inconsistent results on similar queries with join lateral
Previous Message Tom Lane 2024-04-12 13:38:21 Re: BUG #18428: Connection broken but DB service still alive.