summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-08-24 00:46:49 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-08-24 00:46:49 +0400
commit662bfed027dbf29d1d185ae677f0b5c79920287b (patch)
treee93419f19a639244b5f4b43d4af889b5330f4743 /sql/sql_union.cc
parent97e640b9ae83e07b444fceede6b0524256c7a3cc (diff)
parentef47cc1f091f76740212e125fe91f113028cbaa8 (diff)
downloadmariadb-git-662bfed027dbf29d1d185ae677f0b5c79920287b.tar.gz
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Merge with current 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 82808708889..832af7afff0 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -620,6 +620,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);
@@ -629,6 +630,9 @@ bool st_select_lex_unit::exec()
saved_error= optimize();
+ if (!was_executed && thd->lex->query_plan_footprint)
+ save_union_qpf(thd->lex->query_plan_footprint);
+
if (uncacheable || !item || !item->assigned() || describe)
{
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
@@ -775,6 +779,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->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,