-
Committer:
timour at askmonty
-
Date:
2012-12-21 09:32:49 UTC
-
Revision ID:
timour@askmonty.org-20121221093249-y6ju4tj7y0uwco7l
MDEV-537 Make multi-column non-top level subqueries to be executed via index (index/unique subquery)
instead of single_select_engine
This task changes the IN-EXISTS rewrite for multi-column subqueries "(a, b) IN (select b, c ...)"
to work in the same way as for single-column subqueries "a IN (select b ...) with respect to the
injection of NULL-rejecting predicates.
More specifically, the method Item_in_subselect::create_row_in_to_exists_cond() adds
Item_is_not_null_test and Item_func_trig_cond only if the left IN operand can be NULL.
Not having these predicates when not necessary, makes it possible to rewrite the subquery
into a "unique_subquery" or "index_subquery" when there is a suitable index on the only
subquery table.