<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 13:16:06 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-1079/DDC-1079.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-1079] Behavior of Doctrine 2 is not as defined by EBNF definition for SimpleSelectExpression</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1079</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Queries like&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 COUNT(a)
  FROM \a a
 WHERE EXISTS (SELECT 0
      		 FROM \b b
                WHERE b.a = a)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;will not work, whereas they should.&lt;/p&gt;

&lt;p&gt;Assume that there are potentially millions of b&apos;s per a, so this should not be joined, just simply left as-is as a correlated subquery within an exists expression. Actually, a &quot;LIMIT 1&quot; at the end of the subquery would come in handy here, too.&lt;/p&gt;


&lt;p&gt;Doctrine 2 will give an error message&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;: Error: Expected known function, got &apos;0&apos;&apos;&lt;/p&gt;

&lt;p&gt;when parsing the DQL statement.&lt;/p&gt;


&lt;p&gt;According to the EBNF definition, 0 qualifies as a Literal, which qualifies as an ArithmeticPrimary, which qualifies as an ArithmeticFactor, which qualifies as an ArithmeticTerm, which qualifies as a SimpleArithmeticExpression, which qualifies as a ScalarExpression, which qualifies as a SimpleSelectExpression, which should be perfectly legitimate in that position.&lt;/p&gt;

&lt;p&gt;This is yet another annoying case of the Doctrine 2 documentation not matching the behavior of the actual implementation.&lt;/p&gt;

&lt;p&gt;Fortunately, it is easy to work around this defect by selecting some field and sacrificing a bit of performance, but then again, it sucks to have to continuously implement workarounds. &lt;/p&gt;</description>
                <environment></environment>
            <key id="12496">DDC-1079</key>
            <summary>Behavior of Doctrine 2 is not as defined by EBNF definition for SimpleSelectExpression</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="dalvarez">Daniel Alvarez Arribas</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Mar 2011 10:59:11 +0000</created>
                <updated>Sat, 29 Oct 2011 10:19:29 +0000</updated>
                    <resolved>Sun, 27 Mar 2011 08:09:10 +0000</resolved>
                            <version>2.0.2</version>
                                <fixVersion>2.0.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15595" author="beberlei" created="Sun, 27 Mar 2011 08:09:10 +0000"  >&lt;p&gt;Fixed, didn&apos;t work because of a shortcut that was implemented in SimpleSelectExpression. I removed that now and fixed the problem the shortcut was trying to fix at a better location.&lt;/p&gt;</comment>
                    <comment id="16723" author="beberlei" created="Sat, 29 Oct 2011 10:19:29 +0000"  >&lt;p&gt;Some more stuff is fixed in regard to this in some lsat ocmmits.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>