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

There is a logical error when applying constraints that combine comparison operators and OR expressions on the Time field. #28904

Open
LingweiKuang opened this issue Nov 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@LingweiKuang
Copy link

Bug Description

There is a logical error when applying constraints that combine comparison operators and OR expressions on the Time field. The abstract expression sequence is: (time < CONSTANT) OR (TRUE)

To Reproduce

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

DROP TABLE IF EXISTS t1;
CREATE TABLE t1(time TIMESTAMP, c1 BIGINT);
INSERT INTO t1(time, c1) VALUES (1641024000000, 1);

# query 1
SELECT c1 FROM t1 WHERE time <= 1641024000001;

# query 2
SELECT c1 FROM t1 WHERE (time <= 1641024000001) OR (1 < 2);

Expected Behavior

Query 1 returned result set: 1

Query 2 returned result set: 1

Actual behaviour

Query 1 returned result set: 1

Query 2 returned result set: empty set

Environment

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

Additional Context

Hello, TDengine team. In Query 1, using comparison operators to constrain the Time field successfully retrieves data. However, in Query 2, after adding the OR operator in combination, a logical error occurs, and the query returns no results.

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

There is a logical error when applying constraints that combine comparison operators and OR expressions on the Time field

@yu285
Copy link
Contributor

yu285 commented Nov 29, 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