• unknown's avatar
    Fixed bug lp:809245 · 990584d7
    unknown authored
    In addition to the bug fix explained below, the patch performs
    few renames, and adds some comments to avoid similar problems.
    
    Analysis:
    The failed assert was due to a bug in MWL#68, where it was
    incorrectly assumed that the size of the bitmap
    subselect_rowid_merge_engine::null_only_columns should be
    the same as the size of the array of Ordered_keys.
    
    The bitmap null_only_columns contains bits to mark columns
    that contain only NULLs. Therefore the indexes of the bits
    to be set in null_only_columns are different from the indexes
    of the Ordered_keys. If there is a NULL-only column that appears
    in a table after the last partial match column with Ordered_key,
    this NULL-only column would require setting a bit with index
    bigger than the size of the bitmap null_only_columns.
    
    Accessing such a bit caused the failed assert.
    
    Solution:
    Upon analysis, it turns out that null_only_columns is not needed
    at all, because we are looking for partial matches, and having
    such columns guarantees that there is a partial match for any
    corresponding outer value.
    
    Therefore the patch removes
      subselect_rowid_merge_engine::null_only_columns.
    990584d7
item_subselect.cc 159 KB