summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-07-20 01:52:03 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-07-20 01:52:03 +0400
commit8950ed8fdd7e19c8f49a5f0e6ea0c46a92d59e06 (patch)
treeeffdc3403345d18966581fdef9ac807f06ca5f05 /sql/sql_lex.cc
parentab70b76d9c4eaafde3a4c639bd280d2ccb1d2999 (diff)
downloadmariadb-git-8950ed8fdd7e19c8f49a5f0e6ea0c46a92d59e06.tar.gz
MDEV-298: SHOW EXPLAIN: Plan returned by SHOW EXPLAIN only contains 'Using temporary' ...
- Correct the way SHOW EXPLAIN code calculates 'need_order' parameter for JOIN::print_explain(). The calculation is still an approximation (see MDEV entry for details) (even EXPLAIN itself is wrong in certain cases), but now it's a better approximation than before.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index f918439d45a..5ff7705706e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -4100,7 +4100,8 @@ int st_select_lex::print_explain(select_result_sink *output,
{
res= join->print_explain(output, explain_flags, TRUE,
join->need_tmp, // need_tmp_table
- (join->order != 0 && !join->skip_sort_order), // bool need_order
+ !join->skip_sort_order && !join->no_order &&
+ (join->order || join->group_list), // bool need_order
join->select_distinct, // bool distinct
NULL); //const char *message
}