Bug #2355 | NOT ( Field_With_Nulls LIKE '%foo%' ) does not work intuitively | ||
---|---|---|---|
Submitted: | 12 Jan 2004 8:29 | Modified: | 12 Jan 2004 9:30 |
Reporter: | James Sleeman | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | OS: | ||
Assigned to: | CPU Architecture: | Any |
[12 Jan 2004 8:29]
James Sleeman
[12 Jan 2004 9:30]
MySQL Verification Team
This is not a bug. When applied like you did it will return improper results. Try with NOT LIME ...
[12 Jan 2004 12:17]
James Sleeman
Fair `nuff, not a bug, but you must agree it's counter intuitive. Of course, this all stems back however to any operation on NULL returning NULL as defined in SQL92, some other servers (*cough* MS *cough*) have a setting (ANSI_NULLS OFF) that will instead effectively treat null in comparisons as false so that comparisons work more intuitively ( NOT(NULL LIKE 'f') is true ). It would be nice for MySQL to have a similar query-time option. This should really be a feature request now I think of it some more.