DDC-1815: using aliases from select clause in having clause does not work #2286

Closed
opened 2026-01-22 13:47:22 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (May 8, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user burgov:

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

Originally created by @doctrinebot on GitHub (May 8, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user burgov: 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
admin added the Bug label 2026-01-22 13:47:22 +01:00
admin closed this issue 2026-01-22 13:47:22 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 27, 2012):

Comment created by @beberlei:

can you execute the query without being wrapped into KNP Paginator?

@doctrinebot commented on GitHub (May 27, 2012): Comment created by @beberlei: can you execute the query without being wrapped into KNP Paginator?
Author
Owner

@doctrinebot commented on GitHub (Oct 6, 2012):

Comment created by @beberlei:

No feedback given and executed in context of knp paginator, which probably is the source of the error.

@doctrinebot commented on GitHub (Oct 6, 2012): Comment created by @beberlei: No feedback given and executed in context of knp paginator, which probably is the source of the error.
Author
Owner

@doctrinebot commented on GitHub (Oct 6, 2012):

Issue was closed with resolution "Cannot Reproduce"

@doctrinebot commented on GitHub (Oct 6, 2012): Issue was closed with resolution "Cannot Reproduce"
Author
Owner

@ghost commented on GitHub (Sep 23, 2018):

i have the same error : Symfony doctrine DQL Functions give's Notice: Undefined index on alias column name
https://stackoverflow.com/questions/52467876/symfony-doctrine-dql-functions-gives-notice-undefined-index-on-alias-column-na

@ghost commented on GitHub (Sep 23, 2018): i have the same error : Symfony doctrine DQL Functions give's Notice: Undefined index on alias column name https://stackoverflow.com/questions/52467876/symfony-doctrine-dql-functions-gives-notice-undefined-index-on-alias-column-na
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2286