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

CastStringAsDecimal return wrong result of negative number. #3619

Closed
LittleFall opened this issue Dec 9, 2021 · 1 comment · Fixed by #3621
Closed

CastStringAsDecimal return wrong result of negative number. #3619

LittleFall opened this issue Dec 9, 2021 · 1 comment · Fixed by #3621

Comments

@LittleFall
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a char(5));
alter table t set tiflash replica 1;
insert into t values ('-1');
set tidb_enforce_mpp=1; -- force cast push down to tiflash

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

mysql> SELECT /*+ READ_FROM_STORAGE(tikv[t]) */ cast(a AS DECIMAL) FROM t;
+--------------------+
| cast(a AS DECIMAL) |
+--------------------+
|                 -1 |
+--------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

SELECT /*+ READ_FROM_STORAGE(tiflash[t]) */ cast(a AS DECIMAL) FROM t;
+--------------------+
| cast(a AS DECIMAL) |
+--------------------+
|                  1 |
+--------------------+

4. What is your TiFlash version? (Required)

4.0+

@LittleFall LittleFall added type/bug The issue is confirmed as a bug. severity/critical labels Dec 9, 2021
@LittleFall
Copy link
Contributor Author

LittleFall commented Dec 9, 2021

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.

2 participants