Bug #77103 DATE and IFNULL result is returned different
Submitted: 20 May 2015 12:31 Modified: 21 May 2015 11:31
Reporter: Eimantas Jatkonis Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S2 (Serious)
Version:5.6.24 and 5.1.73, 5.1.75, 5.5.45, 5.6.26, 5.7.8, 8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[20 May 2015 12:31] Eimantas Jatkonis
Description:
DATE(IFNULL(XXX, 0)) is not returning same result with different XXX.

How to repeat:
mysql> SELECT DATE(0), DATE(IFNULL(NULL, 0)), DATE(IFNULL(DATE(NULL), 0)), DATE(NULL);
+------------+-----------------------+-----------------------------+------------+
| DATE(0)    | DATE(IFNULL(NULL, 0)) | DATE(IFNULL(DATE(NULL), 0)) | DATE(NULL) |
+------------+-----------------------+-----------------------------+------------+
| 0000-00-00 | 0000-00-00            | NULL                        | NULL       |
+------------+-----------------------+-----------------------------+------------+
[21 May 2015 11:31] Umesh Shastry
Hello Eimantas Jatkonis,

Thank you for the report and test case.

Thanks,
Umesh
[18 Jun 2016 21:26] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0