mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed bug #16203.
If check_quick_select returns non-empty range then the function cost_group_min_max cannot return 0 as an estimate of the number of retrieved records. Yet the function erroneously returned 0 as the estimate in some situations. mysql-test/r/group_min_max.result: Added a test case for bug #16203. mysql-test/t/group_min_max.test: Added a test case for bug #16203.
This commit is contained in:
@ -7780,6 +7780,7 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
|
||||
quick_prefix_selectivity= (double) quick_prefix_records /
|
||||
(double) table_records;
|
||||
num_groups= (uint) rint(num_groups * quick_prefix_selectivity);
|
||||
set_if_bigger(num_groups, 1);
|
||||
}
|
||||
|
||||
if (used_key_parts > group_key_parts)
|
||||
|
Reference in New Issue
Block a user