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