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

Merge of fix for Bug#50394.

This commit is contained in:
Martin Hansson
2010-09-13 14:46:55 +02:00
3 changed files with 55 additions and 0 deletions

View File

@ -1522,6 +1522,15 @@ JOIN::optimize()
}
if (order)
{
/*
Do we need a temporary table due to the ORDER BY not being equal to
the GROUP BY? The call to test_if_skip_sort_order above tests for the
GROUP BY clause only and hence is not valid in this case. So the
estimated number of rows to be read from the first table is not valid.
We clear it here so that it doesn't show up in EXPLAIN.
*/
if (need_tmp && (select_options & SELECT_DESCRIBE) != 0)
join_tab[const_tables].limit= 0;
/*
Force using of tmp table if sorting by a SP or UDF function due to
their expensive and probably non-deterministic nature.