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

Missing double overflow error exception in Tiflash #9654

Open
curry-oss opened this issue Nov 19, 2024 · 6 comments
Open

Missing double overflow error exception in Tiflash #9654

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

Comments

@curry-oss
Copy link

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 PRIMARY KEY AUTO_INCREMENT
);

ALTER TABLE t1 SET TIFLASH REPLICA 1;
INSERT INTO t1 values (1000);

SELECT /*+ READ_FROM_STORAGE(TIKV[t1])*/
    EXP(id) AS exp_overflow
FROM
    t1;

SELECT /*+ READ_FROM_STORAGE(TIFLASH[t1])*/
    EXP(id) AS exp_overflow
FROM
    t1;

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

I find that the returned information is inconsistent across two queries.

3. What did you see instead (Required)

mysql> SELECT /*+ READ_FROM_STORAGE(TIFLASH[t1])*/     EXP(id) AS exp_overflow FROM     t1;
+--------------+
| exp_overflow |
+--------------+
|            0 |
+--------------+
1 row in set (0.04 sec)

mysql> SELECT /*+ READ_FROM_STORAGE(TIKV[t1])*/     EXP(id) AS exp_overflow FROM     t1;
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(cast(test1.t1.id, double BINARY))'

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 19, 2024
@curry-oss
Copy link
Author

/label affects-8.4

@curry-oss
Copy link
Author

/label affects-8.5

@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Nov 19, 2024
@jebter jebter added severity/moderate impact/inconsistency incorrect/inconsistency/inconsistent labels Nov 22, 2024
@curry-oss curry-oss changed the title Wrong Error Exception in Tiflash Missing Error Exception in Tiflash Nov 25, 2024
@yibin87
Copy link
Contributor

yibin87 commented Nov 25, 2024

Tiflash currently uses native c++ double type as the implementation. Thus it lacks some overflow checks.

@yibin87 yibin87 changed the title Missing Error Exception in Tiflash Missing double overflow error exception in Tiflash Nov 25, 2024
@yibin87
Copy link
Contributor

yibin87 commented Nov 25, 2024

BTW, are you doing some automatic testing like fuzz to help find tidb issues? @curry-oss

@curry-oss
Copy link
Author

Ok, looking forward to it being resolved in the near future.

@curry-oss
Copy link
Author

BTW, are you doing some automatic testing like fuzz to help find tidb issues? @curry-oss

I have recently started learning TiDB, but I have not yet used any automated tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute impact/inconsistency incorrect/inconsistency/inconsistent severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants