diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-10-14 20:09:33 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-10-14 20:09:33 +0400 |
commit | 105e3ae6c93f57498fa6c504dfbb92203b0d1056 (patch) | |
tree | 8148f8bc8bbd717f5b4540e0ea8a7673a490fc00 /sql/sql_delete.cc | |
parent | f67f8fd00fa6cf4bb38b10094060e6842a7d8daa (diff) | |
download | mariadb-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_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 7f58526d174..fae44a72205 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -66,8 +66,8 @@ void Delete_plan::save_explain_data(Explain_query *query) explain->deleting_all_rows= false; Update_plan::save_explain_data_intern(query, explain); } - - query->upd_del_plan= explain; + + query->add_upd_del_plan(explain); } @@ -75,7 +75,7 @@ void Update_plan::save_explain_data(Explain_query *query) { Explain_update* explain= new Explain_update; save_explain_data_intern(query, explain); - query->upd_del_plan= explain; + query->add_upd_del_plan(explain); } @@ -459,7 +459,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, goto exit_without_my_ok; query_plan.save_explain_data(thd->lex->explain); - thd->apc_target.enable(); DBUG_EXECUTE_IF("show_explain_probe_delete_exec_start", dbug_serve_apcs(thd, 1);); @@ -486,7 +485,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { delete select; free_underlaid_joins(thd, &thd->lex->select_lex); - thd->apc_target.disable(); DBUG_RETURN(TRUE); } thd->examined_row_count+= examined_rows; @@ -505,7 +503,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { delete select; free_underlaid_joins(thd, select_lex); - thd->apc_target.disable(); DBUG_RETURN(TRUE); } if (query_plan.index == MAX_KEY || (select && select->quick)) @@ -514,7 +511,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { delete select; free_underlaid_joins(thd, select_lex); - thd->apc_target.disable(); DBUG_RETURN(TRUE); } } @@ -624,7 +620,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, if (options & OPTION_QUICK) (void) table->file->extra(HA_EXTRA_NORMAL); - thd->apc_target.disable(); cleanup: /* Invalidate the table in the query cache if something changed. This must |