Comment 5 for bug 938977

Revision history for this message
Sergey Petrunia (sergefp) wrote :

5.3 doesn't convert SP call to constant because of this piece of code in item_cmpfunc.cc:convert_const_to_int() :

  /*
    We don't need to convert an integer to an integer,
    pretend it's already converted.

    But we still convert it if it is compared with a Field_year,
    as YEAR(2) may change the value of an integer when converting it
    to an integer (say, 0 to 70).
  */
  if ((*item)->cmp_type() == INT_RESULT &&
      field_item->field_type() != MYSQL_TYPE_YEAR)
    return 1;

it was added by the cset: <email address hidden>, "merge with 5.1-micro".