diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-10-16 13:38:42 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-10-16 13:38:42 +0400 |
commit | e5d13c1567cd5600f163aedfc940b3ba6b7703af (patch) | |
tree | e7ddb60207533508db6f4c509e8921e398769eed /sql/sql_union.cc | |
parent | ce069b1f6b3847309b06e548adf23fa0c7238336 (diff) | |
parent | e62e1e8a3b82f037cb3c76986327b36647288a2d (diff) | |
download | mariadb-git-e5d13c1567cd5600f163aedfc940b3ba6b7703af.tar.gz |
Merge 10.0-base -> 10.0
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index d7987a62a14..2523e03b4e3 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -622,6 +622,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); @@ -630,6 +631,11 @@ bool st_select_lex_unit::exec() item->make_const(); saved_error= optimize(); + + create_explain_query_if_not_exists(thd->lex, thd->mem_root); + + if (!saved_error && !was_executed) + save_union_explain(thd->lex->explain); if (uncacheable || !item || !item->assigned() || describe) { @@ -777,6 +783,9 @@ 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; + + if (!was_executed) + save_union_explain_part2(thd->lex->explain); saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array, &result_table_list, |