<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sun May 19 21:51:17 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DC-927/DC-927.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DC-927] Query with left join and group clause returns only one row, even though there are multiple results</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-927</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;under certain circumstances, Doctrine will only return one result out of a bunch of results, for example:&lt;/p&gt;

&lt;p&gt;$ symfony doctrine:dql &quot;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)&quot;&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
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)&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;1&apos;&lt;/p&gt;

&lt;p&gt;Expected outcome:&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-16&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;0&apos;&lt;/p&gt;

&lt;p&gt;The query works fine without the left join:&lt;br/&gt;
$ symfony doctrine:dql &quot;from Tafel t where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels group by date(t.tijd)&quot;&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: from Tafel t  where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, group by date(t.tijd)&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-16&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;/p&gt;</description>
                <environment>Windows 7-64 bit&lt;br/&gt;
Symfony 1.4.8</environment>
            <key id="12102">DC-927</key>
            <summary>Query with left join and group clause returns only one row, even though there are multiple results</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dareaper">Bart van den Burg</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Nov 2010 07:55:55 +0000</created>
                <updated>Thu, 19 May 2011 07:50:36 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14734" author="dareaper" created="Sun, 14 Nov 2010 07:56:37 +0000"  >&lt;p&gt;As you can see, by the way, it does actually say &quot;found 2 results&quot;, but then returns only one.&lt;/p&gt;</comment>
                    <comment id="15239" author="geckow" created="Tue, 8 Feb 2011 07:08:14 +0000"  >&lt;p&gt;There are multiple reports from people that are hurt by this bug:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm&quot; class=&quot;external-link&quot;&gt;http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.devcomments.com/Problem-with-Doctrine-and-Join-GroupBy-query-at87536.htm&quot; class=&quot;external-link&quot;&gt;http://www.devcomments.com/Problem-with-Doctrine-and-Join-GroupBy-query-at87536.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting the Hydration-mode to HYDRATE_NONE yields multiple result rows (but is not useful). &lt;/p&gt;</comment>
                    <comment id="15337" author="victoruiz" created="Fri, 18 Feb 2011 13:49:55 +0000"  >&lt;p&gt;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.&lt;/p&gt;</comment>
                    <comment id="15865" author="mikeseth" created="Thu, 19 May 2011 07:50:36 +0000"  >&lt;p&gt;This is a hydration problem that occurs because the ID columns of the joined tables are not SELECT&apos;ed explicitly. The offending code is a loop in the graph base hydrator, but I don&apos;t understand it well enough to fix it with any certainty that I don&apos;t break anything. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>