Skip to content

NOT IN <list> returns incorrect result if NULLs are present inside the value list #7795

@dyemanov

Description

@dyemanov

Test case:

SQL> select count(*) from rdb$relations where rdb$relation_id not in (100, 200);

                COUNT 
===================== 
                   67 

SQL> select count(*) from rdb$relations where rdb$relation_id not in (100, 200, null);

                COUNT 
===================== 
                   66 

For the second query the expected result is zero.

The new implementation of IN <list> removes NULLs from the lookup list to optimize things and it works perfectly for IN, but it plays a bad joke for NOT IN which should be aware of the NULLs being involved in comparisons.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions