Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1435

Exception thrown when generating SQL from a DQL subselect where the entity has a foreign key as a primary key

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.1.3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      If an entity has a foreign key as part of its primary key and you try to query that entity in a subselect clause in DQL, an exception is thrown in ClassMetadataInfo->getQuotedColumnName. The problem seems to be that it's only considering the field mappings rather than both the field and association mappings when it's looking for the correct column name.

      Example entities:

      • Article(id primary key, title, content)
      • ArticleTag(article_id, tag, primary key (article_id, tag))

      Example DQL: select art from Article art where exists (select tag from ArticleTag tag where tag.article = art)

        Activity

        Payam Hekmat created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Guilherme Blanco [ guilhermeblanco ]
        Guilherme Blanco made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2-DEV [ 10157 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.1.3 [ 10164 ]
        Fix Version/s 2.2-DEV [ 10157 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13100 ] jira-feedback [ 15072 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15072 ] jira-feedback2 [ 16936 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16936 ] jira-feedback3 [ 19189 ]

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Payam Hekmat
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: