pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: mingodad@gmail.com
Subject: BUG #17109: Fail to evaluate boolean expression properly
Date: Thu, 15 Jul 2021 09:38:08 +0000
Message-ID: <17109-bc19e4c9849e382d@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17109
Logged by:          Domingo Alvarez Duarte
Email address:      mingodad@gmail.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
====



view thread (3+ messages)  latest in thread

Message-ID: <17109-bc19e4c9849e382d@postgresql.org>
Permalink:  ../17109-bc19e4c9849e382d@postgresql.org/
Also on:    postgresql.org/message-id/17109-bc19e4c9849e382d@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, mingodad@gmail.com
  Subject: Re: BUG #17109: Fail to evaluate boolean expression properly
  In-Reply-To: <17109-bc19e4c9849e382d@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox