1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Bug #32268: Indexed queries give bogus MIN and MAX results

Loose index scan does the grouping so the temp table does 
not need to do it, even when sorting.
Fixed by checking if the grouping is already done before
doing sorting and grouping in a temp table and do only 
sorting.


mysql-test/r/group_min_max.result:
  Bug #32268: test case
mysql-test/t/group_min_max.test:
  Bug #32268: test case
sql/sql_select.cc:
  Bug #32268: don't group in the temp table if already done
This commit is contained in:
unknown
2007-11-20 16:07:24 +02:00
parent 4b48eb6f1e
commit 429abc5845
3 changed files with 72 additions and 1 deletions

View File

@@ -10256,7 +10256,8 @@ Next_select_func setup_end_select_func(JOIN *join)
/* Set up select_end */
if (table)
{
if (table->group && tmp_tbl->sum_func_count)
if (table->group && tmp_tbl->sum_func_count &&
!tmp_tbl->precomputed_group_by)
{
if (table->s->keys)
{