Bug #78951 | select * from abc where xCol = 'dd', return row with xCol = 0, xCol is Double ty | ||
---|---|---|---|
Submitted: | 24 Oct 2015 4:12 | Modified: | 27 Oct 2015 1:24 |
Reporter: | deepansh aggarwal | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S4 (Feature request) |
Version: | 5.5.24 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | Double column string in where clause |
[24 Oct 2015 4:12]
deepansh aggarwal
[24 Oct 2015 7:11]
MySQL Verification Team
As far as I can see, this is a request to have some kind of STRICT mode apply to selects? Here's the example I'm using. mysql> set sql_mode='STRICT_ALL_TABLES'; Query OK, 0 rows affected (0.00 sec) mysql> drop table if exists t; Query OK, 0 rows affected (0.00 sec) mysql> create table t(a double)engine=innodb; Query OK, 0 rows affected (0.02 sec) mysql> insert into t values(0),(1),(2); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from t where a='d'; +------+ | a | +------+ | 0 | +------+ 1 row in set, 1 warning (0.00 sec) mysql> show warnings; +---------+------+---------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------+ | Warning | 1292 | Truncated incorrect DOUBLE value: 'd' | +---------+------+---------------------------------------+ 1 row in set (0.00 sec)
[24 Oct 2015 7:19]
MySQL Verification Team
personally I'd love this, because it would let application developers catch bad queries sooner. we all know nobody checks warnings ;)
[27 Oct 2015 1:24]
deepansh aggarwal
Yeah I agree. But with increasing developing frameworks, nobody can see warnings in java applications, since they get the result, incorrect though :P