I've discovered that function YEAR(CURRENT_TIME())
returns an 2023 year instead of NULL as I thought or something like that.
When i made this query
SELECT DAY(CURRENT_TIME()), MONTH(CURRENT_TIME()), YEAR(CURRENT_TIME());
I got the next result
+---------------------+-----------------------+----------------------+
| DAY(CURRENT_TIME()) | MONTH(CURRENT_TIME()) | YEAR(CURRENT_TIME()) |
+---------------------+-----------------------+----------------------+
| 24 | 11 | 2023 |
+---------------------+-----------------------+----------------------+
So why does 'TIME' implicitly stores the date?
The answer is that mysql performs an implicit time -> datetime conversion when you call the year() function on the returned time as year() cannot operate on time data type.
As mysql manual on date and time data types conversion says: