• unknown's avatar
    Bug#34731: highest possible value for INT erroneously filtered by WHERE · ec62aba3
    unknown authored
    WHERE f1 < n ignored row if f1 was indexed integer column and
    f1 = TYPE_MAX ^ n = TYPE_MAX+1. The latter value when treated
    as TYPE overflowed (obviously). This was not handled, it is now.
    
    
    mysql-test/r/range.result:
      show that on an index int column, we no longer disregard
      a field val of TYPE_MAX in SELECT ... WHERE ... < TYPE_MAX+1
    mysql-test/t/range.test:
      show that on an index int column, we no longer disregard
      a field val of TYPE_MAX in SELECT ... WHERE ... < TYPE_MAX+1
    sql/opt_range.cc:
      Handle overflowing of int-types in range-optimizer.
      Unfortunately requires re-indentation of entire block.
      Overflow (err == 1) was handled, but only if
      field->cmp_type() != value->result_type(), which it
      just wasn't in our case.
    ec62aba3
opt_range.cc 300 KB