• Igor Babaev's avatar
    Fixed the bug mdev-7599. · e0352fb0
    Igor Babaev authored
    At some conditions the function opt_sum_query() can apply MIN/MAX
    optimizations to to Item_sum objects of a select These optimizations
    becomes invalid if this select is the subquery of an IN subquery
    predicate that is converted to a EXISTS subquery. Thus in this case
    the MIX/MAX optimizations that have been applied in opt_sum_query()
    must be rolled back.
    This bug appeared in 5.3 when the code for the cost base choice between
    materialization and in-to-exists transformation of non-correlated
    IN subqueries was introduced. Before this code in-to-exists
    transformations were always performed before the call of opt_sum_query().
    e0352fb0
item_subselect.cc 174 KB