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

bug: WHERE clause not working as expected with NOT #15572

Closed
1 of 2 tasks
malwaregarry opened this issue May 18, 2024 · 0 comments · Fixed by #15577
Closed
1 of 2 tasks

bug: WHERE clause not working as expected with NOT #15572

malwaregarry opened this issue May 18, 2024 · 0 comments · Fixed by #15577
Labels
C-bug Category: something isn't working

Comments

@malwaregarry
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Version

8.0.26-v1.2.453-d7c9a83f6b(rust-1.77.0-nightly-2024-05-06T12:12:40.122758622Z)

What's Wrong?

There seems to be a problem with chaining NOT operations and WHERE clause.

Example:

CREATE TABLE t0(c0 BOOLEAN);
INSERT INTO t0(c0) VALUES (false);

This query returns false

SELECT (NOT (NOT t0.c0)) from t0;

But it successfully selects the row in the table

SELECT t0.c0 FROM t0 WHERE (NOT (NOT t0.c0)); -- return 1  row

How to Reproduce?

CREATE TABLE t0(c0 BOOLEAN);
INSERT INTO t0(c0) VALUES (false);

SELECT t0.c0 FROM t0 WHERE (NOT t0.c0); -- return 1 row
SELECT t0.c0 FROM t0 WHERE (NOT (NOT t0.c0)); -- return 1 row


CREATE TABLE t1(c0 BOOLEAN);
INSERT INTO t1(c0) VALUES (true);

SELECT t1.c0 FROM t1 WHERE (NOT t1.c0); -- return 0 rows
SELECT t1.c0 FROM t1 WHERE (NOT (NOT t1.c0)); -- return 0 rows

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant