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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user