diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-10-28 02:30:02 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-10-28 02:30:02 +0400 |
commit | ca020dfa9e8668ce52eaff92c157097bba671ec1 (patch) | |
tree | 24f6043a525155189e0cc3b7a41eb75e8377c3d3 /sql/sql_lex.cc | |
parent | 286a751490cd109a470e30ef486755cd4922802d (diff) | |
download | mariadb-git-ca020dfa9e8668ce52eaff92c157097bba671ec1.tar.gz |
MWL#182: Explain running statements
- Get subqueries to work, part #1.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 9aee5caeb64..3b355a312af 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3706,6 +3706,22 @@ int st_select_lex::print_explain(select_result_sink *output) FALSE, // bool need_order, FALSE, // bool distinct, NULL); //const char *message + if (res) + goto err; + + for (SELECT_LEX_UNIT *unit= join->select_lex->first_inner_unit(); + unit; + unit= unit->next_unit()) + { + /* + Display subqueries only if they are not parts of eliminated WHERE/ON + clauses. + */ + if (!(unit->item && unit->item->eliminated)) + { + unit->print_explain(output); + } + } } else { @@ -3717,6 +3733,7 @@ int st_select_lex::print_explain(select_result_sink *output) FALSE, // bool distinct, msg); //const char *message } +err: return 0; } |