[MDEV-23278] Incorrect Calculation while using Avg Function Created: 2020-07-23 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.4.8, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | anup b | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Amazon RDS |
||
| Description |
|
Avg Function reports incorrect query results in SELECT. show variables like '%optimizer_switch%'; index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on CREATE TABLE `avg_calc_test` ( INSERT INTO avg_calc_test (name) values ('ORANGE'), ('BLUE'), ('BLACK'), ('ORANGE'), ('BLACK'); – correct result 2.00 --Incorrect result 0.99 SET optimizer_switch="split_materialized=off"; |
| Comments |
| Comment by Alice Sherepa [ 2020-07-24 ] | ||||||||||||||
|
Thanks a lot for the report!
| ||||||||||||||
| Comment by anup b [ 2020-07-28 ] | ||||||||||||||
|
Thank you!! |