Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparing with NULL is always FALSE #110

Open
petriq opened this issue Mar 28, 2023 · 0 comments
Open

Comparing with NULL is always FALSE #110

petriq opened this issue Mar 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@petriq
Copy link
Contributor

petriq commented Mar 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant