<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 00:06:45 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-2204/DDC-2204.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-2204] Order by With Equals is not supported</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2204</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The sample query (I want to bring a specific item to the top of the list).&lt;br/&gt;
mysql&amp;gt; select * from Language order by name=&apos;English&apos; desc, name asc limit 5;&lt;br/&gt;
&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; id &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; name     &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 82 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; English  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 73 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Albanian &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 74 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Arabic   &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 75 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Armenian &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 76 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Bengali  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;br/&gt;
5 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;In theory, the code below should generate the same query.&lt;br/&gt;
$repository-&amp;gt;createQueryBuilder(&apos;p&apos;)&lt;br/&gt;
-&amp;gt;addOrderBy(&quot;p.name=&apos;english&apos;&quot;, &apos;desc&apos;)&lt;br/&gt;
-&amp;gt;addOrderBy(&apos;p.name&apos;, &apos;asc&apos;);&lt;/p&gt;

&lt;p&gt;In practice, an exception is thrown.&lt;br/&gt;
Doctrine\ORM\Query\QueryException: &lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 67: Error: Expected end of string, got &apos;=&apos; (uncaught exception) at /vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 44 &lt;/p&gt;

&lt;p&gt;Attached, SQL dump for the table &amp;amp; data&lt;/p&gt;</description>
                <environment>SQL construct tested on postgres 9.0, mysql 5.5, and sqlite 3.</environment>
            <key id="14318">DDC-2204</key>
            <summary>Order by With Equals is not supported</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="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ibiryukov">Ilya Biryukov</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Mon, 17 Dec 2012 20:39:59 +0000</created>
                <updated>Sat, 22 Dec 2012 13:19:16 +0000</updated>
                    <resolved>Sat, 22 Dec 2012 13:19:16 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19172" author="beberlei" created="Sat, 22 Dec 2012 13:19:16 +0000"  >&lt;p&gt;Its supported by including the condition in the SELECT clause, aliasing it, then using it. You might need to use &quot;AS HIDDEN name&quot; to prevent it from appearing in the result&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11364" name="Language.sql" size="1756" author="ibiryukov" created="Mon, 17 Dec 2012 20:39:59 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>