Jira issue originally created by user greg:
I have a DQL query with a ORDER BY clause.
When I paginate the result with new Paginator($query, $fetchJoinCollection = true); the orderind isn't correct.
The order is lost in the second request (Perform a Limit Subquery with DISTINCT to find all ids of the entity in from on the current page)
It creates a SQL query like that :
SELECT
DISTINCT id0
FROM
(
SELECT
d0_.id AS id0,
d0_.name AS name1,
d0_.note AS note2,
FROM
data d0_
ORDER BY
d0_.note DESC
) dctrn_result
LIMIT
20 OFFSET 0
The external SELECT don't keep the order so it just fetch the 20 first elements from the whole table.
Has this been fixed?
@yangjiel write a test that verifies it: I think this has been previously fixed.
@Ocramius I am using Doctrine 2.5, I still have the error on my end. Do you know on which version it get fixed? Thank you. (I found the 2.6 is working)
If it is to be checked, then it should be checked on the latest stable release: 2.5 is unsupported (besides security issues)