summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 08:59:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 08:59:09 +0300
commitd6d66c6e90050cb8aefcb55da48f7f849e5b11de (patch)
tree8a0fd06ca5605d9158e8d68924aff38262e073af /sql/sql_select.cc
parentf6b09a7ce58f564d8e5c08c799d2fc45cfc10870 (diff)
parent7c584d8270cf192496f36e993e7759616f3b650b (diff)
downloadmariadb-git-d6d66c6e90050cb8aefcb55da48f7f849e5b11de.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 6775c414402..8561f421ab3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -27263,8 +27263,11 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
if (unit->is_unit_op() || unit->fake_select_lex)
{
+ ulonglong save_options= 0;
+
if (unit->union_needs_tmp_table() && unit->fake_select_lex)
{
+ save_options= unit->fake_select_lex->options;
unit->fake_select_lex->select_number= FAKE_SELECT_LEX_ID; // just for initialization
unit->fake_select_lex->type= unit_operation_text[unit->common_op()];
unit->fake_select_lex->options|= SELECT_DESCRIBE;
@@ -27275,6 +27278,9 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
if (!is_pushed_union)
res= unit->exec();
}
+
+ if (unit->union_needs_tmp_table() && unit->fake_select_lex)
+ unit->fake_select_lex->options= save_options;
}
else
{