• unknown's avatar
    Fix LP BUG#719198, LP BUG#730604 · 329f6431
    unknown authored
    Analysis (BUG#719198):
    The assert failed because the execution code for
    partial matching is designed with the assumption that
    NULLs on the left side are detected as early as possible,
    and a NULL result is returned before any lookups are
    performed at all.
    
    However, in the case of an Item_cache object on the left
    side, null was not detected properly, because detection
    was done via Item::is_null(), which is not implemented at
    all for Item_cache, and resolved to the default Item::is_null()
    which always returns FALSE.
    
    Solution:
    Imlpement Item::is_null().
    
    ******
    
    Analysis (BUG#730604):
    The method Item_field::is_null() determines if an item is NULL from its
    Item_field::field object. However, for Item_fields that represent internal
    temporary tables, Item_field::field represents the field of the original
    table that was the source for the temporary table (in this case t1.f3).
    Both in the committed test case, and in the original bug report the current
    value of t1.f3 is not NULL. This results in an incorrect count of NULLs
    for this column. As a consequence, all related Ordered_key buffers are
    allocated with incorrect sizes. Depending on the exact query and data,
    these incorrect sizes result in various crashes or failed asserts.
    
    Solution:
    The correct value of the current field of the internal temp table is
    in Item_field::result_field. This value is determined by
    Item::is_null_result().
    329f6431
subselect_mat.result 90.8 KB