1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-10880: Assertions keypart_map' or prebuilt->search_tuple->n_fields > 0' fail on DISTINCT and GROUP BY constant

add_group_and_distinct_keys() should take into account JOIN::simple_group.
This commit is contained in:
Oleksandr Byelkin
2017-06-20 14:55:30 +02:00
parent f65d6a03f0
commit b76b69cd5f
9 changed files with 65 additions and 37 deletions

View File

@ -5708,7 +5708,7 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab)
Item_field *cur_item;
key_map possible_keys(0);
if (join->group_list)
if (join->group_list || join->simple_group)
{ /* Collect all query fields referenced in the GROUP clause. */
for (cur_group= join->group_list; cur_group; cur_group= cur_group->next)
(*cur_group->item)->walk(&Item::collect_item_field_processor, 0,