diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-06-27 16:41:12 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-06-27 16:41:12 +0400 |
commit | 8b7bbcf4dca77690091360e5ae7d011fb74554d6 (patch) | |
tree | f24c3d6df1035e7fab84e9fcbae80af7754a3bd6 /sql/sql_union.cc | |
parent | 99a8bfe68cdd6411ed24b3fa465d5dd4b70be6dc (diff) | |
download | mariadb-git-8b7bbcf4dca77690091360e5ae7d011fb74554d6.tar.gz |
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Make query plan be re-saved after the first join execution
(saving it after JOIN::cleanup is too late because EXPLAIN output
is currently produced before that)
- Handle QPF allocation/deallocation for edge cases, like unsuccessful
BINLOG command.
- Work around the problem with UNION's direct subselects not being visible.
- Update test results ("Using temporary; Using filesort" are now always printed
last in the Extra column)
- This cset gets rid of memory leaks/crashes. Some result mismatches still remain.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index b77b0669b50..e4a9c7630e6 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -617,6 +617,7 @@ bool st_select_lex_unit::exec() ulonglong add_rows=0; ha_rows examined_rows= 0; DBUG_ENTER("st_select_lex_unit::exec"); + bool was_executed= executed; if (executed && !uncacheable && !describe) DBUG_RETURN(FALSE); @@ -626,8 +627,8 @@ bool st_select_lex_unit::exec() saved_error= optimize(); - - save_union_qpf(thd->lex->query_plan_footprint); + if (!was_executed && thd->lex->query_plan_footprint) + save_union_qpf(thd->lex->query_plan_footprint); if (uncacheable || !item || !item->assigned() || describe) { @@ -776,8 +777,8 @@ bool st_select_lex_unit::exec() if (!fake_select_lex->ref_pointer_array) fake_select_lex->n_child_sum_items+= global_parameters->n_sum_items; - - save_union_qpf_part2(thd->lex->query_plan_footprint); + if (!was_executed && thd->lex->query_plan_footprint) + save_union_qpf_part2(thd->lex->query_plan_footprint); saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array, &result_table_list, |