Doctrine 1
  1. Doctrine 1
  2. DC-815

Model's default sorting breaks subqueries

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Query, Record
    • Labels:
      None

      Description

      It works except subqueries. Main table's order is added to subquery and vice versa. SQL query looks like this:

      {{
      SELECT t.id AS t_id FROM ticket_d_c9999_record t WHERE (t.id = (SELECT MAX(t2.id) AS t20 FROM ticket_d_c9999__record t2 ORDER BY t.id ASC, t2.id ASC)) ORDER BY t.id ASC, t2.id ASC
      }}

      Query fails because there is >>no such column "t.id"<<.

      I include a testcase when it is all visible.

      BTW. there is nothing about that feature (and relation orderBy) in docs. It is only in UPGRADE file.

      1. DC9999TestCase.php
        1.0 kB
        Jacek Jędrzejewski

        Activity

        Jacek Jędrzejewski created issue -

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Jacek Jędrzejewski
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: