Bug #15873 | Cannot use NULL in IN statement | ||
---|---|---|---|
Submitted: | 19 Dec 2005 23:18 | Modified: | 20 Dec 2005 14:50 |
Reporter: | Nathan Tanner | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.16 | OS: | Linux (FC3) |
Assigned to: | CPU Architecture: | Any |
[19 Dec 2005 23:18]
Nathan Tanner
[20 Dec 2005 14:50]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but current behaviour is simply correct (unlike previous), and documented in http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html: "In order to comply with the SQL standard, IN returns NULL not only if the expression on the left hand side is NULL, but also if no match is found in the list and one of the expressions in the list is NULL." So, this result: mysql> select * from test where id not in (null); Empty set (0.00 sec) will not be changed in 5.0.x.