Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1815

using aliases from select clause in having clause does not work

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: DQL
    • Security Level: All
    • Labels:
      None

      Description

      I have the following DQL:

      SELECT e, count(s) AS shiftsTooLate FROM RAI\ShifterBundle\Entity\Worker e INNER JOIN e.person person LEFT JOIN e.shifts s 
      WITH s.reasonTooLate IS NOT NULL LEFT JOIN e.person a96582 LEFT JOIN e.person a31040 LEFT JOIN e.person a49970 
      LEFT JOIN e.pools a30107 LEFT JOIN e.person a12776 LEFT JOIN a12776.qualifications a78193 LEFT JOIN e.person a38925 
      WHERE (e.blacklist = :f0) AND (e.haccpInstruction = :f1) AND (e.introductoryMaterial = :f2) GROUP BY e.id HAVING (shiftsTooLate = :f3) 
      ORDER BY e.id ASC
      

      When I try to execute this query, I get an undefined index error:

      https://gist.github.com/139220fe4ef7097d05d5

        Activity

        Bart van den Burg created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13689 ] jira-feedback [ 14062 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14062 ] jira-feedback2 [ 15926 ]
        Alexander made changes -
        Status Open [ 1 ] Awaiting Testcase/Feedback [ 10000 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15926 ] jira-feedback3 [ 18208 ]
        made changes -
        Status Awaiting Feedback [ 10000 ] In Progress [ 3 ]
        Benjamin Eberlei made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Bart van den Burg
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: