summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_union.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index ec1abc57a51..e56dd4b476e 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -361,7 +361,8 @@ int st_select_lex_unit::exec()
item->reset();
table->file->delete_all_rows();
}
- if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL))
+ if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL) &&
+ !describe)
DBUG_RETURN(1); // For sub-selects
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{