DDC-276: Left join using DQL generates a SQL Inner Join #343

Open
opened 2026-01-22 12:35:28 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 26, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user kidh0:

I tried to execute the follow DQL:

$this->_em->createQueryBuilder()
                    ->select('c1,c2, c3')
                    ->from('Class1, 'c1')
                    ->innerJoin('c1.class2', 'c2')
                    ->leftJoin('c1.class3', 'c3'); 

The class 3 extends a abstract class.

It generates the follow SQL:

SELECT ...
FROM   class1 c1_
       INNER JOIN classe2 c2_
        ...
       LEFT JOIN classe3  c3_
        ...
       INNER JOIN abstract*class3 ac3*
        ...

It breaks my query, 'cause there is one register in class1 but no register in class3, but since it generates a INNER JOIN, I brings no register.

Originally created by @doctrinebot on GitHub (Jan 26, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user kidh0: I tried to execute the follow DQL: ``` $this->_em->createQueryBuilder() ->select('c1,c2, c3') ->from('Class1, 'c1') ->innerJoin('c1.class2', 'c2') ->leftJoin('c1.class3', 'c3'); ``` The class 3 extends a abstract class. It generates the follow SQL: ``` SELECT ... FROM class1 c1_ INNER JOIN classe2 c2_ ... LEFT JOIN classe3 c3_ ... INNER JOIN abstract*class3 ac3* ... ``` It breaks my query, 'cause there is one register in class1 but no register in class3, but since it generates a INNER JOIN, I brings no register.
admin added the Bug label 2026-01-22 12:35:28 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#343