• Tatiana A. Nurnberg's avatar
    Bug#42146 - DATETIME fractional seconds parse error · 69432395
    Tatiana A. Nurnberg authored
    Bug#38435 - LONG Microseconds cause MySQL to fail a CAST to DATETIME or DATE
    
    Parsing of optional microsecond part in datetime did not
    fail gracefully when field width was larger than the allowed
    six places.
    
    Now handles up to the correct six places, and disregards
    any extra digits without messing up what we've already got.
    
    mysql-test/r/type_datetime.result:
      show graceful handling of overly long microsecond parts
      (correct truncation).
    mysql-test/t/type_datetime.test:
      show graceful handling of overly long microsecond parts
      (correct truncation).
    sql-common/my_time.c:
      Special case for time-parsing: for microsecond part,
      leading zeroes are actually meaningful! Also, don't
      break the entire date on more than the allowed six
      digits in microsecond part, just truncate the extra
      digits.
    69432395
my_time.c 38.2 KB