DDC-3022: JOIN without association generates invalid SQL #3752

Open
opened 2026-01-22 14:27:24 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 11, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user mnapoli:

I saw in the documentation than since Doctrine 2.4 we could join without associations, using fields.

However I tried it and it generates invalid SQL (I use master). Here is an example:

SELECT a
FROM Namespace\Article a
JOIN Namespace\Authorization authorization WITH a.id = authorization.entityId

Generates the following SQL:

SELECT a0*.id AS id0 FROM Article a0_ INNER JOIN Authorization a1_ AND (a0_.id = a1*.entityId)

As you can see, instead of "INNER JOIN ... ON ..." we have "INNER JOIN ... AND ..." which is invalid.

I can't say if it's a regression of 2.5, or already in 2.4. I can't test my project with 2.4 because I used embedded objects.

Originally created by @doctrinebot on GitHub (Mar 11, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user mnapoli: I saw in the documentation than since Doctrine 2.4 we could join without associations, using fields. However I tried it and it generates invalid SQL (I use master). Here is an example: ``` SELECT a FROM Namespace\Article a JOIN Namespace\Authorization authorization WITH a.id = authorization.entityId ``` Generates the following SQL: ``` SELECT a0*.id AS id0 FROM Article a0_ INNER JOIN Authorization a1_ AND (a0_.id = a1*.entityId) ``` As you can see, instead of "INNER JOIN ... ON ..." we have "INNER JOIN ... AND ..." which is invalid. I can't say if it's a regression of 2.5, or already in 2.4. I can't test my project with 2.4 because I used embedded objects.
admin added the Bug label 2026-01-22 14:27:24 +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#3752