<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue Jun 18 22:17:27 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/DDC-736/DDC-736.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>[DDC-736] Nasty ordering issue with fetch-joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-736</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Will not work correctly:&lt;/p&gt;

&lt;p&gt;select c, ca from Cart ca join ca.customer c&lt;/p&gt;

&lt;p&gt;Works correctly:&lt;/p&gt;

&lt;p&gt;select ca, c from Cart ca join ca.customer c&lt;/p&gt;

&lt;p&gt;In the first case the ordering of the DQL aliases causes associations to be skipped during hydration.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11738">DDC-736</key>
            <summary>Nasty ordering issue with fetch-joins</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Sat, 7 Aug 2010 16:57:49 +0000</created>
                <updated>Fri, 10 Dec 2010 14:57:01 +0000</updated>
                    <resolved>Sat, 13 Nov 2010 03:55:32 +0000</resolved>
                            <version>2.0-BETA3</version>
                                <fixVersion>2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14151" author="romanb" created="Mon, 30 Aug 2010 06:19:29 +0000"  >&lt;p&gt;Scheduling for RC1.&lt;/p&gt;</comment>
                    <comment id="14571" author="mitmaro" created="Fri, 15 Oct 2010 12:49:42 +0000"  >&lt;p&gt;If anyone is getting issues with missing or incorrectly ordered relations it may be caused by this bug.&lt;/p&gt;

&lt;p&gt;Would it be possible to put a note in the documentation to ensure the order of the select clause must match that of the joins. I just spent 2 days trying to figure out why the data being returned was incorrect.&lt;/p&gt;</comment>
                    <comment id="14712" author="beberlei" created="Wed, 10 Nov 2010 17:36:55 +0000"  >&lt;p&gt;Patch that solves this problem. What does it do?&lt;/p&gt;

&lt;p&gt;Two additional instance variables are needed, one for the order of the AliasIdentificationVariables and one for a IdentVariable =&amp;gt; SelectExpression lookup map.&lt;/p&gt;

&lt;p&gt;Inside parse() a reordering is done right before the SQL Walkers are created. This is only done if there is more than one Identification variable in the select expressions, otherwise its not necessary.&lt;/p&gt;

&lt;p&gt;The reordering iterates in order of the alias identification variables, grabs the expression from the select expressions and appends it to them. This way it is guaranteed that the expressions are ordered correctly.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT a, b, c.foo, count(d.bar) FROM B b JOIN b.a a JOIN ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;becomes:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT c.foo, count(d.bar), b, a FROM ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Roman do you think this is viable? See the patch for more details &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="14725" author="romanb" created="Fri, 12 Nov 2010 17:57:52 +0000"  >&lt;p&gt;Attached simplified patch.&lt;/p&gt;</comment>
                    <comment id="14726" author="beberlei" created="Sat, 13 Nov 2010 03:55:32 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                    <comment id="14926" author="hype" created="Tue, 7 Dec 2010 09:02:17 +0000"  >&lt;p&gt;I think that this patch breaks modifying the select clause in custom tree walkers because walking the select clause will be done after the $_identVariableExpressions array is populated. Reordering the identification variables will then override the modified select clause.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12200">DDC-915</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="12218">DDC-925</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10860" name="ddc736-simplified.patch" size="3869" author="romanb" created="Fri, 12 Nov 2010 17:56:32 +0000" />
                    <attachment id="10857" name="ddc736.patch" size="3763" author="beberlei" created="Wed, 10 Nov 2010 17:36:55 +0000" />
                    <attachment id="10846" name="DDC736Test.php" size="1405" author="romanb" created="Sat, 6 Nov 2010 13:13:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>