[DC-927] Query with left join and group clause returns only one row, even though there are multiple results Created: 14/Nov/10 Updated: 19/May/11
|Reporter:||Bart van den Burg||Assignee:||Guilherme Blanco|
Windows 7-64 bit
under certain circumstances, Doctrine will only return one result out of a bunch of results, for example:
$ symfony doctrine:dql "from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)"
The query works fine without the left join:
|Comment by Bart van den Burg [ 14/Nov/10 ]|
As you can see, by the way, it does actually say "found 2 results", but then returns only one.
|Comment by Willem van Duijn [ 08/Feb/11 ]|
There are multiple reports from people that are hurt by this bug:
Setting the Hydration-mode to HYDRATE_NONE yields multiple result rows (but is not useful).
|Comment by Victor Ruiz [ 18/Feb/11 ]|
Related in some way with multiple order by clauses. If I remove all of them but one it works, the problem appears when I put more than one order by criteria.
|Comment by Mike Seth [ 19/May/11 ]|
This is a hydration problem that occurs because the ID columns of the joined tables are not SELECT'ed explicitly. The offending code is a loop in the graph base hydrator, but I don't understand it well enough to fix it with any certainty that I don't break anything.