-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[10.x] Fix CanBeOneOfMany
giving erroneous results
#47427
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b304a89
Add test to pinpoint the dysfunction
Guilhem-DELAITRE 46e4ec6
FIX CanBeOneOfMany.php
Guilhem-DELAITRE 3ce8130
FIX test on raw sql
Guilhem-DELAITRE 37171b5
Merge branch 'laravel:10.x' into 10.x
Guilhem-DELAITRE 92c3848
Merge branch 'laravel:10.x' into 10.x
Guilhem-DELAITRE 938b7ca
FIX missing aggregate for strict RDBMS (like postgresql)
Guilhem-DELAITRE c91ef12
FIX
Guilhem-DELAITRE 98ff70d
Add integration test to ensure multi-databases coverage
Guilhem-DELAITRE 6367599
Update EloquentHasOneOfManyTest.php
crynobone c5613a8
Update EloquentHasOneOfManyTest.php
crynobone e1b53a2
wip
crynobone 1c44641
wip
crynobone 84c191d
wip
crynobone fcc4848
wip
crynobone e0e3756
wip
crynobone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
min
here? Can you explain the entire logic behind this PR and how it fixes the issue?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
min
purpose is to use an aggregate to select any value on a column which we already know all value are the same because it's the sub-level aggregate. We still need an aggregate because there's nogroup by
clause on that column. The most correct solution would probably be to add a group by on that column, but I didn't manage to do it in the time I had.The more global purpose of the PR is fully stated and detailed (and is demonstrated by the modification of the generated query) in the original PR : #46309
The last two commits purpose is to fix the problem mentionned in
#46394 which was due to my modification not working with DBRMS which are strict with aggregates / group by like PostgreSQL.