diff options
author | Igor Babaev <igor@askmonty.org> | 2017-05-17 16:16:54 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-05-17 16:16:54 -0700 |
commit | efb9f2617bde1654006a99af625859eb509d5448 (patch) | |
tree | 1b60247f430cc7c49e6fce8f40e332f0b9bc1a96 /sql/opt_subselect.cc | |
parent | 7e9716310261bce124585cbffd85f3402390ec9d (diff) | |
download | mariadb-git-efb9f2617bde1654006a99af625859eb509d5448.tar.gz |
Fixed the bug mdev-12812.
This is another correction of the patch for bug mdev-12670.
If a derived table is merged into a select with STRAIGHT_JOIN
modifier all IN subquery predicates contained in the
specification of the derived table cannot be subject to
conversion to semi-joins.
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r-- | sql/opt_subselect.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 84e06fda852..d8b4de29f47 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -1161,6 +1161,16 @@ bool convert_join_subqueries_to_semijoins(JOIN *join) in_subq->block_conversion_to_sj(); } } + + if (join->select_options & SELECT_STRAIGHT_JOIN) + { + /* Block conversion to semijoins for all candidates */ + li.rewind(); + while ((in_subq= li++)) + { + in_subq->block_conversion_to_sj(); + } + } li.rewind(); /* First, convert child join's subqueries. We proceed bottom-up here */ |