• Alexander Barkov's avatar
    MDEV-34069 Zero datetime reinterprets as '1970-01-01 00:00:00' on field_datetime=field_timestamp · 1cdf2237
    Alexander Barkov authored
    The code in Field_timestamp::save_in_field() did not catch
    zero datetime and stored it to the other field like a usual value
    using store_timestamp_dec(), which knows nothing about zero date and
    treats {tv_sec=0, tv_usec=0} as a normal timeval value corresponding to
    '1970-01-01 00:00:00 +00:00'.
    
    Fixing the code to catch the special combination (ts==0 && sec_pat==0) and
    store it using store_time_dec() with a zero datetime passed as an argument.
    1cdf2237
field.cc 331 KB