summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-10-14 20:09:33 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-10-14 20:09:33 +0400
commit105e3ae6c93f57498fa6c504dfbb92203b0d1056 (patch)
tree8148f8bc8bbd717f5b4540e0ea8a7673a490fc00 /sql/sql_lex.cc
parentf67f8fd00fa6cf4bb38b10094060e6842a7d8daa (diff)
downloadmariadb-git-105e3ae6c93f57498fa6c504dfbb92203b0d1056.tar.gz
MDEV-3798: EXPLAIN UPDATE/DELETE
Update the SHOW EXPLAIN code to work with the new architecture (part#1): Before, SHOW EXPLAIN operated on real query plan structures, which meant it had to check when SELECTs are created/deleted. SELECTs would call apc_target->enable() when they got a query plan and disable() when their query plan was deleted. Now, Explain data structure becomes available at once (and we call apc_target->enable()) and then it stays until it is deleted (when that happens, we call apc_target->disable()).
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index bd31200e749..09cb8f06afc 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -4276,11 +4276,15 @@ int st_select_lex_unit::save_union_explain(Explain_query *output)
for (SELECT_LEX *sl= first; sl; sl= sl->next_select())
eu->add_select(sl->select_number);
+ eu->fake_select_type= "UNION RESULT";
+ eu->using_filesort= test(global_parameters->order_list.first);
+
// Save the UNION node
output->add_node(eu);
- eu->fake_select_type= "UNION RESULT";
- eu->using_filesort= test(global_parameters->order_list.first);
+ if (eu->get_select_id() == 1)
+ output->query_plan_ready();
+
return 0;
}