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

Wrong precision:18446744073709551615 #4147

Closed
lilinghai opened this issue Feb 25, 2022 · 2 comments · Fixed by #4329
Closed

Wrong precision:18446744073709551615 #4147

lilinghai opened this issue Feb 25, 2022 · 2 comments · Fixed by #4329
Assignees
Labels
affects-6.0 plan bugs related to plans severity/major type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t( a int primary key);
alter table t set tiflash replica 2;
select count(*) from t where case when a then isnull(a) else 12.991 end;
/*
+--------------------------------+----------+-------------------+---------------+---------------------------------+
| id                             | estRows  | task              | access object | operator info                   |
+--------------------------------+----------+-------------------+---------------+---------------------------------+
| HashAgg_21                     | 1.00     | root              |               | funcs:count(Column#4)->Column#2 |
| └─TableReader_23               | 1.00     | root              |               | data:ExchangeSender_22          |
|   └─ExchangeSender_22          | 1.00     | batchCop[tiflash] |               | ExchangeType: PassThrough       |
|     └─HashAgg_9                | 1.00     | batchCop[tiflash] |               | funcs:count(1)->Column#4        |
|       └─Selection_20           | 8000.00  | batchCop[tiflash] |               | case(c2.t.a, 0, 12.991)         |
|         └─TableFullScan_19     | 10000.00 | batchCop[tiflash] | table:t       | keep order:false, stats:pseudo  |
+--------------------------------+----------+-------------------+---------------+---------------------------------+
*/

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

successfully

3. What did you see instead (Required)

ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Wrong precision:18446744073709551615

4. What is your TiFlash version? (Required)

master

@lilinghai lilinghai added the type/bug The issue is confirmed as a bug. label Feb 25, 2022
@yibin87 yibin87 self-assigned this Mar 4, 2022
@yibin87
Copy link
Contributor

yibin87 commented Mar 4, 2022

Reproduced on latest version on local dev.

@yibin87
Copy link
Contributor

yibin87 commented Mar 17, 2022

It seems type transformation error from TiDB type to TiFlash IDataType, and mistakenly take NewDecimal's prec as -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.0 plan bugs related to plans severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants