BUG #17109: Fail to evaluate boolean expression properly

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: mingodad(at)gmail(dot)com
Subject: BUG #17109: Fail to evaluate boolean expression properly
Date: 2021-07-15 09:38:08
Message-ID: 17109-bc19e4c9849e382d@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17109
Logged by: Domingo Alvarez Duarte
Email address: mingodad(at)gmail(dot)com
PostgreSQL version: 11.10
Operating system: Online at https://extendsclass.com/postgresql-onli
Description:

When proposing a change to
https://github.com/facebookincubator/CG-SQL/pull/62 people there found
several problems on their project and one of the related to how
parse/evaluate expressions around "BETWEEN" keyword and they created a
simple test case to check it (adapted by me):

====
select /*NOT*/ 1 BETWEEN -2 and 2, NOT (1 BETWEEN -2 and 2), (/*NOT*/ 1)
BETWEEN -2 and 2
====

Here is the output of PostgreSQL where the second column is not negated (if
column 1 expression is true then "NOT" that expression should return false
):
====
?column? | ?column? | ?column?
-- | -- | --
true | true | true
====

Here is the output of sqlite3:
====
sqlite3 < "test-between.sql"
1|0|1
====

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Domingo Alvarez Duarte 2021-07-15 10:01:31 Re: BUG #17109: Fail to evaluate boolean expression properly
Previous Message Pawel Kudzia 2021-07-15 09:38:04 Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows