• timour/tkatchaounov@lapi.mysql.com's avatar
    Fix for BUG#32694 "NOT NULL table field in a subquery produces invalid results" · 9be915e7
    timour/tkatchaounov@lapi.mysql.com authored
      
    The problem was that when convert_constant_item is called for subqueries,
    this happens when we already started executing the top-level query, and
    the field argument of convert_constant_item pointed to a valid table row.
    In turn convert_constant_item used the field buffer to compute the value
    of its item argument. This copied the item's value into the field,
    and made equalities with outer references always true.
      
    The fix saves/restores the original field's value when it belongs to an
    outer table.
    9be915e7
item_cmpfunc.cc 127 KB