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 related to precision in the division operation. #28990

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

Comments

@LingweiKuang
Copy link

Bug Description

The abstract expression sequence is: column / constant <= constant

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 DOUBLE);
INSERT INTO t1(time, c1) VALUES (1641024000000, 2), (1641024005000, 3), (1641024010000, 4), (1641024015000, 5);

# query 1
SELECT c1 FROM t1 WHERE (c1 / 10000000 <= 0.0000001);

Expected Behavior

Query 1 returned result set: empty set

Actual behaviour

Query 1 returned result set: 2, 3, 4, 5

Environment

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

Additional Context

Hello, TDengine team. In the above query, the predicate for column c1 should result in values less than or equal to 1, but values 2, 3, 4, and 5 are being returned. Therefore, when performing division, if a column is used as the divisor, regardless of the column's data type, the division operation retains only six significant digits, which does not meet the setting for the DOUBLE data type, which should allow 15-16 significant digits. This suggests that there may be a logical error related to precision loss in the division operation.

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

There is a logical error related to precision in the division operation

@yu285
Copy link
Contributor

yu285 commented Dec 2, 2024

Thanks for your feedback , you provide us many good bug issue , do you have Wechat ? we can communicate more
conveniently in the future

@yu285 yu285 self-assigned this Dec 2, 2024
@LingweiKuang
Copy link
Author

Thank you for your recognition of our work. My WeChat ID is: Rose-of-LittlePrince.
😊😊

Thanks for your feedback , you provide us many good bug issue , do you have Wechat ? we can communicate more感谢您的反馈,您为我们提供了很多很好的 bug 问题,您有微信吗?我们可以进行更多沟通 conveniently in the future方便将来

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