mirror of
https://github.com/doctrine/orm.git
synced 2026-04-29 17:33:15 +02:00
DDC-795: Wrong SQL statement when using loadOneToManyCollection #977
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Sep 9, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user tbo:
I have the following SQL
And these 2 models
and
When I do the following
it generates the following SQL
I tracked the problem down to the following method
Because $this->_class->fieldNames is empty for my class, $columnList will also be empty.
$this->_getSelectJoinColumnsSQL($this->_class) generates
", t1.articleID AS articleID0, t1.relatedArticleID AS relatedArticleID2"
so $this->_selectColumnListSql == ", t1.articleID AS articleID0, t1.relatedArticleID AS relatedArticleID2"
I fixed the problem by adding trim:
@doctrinebot commented on GitHub (Sep 9, 2010):
@doctrinebot commented on GitHub (Sep 10, 2010):
Comment created by @beberlei:
Foreign Keys as Primary Keys are currently not supported (except for the DDC-117 experimental branch, scheduled for 2.1)
See: http://www.doctrine-project.org/projects/orm/2.0/docs/reference/limitations-and-known-issues/en#current-limitations:foreign-keys-as-identifiers
@doctrinebot commented on GitHub (Sep 10, 2010):
Comment created by tbo:
Sorry Benjamin, I should have mentioned that I work with that branch.
@doctrinebot commented on GitHub (Sep 12, 2010):
Comment created by @beberlei:
Ah ok, i'll move and downgrade priority because there is so much to do on the master branch before release.
@doctrinebot commented on GitHub (Dec 28, 2010):
Comment created by @beberlei:
Fixed in DDC-117 branch.
@doctrinebot commented on GitHub (Dec 28, 2010):
Issue was closed with resolution "Fixed"