Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2506

WITH Conditionals on Class Table Inheritance LEFT JOINs are inserted incorrectly

    Details

      Description

      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
      

        Activity

        Hide
        Matt Janssen added a comment - - edited
        Show
        Matt Janssen added a comment - - edited https://github.com/doctrine/doctrine2/pull/708
        Hide
        gseric added a comment -

        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).

        Show
        gseric added a comment - 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).
        Hide
        Gordon Forsythe added a comment -

        I've tested this PR and it does work.

        Show
        Gordon Forsythe added a comment - I've tested this PR and it does work.
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-708] was closed:
        https://github.com/doctrine/doctrine2/pull/708

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-708] was closed: https://github.com/doctrine/doctrine2/pull/708
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-886] was closed:
        https://github.com/doctrine/doctrine2/pull/886

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-886] was closed: https://github.com/doctrine/doctrine2/pull/886
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-708] was closed:
        https://github.com/doctrine/dbal/pull/708

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-708] was closed: https://github.com/doctrine/dbal/pull/708

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Matt Janssen
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: