Bug #7515 from_unixtime(0) now returns NULL instead of the epoch
Submitted: 23 Dec 2004 21:15 Modified: 30 Dec 2004 21:54
Reporter: Tim Smith
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:4.0.23 OS:Any (all)
Assigned to: Dmitri Lenev Target Version:

[23 Dec 2004 21:15] Tim Smith
Description:
In MySQL 4.0.18 and before, FROM _UNIXTIME(0) returned '1970-01-01 00:00:00'; it was
changed some time later so that it returns NULL instead, which breaks some functionality
in the application.

How to repeat:
select from_unixtime(0);

Try the above on 4.0.18 and 4.0.23.

Suggested fix:
revert to previous behavior for 4.0, and perhaps have unix_timestamp('bogus') return NULL
instead of 0, to keep unix_timestamp() and from_unixtime() compatible.
[30 Dec 2004 21:09] Heath Morrison
This isn't just 4.0.23, this operates differently between 4.1.7 and 4.1.8. On upgrading
SELECT FROM_UNIXTIME(0) behavior has changed. This has been broken in 4.1.8, as far as I
can tell.
[30 Dec 2004 21:54] Dmitri Lenev
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

ChangeSet
  1.2014 04/12/30 21:18:10 dlenev@mysql.com +4 -0
  Fix for bug #7515 "from_unixtime(0) now returns NULL instead of
  the Epoch". (With after review fixes).

(Indeed, this fix will be also propagated to 4.1 tree)