• Sergey Petrunya's avatar
    BUG#860580: Sporadic crash / valgrind warning in register_field_in_read_map() with semijoin · 0200ee70
    Sergey Petrunya authored
    The problem: in an uncorrelated subquery, JOIN execution code may make 
    irreversible cleanups after it has been executed (because the subquery 
    won't be executed again). In particular, JTBM nests and their injected 
    IN-equalities will be invalidated (the materialized table will be dropped
    and TABLE structure freed).
    Solution: don't walk into Item_subselect if represents an uncorrelated 
    subselect that has already been executed. The idea is that the subselect
    will not be executed again (calling Item_subselect_xxx::val_int() will fetch
    the cached value), so it should not matter what is inside the subselect.
    0200ee70
item_subselect.cc 164 KB