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 SQL Server operator precedence table #33875

Merged
merged 2 commits into from
Jun 2, 2024
Merged

Conversation

ranma42
Copy link
Contributor

@ranma42 ranma42 commented Jun 2, 2024

Specifically, binary logical operators have the same precedence as +/-.

The table is now aligned with the referenced document, plus shift operators.
They seem to have the same precedence as +/- according to manual tests; no documentation about this is available.

Fixes #30248.

ranma42 added 2 commits June 2, 2024 18:34
Specifically, binary logical operators have the same precedence as `+`/`-`.

The table is now aligned with the referenced document, plus shift operators.
They seem to have the same precedence as `+`/`-` according to manual tests; no
documentation about this is available.

Fixes dotnet#30248.
@ranma42
Copy link
Contributor Author

ranma42 commented Jun 2, 2024

I was wondering if there is a reasonable approach to testing that the precedence table is correct, but so far I have not found a "general" approach.
Would it make sense to add some checks for the specific case of +/- and &/|? (i.e. the one that is fixed in this PR)
In a way, it is already tested (see the re-enabled test), but if they were changed again it would not be straightforward to find out what is causing the test failure.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ranma42, good catch!

@roji roji merged commit 77097ee into dotnet:main Jun 2, 2024
7 checks passed
@ranma42 ranma42 deleted the sqlserver-30248 branch June 2, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query: incorrect results for a very complex predicate with bitwise operations
2 participants