1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Fix makedate() and year() functions

* The year() function did not handle float/double input correctly
* Makedate() did not handle year < 100 conversion
* 0 date was converted to NULL for some functions

In addition makedate did
This commit is contained in:
Andrew Hutchings
2016-09-27 16:11:31 +01:00
parent 03ce5a4936
commit 55844a0f0b
3 changed files with 27 additions and 4 deletions

View File

@ -78,8 +78,15 @@ uint64_t makedate(rowgroup::Row& row,
isNull = true;
return 0;
}
if (year < 1000 || year > 9999) {
if (year < 70)
{
year = 2000 + year;
}
else if (year < 100)
{
year = 1900 + year;
}
else if (year < 1000 || year > 9999) {
isNull = true;
return 0;
}