summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index d694afebc2c..5408b10c6b1 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3333,12 +3333,14 @@ void THD::restore_active_arena(Query_arena *set, Query_arena *backup)
void Show_explain_request::get_explain_data(void *arg)
{
Show_explain_request *req= (Show_explain_request*)arg;
- //TODO: change mem_root to point to request_thd->mem_root.
- // Actually, change the ARENA, because we're going to allocate items!
Query_arena backup_arena;
THD *target_thd= req->target_thd;
bool printed_anything= FALSE;
+ /*
+ Change the arena because JOIN::print_explain and co. are going to allocate
+ items. Let them allocate them on our arena.
+ */
target_thd->set_n_backup_active_arena((Query_arena*)req->request_thd,
&backup_arena);