Details
Description
If you do SELECT date('string'); in MySQL you get NULL and if you do the same in MariaDB you get '0000-00-00';
Tried with MySQL ver 5.1.29, probably with all previous versions.
Perhaps it is a known change, but it's hard to search for
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
We had various similar issues, since NULL vs 0000-00-00 inconsistency is all over the place, even inside the same version (e.g. compare DATE('string') and FROM_DAYS('string') in MySQL). However, I haven't found this exact problem, so I'm passing it over to Sergei for a verdict. If it's intentional, maybe we should document it here https://kb.askmonty.org/en/date-function/ , the same way as error handling is documented at https://kb.askmonty.org/en/unix_timestamp/.
CAST has the same difference:
MySQL:
CAST('string' AS DATE)
NULL
MariaDB:
CAST('string' AS DATE)
0000-00-00