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: FALSE AND exp1 OR exp1 in WHERE clause results in "Lost connection from server" #15569

Closed
1 of 2 tasks
malwaregarry opened this issue May 18, 2024 · 1 comment · Fixed by #15587
Closed
1 of 2 tasks
Assignees
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?

CREATE TABLE t2(c0 BOOLEAN, c1 INT);
SELECT t2.c1 FROM t2 WHERE (FALSE OR t2.c0 AND t2.c0);

The SELECT query above disconnects the client from the server:

ERROR 2013 (HY000): Lost connection to server during query

Interestingly this query does not:

SELECT t2.c1 FROM t2 WHERE (t2.c0 AND t2.c0);

Bug discovered with SQLancer

How to Reproduce?

CREATE TABLE t2(c0 BOOLEAN, c1 INT);
SELECT t2.c1 FROM t2 WHERE (FALSE OR t2.c0 AND t2.c0);

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@malwaregarry malwaregarry added the C-bug Category: something isn't working label May 18, 2024
@sundy-li
Copy link
Member

panicked at src/query/sql/src/planner/optimizer/filter/normalize_disjunctive_filter.rs:102:13:
assertion failed: args.len() >= 2
   0: databend_common_tracing::panic_hook::log_panic
             at ./src/common/tracing/src/panic_hook.rs:35:21
   1: databend_common_tracing::panic_hook::set_panic_hook::{{closure}}
             at ./src/common/tracing/src/panic_hook.rs:30:9

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.

3 participants