Bug #21041 Attempting to query a table with null int fields and it always returns 0 records
Submitted: 13 Jul 2006 16:40 Modified: 13 Jul 2006 18:46
Reporter: Paul McLean Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.22 OS:Windows (win XP)
Assigned to: CPU Architecture:Any

[13 Jul 2006 16:40] Paul McLean
Description:
using odbc I send this simple query
SELECT
`quick_links`.`ID`
FROM
`quick_links`
WHERE
`quick_links`.`Org1` <>  1

Org1 is int (5)
ID is auto increment

Org1 is null at time of query

How to repeat:
Create table with:
 "ID" primary auto increment
 "Org1" int(5) NO DEFAULT Value

add record with null value for org1

query as stated above
[13 Jul 2006 18:46] Valeriy Kravchuk
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc. 

If you compare NULL with any value, you'll get NULL, not TRUE, and not FALSE. This is SQL Standard demand. So, that row with NULL value does not satisfy `quick_links`.`Org1` <>  1 condition.