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

          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: