1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring

Part 2 of:
- Pass more tests
- select with subselects is now shown with type=PRIMARY where it used to be (incorrectly) 'SIMPLE'
This commit is contained in:
Sergey Petrunya
2013-06-18 19:21:00 +04:00
parent d2ea53aaed
commit 1c6fc3f6b9
17 changed files with 100 additions and 68 deletions

View File

@ -3273,6 +3273,7 @@ end_with_restore_list:
result= NULL;
}
select_lex->set_explain_type(FALSE);
thd->lex->query_plan_footprint= new QPF_query;
}
else
result= new multi_delete(aux_tables, lex->table_count);
@ -3296,6 +3297,13 @@ end_with_restore_list:
{
MYSQL_MULTI_DELETE_DONE(res, del_result->num_deleted());
}
else
{
result->reset_offset_limit();
thd->lex->query_plan_footprint->print_explain(result, thd->lex->describe);
delete thd->lex->query_plan_footprint;
thd->lex->query_plan_footprint= NULL;
}
if (res)
result->abort_result_set(); /* for both DELETE and EXPLAIN DELETE */
@ -4816,6 +4824,11 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
if (!res)
{
/*
Do like the original select_describe did: remove OFFSET from the
top-level LIMIT
*/
result->reset_offset_limit();
thd->lex->query_plan_footprint->print_explain(result, thd->lex->describe);
}
delete thd->lex->query_plan_footprint;