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
      

        Issue Links

          Activity

          Matt Janssen created issue -
          Hide
          Matt Janssen added a comment - - edited
          Show
          Matt Janssen added a comment - - edited https://github.com/doctrine/doctrine2/pull/708
          Matt Janssen made changes -
          Field Original Value New Value
          Status Open [ 1 ] Awaiting Feedback [ 10000 ]
          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
          Gordon Forsythe made changes -
          Comment [ Anyone alive in there? ]
          Benjamin Eberlei made changes -
          Status Awaiting Feedback [ 10000 ] Open [ 1 ]
          Benjamin Eberlei made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.4 [ 10321 ]
          Fix Version/s 2.3.5 [ 10521 ]
          Resolution Fixed [ 1 ]
          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
          Hide
          Doctrine Bot added a comment -

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

          Show
          Doctrine Bot added a comment - A related Github Pull-Request [GH-708] was assigned: https://github.com/doctrine/dbal/pull/708
          Marco Pivetta made changes -
          Link This issue is referenced by DDC-3500 [ DDC-3500 ]

          This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

          • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2506, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

            People

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

              Dates

              • Created:
                Updated:
                Resolved: