Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3110

paginator doesn't respect order by clause when using the fetchJoinCollection flag

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      MariaDB 5.5

      Description

      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.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Greg
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: