Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.5, 1.2.3
-
None
-
2019-05, 2019-06
Description
Discovered during QA:
create table tb1 (d1 decimal(7,2), i1 int)engine=columnstore;
insert into tb1 values (7.12, 1), (12.12, 1);
select (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) from tb1 group by i1;
This results in a random output in 1.2, and a 0 output in 1.1. The answer is 100 as can be seen when using innodb:
MariaDB [dhall]> select (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) from inno_tb1 group by i1;
---------------------------------------------------------
(sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) |
---------------------------------------------------------
100 |
---------------------------------------------------------
1 row in set (0.008 sec)
Using the divide operator '/' instead of the div function may result in a different set of random numbers.
Attachments
Issue Links
- is duplicated by
-
MCOL-3338 Sporadic Internal error: TreeNode::getDecimalVal: decimal overflow is returned when execute query consecutively several times
- Closed
- relates to
-
MCOL-3338 Sporadic Internal error: TreeNode::getDecimalVal: decimal overflow is returned when execute query consecutively several times
- Closed