diff options
author | Igor Babaev <igor@askmonty.org> | 2019-09-20 09:03:38 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2019-09-23 09:57:37 -0700 |
commit | b44171428ab2ea25db82f7cd27349e67812e4921 (patch) | |
tree | 15508ccee1f052305f1fe8b421e9dbf69f8df6e8 /sql/item_subselect.cc | |
parent | e3da362c037af95a85d3054243a4c9a039ceb4b4 (diff) | |
download | mariadb-git-b44171428ab2ea25db82f7cd27349e67812e4921.tar.gz |
MDEV-19956 Queries with subqueries containing UNION are not parsed
Shift-Reduce conflicts prevented parsing some queries with subqueries that
used set operations when the subqueries occurred in expressions or in IN
predicands.
The grammar rules for query expression were transformed in order to avoid
these conflicts. New grammar rules employ an idea taken from MySQL 8.0.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index dd1ffd20b47..86c607fb894 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -122,7 +122,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); |