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

SQL Server: Use bitwise NOT on BIT expressions #34303

Merged
merged 5 commits into from
Jul 29, 2024

Conversation

ranma42
Copy link
Contributor

@ranma42 ranma42 commented Jul 28, 2024

Since #34080 the SqlServer provider uses XOR to avoid converting to/from predicates when negating BIT expressions.
It is actually possible to simply use ~ on BIT values and this changeset implements this.

Fixes #34213

It is currently only supported in the final part of SqlServer translation pipeline.
Instead of `x ^ 1`, use the `~x` expression when translating boolean values in
SqlServer.
@maumar maumar merged commit 1e828fd into dotnet:main Jul 29, 2024
7 checks passed
@maumar
Copy link
Contributor

maumar commented Jul 29, 2024

nice! thanks @ranma42

@ranma42 ranma42 deleted the sqlserver-bitwise-not branch July 29, 2024 19:08
@roji roji changed the title Use bitwise NOT on BIT SqlServer expressions SQL Server: Use bitwise NOT on BIT expressions Sep 23, 2024
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.

SQL Server: support bitwise NOT on boolean values
2 participants