Skip to content

Comparing with NULL is always FALSE #110

Open
@petriq

Description

Library name and version

  • Kros.KORM 6.2.0

Description

KORM fails to parse correct condition for NULL comparison.

Steps To Reproduce

Example:

var test = _database.Query<MovementsOverviewSearchResult>()
                .Where(x => x.PartnerName != null);

Expected behavior

LINQ query above should be parsed

SELECT ... FROM ... Where (PartnerName IS NOT NULL)

Actual behavior

KORM parses the query as

SELECT ... FROM ... Where (PartnerName <> NULL)

Comparing NULL with anything using operators =, !=, <> ALWAYS produces FALSE. Even NULL = NULL is FALSE. Therefore, IS and IS NOT keywords should be parsed instead when comparing with NULL.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions