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

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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