Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.5.33
-
None
-
None
Description
This query correctly returns a warning,
because 'xxx' is not a valid number.
mysql> select 'xxx'+1;
|
+---------+
|
| 'xxx'+1 |
|
+---------+
|
| 1 |
|
+---------+
|
1 row in set, 1 warning (0.00 sec)
|
 |
mysql> show warnings;
|
+---------+------+-----------------------------------------+
|
| Level | Code | Message |
|
+---------+------+-----------------------------------------+
|
| Warning | 1292 | Truncated incorrect DOUBLE value: 'xxx' |
|
+---------+------+-----------------------------------------+
|
1 row in set (0.00 sec)
|
This query does not produce a warning, which is wrong:
mysql> select IF(1=1,'xxx','yyy')+1;
|
+-----------------------+
|
| IF(1=1,'xxx','yyy')+1 |
|
+-----------------------+
|
| 1 |
|
+-----------------------+
|
1 row in set (0.00 sec)
|