• Mattias Jonsson's avatar
    Bug#14495351: CRASH IN HA_PARTITION::HANDLE_UNORDERED_NEXT · 7113d5d3
    Mattias Jonsson authored
    The partitioning engine does not implement index_next for partitions
    which return HA_ERR_KEY_NOT_FOUND in index_read_map.
    
    If HA_ERR_KEY_NOT_FOUND was returned by a partition during
    index_read_map, that partition would not be included in following
    calls to index_next. If no partition returned a row in index_read_map,
    then the subsequent call to index_next would try to use a non existing
    handler (index out of bound).
    Even after fixing the index out of bound if at least one partition
    returned.
    
    So it is really two connected bugs
    1) crash due to index out of bound (-1 unsigned).
    2) not including partitions that returned HA_ERR_KEY_NOT_FOUND.
    
    Fixed by recording the partitions that returned HA_ERR_KEY_NOT_FOUND,
    and include them too when doing handle_ordered_next the first time.
    7113d5d3
ha_partition.cc 223 KB