Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug on paginating ORDER BY queries
In some cases, the paginator can give the wrong result when an explicit ORDER BY clause collides with the field that Paginate is trying to select in order to limit the query. Example: User belongsTo group, where group 1 has 4 users. The following DQL will, when paginated, return only a single user and not all 4 users. SELECT u FROM User u LEFT JOIN u.group g WHERE g.name = 'Some group' ORDER BY g.id ASC Paginate will issue a select for the User.id but adds the ORDER BY clause in the resultset. But the ScalarHydrator simply overwrites the User.id with the Group.id, causing the query to fail. This update ensures that the LimitSubQuery uses unique column aliases to fix the issue.
- Loading branch information