mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-31302 Assertion `mon > 0 && mon < 13' failed in my_time_t sec_since_epoch(int, int, int, int, int, int)
The code erroneously called sec_since_epoch() for dates with zeros, e.g. '2024-00-01'. Fixi: adding a test that the date does not have zeros before calling TIME_to_native().
This commit is contained in:
@ -9182,6 +9182,7 @@ Type_handler_timestamp_common::Item_val_native_with_conversion(THD *thd,
|
||||
Datetime dt(thd, item, Datetime::Options(TIME_NO_ZERO_IN_DATE, thd));
|
||||
return
|
||||
!dt.is_valid_datetime() ||
|
||||
dt.check_date(TIME_NO_ZERO_IN_DATE | TIME_NO_ZERO_DATE) ||
|
||||
TIME_to_native(thd, dt.get_mysql_time(), to, item->datetime_precision(thd));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user