Bug #79949 "CONCAT( '2005' , '-01-01') - 100" doesn't throw any warning
Submitted: 13 Jan 2016 9:17 Modified: 13 Jan 2016 9:27
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

[13 Jan 2016 9:17] Su Dylan
Description:
Output:
=====
mysql> select CONCAT( '2005' , '-01-01') - 100;
+----------------------------------+
| CONCAT( '2005' , '-01-01') - 100 |
+----------------------------------+
|                             1905 |
+----------------------------------+
1 row in set (0.00 sec)

mysql> select '2005-01-01' - 100;
+--------------------+
| '2005-01-01' - 100 |
+--------------------+
|               1905 |
+--------------------+
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+------------------------------------------------+
| Level   | Code | Message                                        |
+---------+------+------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: '2005-01-01' |
+---------+------+------------------------------------------------+
1 row in set (0.00 sec)

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

Problem:
=====
Warning 1292 is expected for "CONCAT( '2005' , '-01-01') - 100".

How to repeat:
select CONCAT( '2005' , '-01-01') - 100;
select '2005-01-01' - 100;

Suggested fix:
Warning 1292 is returned for "CONCAT( '2005' , '-01-01') - 100".
[13 Jan 2016 9:27] MySQL Verification Team
Hello Su Dylan,

Thank you for the report and test case.
Observed that 5.5.48/5.6.28/5.7.10 are affected.

Thanks,
Umesh