• Sreeharsha Ramanavarapu's avatar
    Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6 · cb15cce7
    Sreeharsha Ramanavarapu authored
                   UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M"
    
    Issue:
    -----
    When an invalid date is supplied to the UNIX_TIMESTAMP
    function from STR_TO_DATE, no check is performed before
    converting it to a timestamp value.
    
    SOLUTION:
    ---------
    Add the check_date function and only if it succeeds,
    proceed to the timestamp conversion.
    
    No warning will be returned for dates having zero in
    month/date, since partial dates are allowed. UNIX_TIMESTAMP
    will return only a zero for such values.
    
    The problem has been handled in 5.6+ with WL#946.
    cb15cce7
sql_time.h 4.77 KB