Details
Description
calculation of view column is wrong (by factor 1/10000). The column (3rd) is an arithmetic expression with an embedded select.
## create view v1 as select "error" , count(*) cnt , count(*) / (( select count(*) from t1 b where ## b.c3 = a.c3 ) / 100 ) "%" from t1 a where c1 < 5 group by c3 ;
|
## select * from v1 ;
|
## +-------+-----+------------+
|
## | error | 4 | 0.00666700 |
|
## +-------+-----+------------+
|
When executing the views underlying select directly, the correct value is returned.
## select "ok " , count(*) cnt , count(*) / (( select count(*) from t1 b where b.c3 = a.c3 ) / 100 ) ## "%" from t1 a where c1 < 5 group by c3 ;
|
## +-------+-----+---------+
|
## | ok | 4 | 66.6667 |
|
## +-------+-----+---------+
|
|
Attachments
Issue Links
- is duplicated by
-
MDEV-23656 view: removal of parentheses results in wrong result
- Closed