Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Wrong Returned Function Result in Tiflash #9664

Closed
curry-oss opened this issue Nov 21, 2024 · 2 comments
Closed

Wrong Returned Function Result in Tiflash #9664

curry-oss opened this issue Nov 21, 2024 · 2 comments
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute severity/moderate type/bug The issue is confirmed as a bug.

Comments

@curry-oss
Copy link

curry-oss commented Nov 21, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

DROP TABLE IF EXISTS t1;

CREATE TABLE t1 (
  id INT AUTO_INCREMENT PRIMARY KEY,
  col1 DOUBLE,
  INDEX idx_col1 (col1)
);

INSERT INTO t1 (col1) 
VALUES 
  (1.7976931348623157E308),
  (2.2250738585072014E-308),
  (-1.7976931348623157E308),
  (-2.2250738585072014E-308);

ALTER TABLE t1 SET TIFLASH REPLICA 1;

SELECT  /*+ READ_FROM_STORAGE(TIKV[t1]) */ * FROM t1
WHERE col1 <> LOG(1 + col1) * EXP(ROUND(ABS(col1))) + SQRT(ROUND(col1));

SELECT  /*+ READ_FROM_STORAGE(TIFLASH[t1]) */ * FROM t1
WHERE col1 <> LOG(1 + col1) * EXP(ROUND(ABS(col1))) + SQRT(ROUND(col1));

2. What did you expect to see? (Required)

I believe that both TiKV and TiFlash should either throw the same errors or return the same accurate values.

3. What did you see instead (Required)

mysql> SELECT  /*+ READ_FROM_STORAGE(TIKV[t1]) */ * FROM    t1 WHERE    col1 <> LOG(1 + col1) * EXP(ROUND(ABS(col1))) + SQRT(ROUND(col1));
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'
mysql> SELECT  /*+ READ_FROM_STORAGE(TIFLASH[t1]) */ * FROM    t1 WHERE    col1 <>  LOG(1 + col1) * EXP(ROUND(ABS(col1))) + SQRT(ROUND(col1));
+----+--------------------------+
| id | col1                     |
+----+--------------------------+
|  1 |   1.7976931348623157e308 |
|  2 |  2.2250738585072014e-308 |
|  4 | -2.2250738585072014e-308 |
+----+--------------------------+
3 rows in set (0.05 sec)

4. What is your TiDB version? (Required)

TiDB v8.4.0

@curry-oss curry-oss added the type/bug The issue is confirmed as a bug. label Nov 21, 2024
@curry-oss
Copy link
Author

/label affects-8.4
/label affects-8.5

@yibin87
Copy link
Contributor

yibin87 commented Nov 25, 2024

Duplicated with #9654

@yibin87 yibin87 closed this as completed Nov 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants