• Ole John Aske's avatar
    Fix for bug#58818: Incorrect result for IN/ANY subquery · bbf40ba3
    Ole John Aske authored
    If the ::single_value_transformer() find an existing HAVING condition it used
    to do the transformation:
                
      1) HAVING cond -> (HAVING Cond) AND (cond_guard (Item_ref_null_helper(...))
          
    As the AND condition in 1) is Mc'Carty evaluated, the
    right side of the AND cond should be executed only if the 
    original 'HAVING evaluated' to true.
          
    However, as we failed to set 'top_level' for the tranformed HAVING condition,
    'abort_on_null' was FALSE after transformation. An
    UNKNOWN having condition will then not terminate evaluation of the
    transformed having condition, and we incorrectly continued
    into the Item_ref_null_helper() part.
    bbf40ba3
item_subselect.cc 71.6 KB