<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu May 23 15:52:05 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-1010/DC-1010.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-1010] When putting a subquery in the where clause which includes a join and a limit the limit subquery algorithm mistakenly modifies the subquery</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1010</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have fixed this in my own version of doctrine but unfortunately I am to far diverged from the trunk to offer a patch.&lt;/p&gt;

&lt;p&gt;here is a test case:&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;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testSubqueryInWhereWithJoinAndLimit()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;select(&apos;u.id&apos;);
        $q-&amp;gt;from(&apos;User u&apos;);
        $q-&amp;gt;where(&apos;u.id NOT IN (SELECT a.id FROM User u2 LEFT JOIN u2.Album a LIMIT 1)&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;SELECT e.id AS e__id FROM entity e WHERE (e.id NOT IN (SELECT a.id AS a__id FROM entity e2 LEFT JOIN album a ON e2.id = a.user_id WHERE (e2.type = 0) LIMIT 1) AND (e.type = 0))&apos;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To fix the issue I changed this line in Doctrine_Query as follows:&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;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;limit&apos;]) || ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;offset&apos;])) &amp;amp;&amp;amp; $needsSubQuery &amp;amp;&amp;amp; $limitSubquery) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;=&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;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;limit&apos;]) || ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;offset&apos;])) &amp;amp;&amp;amp; $needsSubQuery &amp;amp;&amp;amp; $limitSubquery &amp;amp;&amp;amp; !$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;isSubquery()) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hope that helps.&lt;/p&gt;

&lt;p&gt;Sincerely&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12728">DC-1010</key>
            <summary>When putting a subquery in the where clause which includes a join and a limit the limit subquery algorithm mistakenly modifies the subquery</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="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jun 2011 01:44:36 +0000</created>
                <updated>Tue, 21 Jun 2011 01:46:55 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>