1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-17015 Assertion `m_year <= 9999' failed in Year::Year upon bad argument to MAKEDATE

This commit is contained in:
Alexander Barkov
2018-08-18 23:22:22 +04:00
parent bf1c53e9be
commit 4299b82ad8
3 changed files with 12 additions and 2 deletions

View File

@ -323,8 +323,8 @@ VSec6::VSec6(Item *item, const char *type_str, ulonglong limit)
Year::Year(longlong value, bool unsigned_flag, uint length)
{
if ((m_truncated= (value < 0 && !unsigned_flag)))
m_year= 0;
if ((m_truncated= (value < 0))) // Negative or huge unsigned
m_year= unsigned_flag ? 9999 : 0;
else if (value > 9999)
{
m_truncated= true;