summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-10-15 11:51:41 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-10-15 11:51:41 +0400
commit1e36cbfa391ac80297958a4cc72d676e15eb1b37 (patch)
tree2304f70f5fd0d810ae7690360c65283015f08b5c /sql/sql_union.cc
parenteb2c6f451392396ef2ca74f1dba761fc4459d171 (diff)
parent25d0175fde2bff7397628d91c30aac8ba9d56301 (diff)
downloadmariadb-git-1e36cbfa391ac80297958a4cc72d676e15eb1b37.tar.gz
MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETE
- Merge with 10.0-base
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 19664c5079f..48611554987 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);
@@ -631,6 +632,9 @@ bool st_select_lex_unit::exec()
saved_error= optimize();
+ if (!saved_error && !was_executed && thd->lex->explain)
+ save_union_explain(thd->lex->explain);
+
if (uncacheable || !item || !item->assigned() || describe)
{
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
@@ -777,6 +781,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 && thd->lex->explain)
+ save_union_explain_part2(thd->lex->explain);
saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array,
&result_table_list,