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

A logical error occurs when performing arithmetic operations on the BIGINT type. #28884

Open
LingweiKuang opened this issue Nov 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@LingweiKuang
Copy link

Bug Description

Loss of Precision in Arithmetic Operations on BIGINT Data Type.

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, 9000000000000000000);

# query 1
SELECT c1 FROM t1 WHERE 9000000000000000001 <= c1;

# query 2
SELECT c1 FROM t1 WHERE 9000000000000000001 <= c1 + CAST(0 as BIGINT);

Expected Behavior

Query 1 returned result set: empty set

Query 2 returned result set: empty set

Actual behaviour

Query 1 returned result set: empty set

Query 2 returned result set: 9000000000000000000

Environment

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

Additional Context

Hello, TDengine team. I found that arithmetic operations on the BIGINT type fail to meet the precision requirement of 2^63-1 supported by the BIGINT type, which might be a logical error.

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

A logical error occurs when performing arithmetic operations on the BIGINT type

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

1 participant