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 version 3.3.4.8 of TDengine, There is a logical error in converting a CAST BINARY compound expression to a DOUBLE value. #29382

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

Comments

@LingweiKuang
Copy link

LingweiKuang commented Dec 29, 2024

Bug Description

The abstract expression sequence is: CAST(timeseries AS BINARY(50)) != timeseries;

To Reproduce

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

DROP TABLE IF EXISTS t1;
CREATE TABLE t1(time TIMESTAMP, c0 DOUBLE);
INSERT INTO t1(time, c0) VALUES (1641024000000, 0.018518518518519), (1641024005000, 0.015151515151515), (1641024010000, 0.1234567891012345);

# query 1
SELECT c0, CAST(c0 AS BINARY(50)) FROM t1 WHERE CAST(c0 AS BINARY(50)) != c0;

Expected Behavior

Expected result set for Query 1: empty set

Actual behaviour

Query 1 returned result set: 0.018518518518519 and 0.015151515151515

Environment

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

Additional Context

Hello, TDengine team. In the above query, I have encountered an issue while converting a DOUBLE value to BINARY, 0.1234567891012345 is correctly not retrieved; however, a value with lower precision, such as 0.015151515151515, is unexpectedly retrieved. The result of the cast does not meet expectations, This might be a logical error. Thank you.

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

In version 3 3 4 8 of TDengine, There is a logical error in converting a CAST BINARY compound expression to a DOUBLE value

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