1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed bug lp:900375

The range optimizer incorrectly chose a loose scan for group by
when there is a correlated WHERE condition. This range access
method cannot be executed for correlated conditions also with the
"range checked for each record" because generally the range access
method can change for each outer record. Loose scan destructively
changes the query plan and removes the GROUP operation, which will
result in wrong query plans if another range access is chosen
dynamically.
This commit is contained in:
unknown
2011-12-12 12:36:46 +02:00
parent 314c377422
commit 6404504d0c
3 changed files with 255 additions and 1 deletions

View File

@ -9337,6 +9337,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
DBUG_RETURN(NULL);
if (table->s->keys == 0) /* There are no indexes to use. */
DBUG_RETURN(NULL);
if (join->conds && join->conds->used_tables() & OUTER_REF_TABLE_BIT)
DBUG_RETURN(NULL); /* Cannot execute with correlated conditions. */
/* Analyze the query in more detail. */
List_iterator<Item> select_items_it(join->fields_list);