fix(db-postgres): selectDistinct might remove expected rows when querying with nested fields or relations#12365
Merged
Merged
Conversation
selectDistinct might remove expected rows when querying with nested fields or relationsselectDistinct might remove expected rows when querying with nested fields or relations
selectDistinct might remove expected rows when querying with nested fields or relationsselectDistinct might remove expected rows when querying with nested fields or relations
selectDistinct might remove expected rows when querying with nested fields or relations
DanRibbens
approved these changes
May 12, 2025
kendelljoseph
pushed a commit
that referenced
this pull request
May 15, 2025
…ying with nested fields or relations (#12365) Fixes #12263 This was caused by passing not needed columns to the `SELECT DISTINCT` query, which we execute in case if we have a filter / sort by a nested field / relationship. Since the only columns that we need to pass to the `SELECT DISTINCT` query are: ID and field(s) specified in `sort`, we now filter the `selectFields` variable.
Contributor
|
🚀 This is included in version v3.38.0 |
kendelljoseph
pushed a commit
that referenced
this pull request
May 19, 2025
…ying with nested fields or relations (#12365) Fixes #12263 This was caused by passing not needed columns to the `SELECT DISTINCT` query, which we execute in case if we have a filter / sort by a nested field / relationship. Since the only columns that we need to pass to the `SELECT DISTINCT` query are: ID and field(s) specified in `sort`, we now filter the `selectFields` variable.
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.
Fixes #12263
This was caused by passing not needed columns to the
SELECT DISTINCTquery, which we execute in case if we have a filter / sort by a nested field / relationship. Since the only columns that we need to pass to theSELECT DISTINCTquery are: ID and field(s) specified insort, we now filter theselectFieldsvariable.