Bug #100258 decimal returned function value overflow

Submitted: 20 Jul 2020 4:26 Modified: 20 Jul 2020 4:45
Reporter: andy zhang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: decimal function

[20 Jul 2020 4:26] andy zhang
Description:
When select list has function of decimal type, it's possible it is overflowed due to the incorrect integer part and precision.

How to repeat:
create table decimal_test(c1 int, c2 int);
insert into decimal_test values(97, 1);
select 27 DIV (C2/C1) / 17 from decimal_test;

---> return 99.9999 instead of expected 154.0588
[20 Jul 2020 4:27] andy zhang
It has nothing to do with group by.
[20 Jul 2020 4:45] andy zhang
Please refer to bug #100259 for correct description.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.