Details
-
Type:
Bug
-
Status: Closed
-
Resolution: Not a Bug
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
MariaDB 5.3.7 returns NULL instead of expected 0 for the the following query:
MariaDB [(none)]> select unix_timestamp('0000-00-00');
------------------------------
| unix_timestamp('0000-00-00') |
------------------------------
| NULL |
------------------------------
1 row in set (0.00 sec)
Replacing MariaDB with MySQL 5.1 (Percona SQL server) returns expected 0 as in MySQL 5.0
mysql> select unix_timestamp('0000-00-00');
------------------------------
| unix_timestamp('0000-00-00') |
------------------------------
| 0 |
------------------------------
1 row in set (0.00 sec)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Re: select unix_timestamp('0000-00-00') returns NULL instead of 0
Hi,
This is intentional and documented behavior: http://kb.askmonty.org/en/unix_timestamp/
(see Error handling at the bottom)