mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1357: Queries with multiple joins resulting in multiple scalar results for each top level entity only retain one scalar value for each entity #1700
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 1, 2011).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user naderman:
Consider this example:
select g.id, u.id, u.status, count(p.phonenumber) numPhones from Group * g join g.user u join u.phonenumbers p group by g.id, u.status, u.idWith data:
The result currently is:
Note that the first entry contains only one value numPhones => 1, even though there are two users associated with that group. One of whom has 2 phone numbers and the other has 1.
The result I would expect is:
The difference is that numPhones for each row now contains an array of the
scalar values matching the corresponding users.
@doctrinebot commented on GitHub (Sep 1, 2011):
Comment created by naderman:
You can find a test case for the correct result here:
a1ca3d9847@malukenho commented on GitHub (Jan 5, 2017):
@Ocramius offered test seems to be wrong and we have similar tests on
ObjectHydratorTest#testMixedQueryMultipleDeepMixedFetchJoin