1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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:
Alexander Barkov
2024-09-20 14:10:27 +04:00
parent 9ac8172ac3
commit 607fc15393
3 changed files with 23 additions and 0 deletions

View File

@ -6425,5 +6425,16 @@ Warning 1292 Truncated incorrect time value: '8390000'
Warning 1292 Truncated incorrect time value: '8390000'
SET @@timestamp= DEFAULT;
#
# MDEV-31302 Assertion `mon > 0 && mon < 13' failed in my_time_t sec_since_epoch(int, int, int, int, int, int)
#
CREATE TABLE t1 (a DATE);
SET @@time_zone='+1:00';
INSERT INTO t1 VALUES ('2024-00-01');
SELECT UNIX_TIMESTAMP(MAX(a)) AS a FROM t1;
a
NULL
SET @@time_zone=DEFAULT;
DROP TABLE t1;
#
# End of 10.5 tests
#