Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression with <boolean> = NOT <boolean> returns a syntax error but NOT <boolean> = <boolean> not #3505

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2014-06-27 17:22:18 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.17.17 (Jan2014-SP2)
CC: @njnes

Last updated: 2014-10-31 14:15:01 +0100

Comment 19858

Date: 2014-06-27 17:22:18 +0200
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0
Build Identifier:

SQL statements with syntax
fail to execute

SELECT '' AS "Not False" WHERE f1 = NOT FALSE;
SELECT '' AS "Not True" WHERE f1 = NOT TRUE;

Reproducible: Always

Steps to Reproduce:

CREATE TABLE BOOLTBL1 (f1 bool);
INSERT INTO BOOLTBL1 (f1) VALUES (cast('true' AS boolean));
INSERT INTO BOOLTBL1 (f1) VALUES ('true');
INSERT INTO BOOLTBL1 (f1) VALUES ('false');

-- next two queries fail with a syntax error:
SELECT f1 FROM BOOLTBL1 WHERE f1 = NOT FALSE;
SELECT f1 FROM BOOLTBL1 WHERE f1 = NOT TRUE;

-- next similar queries run fine:
SELECT f1 FROM BOOLTBL1 WHERE f1 = (NOT FALSE);
SELECT f1 FROM BOOLTBL1 WHERE NOT FALSE = f1;
SELECT f1 FROM BOOLTBL1 WHERE NOT f1 = FALSE;

SELECT f1 FROM BOOLTBL1 WHERE f1 = (NOT TRUE);
SELECT f1 FROM BOOLTBL1 WHERE NOT TRUE = f1;
SELECT f1 FROM BOOLTBL1 WHERE NOT f1 = TRUE;

something is wrong with the order of execution of an = NOT expression

Actual Results:

Error: syntax error, unexpected NOT in: "select f1 from booltbl1 where f1 = not"

Expected Results:

no syntax error and query result output

These tests are already included in sql/test/pg_regress/Test/boolean.sql
together with corrected stable.out and stable.err files.
So once this bug is resolved that test should report OK instead of current MAJOR

Comment 19887

Date: 2014-07-09 10:47:46 +0200
From: MonetDB Mercurial Repository <>

Changeset be17bc388a09 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=be17bc388a09

Changeset description:

add not true/not false parsing (solving bug #3505)

Comment 19982

Date: 2014-08-06 19:06:53 +0200
From: @njnes

fixed handling of bool with not.

Comment 19987

Date: 2014-08-06 19:12:37 +0200
From: MonetDB Mercurial Repository <>

Changeset 516d270cbe32 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=516d270cbe32

Changeset description:

fixed bugs 3505 and 3511

Comment 20402

Date: 2014-10-31 14:15:01 +0100
From: @sjoerdmullender

Oct2014 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant