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

Fix of LP BUG#793589 Wrong result with double ORDER BY

Problem was in caching 'eq_ref' dependency between calls of remove_const() for ORDER BY and GROUP BY lists.
This commit is contained in:
unknown
2012-01-05 11:06:52 +02:00
parent 98135fed0f
commit d63fc00f35
3 changed files with 92 additions and 0 deletions

View File

@ -7368,6 +7368,15 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
table_map ref;
DBUG_ENTER("remove_const");
/*
Cleanup to avoid interference of calls of this function for
ORDER BY and GROUP BY
*/
for (JOIN_TAB *tab= join->join_tab + join->const_tables;
tab < join->join_tab + join->tables;
tab++)
tab->cached_eq_ref_table= FALSE;
prev_ptr= &first_order;
*simple_order= *join->join_tab[join->const_tables].on_expr_ref ? 0 : 1;