summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index de49a54b54a..96344c0968b 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -124,7 +124,8 @@ void Item_subselect::init(st_select_lex *select_lex,
parsing_place= (outer_select->in_sum_expr ?
NO_MATTER :
outer_select->parsing_place);
- if (unit->is_unit_op() && unit->first_select()->next_select())
+ if (unit->is_unit_op() &&
+ (unit->first_select()->next_select() or unit->fake_select_lex))
engine= new subselect_union_engine(unit, result, this);
else
engine= new subselect_single_select_engine(select_lex, result, this);