diff options
author | Mattias Jonsson <mattias.jonsson@oracle.com> | 2010-09-13 16:07:50 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@oracle.com> | 2010-09-13 16:07:50 +0200 |
commit | 061769d7b61e1255664644618c83f73a414ad66e (patch) | |
tree | f1438c893cdf1f838754f9754951f5fe972782bc /sql/sql_select.cc | |
parent | 99e507e8a4d44243740e8629c5517927f948a127 (diff) | |
parent | 20bdf7636b115c53bfb57417af43db3b1494a6da (diff) | |
download | mariadb-git-061769d7b61e1255664644618c83f73a414ad66e.tar.gz |
merge
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 9 |
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. */ |