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

use cte sql by tikv and tiflah return different result #6994

Closed
dmf1721511982 opened this issue Mar 8, 2023 · 1 comment · Fixed by #7026
Closed

use cte sql by tikv and tiflah return different result #6994

dmf1721511982 opened this issue Mar 8, 2023 · 1 comment · Fixed by #7026

Comments

@dmf1721511982
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE abc (
dec1 DECIMAL(28,4),
dec2 DECIMAL(28,4)
)

INSERT INTO abc
(dec1, dec2)
VALUES (176.9900, 176.1100);

ALTER TABLE abc SET tiflash replica 1;

WITH kc AS(
SELECT CAST(IFNULL(dec1,0) - IFNULL(dec2,0) AS DECIMAL(28,2)) book_sum_1
FROM test.abc
)
SELECT * FROM kc;

WITH kc AS(
SELECT /*+ read_from_storage(tiflash[mi]) */CAST(IFNULL(dec1,0) - IFNULL(dec2,0) AS DECIMAL(28,2)) book_sum_1
FROM test.abc mi
)
SELECT * FROM kc;

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

return the same result

3. What did you see instead (Required)

use tikv return 0.88 and use tiflash return 0.89

4. What is your TiFlash version? (Required)

6.5.0

@windtalker
Copy link
Contributor

Seems there is a bug in decimal cast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants