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

Support more bitwise operators #18795

Open
roji opened this issue Nov 7, 2019 · 4 comments
Open

Support more bitwise operators #18795

roji opened this issue Nov 7, 2019 · 4 comments

Comments

@roji
Copy link
Member

roji commented Nov 7, 2019

Following #18788, we can add support for xor, shift-left, shift-right etc. which seem to be pretty universally supported across databases.

@ajcvickers ajcvickers added this to the Backlog milestone Nov 8, 2019
roji added a commit that referenced this issue Nov 17, 2019
roji added a commit that referenced this issue Nov 17, 2019
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 17, 2019
@roji roji self-assigned this Nov 17, 2019
@roji roji modified the milestones: Backlog, 5.0.0 Nov 17, 2019
roji added a commit that referenced this issue Nov 17, 2019
roji added a commit to roji/efcore that referenced this issue Dec 19, 2019
roji added a commit to roji/efcore that referenced this issue Dec 19, 2019
@ajcvickers
Copy link
Contributor

@roji This has had closed-fixed for a while without being closed.

@smitpatel smitpatel reopened this Mar 13, 2020
@smitpatel
Copy link
Contributor

PR never got merged or updated.

@roji roji added propose-punt and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels May 6, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0, Backlog Jun 9, 2020
@ranma42
Copy link
Contributor

ranma42 commented Jun 24, 2024

As of 7e313ab XOR is supported.

I can try and rebase main...roji:efcore:MoreBitwise to also tackle left and right shift if it makes sense, but I would need some guidance around the mismatches between C# and SQL:

  • C# masks the count operand to the number of bits of the operations (see docs); SQL providers have different behaviors (for example SqlServer shifts according to the sign of the count)
  • C# performs a "logical" right shift on unsigned types and an "arithmetic" right shift on signed types; some providers might not support them (AFAICT SqlServer only supports the logical shift, even though it performs it on signed values)

Note that while I have short-term plans to use the XOR (to improve some NOT translations in SqlServer), I have no immediate plan to proceed on this issue 😇

@roji
Copy link
Member Author

roji commented Jun 24, 2024

@ranma42 yeah, we've seen zero user interest in this, so I'd just leave it alone until we do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants