Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix invalid order clauses being left on subqueries
When eager loading associations that contain an ORDER, we need to augment the selected fields to include the fields being ordered by. If we were to remove the ORDER BY, incorrect association data would be loaded. If we were to leave the fields alone, we'd have problems with postgres. Instead, if we find fields in the ORDER BY, that also exist in the column list, those fields should be preserved in the generated subquery. Refs #7669
- Loading branch information
Showing
2 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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