-
Notifications
You must be signed in to change notification settings - Fork 409
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
avg overflow #3562
Labels
affects-5.4
affects-6.0
affects-6.1
affects-6.2
affects-6.3
affects-6.4
affects-6.5
affects-6.6
affects-7.0
affects-7.1
affects-7.5
affects-8.1
component/compute
severity/major
type/bug
The issue is confirmed as a bug.
Comments
mysql does not return the correct result, because it Truncated the immediate sum results at runtime.
|
|
mysql:
after insert into ts select * from ts; mysql has 16 rows.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-5.4
affects-6.0
affects-6.1
affects-6.2
affects-6.3
affects-6.4
affects-6.5
affects-6.6
affects-7.0
affects-7.1
affects-7.5
affects-8.1
component/compute
severity/major
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
99999999999999999999999999999999999999999999999999999999999999999
3. What did you see instead (Required)
mysql> select avg(a) from t group by b;
ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Decimal math overflow
4. What is your TiFlash version? (Required)
master
root cause
in the projection after rewritten avg = sum/count, the sum overflows decaim(65,0), but the div's return type is decimal(65,4), whose length of integer is shorter than 65. It throws exception overflow after div.
The text was updated successfully, but these errors were encountered: