<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 06:03:03 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-1919/DDC-1919.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-1919] Doctrine fails to escape entity with reserved name in various situations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1919</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have submitted a PR here, fixing part of this issue: &lt;a href=&quot;https://github.com/doctrine/dbal/pull/166&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/166&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, it fails when UPDATE or INSERT is used. I&apos;m using a very simple, and common, entity name: Group. Doctrine is failing to escape this in various situations, causing queries to fail in MySQL due to reserved keywords.&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="13845">DDC-1919</key>
            <summary>Doctrine fails to escape entity with reserved name in various situations</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="klaussilveira">Klaus Silveira</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Jul 2012 21:34:08 +0000</created>
                <updated>Thu, 19 Jul 2012 18:27:21 +0000</updated>
                    <resolved>Wed, 11 Jul 2012 19:28:24 +0000</resolved>
                            <version>2.2</version>
                                <fixVersion>2.3</fixVersion>
                <fixVersion>Git Master</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18274" author="ocramius" created="Wed, 11 Jul 2012 00:31:41 +0000"  >&lt;p&gt;Can you try using the quoting strategy in master? By defining an &apos;@Table(name=&quot;`Group`&quot;)&apos; on your entity you should be able to fix this issue by yourself... Anyway, this is only available in latest master.&lt;br/&gt;
Please give it a try and let us know.&lt;/p&gt;</comment>
                    <comment id="18275" author="klaussilveira" created="Wed, 11 Jul 2012 17:27:34 +0000"  >&lt;p&gt;That hack, of course, fixes the problem. However, Doctrine is failing to escape entities with reserved keywords in various different situations and this should be a major problem, specially since there are many keywords that are common table names. Having to change the table name or escape the table name manually is not the best solution.&lt;/p&gt;

&lt;p&gt;I have look through the code but could not find out why getQuotedTableName() is failing to quote the table name &quot;Group&quot;. I fixed the other problem, involving schema creation, but this one i couldn&apos;t fix. That&apos;s why i&apos;m opening the issue, hoping someone with more experience in the ORM codebase manages to fix it.&lt;/p&gt;</comment>
                    <comment id="18276" author="ocramius" created="Wed, 11 Jul 2012 18:04:26 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=klaussilveira&quot; class=&quot;user-hover&quot; rel=&quot;klaussilveira&quot;&gt;Klaus Silveira&lt;/a&gt;, doctrine won&apos;t quote (at least with the default strategy) a table called &quot;Group&quot;. The default strategy will look for the sorrounding &quot;`&quot; (&quot;`Group`&quot;).&lt;br/&gt;
Is it still failing to quote something in latest master? Can you write a simple example of a failure you are getting?&lt;/p&gt;</comment>
                    <comment id="18277" author="klaussilveira" created="Wed, 11 Jul 2012 18:12:48 +0000"  >&lt;p&gt;The failure is caused when querying anything related to an entity wich it&apos;s name is a reserved keyword, for example, an entity called &quot;Group&quot;. I expected Doctrine to quote such table names. &lt;/p&gt;</comment>
                    <comment id="18278" author="ocramius" created="Wed, 11 Jul 2012 18:41:26 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=klaussilveira&quot; class=&quot;user-hover&quot; rel=&quot;klaussilveira&quot;&gt;Klaus Silveira&lt;/a&gt; did you put an @Table(name=&quot;`Group`&quot;) in it?&lt;/p&gt;</comment>
                    <comment id="18279" author="ocramius" created="Wed, 11 Jul 2012 18:48:04 +0000"  >&lt;p&gt;Please note that &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;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; and &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;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;@Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;`Group`&quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; are quite different. That&apos;s why I&apos;m asking&lt;/p&gt;</comment>
                    <comment id="18280" author="klaussilveira" created="Wed, 11 Jul 2012 19:00:52 +0000"  >&lt;p&gt;As i said, that hack fixes the problem. But i don&apos;t believe that having to change the table name or escape the table name manually is the best solution. Doctrine should be doing that transparently, as it does for other situations (such as during schema creation). Why not during all other operations? Makes no sense at all.&lt;/p&gt;</comment>
                    <comment id="18281" author="ocramius" created="Wed, 11 Jul 2012 19:22:07 +0000"  >&lt;p&gt;This is not a hack... In ORM, &quot;`&quot; is not the MySQL identifier quote. It is exactly thought as a character with which you tell the ORM that the identifier should be quoted.&lt;br/&gt;
The default strategy does make use of it, so please use it.&lt;/p&gt;</comment>
                    <comment id="18282" author="ocramius" created="Wed, 11 Jul 2012 19:27:29 +0000"  >&lt;p&gt;Also, we won&apos;t collect the SQL reserved keywords, nor we can know what keywords are used in all vendors. The patch for the quoting strategy was exactly thought to allow end users to use insecure names for their objects/fields/indexes/etc but without having the ORM implement those checks for them (since it would just be messy and too &quot;magic&quot;).&lt;/p&gt;

&lt;p&gt;Please also reconsider your pull request on github too ( &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-298&quot; title=&quot;[GH-166] Fixes a bug caused by unquoted reserved table name being referenced during schema creation&quot;&gt;&lt;del&gt;DBAL-298&lt;/del&gt;&lt;/a&gt; ).&lt;/p&gt;

&lt;p&gt;I&apos;m closing this one&lt;/p&gt;</comment>
                    <comment id="18283" author="klaussilveira" created="Wed, 11 Jul 2012 19:32:14 +0000"  >&lt;p&gt;Then what&apos;s the purpose of Doctrine\DBAL\Platforms\Keywords\MySQLKeywords?&lt;/p&gt;</comment>
                    <comment id="18284" author="ocramius" created="Wed, 11 Jul 2012 19:38:58 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=klaussilveira&quot; class=&quot;user-hover&quot; rel=&quot;klaussilveira&quot;&gt;Klaus Silveira&lt;/a&gt; not sure, but it isn&apos;t used in ORM.&lt;/p&gt;</comment>
                    <comment id="18339" author="beberlei" created="Thu, 19 Jul 2012 18:27:21 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-166&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/dbal/pull/166&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/166&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>