• Sergey Petrunya's avatar
    MDEV-6434: Wrong result (extra rows) with ORDER BY, multiple-column index, InnoDB · 07c0b1d8
    Sergey Petrunya authored
    - Filesort has an optmization where it reads only columns that are 
      needed before the sorting is done.
    - When ref(_or_null) is picked by the join optimizer, it may remove parts
      of WHERE clause that are guaranteed to be true.
    - However, if we use quick select, we must put all of the range columns into the 
      read set. Not doing so will may cause us to fail to detect the end of the range.
    07c0b1d8
opt_range.cc 465 KB