summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-09-13 16:07:50 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-09-13 16:07:50 +0200
commit061769d7b61e1255664644618c83f73a414ad66e (patch)
treef1438c893cdf1f838754f9754951f5fe972782bc /sql/sql_select.cc
parent99e507e8a4d44243740e8629c5517927f948a127 (diff)
parent20bdf7636b115c53bfb57417af43db3b1494a6da (diff)
downloadmariadb-git-061769d7b61e1255664644618c83f73a414ad66e.tar.gz
merge
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 02f2fc6bc9e..1a4c12d6940 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1487,6 +1487,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.
*/