mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
Merge mhansson@bk-internal:/home/bk/mysql-5.1-opt
into linux-st28.site:/home/martin/mysql/src/5.1o-bug30596 sql/sql_select.cc: Auto merged
This commit is contained in:
commit
53daf2e674
6 changed files with 229 additions and 4 deletions
|
|
@ -1069,6 +1069,20 @@ JOIN::optimize()
|
|||
find_field_in_order_list,
|
||||
(void *) group_list))
|
||||
{
|
||||
/*
|
||||
We have found that grouping can be removed since groups correspond to
|
||||
only one row anyway, but we still have to guarantee correct result
|
||||
order. The line below effectively rewrites the query from GROUP BY
|
||||
<fields> to ORDER BY <fields>. One exception is if skip_sort_order is
|
||||
set (see above), then we can simply skip GROUP BY.
|
||||
*/
|
||||
order= skip_sort_order ? 0 : group_list;
|
||||
/*
|
||||
If we have an IGNORE INDEX FOR GROUP BY(fields) clause, this must be
|
||||
rewritten to IGNORE INDEX FOR ORDER BY(fields).
|
||||
*/
|
||||
join_tab->table->keys_in_use_for_order_by=
|
||||
join_tab->table->keys_in_use_for_group_by;
|
||||
group_list= 0;
|
||||
group= 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue