Bug #67411 | NULL breaks "WHERE (columns) IN ((tuple), (tuple))" | ||
---|---|---|---|
Submitted: | 29 Oct 2012 13:54 | Modified: | 29 Jan 2013 9:18 |
Reporter: | Rolf Neuberger | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S4 (Feature request) |
Version: | 5.5.24 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[29 Oct 2012 13:54]
Rolf Neuberger
[29 Jan 2013 9:18]
Roy Lyseng
Thank you for the feature request. Let me say first that your "bold" suggestion has little chance of being accepted. - The current behavior is according to the SQL standard. - We will break compatibility with existing applications if we implement this. - We will also break compatibility with other DBMS's if we implement this. The reason that standard SQL does not allow this is that NULL is not a "value", but rather an indication of something that is unknown. Your "tame" suggestion is a syntax extension, so we are free to implement what we want here, as long as it is reasonably consistent with SQL. IN is a synonym to =ANY, so we could use an operator named <=>ANY to implement this extension, like this: ... WHERE (a, b) <=>ANY ((1,1), (1,NULL), (NULL,1), (NULL,NULL),(2,1), (1,2)) However, this might turn out to be a very large effort, as we have a lot of code that deals with proper results of subqueries.