Skip to content

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

3 participants