Skip to content

Fix to #23990 - Relational: IS (NOT) NULL requires parenthesis when not in left side of an equality #25722

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Aug 26, 2021

We were generating incorrect sql when comparing bool value to a nullableBool.HasValue. Fix is to add parentheses to the right side when we detect the pattern:

  • left side doesn't already have parentheses
  • right side is a IS NULL / IS NOT NULL check
  • argument to that null check is bool

Note: this is not really an issue for sql server because of search conditions, but sqlite would yield incorrect data for those queries.

Fixes #23990

@maumar maumar requested a review from smitpatel August 26, 2021 01:08
…ot in left side of an equality

We were generating incorrect sql for some cases involving nullability check on nullable bool. E.g. true = someBool IS NULL. Instead we need true = (someBool IS NULL)
Note: this is not really an issue for sql server because of search conditions, but sqlite would yield incorrect data for those queries.

Fixes #23990
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relational: IS (NOT) NULL requires parenthesis when not in left side of an equality
2 participants