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