<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 19:35:10 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-932/DC-932.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-932] Queries fail when a model contains underscore and we try to apply a limit</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-932</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Actually, I&apos;ve a dead simple schema.yml, with two tables:&lt;/p&gt;

&lt;p&gt;T_Media:&lt;br/&gt;
    actAs:&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
    columns:&lt;br/&gt;
        media_id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;        name: string(25)&lt;/p&gt;


&lt;p&gt;J_Acl:&lt;br/&gt;
    columns:&lt;br/&gt;
        media_id: integer&lt;br/&gt;
    relations:&lt;br/&gt;
        Media: &lt;/p&gt;
{ class: T_Media, local: media_id, foreign: media_id, onDelete: CASCADE }


&lt;p&gt;I have some fixtures:&lt;br/&gt;
T_Media:&lt;br/&gt;
    m1:&lt;br/&gt;
        name: foobar&lt;/p&gt;

&lt;p&gt;J_Acl:&lt;br/&gt;
    a1:&lt;br/&gt;
        Media: m1&lt;/p&gt;

&lt;p&gt;And then, the DQL query I want to execute:&lt;/p&gt;

&lt;p&gt;&quot;From T_Media m INNER JOIN m.J_Acl order by m.created_at limit 1&quot;&lt;/p&gt;

&lt;p&gt;But if I run this query, for instance in CLI, I got an error:&lt;br/&gt;
./symfony doctrine:dql &quot;From T_Media m INNER JOIN m.J_Acl order by m.created_at limit 1&quot;&lt;/p&gt;


&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S02&amp;#93;&lt;/span&gt;: Base table or view not found: 1146 Table &apos;test_noel.t2__media&apos; doesn&apos;t exist.&lt;br/&gt;
Failing Query: &quot;SELECT DISTINCT t2.media_id FROM t2_&lt;em&gt;media t2 INNER JOIN j2&lt;/em&gt;_acl j2 ON t2.media_id = j2.media_id ORDER BY t2.created_at LIMIT 1&quot;&lt;/p&gt;

&lt;p&gt;Notes: &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the query works if I do not apply the limit clause.&lt;/li&gt;
	&lt;li&gt;if I remove the underscore from the model, or if I set manually the tableName to remove the double underscore, it works&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Doctrine 1.2, Symfony 1.4.6, MySQL, Postgresql</environment>
            <key id="12125">DC-932</key>
            <summary>Queries fail when a model contains underscore and we try to apply a limit</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="noel">Noel GUILBERT</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2010 08:47:27 +0000</created>
                <updated>Fri, 19 Nov 2010 08:47:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>