Bug #79891 "case when" and IF() are not returning result with general precision
Submitted: 8 Jan 2016 12:44 Modified: 8 Jan 2016 14:39
Reporter: Su Dylan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7.8, 5.5.48, 5.6.28, 5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[8 Jan 2016 12:44] Su Dylan
Description:
Output:
=====
mysql> select case when false then 1.00 when true then 2 end, if(false, 1.00, 2 );
+------------------------------------------------+---------------------+
| case when false then 1.00 when true then 2 end | if(false, 1.00, 2 ) |
+------------------------------------------------+---------------------+
|                                              2 |                   2 |
+------------------------------------------------+---------------------+
1 row in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc  |
+-----------+
1 row in set (0.00 sec)

Problem:
=====
2.00 is expected for both.

How to repeat:
 select case when false then 1.00 when true then 2 end, if(false, 1.00, 2 );

Suggested fix:
2.00 is returned for both.
[8 Jan 2016 14:39] MySQL Verification Team
Hello Su Dylan,

Thank you for the report and test case.

Thanks,
Umesh