Skip to content

Loading…

DDC-2506: WITH Conditionals on Class Table Inheritance LEFT JOINs are inserted incorrectly #3228

Closed
doctrinebot opened this Issue · 9 comments

2 participants

@doctrinebot

Jira issue originally created by user mattjanssen:

The following JOIN

JOIN c.ctiRelationship cti WITH cti.id IN (42)

generates unexpected SQL

LEFT JOIN class*base p1_ ON u1_.cti_id = p1*.id 
LEFT JOIN class*child1 p2_ ON p1_.id = p2*.id
LEFT JOIN class*child2 p3_ ON p1_.id = p3_.id AND (p1*.id IN (42)) 

when it SHOULD be generating

LEFT JOIN class*base p1_ ON u1_.cti_id = p1_.id AND (p1*.id IN (42)) 
LEFT JOIN class*child1 p2_ ON p1_.id = p2*.id
LEFT JOIN class*child2 p3_ ON p1_.id = p3*.id
@doctrinebot

Comment created by mattjanssen:

#708

@doctrinebot

Comment created by gseric:

Thanks Matt, this bug prevented me to upgrade to 2.3. BTW it was originally reported in DDC-2131 (I put a comment there to redirect users here).

@doctrinebot

Comment created by baohx2000:

I've tested this PR and it does work.

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-708] was closed:
#708

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-886] was closed:
#886

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-708] was closed:
doctrine/dbal#708

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-708] was assigned:
doctrine/dbal#708

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.3.5 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.