summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
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.h
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.h')
-rw-r--r--sql/sql_lex.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index c5b9c1eada2..0d22e815f5f 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1031,6 +1031,10 @@ public:
void clear_index_hints(void) { index_hints= NULL; }
bool is_part_of_union() { return master_unit()->is_union(); }
+ bool is_top_level_node()
+ {
+ return (select_number == 1) && !is_part_of_union();
+ }
bool optimize_unflattened_subqueries(bool const_only);
/* Set the EXPLAIN type for this subquery. */
void set_explain_type(bool on_the_fly);