• Georgi Kodinov's avatar
    Bug #39353: Multiple conditions on timestamp column crashes server · 71fe1901
    Georgi Kodinov authored
          
    The fix for bug 31887 was incomplete : it assumes that all the 
    field types returned by the IS_NUM macro are descendants of 
    Item_num and tries to zero-fill the values before doing constant
    substitution with such fields when they are compared to constant string
    values.
    The only exception to this is Field_timestamp : it's in the IS_NUM
    macro, but is not a descendant of Field_num.
    Fixed by excluding timestamp fields (Field_timestamp) when zero-filling
    when converting the constant to compare with to a string.
    Note that this will not exclude the timestamp columns from const 
    propagation.
    
    mysql-test/r/compare.result:
      Bug #39353: test case
    mysql-test/t/compare.test:
      Bug #39353: test case
    sql/item.cc:
      Bug #39353: don't zero-fill timestamp fields when const propagating
      to a string : they'll be converted to a string in a date/time format
      and not as an integer.
    71fe1901
compare.test 2.07 KB