fix: make NotConditions obey De Morgan's laws#7371
Closed
molon wants to merge 2 commits intogo-gorm:masterfrom
Closed
fix: make NotConditions obey De Morgan's laws#7371molon wants to merge 2 commits intogo-gorm:masterfrom
molon wants to merge 2 commits intogo-gorm:masterfrom
Conversation
Member
|
This change does make sense, but since it is a long-standing behavior, we’d prefer to keep things as they are to avoid breaking existing user systems. Thank you for your PR! |
Contributor
|
@jinzhu this was a bug introduced in gorm in 1.25.6 (released Jan 12, 2024). Testing against 1.25.5 (released Oct 10, 2023) returns the correct condition and expected rows in the included tests (see go-gorm/playground#767). This doesn't seem like designed behaviour, and it's only been one year and a half that it's been in this faulty state. I've had to stay at 1.25.6 in my system because I rely on the previous correct logic for negating expressions. I just don't see how the comment about not breaking existing systems makes any sense. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What did this pull request do?
Resolve this issue: #7294
This should be a breaking change, but I think the previous logic is a bug.
Or is it because I don't understand the role of this condition?
User Case Description