Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.3.12, 5.5.37, 10.0.11, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
-
None
-
None
Description
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a DATE) ENGINE=MyISAM;
|
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
|
SELECT a, FROM_UNIXTIME(CONCAT(a,'10')) AS f1, IFNULL(FROM_UNIXTIME(CONCAT(a,'10')),0)+0 AS f2 FROM t1;
|
returns
+------------+---------------------+------+
|
| a | f1 | f2 |
|
+------------+---------------------+------+
|
| 2005-05-04 | 1970-01-01 03:33:25 | 1970 |
|
| 2000-02-23 | 1970-01-01 03:33:20 | 1970 |
|
+------------+---------------------+------+
|
The expected result for f2 is 19700101033325 and 19700101033330.
The same problem happens with IF:
SELECT a, FROM_UNIXTIME(CONCAT(a,'10')) AS f1, IF(1,FROM_UNIXTIME(CONCAT(a,'10')),0)+0 AS f2 FROM t1;
|