Fixed bug mdev-10053.

The implementation of the walk method for the class Item_in_subselect
was missing. As a result the method never traversed the left operand
of any IN subquery predicate.

Item_exists_subselect::exists2in_processor() that performs the
Exist-To-In transformation calls the walk method to collect info
on outer references. As the walk method did not traverse the
left operands of the IN subqueries the outer references there
were not taken into account and some subqueries that were actually
correlated were marked as uncorrelated. It could lead to an
attempt of the materialization of such a subquery.

Also added a cleanup for some test cases merged from 5.5.
This commit is contained in:
Igor Babaev 2017-04-21 14:34:24 -07:00
commit 97fb1f2679
6 changed files with 101 additions and 12 deletions

View file

@ -705,6 +705,13 @@ public:
in_strategy= (SUBS_STRATEGY_CHOSEN | strategy);
DBUG_VOID_RETURN;
}
bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
return left_expr->walk(processor, walk_subquery, arg) ||
Item_subselect::walk(processor, walk_subquery, arg);
}
bool exists2in_processor(uchar *opt_arg __attribute__((unused)))
{
return 0;