• Tor Didriksen's avatar
    Bug#16482467 ORDER BY IGNORED IN SOME SITUATIONS FOR UPDATE QUERY · b9ec1837
    Tor Didriksen authored
    For queries like
    update t1 set ... where <unique key> order by ... limit ...
    we need to handle the fact that unique keys allow NULL
    values, and hence can return more than one row.
    
    
    sql/opt_range.cc:
      When the unique key has multiple key parts,
      check each key_part for nullability, rather than the first key part.
      (s/key->part ==/key_tree->part ==/)
      
      Also: revert the if() test, for better readability.
    b9ec1837
opt_range.cc 375 KB