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

In STABLE, there is a logical error when combining the IS NULL and IN operators. #29067

Open
LingweiKuang opened this issue Dec 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@LingweiKuang
Copy link

LingweiKuang commented Dec 9, 2024

Bug Description

The abstract expression sequence is: column IS [NOT] NULL AND column IN (constant)

To Reproduce

Assume that we execute the following statement under a database named testdb.

DROP STABLE super_t1;
DROP TABLE t1;
CREATE STABLE IF NOT EXISTS super_t1(time TIMESTAMP, c0 BIGINT UNSIGNED) TAGS (location BINARY(64));
CREATE TABLE t1 USING super_t1 TAGS ('ek');
INSERT INTO t1(time, c0) VALUES (1641024000000, 1);
INSERT INTO t1(time, c0) VALUES (1641024005000, 2);
INSERT INTO t1(time, c0) VALUES (1641024010000, NULL);

# query 1
SELECT * FROM t1 WHERE c0 IS NOT NULL AND c0 IN (-1);

# query 2
SELECT * FROM t1 WHERE c0 IS NULL AND c0 IN (-1);

Expected Behavior

Expected result set for Query 1: empty set

Expected result set for Query 2: empty set

Actual behaviour

Query 1 returned result set: 1 and 2

Query 2 returned result set: NULL

Environment

  • OS:Ubuntu Server 22.04 LTS 64bit
  • TDengine Version:3.3.4.8

Additional Context

Hello, TDengine team. The predicate evaluations for both Query 1 and Query 2 result in FALSE, and theoretically, no data should be retrieved from the database. However, in STABLE, we are able to retrieve all data that satisfies the IS [NOT] NULL condition, , while the IN operator has no effect.

@LingweiKuang LingweiKuang added the bug Something isn't working label Dec 9, 2024
@LingweiKuang
Copy link
Author

In STABLE, there is a logical error when combining the IS NULL and IN operators

@yu285 yu285 self-assigned this Dec 10, 2024
@yu285
Copy link
Contributor

yu285 commented Dec 10, 2024

ok we will check on this

@yu285
Copy link
Contributor

yu285 commented Dec 11, 2024

same as #25059

@yu285 yu285 closed this as completed Dec 11, 2024
@yu285 yu285 reopened this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants