Description:
when i create table,the coum of a was int type.
when i use where a is char then find one row ,Actual this cloumn data is 0 .
mysql> select * from t1 where a='abc';
+------+
| a |
+------+
| 0 |
+------+
1 row in set, 1 warning (0.07 sec)
mysql> show warnings//
+---------+------+-----------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'abc' |
+---------+------+-----------------------------------------+
1 row in set (0.00 sec)
How to repeat:
create table t1 (a int);
insert into t1 values(1);
insert into t1 values(0);
mysql> select * from t1 where a='abc';
+------+
| a |
+------+
| 0 |
+------+
1 row in set, 1 warning (0.07 sec)
mysql> show warnings//
+---------+------+-----------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'abc' |
+---------+------+-----------------------------------------+
1 row in set (0.00 sec)