Description:
I get an unexpected warning 1292 "Truncated incorrect INTEGER value...".
I tried at 5.0.74(on linux) and 5.1.30(on windows), but got the warning
in both cases.
How to repeat:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.74-debug-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use test;
Database changed
mysql> create table t1(c1 varchar(8), c2 char(8)) engine=myisam default charset=latin1;
Query OK, 0 rows affected (0.03 sec)
mysql> insert t1 values('vvvv','cccc');
Query OK, 1 row affected (0.00 sec)
mysql> select count(CASE WHEN 1=1 THEN c1 ELSE null END) from t1;
+--------------------------------------------+
| count(CASE WHEN 1=1 THEN c1 ELSE null END) |
+--------------------------------------------+
| 1 |
+--------------------------------------------+
1 row in set (0.03 sec)
/* ==> no warnings for varchar column */
mysql> select count(CASE WHEN 1=1 THEN c2 ELSE null END) from t1;
+--------------------------------------------+
| count(CASE WHEN 1=1 THEN c2 ELSE null END) |
+--------------------------------------------+
| 1 |
+--------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+-----------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: 'cccc ' |
+---------+------+-----------------------------------------------+
1 row in set (0.00 sec)
mysql> exit
Suggested fix:
No idea.