diff options
author | dlenev@mysql.com <> | 2004-12-30 21:18:10 +0300 |
---|---|---|
committer | dlenev@mysql.com <> | 2004-12-30 21:18:10 +0300 |
commit | 2878395ab149838306719ba617dbe24507b21838 (patch) | |
tree | b54b57244a10da8f91840a3a3c53989a5220db7c /mysql-test | |
parent | aeaeb3f02240af14c1c3f6d095387c1b38e2dc5f (diff) | |
download | mariadb-git-2878395ab149838306719ba617dbe24507b21838.tar.gz |
Fix for bug #7515 "from_unixtime(0) now returns NULL instead of
the Epoch". (With after review fixes).
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_time.result | 7 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 32034bf289d..c1e75b60e4f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -470,9 +470,12 @@ unix_timestamp(@a) select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') 0 -select from_unixtime(0); -from_unixtime(0) +select from_unixtime(-1); +from_unixtime(-1) NULL select from_unixtime(2145916800); from_unixtime(2145916800) NULL +select from_unixtime(0); +from_unixtime(0) +1970-01-01 03:00:00 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index da18269cf6a..60c7aa49fbf 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -228,7 +228,11 @@ select unix_timestamp('1969-12-01 19:00:01'); # # Test for bug #6439 "unix_timestamp() function returns wrong datetime -# values for too big argument". It should return error instead. +# values for too big argument" and bug #7515 "from_unixtime(0) now +# returns NULL instead of the epoch". unix_timestamp() should return error +# for too big or negative argument. It should return Epoch value for zero +# argument since it seems that many user's rely on this fact. # -select from_unixtime(0); +select from_unixtime(-1); select from_unixtime(2145916800); +select from_unixtime(0); |