Skip to content

Conversation

roji
Copy link
Member

@roji roji commented May 20, 2025

Fixes #36105
Fixes #36112

Thanks to @Charlieface for reporting #36105 and also suggesting the right fix.

@roji roji requested a review from a team May 20, 2025 20:41
@roji roji enabled auto-merge (squash) May 20, 2025 20:41
@roji roji marked this pull request as draft May 20, 2025 21:41
auto-merge was automatically disabled May 20, 2025 21:41

Pull request was converted to draft

@roji roji marked this pull request as ready for review May 20, 2025 22:06
@roji roji enabled auto-merge (rebase) May 21, 2025 05:37
FROM [Customers] AS [c0]
WHERE [c0].[City] = N'México D.F.'
"""
(
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that this SQL is slightly worse - we add parentheses although they're not needed. We were already doing this for non-EXCEPT cases (for two heterogeneous set operations). At some point we can improve the parentheses algorithm to more fully eliminate parentheses when they're not needed.

@roji roji merged commit 95653e2 into dotnet:main May 22, 2025
7 checks passed
@roji roji deleted the Except branch May 22, 2025 14:29
@roji roji changed the title Fix nested EXCEPT parentheses Fix set operation precedence issues May 23, 2025
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.

SQLite: Parentheses are currently omitted around set operations, leading to data corruption Parentheses missing with some set operation combinations
2 participants