Orm: DDC-3110: paginator doesn't respect order by clause when using the fetchJoinCollection flag

Created on 1 May 2014  路  4Comments  路  Source: doctrine/orm

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.

Bug

All 4 comments

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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doctrinebot picture doctrinebot  路  3Comments

doctrinebot picture doctrinebot  路  3Comments

podorozhny picture podorozhny  路  4Comments

doctrinebot picture doctrinebot  路  3Comments

dmaicher picture dmaicher  路  3Comments