<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue Jun 18 22:57:44 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/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DC+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1000" total="1048"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-646] DELETE and INNER JOIN</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-646</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I made a DQL delete query.&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
  -&amp;gt;delete()&lt;br/&gt;
  -&amp;gt;from(&apos;termRelationship tr&apos;)&lt;br/&gt;
  -&amp;gt;innerJoin(&apos;tr.termTaxonomy tt&apos;)&lt;br/&gt;
  -&amp;gt;innerJoin(&apos;tr.Post p&apos;)&lt;br/&gt;
  -&amp;gt;where(&apos;p.id = ?&apos;, &apos;1&apos;)&lt;br/&gt;
  -&amp;gt;andWhere(&apos;tt.taxonomy = ?&apos;,&apos;category&apos;);&lt;/p&gt;

&lt;p&gt;//GENERATED SQL OF THE DQL&lt;br/&gt;
DELETE FROM term_relationship INNER JOIN term_taxonomy t2 ON t.term_taxonomy_id = t2.id INNER JOIN post p ON t.object_id = p.id WHERE (id = &apos;1&apos; AND taxonomy = &apos;category&apos;)&lt;/p&gt;

&lt;p&gt;But this query is incorrect &lt;/p&gt;

&lt;p&gt;The query must be( alias are not present beetween DELETE and FROM and for the FROM table)&lt;/p&gt;

&lt;p&gt;DELETE tr FROM term_relationship tr  INNER JOIN term_taxonomy t2 ON tr.term_taxonomy_id = t2.id INNER JOIN post p ON tr.object_id = p.id WHERE (p.id = &apos;1&apos; AND t2.taxonomy = &apos;category&apos;)&lt;/p&gt;

&lt;p&gt;With this request all is good in pphmyadmin.&lt;/p&gt;
</description>
                <environment>WIndows 7&lt;br/&gt;
Wamp (PHP Version 5.3.0 mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.27 $ )&lt;br/&gt;
</environment>
            <key id="11260">DC-646</key>
            <summary>DELETE and INNER JOIN</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="masseur">jerome</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Apr 2010 08:43:49 +0000</created>
                <updated>Mon, 3 Jun 2013 15:43:55 +0000</updated>
                    <resolved>Tue, 8 Jun 2010 13:59:37 +0000</resolved>
                            <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13184" author="jwage" created="Tue, 8 Jun 2010 13:59:37 +0000"  >&lt;p&gt;Joins are not supported on update and delete queries because it is not supported on all dbms. It won&apos;t be implemented in Doctrine 1 or Doctrine 2. You can however get the same affect by using subqueries.&lt;/p&gt;</comment>
                    <comment id="20469" author="jebbench" created="Mon, 3 Jun 2013 15:42:00 +0000"  >&lt;p&gt;You can&apos;t delete from a table when it&apos;s in a subquery in MySQL (I&apos;m using Doctrine 2).&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;
DELETE FROM tblA a WHERE a.id NOT IN(SELECT a2.id FROM tblA a2 JOIN a2.tblB b WHERE b.value = :value)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-884] Doctrine_Collection::loadRelated uses getLocal instead of getLocalFieldName</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-884</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Having a camelcase fieldname with a lowercase column name causes loadRelated of doctrine collection to throw an unknown property error, fix:&lt;/p&gt;

&lt;p&gt;Change&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;$rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_LocalKey || $rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_ForeignKey) {
            foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data as $record) {
                $list[] = $record[$rel-&amp;gt;getLocal()];
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to:&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;$rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_LocalKey || $rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_ForeignKey) {
            foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data as $record) {
                $list[] = $record[$rel-&amp;gt;getLocalFieldName()];
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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 populateRelated($name, Doctrine_Collection $coll)
    {
        $rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);
        $table   = $rel-&amp;gt;getTable();
        $foreign = $rel-&amp;gt;getForeign();
        $local   = $rel-&amp;gt;getLocal();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to&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 populateRelated($name, Doctrine_Collection $coll)
    {
        $rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);
        $table   = $rel-&amp;gt;getTable();
        $foreign = $rel-&amp;gt;getForeignFieldName();
        $local   = $rel-&amp;gt;getLocalFieldName();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows</environment>
            <key id="11994">DC-884</key>
            <summary>Doctrine_Collection::loadRelated uses getLocal instead of getLocalFieldName</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="baxter">Jason Brumwell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Oct 2010 12:53:09 +0000</created>
                <updated>Mon, 18 Feb 2013 20:52:07 +0000</updated>
                                                                    <component>Record</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="16574" author="eadi" created="Wed, 12 Oct 2011 07:52:56 +0000"  >&lt;p&gt;Now this is really poor. This trivial bug is known for over a year not but not yet fixed.&lt;/p&gt;

&lt;p&gt;Fixing it would save millions of rainforrest trees because people would not have to rely on hundreds of lazy loading queries per page but start to use the getRelation() method.&lt;/p&gt;</comment>
                    <comment id="18846" author="eadi" created="Thu, 18 Oct 2012 07:52:18 +0000"  >&lt;p&gt;Two years now. :&apos;-(&lt;/p&gt;</comment>
                    <comment id="19563" author="mishal" created="Mon, 18 Feb 2013 20:52:07 +0000"  >&lt;p&gt;Another year, and all people are probably on Doctrine2.&lt;/p&gt;

&lt;p&gt;But.... I just pushed your fix #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-884&quot; title=&quot;Doctrine_Collection::loadRelated uses getLocal instead of getLocalFieldName&quot;&gt;DC-884&lt;/a&gt; to my Doctrine1 fork, if you are interested.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mishal/doctrine1&quot; class=&quot;external-link&quot;&gt;https://github.com/mishal/doctrine1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1056] Doctrine is not compatible with PHP 5.4 due to change in serialize() behaviour.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1056</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In PHP 5.4 there is a change in the way the object references are serialized:&lt;/p&gt;

&lt;p&gt;Quote:&lt;br/&gt;
&quot;Support for object references in recursive serialize() calls&lt;br/&gt;
Prior to PHP 5.4, object references where not saved in recursive serialize calls.&quot;&lt;/p&gt;

&lt;p&gt;This minor change, breaks down serialization of collections when column of type &quot;array&quot; is present - double serialization occurs.&lt;br/&gt;
I&apos;m attaching a patch fixing the issue.&lt;/p&gt;
</description>
                <environment>PHP 5.4+</environment>
            <key id="13751">DC-1056</key>
            <summary>Doctrine is not compatible with PHP 5.4 due to change in serialize() behaviour.</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mg">Marcin Gil</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jun 2012 08:03:39 +0000</created>
                <updated>Mon, 28 Jan 2013 19:45:13 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18837" author="colin.darie" created="Mon, 15 Oct 2012 14:02:29 +0000"  >&lt;p&gt;I confirm for possible future readers: this patch works perfectly well. (cf github for several forks of doctrine with other bugfixes).&lt;/p&gt;</comment>
                    <comment id="19430" author="st3b3n" created="Sun, 27 Jan 2013 19:10:57 +0000"  >&lt;p&gt;Hi all, does somebody knows where can I get a copy of the Doctrine 1.2.4 version but running on php 5.4?&lt;br/&gt;
Thise version you&apos;re talking about&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="19431" author="mg" created="Mon, 28 Jan 2013 08:05:59 +0000"  >&lt;p&gt;I sent you URL to our private svn repo.&lt;/p&gt;</comment>
                    <comment id="19432" author="st3b3n" created="Mon, 28 Jan 2013 19:45:13 +0000"  >&lt;p&gt;Thanks, you&apos;ve saved mi life &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11197" name="Record.php.patch" size="1032" author="mg" created="Mon, 4 Jun 2012 13:59:32 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-356] Error in self referencing (nest relations) and tableName.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-356</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have this schema:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Interface&lt;br/&gt;
Interfaz: &lt;br/&gt;
  tableName:        YT_INTERFAZ&lt;br/&gt;
  columns:&lt;br/&gt;
    cinterfaz:        
{ type: integer, notnull: true, primary: true, autoincrement: true }
&lt;p&gt;  relations:&lt;br/&gt;
    Conexiones:&lt;br/&gt;
      class: Interfaz&lt;br/&gt;
      local: cinterfazsrc&lt;br/&gt;
      foreign: cinterfazdst&lt;br/&gt;
      refClass: Conexion&lt;br/&gt;
      equal: true&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;#Link&lt;br/&gt;
Conexion:&lt;br/&gt;
  tableName:        YT_CONEXION&lt;br/&gt;
  columns:&lt;br/&gt;
    cinterfazsrc:      &lt;/p&gt;
{ type: integer, primary: true }
&lt;p&gt;    cinterfazdst:      &lt;/p&gt;
{ type: integer, primary: true }

&lt;p&gt;When I try to get $interfaz-&amp;gt;Conexiones, I get this message:&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: yt_interfaz in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 288&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 289&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getFieldName() on a non-object in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 290&lt;/p&gt;

&lt;p&gt;But If I remove tableName fields in schema declaration, it works perfectly. The name of tableName don&apos;t matters, if you use it, it fails.&lt;/p&gt;</description>
                <environment>Linux, php 5.2.10, apache 2.2.12</environment>
            <key id="10609">DC-356</key>
            <summary>Error in self referencing (nest relations) and tableName.</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="perseo">Sergio Gomez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Dec 2009 12:07:46 +0000</created>
                <updated>Thu, 17 Jan 2013 01:16:07 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15310" author="kweij" created="Tue, 15 Feb 2011 08:15:12 +0000"  >&lt;p&gt;Same story over here. Same error with the following non-equal nest relation:&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-javascript&quot;&gt;&amp;lt;?php

class TXCRDataNodeCRDataNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;x_CRDataNode_CRDataNode&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;childNodeID&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;parentNodeID&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setUp() {
        parent::setUp();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;TCRDataNode as child&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;childNodeID&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;dataNodeID&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;TCRDataNode as parent&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;parentNodeID&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;dataNodeID&apos;));
    }
}

class TCRDataNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;CRDataNode&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;dataNodeID&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;value&apos;, &apos;string&apos;, 255, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;length&apos; =&amp;gt; 255,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;TCRDataNode as childNodes&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;parentNodeID&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;childNodeID&apos;,
            &apos;refClass&apos; =&amp;gt; &apos;TXCRDataNodeCRDataNode&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;TCRDataNode as parentNodes&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;childNodeID&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;parentNodeID&apos;,
            &apos;refClass&apos; =&amp;gt; &apos;TXCRDataNodeCRDataNode&apos;));
    }
}

$dn = Doctrine_Core::getTable(&apos;TCRDataNode&apos;)-&amp;gt;find(5300);

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;.. and then when I ..&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-javascript&quot;&gt;&amp;lt;?php

$pn = $dn-&amp;gt;parentNodes;

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;.. it goes like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice: Undefined index: crdatanode in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 288&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 289&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getFieldName() on a non-object in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 290&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Using Doctrine 1.2.2&lt;/p&gt;

&lt;p&gt;It seemed like the same thing as presented in the &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models:relationships:join-table-associations:self-referencing-nest-relations#non-equal-nest-relations&quot; class=&quot;external-link&quot;&gt;documentation&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15331" author="kweij" created="Thu, 17 Feb 2011 09:34:20 +0000"  >&lt;p&gt;This aching issue - as I traced the cord back to the wall - appears to originate from the fact that I use UPPERCASES in the names of my databas tables. When I user all lowercases: no problem. Hence it worked on my WAMP server (Windows just lowercases it all). Even when I so much as start the entity-table which an UPPERCASE: bang! Fatal error.&lt;/p&gt;

&lt;p&gt;This is not logical and, I presume, is a definite bug.&lt;/p&gt;

&lt;p&gt;Please, oh please fix this ..&lt;/p&gt;</comment>
                    <comment id="17528" author="dannykopping" created="Tue, 6 Mar 2012 08:39:37 +0000"  >&lt;p&gt;As Klaas mentions, this function incorrectly assumes that all databases will be named using lowercase letters.&lt;/p&gt;

&lt;p&gt;The problem arises in the following line:&lt;br/&gt;
$cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt; = $this-&amp;gt;_tableAliases&lt;span class=&quot;error&quot;&gt;&amp;#91;strtolower(implode(&amp;#39;__&amp;#39;, $e))&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;If one removes the &quot;strtolower&quot; function call, it will work for tables named with uppercase letters, but this is obviously quite an inelegant solution.&lt;/p&gt;

&lt;p&gt;Could you suggest an alternative solution? I&apos;ll be happy to make the change, test it and issue a pull request in GitHub&lt;/p&gt;</comment>
                    <comment id="17529" author="dannykopping" created="Tue, 6 Mar 2012 13:01:44 +0000"  >&lt;p&gt;I&apos;ve just tested this scenario in as many different possible combinations as I could think of (all tables uppercase/PascalCase, all tables lowercase, some Pascal, some lowercase) and just by removing the &quot;strtolower&quot; function, the issue seems to be resolved.&lt;/p&gt;</comment>
                    <comment id="19333" author="jklehr" created="Thu, 17 Jan 2013 01:16:07 +0000"  >&lt;p&gt;We&apos;ve encountered this as well, tried a lot of different things in our models/schema to get around it, but nothing worked.&lt;/p&gt;

&lt;p&gt;Made a test case here: &lt;a href=&quot;https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php&quot; class=&quot;external-link&quot;&gt;https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modified the doctrine core as suggested by Danny, but this change causes other Doctrine test to fail (Particularly tests/TableTestCase.php).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-984] Pessimistic locking locks entire table rather than record</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-984</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using pessimistic locking as described in:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/component-overview:locking-manager:examples/zh&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/component-overview:locking-manager:examples/zh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the locking manager locks the entire table rather than the specific object. &lt;/p&gt;

&lt;p&gt;This should be clear from the attached patch which corrects the issue (assuming I have correctly interpreted the intention of pessimistic locking!).&lt;/p&gt;

&lt;p&gt;The current behavior will have worked as expected for users but it will have locked far more than was intended and may thus have affected performance.&lt;/p&gt;

&lt;p&gt;NB: I can confirm this works for non-composite keys but please review and test for composite keys as I have no such tables to hand.&lt;/p&gt;</description>
                <environment>Standard LAMP stack using current SVN from &lt;a href=&quot;http://svn.doctrine-project.org/branches/1.2/lib/Doctrine/Locking/Manager&quot;&gt;http://svn.doctrine-project.org/branches/1.2/lib/Doctrine/Locking/Manager&lt;/a&gt;</environment>
            <key id="12471">DC-984</key>
            <summary>Pessimistic locking locks entire table rather than record</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="barryo">Barry O&apos;Donovan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Mar 2011 07:53:30 +0000</created>
                <updated>Thu, 13 Dec 2012 13:13:16 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Transactions</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="16657" author="barryo" created="Tue, 18 Oct 2011 07:49:18 +0000"  >&lt;p&gt;Folks - just wondering if anyone had a chance to look at this as, while not critical, it does appear to be a genuinely major performance issue.&lt;/p&gt;</comment>
                    <comment id="19132" author="greg0ire" created="Thu, 13 Dec 2012 13:13:16 +0000"  >&lt;p&gt;Duplicate with more information : &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-185&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-185&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10953" name="Doctrine_Locking_Manager_Pessimistic.diff" size="855" author="barryo" created="Wed, 16 Mar 2011 07:53:30 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-185] The pessimistic offline locking manager locks the entire table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-185</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Scenario: &lt;br/&gt;
    $entity = Doctrine::getTable(&apos;Steps&apos;)-&amp;gt;find($pID);&lt;br/&gt;
    $lockingManager = new Doctrine_Locking_Manager_Pessimistic( Doctrine_Manager::connection()  );&lt;br/&gt;
    $lockingManager-&amp;gt;releaseAgedLocks(300);&lt;br/&gt;
    $gotLock = $lockingManager-&amp;gt;getLock($entity, &apos;user1&apos; ); &lt;/p&gt;

&lt;p&gt;Running this code locks the entire table &quot;Steps&quot;, and not just the record. &lt;/p&gt;

&lt;p&gt;in the table &quot;doctrine_lock_tracking&quot;, in the fields: &quot;object_type&quot; and &quot;object_key&quot;  are saved in this case: &quot;Steps&quot; and &quot;IDStep&quot;. &lt;br/&gt;
I think that here must be saved &quot;Steps&quot; and &quot;120&quot; (the value of IDStep). &lt;/p&gt;
</description>
                <environment>Windows XP, WampServer Version 2.0&lt;br/&gt;
</environment>
            <key id="10336">DC-185</key>
            <summary>The pessimistic offline locking manager locks the entire table</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fbrussa">Fabian Brussa</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 18:33:58 +0000</created>
                <updated>Thu, 13 Dec 2012 13:12:52 +0000</updated>
                                    <version>1.1.4</version>
                <version>1.1.5</version>
                <version>1.2.3</version>
                                                        <due></due>
                    <votes>7</votes>
                        <watches>7</watches>
                        <comments>
                    <comment id="10736" author="fbrussa" created="Wed, 18 Nov 2009 16:01:48 +0000"  >&lt;p&gt;Is anybody looking into this issue ?&lt;/p&gt;</comment>
                    <comment id="10755" author="jwage" created="Wed, 18 Nov 2009 22:05:55 +0000"  >&lt;p&gt;Can you provide a test case that shows the issue? It is hard to look into the issue without a test to run &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; When I look at the code and our tests everything is passing and fine so I am not sure what your issue could be. Re-open if you have more information to provide.&lt;/p&gt;</comment>
                    <comment id="10774" author="fbrussa" created="Thu, 19 Nov 2009 12:14:42 +0000"  >&lt;p&gt;ok, I attach the test case&lt;/p&gt;</comment>
                    <comment id="10994" author="fbrussa" created="Thu, 3 Dec 2009 19:51:20 +0000"  >&lt;p&gt;Have you already been able to look at the testcase ??&lt;/p&gt;</comment>
                    <comment id="11385" author="fbrussa" created="Thu, 14 Jan 2010 19:48:41 +0000"  >&lt;p&gt;Any news ??&lt;/p&gt;</comment>
                    <comment id="13413" author="leszczu" created="Fri, 25 Jun 2010 10:15:21 +0000"  >&lt;p&gt;This issue is still valid for Doctrine 1.2. Doctrine_Locking_Manager_Pessimistic is &lt;b&gt;UNUSABLE&lt;/b&gt; without this bug fixed!&lt;/p&gt;</comment>
                    <comment id="13496" author="markus.woessner" created="Fri, 2 Jul 2010 05:26:05 +0000"  >&lt;p&gt;Having a look at &quot;Doctrine_Locking_Manager_Pessimistic::getLock()&quot; it becomes clear what causes this misbehaviour:&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 getLock(Doctrine_Record $record, $userIdent)
    {
        $objectType = $record-&amp;gt;getTable()-&amp;gt;getComponentName();
        $key        = $record-&amp;gt;getTable()-&amp;gt;getIdentifier();

        $gotLock = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        $time = time();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_array($key)) {
            &lt;span class=&quot;code-comment&quot;&gt;// Composite key
&lt;/span&gt;            $key = implode(&apos;|&apos;, $key);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $dbh = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh();
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;beginTransaction();

            $stmt = $dbh-&amp;gt;prepare(&apos;INSERT INTO &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lockTable
                                  . &apos; (object_type, object_key, user_ident, timestamp_obtained)&apos;
                                  . &apos; VALUES (:object_type, :object_key, :user_ident, :ts_obtained)&apos;);

            $stmt-&amp;gt;bindParam(&apos;:object_type&apos;, $objectType);
            $stmt-&amp;gt;bindParam(&apos;:object_key&apos;, $key);
            $stmt-&amp;gt;bindParam(&apos;:user_ident&apos;, $userIdent);
            $stmt-&amp;gt;bindParam(&apos;:ts_obtained&apos;, $time);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is NO hint about the Record&apos;s identifier VALUE but only about the identifier&apos;s NAME (mostly &quot;id&quot;) which appears to be redundant information. Instead of ...&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;        $key = $record-&amp;gt;getTable()-&amp;gt;getIdentifier();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;..there should be something 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;        $key = $record-&amp;gt;get($record-&amp;gt;getTable()-&amp;gt;getIdentifier());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In case of composite keys a string concatenation, prefixed by identifier&apos;s name might work but I would recommend using &quot;md5()&quot; on resulting value to limit its length since field &quot;object_key&quot; is limited to 250 chars.&lt;/p&gt;</comment>
                    <comment id="13497" author="branleb" created="Fri, 2 Jul 2010 10:49:03 +0000"  >&lt;p&gt;Based on the previous comment by Markus W&#246;&#223;ner i created a patch for  row based locking.&lt;/p&gt;

&lt;p&gt;It concatenates the PK fields and their values to a string and calculates the sha-1 hash as a unique string representing that record. This string is then used as key so that we&apos;ll only lock the single Record and not the whole table.&lt;/p&gt;

&lt;p&gt;I hope you&apos;ll give this patch a try - It solved this problem for me.&lt;/p&gt;</comment>
                    <comment id="13498" author="markus.woessner" created="Fri, 2 Jul 2010 17:18:56 +0000"  >&lt;p&gt;I applied patch from Mr. Florian Zumkeller-Quast and provided testcase didn&apos;t fail anymore. I think this should do it. By the way I find it strange that this issue isn&apos;t already fixed. I guess locking is not very much used by Doctrine users.&lt;/p&gt;</comment>
                    <comment id="16895" author="jeromeweb" created="Mon, 21 Nov 2011 10:29:51 +0000"  >&lt;p&gt;I applied patch too and it works now. I guess too that nobody use Lockings but when you use it ... without the patch it fails.&lt;/p&gt;</comment>
                    <comment id="19131" author="greg0ire" created="Thu, 13 Dec 2012 13:12:52 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-984&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-984&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10174" name="DC185TestCase.php" size="1952" author="fbrussa" created="Thu, 19 Nov 2009 12:15:52 +0000" />
                    <attachment id="10688" name="row_based_locking.patch" size="3262" author="branleb" created="Fri, 2 Jul 2010 10:49:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1059] Generate Entity From Database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1059</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Problem already report here : &lt;a href=&quot;https://github.com/symfony/symfony/issues/5617#issuecomment-8934524&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/5617#issuecomment-8934524&lt;/a&gt;&lt;br/&gt;
But the idea is, on generation of entity from database MySQL, Int and Tinyint type are tranform as booelan.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14074">DC-1059</key>
            <summary>Generate Entity From Database</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="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="draeli">Draeli</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 Sep 2012 17:07:01 +0000</created>
                <updated>Thu, 27 Sep 2012 17:07:01 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-373] Relating to Translation table (generated by Doctrine_I18n) doesn&apos;t work correctly after resetting connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-373</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Relating to Translation table (generated by Doctrine_I18n) doesn&apos;t work correctly after resetting connection.&lt;/p&gt;

&lt;p&gt;First, I defined the following schema.yml::&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-none&quot;&gt; 
  Example:
    actAs:
      I18n:
        fields: [title]
    columns:
        title: string(128)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, I prepared the following fixture &lt;a href=&quot;file::&quot; class=&quot;external-link&quot;&gt;file::&lt;/a&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-none&quot;&gt; 
  Example:
    Example_1:
      Translation:
        en:
          title: &quot;Title&quot;
        ja:
          title: &quot;&#38988;&#21517;&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, I run &quot;build-all-reload&quot; task. The table was created and data was loaded.&lt;/p&gt;

&lt;p&gt;And I write the following code::&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; 
  Doctrine_Core::loadModels(&apos;models&apos;);
  $example = Doctrine_Core::getTable(&apos;Example&apos;)-&amp;gt;find(1);
  
  var_dump(
    $example-&amp;gt;Translation[&apos;en&apos;]-&amp;gt;title,
    $example-&amp;gt;Translation[&apos;ja&apos;]-&amp;gt;title
  );
  
  Doctrine_Manager::resetInstance();
  Doctrine_Manager::getInstance()-&amp;gt;openConnection(DSN, &apos;doctrine&apos;);
  
  $example2 = Doctrine_Core::getTable(&apos;Example&apos;)-&amp;gt;find(1);
  var_dump(
    $example2-&amp;gt;Translation[&apos;en&apos;]-&amp;gt;title,
    $example2-&amp;gt;Translation[&apos;ja&apos;]-&amp;gt;title
  );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I try executing my code, but I got the following error::&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-none&quot;&gt;  string(5) &quot;Title&quot;
  string(6) &quot;&#38988;&#21517;&quot;
  
  Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;e.title&apos; in &apos;field list&apos; in /path/to/doctrine/Doctrine/Connection.php on line 1082
  
  Call Stack:
      0.0055      65352   1. {main}() /path/to/my/code/test.php:0
      0.2776    5873388   2. Doctrine_Table-&amp;gt;find() /path/to/my/code/test.php:52
      0.2793    5881152   3. Doctrine_Query-&amp;gt;fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
      0.2793    5881296   4. Doctrine_Query_Abstract-&amp;gt;execute() /path/to/doctrine/Doctrine/Query.php:281
      0.2793    5881892   5. Doctrine_Query_Abstract-&amp;gt;_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
      0.3127    5890712   6. Doctrine_Connection-&amp;gt;execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
      0.3164    5892632   7. Doctrine_Connection_Statement-&amp;gt;execute() /path/to/doctrine/Doctrine/Connection.php:1006
      0.3181    5907408   8. Doctrine_Connection-&amp;gt;rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.2.11 (with Suhosin-Patch 0.9.7)&lt;br/&gt;
PHP 5.3.6</environment>
            <key id="10638">DC-373</key>
            <summary>Relating to Translation table (generated by Doctrine_I18n) doesn&apos;t work correctly after resetting connection</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="co3k">Kousuke Ebihara</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Dec 2009 22:54:24 +0000</created>
                <updated>Tue, 11 Sep 2012 13:16:23 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                <component>I18n</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="14659" author="arnaud.charlier@gmail.com" created="Tue, 2 Nov 2010 04:55:46 +0000"  >&lt;p&gt;Good Morning,&lt;/p&gt;

&lt;p&gt;First, thanks a lot for your work on Doctrine. It&apos;s a real great tool we love to use.&lt;/p&gt;

&lt;p&gt;Currently in one of our big application we have exactly the same issue.&lt;br/&gt;
It seems when we close the connection, the reference with the objectTranslation is lost.&lt;br/&gt;
Re-open the connection seems not able to reinstantiate this Translation link to the objectTranslation.&lt;/p&gt;

&lt;p&gt;Currently we have no solution, but we are still investigating this.&lt;/p&gt;

&lt;p&gt;I&apos;m available to go deep in the code with you, but any Doctrine Team help will be really nice.&lt;/p&gt;

&lt;p&gt;Thanks to let me know as soon as possible.&lt;/p&gt;

&lt;p&gt;Arnaud&lt;/p&gt;</comment>
                    <comment id="15891" author="jsiponen" created="Fri, 27 May 2011 14:51:51 +0000"  >&lt;p&gt;I&apos;ve just now battled with the very same problem in Doctrine 1.2 (the version bundled with symfony 1.4) and the problem seems to be caused by the fact that Doctrine_Record_Generator simply isn&apos;t written such that it is able to reinitialize generators for unloaded table instances after a connection is closed.  This problem also manifests itself after a table has been loaded in a connection and one tries retrieve a table again after Doctrine_Connection-&amp;gt;evictTables() has been called. This makes it impossible to to open more than one connection at a time in a request/script when using behaviors that dynamically modify table instances (such as the i18n behavior).&lt;/p&gt;

&lt;p&gt;Doctrine_Record_Generator determines if it needs to run its initialization methods simply by checking if the to-be generated class, as defined by the className option, exists using a class_exists call. This means that the first time this method is called the initialization happens but for every subsequent call no initialization is made. Now, in the i18m behavior, the important initialization happens in its setTableDefinition method in which it removes any of the translated fields from the table instance that is been setup and redefines them as relations on the to-be-created Translation class. It then finishes off by dynamically declaring the new class for the translation record using its generateClassFromTable method.&lt;/p&gt;

&lt;p&gt;Thus, the first time everything goes smoothly and the i18n generator&apos;s setTableDefinition is called and the table instance is properly initialized. Everything will now work as expected while the current connection is open since the connection instance keeps the i18n modified table instances alive and well for callers.&lt;/p&gt;

&lt;p&gt;But, when the current connection is closed the i18n modified table instances it holds are also removed (goes out of scope). Then, when a new connection is opened, this new connection will start without having any table instances. This means that the next time one asks the new connection for a table instance of the same class with the i18n behavior the i18n behaviors will fail to initialize because the generator at this time believes its class has actually been initialized which, in turn, means that the table using the i18n behavior isn&apos;t properly initialized. No initialization means that this table will now include the non-existant i18n fields in the select part of its queries (those are in the translation table) causing those queries to fail miserably.&lt;/p&gt;

&lt;p&gt;I believe this could be fixed by adding a static attribute to Doctrine_Record_Generator that tracks the spl_object_hash of the underlying dbh instance variable of the doctrine connection of the table parameter. If the hash is the same the next time that the initialize method is called the generator can decide not to reinitialize itself but if it detects that the hash of the current connection is different then that is definitely a clue to the generator that it needs to reinitialize itself (i.e. run all of the initialization methods but generateClassFromTable which should&apos;t be called more than once).&lt;/p&gt;

&lt;p&gt;Maybe do it like this perhaps:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
abstract class Doctrine_Record_Generator extends Doctrine_Record_Abstract
{
  public function initialize(Doctrine_Table $table)
  {
    /* ... */ 
  
    $currentConnectionHash = spl_object_hash($table-&amp;gt;getConnection()-&amp;gt;getDbh());
    
    //Next part is called if this is the first connection made or if this is a new open connection with new table instances
    if ($currentConnectionHash != self::$lastConnectionHash)
    {
      self::$lastConnectionHash = $currentConnectionHash;
      
      $this-&amp;gt;buildTable();

      $fk = $this-&amp;gt;buildForeignKeys($this-&amp;gt;_options[&apos;table&apos;]);

      $this-&amp;gt;_table-&amp;gt;setColumns($fk);

      $this-&amp;gt;buildRelation();

      $this-&amp;gt;setTableDefinition();
      $this-&amp;gt;setUp();
      
      if ($this-&amp;gt;_options[&apos;generateFiles&apos;] === false &amp;amp;&amp;amp; class_exists($this-&amp;gt;_options[&apos;className&apos;])) {
        $this-&amp;gt;generateClassFromTable($this-&amp;gt;_table); //Don&apos;t generate the class more than once ever
      }
      
      $this-&amp;gt;buildChildDefinitions();

      $this-&amp;gt;_table-&amp;gt;initIdentifier();
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="16003" author="jsiponen" created="Thu, 16 Jun 2011 20:28:21 +0000"  >&lt;p&gt;Failing test case attached&lt;/p&gt;</comment>
                    <comment id="18060" author="co3k" created="Fri, 8 Jun 2012 07:53:37 +0000"  >&lt;p&gt;Good job, Joe Siponen! Thanks for your nice patch!&lt;/p&gt;

&lt;p&gt;I can&apos;t understand why the Doctrine team discontinued maintenance of Doctrine 1 without any fixes for some serious issues like this problem...&lt;/p&gt;

&lt;p&gt;Joe, would you send your patch by pull-request in GitHub? They might notice this problem and try to fix in official repository by your request. If you cannnot, I will do it as your proxy. (Of course I&apos;m going to describe your credit)&lt;/p&gt;</comment>
                    <comment id="18626" author="co3k" created="Tue, 11 Sep 2012 13:16:23 +0000"  >&lt;p&gt;I&apos;ve tested Joe Siponen&apos;s patch, it would be good in a situation of single connection, but it doesn&apos;t work in multiple connections.&lt;/p&gt;

&lt;p&gt;So I modified your patch to fit my needs. I&apos;m testing my arranged patch and I want to publish it ASAP...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11015" name="DC373TestCase.php" size="6100" author="jsiponen" created="Thu, 16 Jun 2011 20:28:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1051] Timestampable listener does not set timestamp fields on a copy of a Doctrine_Record</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1051</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Timestampable Listener only sets the timestamp if the timestamp field has not been modified:&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; ( ! isset($modified[$createdName])) {
  $event-&amp;gt;getInvoker()-&amp;gt;$createdName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTimestamp(&apos;created&apos;, $event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getConnection());
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When saving a copy of a Doctrine_Record that doesn&apos;t already have the timestamp fields set fails to be updated, leading to integrity constraint violation (&quot;created_at cannot be NULL&quot;).  The reason is that all unset fields in the copy are set to an instance of Doctrine_Null, which is considered to be modifed according to the condition tested for above.  To fix the issue, I modified the code above to read:&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; ( ! isset($modified[$createdName]) || $modified[$createdName] &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Null) {
  $event-&amp;gt;getInvoker()-&amp;gt;$createdName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTimestamp(&apos;created&apos;, $event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getConnection());
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13526">DC-1051</key>
            <summary>Timestampable listener does not set timestamp fields on a copy of a Doctrine_Record</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeremyajohnson">Jeremy Johnson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Mar 2012 03:35:04 +0000</created>
                <updated>Thu, 6 Sep 2012 14:26:30 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Timestampable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18612" author="blopblop" created="Thu, 6 Sep 2012 10:47:23 +0000"  >&lt;p&gt;Your fix works great, I have also added the fix for the preupdate function and in one more place in the preinsert function.&lt;br/&gt;
Lines affected: 65, 73, 91.&lt;br/&gt;
Attached the file with the fixes:&lt;br/&gt;
( C:\php5\PEAR\symfony\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Template\Listener\Timestampable.php )&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt;&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Set the created and updated Timestampable columns when a record is inserted&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param Doctrine_Event $event&lt;/li&gt;
	&lt;li&gt;@return void&lt;br/&gt;
     */&lt;br/&gt;
    public function preInsert(Doctrine_Event $event)&lt;br/&gt;
    {&lt;br/&gt;
        if ( ! $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;created&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;disabled&amp;#39;&amp;#93;&lt;/span&gt;) 
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {            $createdName = $event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getFieldName($this-&amp;gt;_options[&amp;#39;created&amp;#39;][&amp;#39;name&amp;#39;]);            $modified = $event-&amp;gt;getInvoker()-&amp;gt;getModified();            if ( ! isset($modified[$createdName]) || $modified[$createdName] instanceof Doctrine_Null) {
                $event-&amp;gt;getInvoker()-&amp;gt;$createdName = $this-&amp;gt;getTimestamp(&apos;created&apos;, $event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getConnection());
            }        }&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;        if ( ! $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;disabled&amp;#39;&amp;#93;&lt;/span&gt; &amp;amp;&amp;amp; $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;onInsert&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;br/&gt;
            $updatedName = $event-&amp;gt;getInvoker()&lt;del&gt;&amp;gt;getTable()&lt;/del&gt;&amp;gt;getFieldName($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
            $modified = $event-&amp;gt;getInvoker()-&amp;gt;getModified();&lt;br/&gt;
            if ( ! isset($modified&lt;span class=&quot;error&quot;&gt;&amp;#91;$updatedName&amp;#93;&lt;/span&gt;) || $modified&lt;span class=&quot;error&quot;&gt;&amp;#91;$updatedName&amp;#93;&lt;/span&gt; instanceof Doctrine_Null) &lt;/p&gt;
{
                $event-&amp;gt;getInvoker()-&amp;gt;$updatedName = $this-&amp;gt;getTimestamp(&apos;updated&apos;, $event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getConnection());
            }&lt;br/&gt;
        }&lt;br/&gt;
    }&lt;br/&gt;
&lt;br/&gt;
    /**&lt;br/&gt;
     * Set updated Timestampable column when a record is updated&lt;br/&gt;
     *&lt;br/&gt;
     * @param Doctrine_Event $evet&lt;br/&gt;
     * @return void&lt;br/&gt;
     */&lt;br/&gt;
    public function preUpdate(Doctrine_Event $event)&lt;br/&gt;
    {&lt;br/&gt;
        if ( ! $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;disabled&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;br/&gt;
            $updatedName = $event-&amp;gt;getInvoker()&lt;del&gt;&amp;gt;getTable()&lt;/del&gt;&amp;gt;getFieldName($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;name&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
			//echo &quot;updatedName: &quot;; var_dump(updatedName);&lt;br/&gt;
            $modified = $event-&amp;gt;getInvoker()-&amp;gt;getModified();&lt;br/&gt;
            if ( ! isset($modified&lt;span class=&quot;error&quot;&gt;&amp;#91;$updatedName&amp;#93;&lt;/span&gt;) || $modified&lt;span class=&quot;error&quot;&gt;&amp;#91;$updatedName&amp;#93;&lt;/span&gt; instanceof Doctrine_Null) {
                $event-&amp;gt;getInvoker()-&amp;gt;$updatedName = $this-&amp;gt;getTimestamp(&apos;updated&apos;, $event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getConnection());
            }
&lt;p&gt;        }&lt;br/&gt;
    }&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;/code&amp;#93;&lt;/span&gt;&lt;br/&gt;
------------------&lt;/p&gt;


&lt;p&gt;Also there is another problem too. If you dont disable the widgets of the fields updated_at and created_at, sometimes they are sending the date time information in the $form, and the function preUpdate doesnt update the update_at because the date time has been sent. The best option is to disable the widgets and form validation in global scope, here:&lt;br/&gt;
&amp;lt;?php&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Project form base class.&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;@package    dbvui&lt;/li&gt;
	&lt;li&gt;@subpackage form&lt;/li&gt;
	&lt;li&gt;@author     Your name here&lt;/li&gt;
	&lt;li&gt;@version    SVN: $Id: sfDoctrineFormBaseTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $&lt;br/&gt;
 */&lt;br/&gt;
abstract class BaseFormDoctrine extends sfFormDoctrine&lt;br/&gt;
{&lt;br/&gt;
  public function setup()&lt;br/&gt;
  {&lt;br/&gt;
  	//Following code will remove Required validators from these fields.&lt;br/&gt;
  	if (isset($this-&amp;gt;validatorSchema))&lt;br/&gt;
  	{&lt;br/&gt;
  		if (isset($this-&amp;gt;validatorSchema&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;created_at&amp;#39;&amp;#93;&lt;/span&gt;))
  		{
	  		unset($this-&amp;gt;validatorSchema[&apos;created_at&apos;]);
  		}&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  		if (isset($this-&amp;gt;validatorSchema&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated_at&amp;#39;&amp;#93;&lt;/span&gt;))&lt;/p&gt;
  		{
	  		unset($this-&amp;gt;validatorSchema[&apos;updated_at&apos;]);
  		}
&lt;p&gt;  	}&lt;/p&gt;

&lt;p&gt;  	if (isset($this-&amp;gt;widgetSchema))&lt;br/&gt;
  	{&lt;br/&gt;
	  	//following code will remove fields from form&lt;br/&gt;
  		if (isset($this-&amp;gt;widgetSchema&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;created_at&amp;#39;&amp;#93;&lt;/span&gt;))&lt;/p&gt;
  		{
	  		unset($this-&amp;gt;widgetSchema[&apos;created_at&apos;]);
  		}

&lt;p&gt;  		if (isset($this-&amp;gt;widgetSchema&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;updated_at&amp;#39;&amp;#93;&lt;/span&gt;))&lt;/p&gt;
  		{
	  		unset($this-&amp;gt;widgetSchema[&apos;updated_at&apos;]);
  		}
&lt;p&gt;  	}&lt;br/&gt;
  }&lt;br/&gt;
}&lt;/p&gt;</comment>
                    <comment id="18613" author="blopblop" created="Thu, 6 Sep 2012 10:50:41 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11318" name="Timestampable.php" size="5266" author="blopblop" created="Thu, 6 Sep 2012 10:50:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-396] Add timezone support for time and timestamp datatype in PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-396</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Please add support for the types of time with timezone and timestamp with timezone in the Doctrine when using PostgreSQL.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10681">DC-396</key>
            <summary>Add timezone support for time and timestamp datatype in PostgreSQL</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="phprus">Vladislav</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 10:01:12 +0000</created>
                <updated>Sun, 19 Aug 2012 05:29:02 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18526" author="alepot" created="Sun, 19 Aug 2012 01:58:16 +0000"  >&lt;p&gt;I came across this problem because I prefer to store timezone information instead of local dates. &lt;/p&gt;

&lt;p&gt;I believe this is resolved by the attached patch, which patches the Timestampable template and it&apos;s listener to create and maintain &apos;timestamp with timezone&apos; in Postgresql.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="11313" name="timestampable.diff" size="2567" author="alepot" created="Sun, 19 Aug 2012 05:26:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-377] Cannot delete a taggable record (Taggable Extension)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-377</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With Taggable extension, when I try to delete a record using Taggable, I get this exception :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`sf_sandbox/article_taggable_tag`, CONSTRAINT `article_taggable_tag_id_article_id` FOREIGN KEY (`id`) REFERENCES `article` (`id`))&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;If I check the sql queries generated by Doctrine, there are not &quot;onDelete CASCADE&quot; for one of relation added by Taggable extension.&lt;/p&gt;

&lt;p&gt;I have write some test cases for reproduce this bug (checking if relation has a property onDelete setted to CASCADE) but I can&apos;t reproduce the thrown exception in test case because sqlite omits queries with constraint. Also, I found how to fix this bug.&lt;/p&gt;

&lt;p&gt;The fix and test cases are available in the file attached to this ticket.&lt;/p&gt;</description>
                <environment>PHP 5.3.1, Mac OS X (10.6), MySQL 5.0.86, Symfony 1.4.1</environment>
            <key id="10647">DC-377</key>
            <summary>Cannot delete a taggable record (Taggable Extension)</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fabienp">Fabien Pennequin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Dec 2009 17:58:17 +0000</created>
                <updated>Fri, 10 Aug 2012 01:51:22 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:40:42 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Extensions</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12718" author="deefour" created="Tue, 20 Apr 2010 10:53:16 +0000"  >&lt;p&gt;Hi Jon-&lt;/p&gt;

&lt;p&gt;Where can I find this fix?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://svn.doctrine-project.org/extensions/Taggable/branches/1.2-1.0&quot; class=&quot;external-link&quot;&gt;http://svn.doctrine-project.org/extensions/Taggable/branches/1.2-1.0&lt;/a&gt; (the link referenced from the docs at &lt;a href=&quot;http://www.doctrine-project.org/extension/Taggable&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/extension/Taggable&lt;/a&gt;) doesn&apos;t have this fix.&lt;/p&gt;</comment>
                    <comment id="12719" author="deefour" created="Tue, 20 Apr 2010 11:02:40 +0000"  >&lt;p&gt;Sorry, it appears the patch attached above &lt;b&gt;is&lt;/b&gt; in SVN, however this is still broken.&lt;/p&gt;

&lt;p&gt;With Doctrine 1.2.2 sandbox configured to work with MySQL 5.x database on 5.2.10, using the following schema&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
BlogPost:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;Taggable&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
    title:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    description:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;the CASCADE in the constraints for the table being applied the Taggable behavior are still not being applied (see first constraint below)&lt;/p&gt;


&lt;p&gt;{{&lt;br/&gt;
CREATE TABLE `blog_post_taggable_tag` (&lt;br/&gt;
  `id` bigint(20) NOT NULL DEFAULT &apos;0&apos;,&lt;br/&gt;
  `tag_id` bigint(20) NOT NULL DEFAULT &apos;0&apos;,&lt;br/&gt;
  PRIMARY KEY (`id`,`tag_id`),&lt;br/&gt;
  KEY `blog_post_taggable_tag_tag_id_taggable_tag_id` (`tag_id`),&lt;br/&gt;
  CONSTRAINT `blog_post_taggable_tag_id_blog_post_id` FOREIGN KEY (`id`) REFERENCES `blog_post` (`id`),&lt;br/&gt;
  CONSTRAINT `blog_post_taggable_tag_tag_id_taggable_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `taggable_tag` (`id`) ON DELETE CASCADE ON UPDATE CASCADE&lt;br/&gt;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | &lt;br/&gt;
}}&lt;/p&gt;</comment>
                    <comment id="18480" author="indiekiduk" created="Fri, 10 Aug 2012 01:51:22 +0000"  >&lt;p&gt;I use Doctrine v1.2.4 and created a fix for this problem, change the _options array initialization in Taggable.php to this:&lt;/p&gt;

&lt;p&gt;    protected $_options = array(&lt;br/&gt;
        &apos;builderOptions&apos; =&amp;gt; array(),&lt;br/&gt;
        &apos;tagField&apos;       =&amp;gt; null,&lt;br/&gt;
	&apos;cascadeDelete&apos; =&amp;gt; true&lt;br/&gt;
    );&lt;/p&gt;

&lt;p&gt;This works because parent::buildRelation() calls the buildLocalRelation() method in Generator.php which looks for the cascadeDelete and if true then it adds the necessary CASCADE params, as you can see below:&lt;/p&gt;

&lt;p&gt;public function buildLocalRelation($alias = null)&lt;br/&gt;
    {&lt;br/&gt;
        ...&lt;br/&gt;
        if (isset($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;cascadeDelete&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;cascadeDelete&amp;#39;&amp;#93;&lt;/span&gt; &amp;amp;&amp;amp; ! $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;appLevelDelete&amp;#39;&amp;#93;&lt;/span&gt;) &lt;/p&gt;
{
            $options[&apos;onDelete&apos;] = &apos;CASCADE&apos;;
            $options[&apos;onUpdate&apos;] = &apos;CASCADE&apos;;
        }
&lt;p&gt;     ...&lt;/p&gt;

&lt;p&gt;Now both parts of the taggable relation get the cascade on delete feature. So if you delete a tag OR you delete a post, the row in the taggable_tag table gets deleted too.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10250" name="TaggableConstraintError.patch" size="1817" author="fabienp" created="Tue, 22 Dec 2009 17:58:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-946] Oracle Doctrine_RawSql()-&gt;count() generates illegal SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-946</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Example RawSQL:&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;$q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_RawSql();
    $q-&amp;gt;select(&apos;{k.*}&apos;)
          -&amp;gt;from(&apos;SHP_MANDANT_KATEGORIE k&apos;)
          -&amp;gt;addComponent(&apos;k&apos;, &apos;ShpMandantKategorie k&apos;)
          -&amp;gt;where( &apos;k.id_mandant=&apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getIdMandant() )
          -&amp;gt;andWhere( &apos;k.id_parent=&apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getIdMandantkategorie() )
          -&amp;gt;andWhere( &apos;k.aktiv=1&apos; )
          -&amp;gt;orderBy( &apos;k.sortorder&apos; ); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$q-&amp;gt;count() generates:&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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; COUNT(*) as num_results 
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; DISTINCT k.id_mandantkategorie 
              &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; SHP_MANDANT_KATEGORIE k 
              &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; k.id_mandant=2 AND k.id_parent=1520 AND k.aktiv=1) as results
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The illegal Part ist the &quot;as results&quot; at the end...&lt;/p&gt;</description>
                <environment></environment>
            <key id="12204">DC-946</key>
            <summary>Oracle Doctrine_RawSql()-&gt;count() generates illegal SQL</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="lars_pohlmann">Lars Pohlmann</reporter>
                        <labels>
                        <label>oracle</label>
                    </labels>
                <created>Wed, 8 Dec 2010 04:45:02 +0000</created>
                <updated>Mon, 6 Aug 2012 08:11:10 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18428" author="lars_pohlmann" created="Mon, 6 Aug 2012 08:10:30 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;will this ever be corrected?&lt;br/&gt;
I just came across the same bug in another project...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1058] Warning: Invalid argument supplied for foreach() in SqlWalker.php line 899</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1058</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hallo, i get the error&lt;br/&gt;
Warning: Invalid argument supplied for foreach() in /var/www/phverbose/vendor/doctrine/Doctrine/ORM/Query/SqlWalker.php line 899&lt;/p&gt;

&lt;p&gt;Here is the line&lt;br/&gt;
foreach ($assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relationToTargetKeyColumns&amp;#39;&amp;#93;&lt;/span&gt; as $relationColumn =&amp;gt; $targetColumn) {&lt;/p&gt;

&lt;p&gt;Here are the relations and the query&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/4352511&quot; class=&quot;external-link&quot;&gt;http://pastie.org/4352511&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/4352498&quot; class=&quot;external-link&quot;&gt;http://pastie.org/4352498&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the dump of $assoc before warning&lt;/p&gt;


&lt;p&gt;array(16) {&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;fieldName&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(5) &quot;sites&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;joinTable&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  array(0) {&lt;br/&gt;
  }&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;targetEntity&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(13) &quot;Entities\Site&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;mappedBy&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(6) &quot;emails&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;inversedBy&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  NULL&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;cascade&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  array(1) &lt;/p&gt;
{
    [0]=&amp;gt;
    string(7) &quot;persist&quot;
  }
&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;orphanRemoval&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;fetch&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  int(2)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;type&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  int(8)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isOwningSide&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;sourceEntity&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(14) &quot;Entities\Email&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeRemove&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadePersist&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(true)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeRefresh&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeMerge&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeDetach&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>Linux, Ubuntu 12, php 5.4</environment>
            <key id="13891">DC-1058</key>
            <summary>Warning: Invalid argument supplied for foreach() in SqlWalker.php line 899</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="alexanderc">Alexander Cucer</reporter>
                        <labels>
                        <label>paginator</label>
                    </labels>
                <created>Sun, 29 Jul 2012 09:44:56 +0000</created>
                <updated>Sun, 29 Jul 2012 09:44:56 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1057] Inserts instead of updates for related objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1057</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Ok, so the object relations go like this:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Comparison
	&lt;ul&gt;
		&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1:N&amp;#93;&lt;/span&gt; Product (FK:comparison_id)
		&lt;ul&gt;
			&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1:N&amp;#93;&lt;/span&gt; Rules (FK:product_id, FK:option_id)&lt;/li&gt;
			&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1:N&amp;#93;&lt;/span&gt; Parameters (FK:product_id)
			&lt;ul&gt;
				&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1:N&amp;#93;&lt;/span&gt; Options (FK:parameter_id)&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The testing code looks like following:&lt;/p&gt;

&lt;p&gt;== CODE START ==&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;
$comp = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Application_Model_Comparison();

/* Filling $comp with data */

&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; 10; $i++) {

    $product = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Application_Model_Product();

    &lt;span class=&quot;code-comment&quot;&gt;// Options referenced in Rules
&lt;/span&gt;    $options = array();

    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($j = 0; $j &amp;lt; 10; $j++) {

        $param = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Application_Model_Parameter();

        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($k = 0; $k &amp;lt; 10; $k++) {

            $option = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Application_Model_Option();

            $param-&amp;gt;Options-&amp;gt;add($option);

            &lt;span class=&quot;code-comment&quot;&gt;// Register a single option &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; parameter
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!isset($options[$j])) {
                $options[$j] = $option;
            }
        }

        $product-&amp;gt;Parameters-&amp;gt;add($param);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($j = 0; $j &amp;lt; 10; $j++) {
        $rule = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Application_Model_Rule();

        $rule-&amp;gt;Option = $options[$j];
        $product-&amp;gt;Rules-&amp;gt;add($rule);
    }

    $comp-&amp;gt;Products-&amp;gt;add($product);
}

/**
 * The first save() goes nicely, all objects
 * are created (INSERTed)
 */ 

$comp-&amp;gt;save();

&lt;span class=&quot;code-comment&quot;&gt;// Remove every second product
&lt;/span&gt;$pCount = $comp-&amp;gt;Products-&amp;gt;count();

&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; $pCount; $i += 2) {
    $comp-&amp;gt;Products-&amp;gt;remove($i);
}

/**
 * Fails &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; trying to save
 *
 * Comparison-&amp;gt;Product-&amp;gt;Parameter-&amp;gt;Option
 * INSERT ... `parameter_id` cannot be NULL
 *
 * Comparison-&amp;gt;Product-&amp;gt;Rule
 * INSERT ... `product_id` cannot be NULL
 */

$comp-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;== CODE END ==&lt;/p&gt;

&lt;p&gt;The first save() cleans up the relation information in the graph. All child objects are INSERTED instead of UPDATE.&lt;/p&gt;</description>
                <environment>linux, apache2, php 5.3</environment>
            <key id="13870">DC-1057</key>
            <summary>Inserts instead of updates for related objects</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="grisha">Grzegorz Godlewski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Jul 2012 09:36:53 +0000</created>
                <updated>Fri, 20 Jul 2012 09:41:36 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-160] Search doesn&apos;t use the Search Analyzer to escape the query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-160</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you use the Doctrine_Search_Analyzer_Standard all special characters like &quot;&#252;&quot; are removed or converted to e.g. &quot;ue&quot;. So far so good.. The problem arises when a user performs a search.&lt;br/&gt;
Since Doctrine is using the plain query with the special char &quot;&#252;&quot; instead of converting it also there no results are returned.&lt;/p&gt;

&lt;p&gt;Using the UTF8 analyzer is no option because often the normalization is a desired feature. It allows for example a user to formulate the query either as &quot;Muenchen&quot; or &quot;M&#252;nchen&quot; and he still receives a relevant result.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10275">DC-160</key>
            <summary>Search doesn&apos;t use the Search Analyzer to escape the query</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="7">Can&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lanthaler">Markus Lanthaler</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Oct 2009 13:46:54 +0000</created>
                <updated>Fri, 13 Jul 2012 15:14:33 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 20:58:24 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                                                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10358" author="jwage" created="Fri, 30 Oct 2009 15:59:05 +0000"  >&lt;p&gt;The only option I can see is to do this in Doctrine_Search_Query::query()&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;$text = Doctrine_Inflector::unaccent($text);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am not sure about doing this though. What do you think?&lt;/p&gt;</comment>
                    <comment id="10365" author="lanthaler" created="Fri, 30 Oct 2009 17:13:29 +0000"  >&lt;p&gt;I don&apos;t think that that&apos;s a good idea since it breaks the UTF8 analyzer. I would refactor the analyzers to include a method like &lt;tt&gt;normalize()&lt;/tt&gt;. Those methods could then be called in the analyzers &lt;tt&gt;analyze()&lt;/tt&gt; method.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Doctrine_Search_Analyzer_Standard::normalize($text, $encoding = $null)&lt;/tt&gt; would look 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;public&lt;/span&gt; function normalize($text, $encoding = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) 
{ 
  $text = preg_replace(&apos;/[\&apos;`&#65533;&quot;]/&apos;, &apos;&apos;, $text); 
  $text = Doctrine_Inflector::unaccent($text); 
  $text = preg_replace(&apos;/[^A-Za-z0-9]/&apos;, &apos; &apos;, $text); 
  $text = str_replace(&apos;  &apos;, &apos; &apos;, $text); 

  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; strtolower(trim($text));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;Doctrine_Search_Analyzer_Utf8::normalize($text, $encoding = $null)&lt;/tt&gt; would look 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;public&lt;/span&gt; function normalize($text, $encoding = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) 
{ 
  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_null($encoding)) { 
    $encoding = isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;encoding&apos;]) ? $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;encoding&apos;]:&apos;utf-8&apos;; 
  } 

  &lt;span class=&quot;code-comment&quot;&gt;// check that $text encoding is utf-8, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; not convert it 
&lt;/span&gt;  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strcasecmp($encoding, &apos;utf-8&apos;) != 0 &amp;amp;&amp;amp; strcasecmp($encoding, &apos;utf8&apos;) != 0) { 
    $text = iconv($encoding, &apos;UTF-8&apos;, $text); 
  } 

  $text = preg_replace(&apos;/[^\p{L}\p{N}]+/u&apos;, &apos; &apos;, $text); 
  $text = str_replace(&apos;  &apos;, &apos; &apos;, $text); 

  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; mb_strtolower(trim($text), &apos;UTF-8&apos;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This would then also allow to remove some code duplication in the &lt;tt&gt;analyze()&lt;/tt&gt; method. It could be changed to the following code in &lt;tt&gt;Doctrine_Search_Analyzer_Standard&lt;/tt&gt; and &lt;b&gt;could be completely removed in &lt;tt&gt;Doctrine_Search_Analyzer_Utf8&lt;/tt&gt;&lt;/b&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;public&lt;/span&gt; function analyze($text, $encoding = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
{
  $text = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;normalize($text, $encoding);

  $terms = explode(&apos; &apos;, $text);

  $ret = array();
  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($terms)) {
      foreach ($terms as $i =&amp;gt; $term) {
          &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (empty($term)) {
              &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
          }

          &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array($lower, self::$_stopwords)) {
              &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
          }

          $ret[$i] = $lower;
      }
  }
  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $ret;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Finally the &lt;tt&gt;normalize()&lt;/tt&gt; method is called in &lt;tt&gt;Doctrine_Search_Query::query()&lt;/tt&gt;. Unfortunately I have no idea how to call it there!?&lt;br/&gt;
What do you think? &lt;/p&gt;</comment>
                    <comment id="10411" author="jwage" created="Mon, 2 Nov 2009 20:58:08 +0000"  >&lt;p&gt;At first this seems like a good solution but I realized it will break things even more. We allow wildcards and certain keywords in the query string. *, OR, AND, etc. If we were to run the normalize() method on the query text it would break all that functionality.&lt;/p&gt;</comment>
                    <comment id="10418" author="lanthaler" created="Mon, 2 Nov 2009 22:28:15 +0000"  >&lt;p&gt;Well.. that&apos;s nowhere documented.. the only thing I found was&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;Doctrine_Search provides a query language similar to Apache Lucene. The Doctrine_Search_Query converts human readable, easy-to-construct search queries to their complex DQL equivalents which are then converted to SQL like normal.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So I would rather break those special things than to have the search missing existing items. But maybe there&apos;s a better place to call that normalize() - perhaps where the query is analyzed and converted to a DQL statement. It should be possible there to run normalize on every search term.&lt;/p&gt;</comment>
                    <comment id="10419" author="jwage" created="Mon, 2 Nov 2009 22:32:11 +0000"  >&lt;p&gt;That&apos;s what this means:&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;Doctrine_Search provides a query language similar to Apache Lucene
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can do things 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;$query-&amp;gt;query(&apos;some text* OR some more test*&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If we normalized each term/word it will still remove those wildcards. That is what query language similar to Apache lucene means.&lt;/p&gt;</comment>
                    <comment id="18306" author="jverissimo" created="Fri, 13 Jul 2012 15:14:33 +0000"  >&lt;p&gt;What do you think about this solution?&lt;br/&gt;
class ErpSearchAnalizer extends Doctrine_Search_Analyzer_Standard {&lt;br/&gt;
  public function analyze($text, $encoding = null) {&lt;br/&gt;
    $text = preg_replace(&apos;/&lt;span class=&quot;error&quot;&gt;&amp;#91;\&amp;#39;`&#65533;&amp;quot;&amp;#93;&lt;/span&gt;/&apos;, &apos;&apos;, $text);&lt;br/&gt;
    $text = Doctrine_Inflector::unaccent($text);&lt;br/&gt;
    // for * search&lt;br/&gt;
    //$text = preg_replace(&apos;/&lt;span class=&quot;error&quot;&gt;&amp;#91;^A-Za-z0-9&amp;#93;&lt;/span&gt;/&apos;, &apos; &apos;, $text);&lt;br/&gt;
    $text = str_replace(&apos;  &apos;, &apos; &apos;, $text);&lt;br/&gt;
    $terms = explode(&apos; &apos;, $text);&lt;/p&gt;

&lt;p&gt;    $ret = array();&lt;br/&gt;
    if (!empty($terms)) {&lt;br/&gt;
      foreach ($terms as $i =&amp;gt; $term) {&lt;br/&gt;
        if (empty($term)) &lt;/p&gt;
{
          continue;
        }&lt;br/&gt;
        if($term == &apos;OR&apos;){
            $ret[$i] = $term;
            continue;
        }&lt;br/&gt;
        $lower = strtolower(trim($term));&lt;br/&gt;
&lt;br/&gt;
        if (in_array($lower, parent::$_stopwords)) {
          continue;
        }

&lt;p&gt;        $ret&lt;span class=&quot;error&quot;&gt;&amp;#91;$i&amp;#93;&lt;/span&gt; = $lower;&lt;br/&gt;
      }&lt;br/&gt;
    }&lt;br/&gt;
    return $ret;&lt;br/&gt;
  }&lt;br/&gt;
}&lt;br/&gt;
to make a search like this&lt;br/&gt;
$analize =  new ErpSearchAnalizer();&lt;br/&gt;
$val_user = $analizar-&amp;gt;analyze($val_user);&lt;br/&gt;
$tempresult = $table-&amp;gt;search(implode(&quot; &quot;, $val_user));&lt;/p&gt;

&lt;p&gt;will it work?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-617] migration problem</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-617</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I attached a testcase that reproduces all problem that I noticed (previously reported in &quot;serious symfony doctrine:migrate issues - symfony 1.4&quot; on symfony-dev)&lt;/p&gt;

&lt;p&gt;There is a problem with an empty ON UPDATE when migrate to version 5&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42601&amp;#93;&lt;/span&gt;: Syntax error: 7 B&#321;&#260;D:  b&#322;&#261;d sk&#322;adni w lub blisko &quot;ON&quot;&lt;br/&gt;
LINE 1: ... (object_c_id) REFERENCES object_c(id) ON UPDATE  ON DELETE ...&lt;br/&gt;
                                                             ^. Failing Query: &quot;ALTER TABLE object_b ADD CONSTRAINT object_b_object_c_id_object_c_id FOREIGN KEY (object_c_id) REFERENCES object_c(id) ON UPDATE  ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When  migrateing from 5 to 3&lt;br/&gt;
Failing Query: &quot;DROP INDEX object_b_object_c_id_idx&quot; - this index doesn&apos;t exist - should be &quot;object_b_object_c_id&quot;&lt;/p&gt;

&lt;p&gt;Also&lt;br/&gt;
        $this-&amp;gt;changeColumn(&apos;object_a&apos;, &apos;name&apos;, &apos;string&apos;, &apos;2048&apos;, array(&lt;br/&gt;
             ));&lt;br/&gt;
        $this-&amp;gt;changeColumn(&apos;object_b&apos;, &apos;name&apos;, &apos;string&apos;, &apos;2048&apos;, array(&lt;br/&gt;
             ));&lt;br/&gt;
doesn&apos;t work for me&lt;/p&gt;</description>
                <environment>Symfony 1.4.3, Linux, PostgreSQL, Pgpool II</environment>
            <key id="11177">DC-617</key>
            <summary>migration problem</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="m">MichalKJP</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Apr 2010 12:07:49 +0000</created>
                <updated>Fri, 22 Jun 2012 14:01:48 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14308" author="ludo.fleury" created="Wed, 8 Sep 2010 10:27:25 +0000"  >&lt;p&gt;My own Quick Fix for  DROP INDEX (into Export class)&lt;br/&gt;
Skip Formatter-&amp;gt;getIndexName() in Export-&amp;gt;dropIndex()&lt;br/&gt;
see : &lt;a href=&quot;http://www.pastie.org/1145916&quot; class=&quot;external-link&quot;&gt;http://www.pastie.org/1145916&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14309" author="m" created="Wed, 8 Sep 2010 10:38:12 +0000"  >&lt;p&gt;I already tested this solution and I can confirm that also works for me.&lt;/p&gt;

&lt;p&gt;I am afraid that Johnatan spends much time on the new version and did not have time to correct these bugs for the old version. So we still repair migrations manualy.&lt;/p&gt;</comment>
                    <comment id="18131" author="sarcas" created="Fri, 22 Jun 2012 14:01:48 +0000"  >&lt;p&gt;We&apos;ve had this issue for a while - while Ludo&apos;s fix does work, there is an SQL injection issue in that the &apos;$name&apos; doesn&apos;t get escaped.&lt;/p&gt;

&lt;p&gt;You can do this:  $name = $this-&amp;gt;conn-&amp;gt;quoteIdentifier($name); which also steps around the issue for now.&lt;/p&gt;

&lt;p&gt;The problem appears to be that the indexes &lt;b&gt;aren&apos;t&lt;/b&gt; being created with the _idx string on the end when using the migrations. This is probably down to the index creation process rather than the index removal process.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10545" name="testcase.tar.bz2" size="49650" author="m" created="Tue, 6 Apr 2010 12:07:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1055] Bug in select query when executed against postgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1055</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the attached Squema run this query against postgreSQL.&lt;br/&gt;
(it runs ok In mysql)&lt;/p&gt;

&lt;p&gt;$lang = &apos;en&apos;;&lt;br/&gt;
$session = 1;&lt;br/&gt;
$q = Doctrine_Query::create()&lt;br/&gt;
                -&amp;gt;from(&apos;Sys_Trace t&apos;)&lt;br/&gt;
                -&amp;gt;leftJoin(&apos;t.Sys_Session s&apos;)&lt;br/&gt;
                -&amp;gt;leftJoin(&apos;t.Translation tr WITH tr.lang = ?&apos;, array($lang))&lt;br/&gt;
                -&amp;gt;leftJoin(&apos;t.Sys_Oper so&apos;)&lt;br/&gt;
                -&amp;gt;leftJoin(&apos;so.Translation tr2 WITH tr2.lang = ?&apos;, array($lang))&lt;br/&gt;
                &amp;gt;where(&apos;t.session_id = ?&apos;, array($session));&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22P02&amp;#93;&lt;/span&gt;: Invalid text representation: 7 ERROR: invalid input syntax for integer: &quot;en&quot;&lt;/p&gt;</description>
                <environment>symfony-1.4.17  php 5.3.5 apache 2.2.17 WIndows xp/7  PostgreSQL 9.1.2 </environment>
            <key id="13728">DC-1055</key>
            <summary>Bug in select query when executed against postgreSQL</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="damianbh">Damian Bergantinnos</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 May 2012 15:46:11 +0000</created>
                <updated>Fri, 25 May 2012 15:46:11 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11192" name="schema.rar" size="1025" author="damianbh" created="Fri, 25 May 2012 15:46:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-702] Migration commands always want to drop all database tables</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-702</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to get migrations going, such that I install the database, make a change to the schema.yml (something simple such as a column length change), and then have a migration generated and performed.&lt;/p&gt;

&lt;p&gt;No matter what I try, doctrine just generates an initial add all the database tables, then after that if I try any further migration generation, they all try to drop all the database tables. I am not having much luck.&lt;/p&gt;



&lt;p&gt;$ rm ../application/data/migrations/*&lt;/p&gt;

&lt;p&gt;$ php ./doctrine build-all-reload&lt;br/&gt;
build-all-reload - Are you sure you wish to drop your databases? (y/n)&lt;br/&gt;
y&lt;br/&gt;
build-all-reload - Successfully dropped database for connection named &apos;0&apos;&lt;br/&gt;
build-all-reload - Generated models successfully from YAML schema&lt;br/&gt;
build-all-reload - Successfully created database for connection named &apos;0&apos;&lt;br/&gt;
build-all-reload - Created tables successfully&lt;br/&gt;
build-all-reload - Data was successfully loaded&lt;/p&gt;

&lt;p&gt;$ ls ../application/data/migrations&lt;/p&gt;

&lt;p&gt;$ php ./doctrine generate-migrations-db&lt;br/&gt;
generate-migrations-db - Generated migration classes successfully from database&lt;/p&gt;

&lt;p&gt;$ ls ../application/data/migrations&lt;br/&gt;
1274778030_addbal_file.php		1274778038_addbal_roleanduser.php	1274778046_addburn_fileandproject.php	1274778054_addinvoicedatabackup.php	1274778062_addburnprojectindex.php&lt;br/&gt;
1274778031_addbal_invoice.php		1274778039_addbal_user.php		1274778047_addburn_imageandproject.php	1274778055_addusergroup.php		1274778063_addideaindex.php&lt;br/&gt;
1274778032_addbal_invoiceitem.php	1274778040_addbrief.php			1274778048_addburn_project.php		1274778056_addusergroupanduserfor.php	1274778064_addusergroupindex.php&lt;br/&gt;
1274778033_addbal_message.php		1274778041_addbriefandfile.php		1274778049_addburn_recommendation.php	1274778057_addbalfileindex.php		1274778065_addfks.php&lt;br/&gt;
1274778034_addbal_permission.php	1274778042_addbriefanduserfor.php	1274778050_addburn_state.php		1274778058_addbalusertaggabletag.php&lt;br/&gt;
1274778035_addbal_permissionandrole.php	1274778043_addbrieftype.php		1274778051_addburn_suburb.php		1274778059_addtaggabletag.php&lt;br/&gt;
1274778036_addbal_permissionanduser.php	1274778044_addburn_company.php		1274778052_addidea.php			1274778060_addbriefindex.php&lt;br/&gt;
1274778037_addbal_role.php		1274778045_addburn_department.php	1274778053_addideaandimage.php		1274778061_addburncompanyindex.php&lt;/p&gt;

&lt;p&gt;$ ... make a change to the schema.yml file in my text editor and save, in this case change a column length from 250 to 200 ...&lt;/p&gt;

&lt;p&gt;$ php ./doctrine generate-migrations-diff&lt;br/&gt;
generate-migrations-diff - Generated migration classes successfully from difference&lt;/p&gt;

&lt;p&gt;$ ls ../application/data/migrations&lt;br/&gt;
1274778030_addbal_file.php		1274778038_addbal_roleanduser.php	1274778046_addburn_fileandproject.php	1274778054_addinvoicedatabackup.php	1274778062_addburnprojectindex.php&lt;br/&gt;
1274778031_addbal_invoice.php		1274778039_addbal_user.php		1274778047_addburn_imageandproject.php	1274778055_addusergroup.php		1274778063_addideaindex.php&lt;br/&gt;
1274778032_addbal_invoiceitem.php	1274778040_addbrief.php			1274778048_addburn_project.php		1274778056_addusergroupanduserfor.php	1274778064_addusergroupindex.php&lt;br/&gt;
1274778033_addbal_message.php		1274778041_addbriefandfile.php		1274778049_addburn_recommendation.php	1274778057_addbalfileindex.php		1274778065_addfks.php&lt;br/&gt;
1274778034_addbal_permission.php	1274778042_addbriefanduserfor.php	1274778050_addburn_state.php		1274778058_addbalusertaggabletag.php	1274778089_version37.php&lt;br/&gt;
1274778035_addbal_permissionandrole.php	1274778043_addbrieftype.php		1274778051_addburn_suburb.php		1274778059_addtaggabletag.php&lt;br/&gt;
1274778036_addbal_permissionanduser.php	1274778044_addburn_company.php		1274778052_addidea.php			1274778060_addbriefindex.php&lt;br/&gt;
1274778037_addbal_role.php		1274778045_addburn_department.php	1274778053_addideaandimage.php		1274778061_addburncompanyindex.php&lt;/p&gt;

&lt;p&gt;$ cat ../application/data/migrations/1274778089_version37.php &lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;This class has been auto-generated by the Doctrine ORM Framework&lt;br/&gt;
 */&lt;br/&gt;
class Version37 extends Doctrine_Migration_Base&lt;br/&gt;
{&lt;br/&gt;
    public function up()
    {
        $this-&amp;gt;dropTable(&apos;bal__file&apos;);
        $this-&amp;gt;dropTable(&apos;bal__invoice&apos;);
        $this-&amp;gt;dropTable(&apos;bal__invoice_item&apos;);
        $this-&amp;gt;dropTable(&apos;bal__message&apos;);
        $this-&amp;gt;dropTable(&apos;bal__permission&apos;);
        $this-&amp;gt;dropTable(&apos;bal__permission_and_role&apos;);
        $this-&amp;gt;dropTable(&apos;bal__permission_and_user&apos;);
        $this-&amp;gt;dropTable(&apos;bal__role&apos;);
        $this-&amp;gt;dropTable(&apos;bal__role_and_user&apos;);
        $this-&amp;gt;dropTable(&apos;bal__user&apos;);
        $this-&amp;gt;dropTable(&apos;brief&apos;);
        $this-&amp;gt;dropTable(&apos;brief_and_file&apos;);
        $this-&amp;gt;dropTable(&apos;brief_and_user_for&apos;);
        $this-&amp;gt;dropTable(&apos;brief_type&apos;);
        $this-&amp;gt;dropTable(&apos;burn__company&apos;);
        $this-&amp;gt;dropTable(&apos;burn__department&apos;);
        $this-&amp;gt;dropTable(&apos;burn__file_and_project&apos;);
        $this-&amp;gt;dropTable(&apos;burn__image_and_project&apos;);
        $this-&amp;gt;dropTable(&apos;burn__project&apos;);
        $this-&amp;gt;dropTable(&apos;burn__recommendation&apos;);
        $this-&amp;gt;dropTable(&apos;burn__state&apos;);
        $this-&amp;gt;dropTable(&apos;burn__suburb&apos;);
        $this-&amp;gt;dropTable(&apos;idea&apos;);
        $this-&amp;gt;dropTable(&apos;idea_and_image&apos;);
        $this-&amp;gt;dropTable(&apos;invoice_data_backup&apos;);
        $this-&amp;gt;dropTable(&apos;user_group&apos;);
        $this-&amp;gt;dropTable(&apos;user_group_and_user_for&apos;);
        $this-&amp;gt;dropTable(&apos;bal_file_index&apos;);
        $this-&amp;gt;dropTable(&apos;bal_user_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;brief_index&apos;);
        $this-&amp;gt;dropTable(&apos;burn_company_index&apos;);
        $this-&amp;gt;dropTable(&apos;burn_project_index&apos;);
        $this-&amp;gt;dropTable(&apos;burn_user_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;burn_user_index&apos;);
        $this-&amp;gt;dropTable(&apos;buyer_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;buyer_index&apos;);
        $this-&amp;gt;dropTable(&apos;company_index&apos;);
        $this-&amp;gt;dropTable(&apos;file_index&apos;);
        $this-&amp;gt;dropTable(&apos;idea_index&apos;);
        $this-&amp;gt;dropTable(&apos;project_index&apos;);
        $this-&amp;gt;dropTable(&apos;seller_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;seller_index&apos;);
        $this-&amp;gt;dropTable(&apos;user_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;user_index&apos;);
        $this-&amp;gt;dropTable(&apos;user_group_index&apos;);
    }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    public function down()&lt;br/&gt;
    {&lt;br/&gt;
        $this-&amp;gt;createTable(&apos;bal__file&apos;, array(&lt;br/&gt;
             &apos;id&apos; =&amp;gt; &lt;br/&gt;
             array(&lt;br/&gt;
....&lt;/p&gt;</description>
                <environment>Zend Server 5.0.1 for OSX, PHP 5.3.2, MySQL 5.1.43</environment>
            <key id="11411">DC-702</key>
            <summary>Migration commands always want to drop all database tables</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="balupton">Benjamin Arthur Lupton</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 05:06:48 +0000</created>
                <updated>Mon, 7 May 2012 16:41:47 +0000</updated>
                    <resolved>Tue, 8 Jun 2010 10:25:10 +0000</resolved>
                            <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="13056" author="balupton" created="Tue, 25 May 2010 05:08:16 +0000"  >&lt;p&gt;Clarity over tables and database.&lt;/p&gt;</comment>
                    <comment id="13057" author="balupton" created="Tue, 25 May 2010 05:18:42 +0000"  >&lt;p&gt;forgot to add the part about me changing the yaml file inbetween&lt;/p&gt;</comment>
                    <comment id="13152" author="jwage" created="Tue, 8 Jun 2010 10:25:10 +0000"  >&lt;p&gt;Hi, I cannot reproduce the issue unfortunately &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="14841" author="skaverat" created="Fri, 26 Nov 2010 06:08:35 +0000"  >&lt;p&gt;I have the exact same problem.&lt;/p&gt;

&lt;p&gt;Looking at the paths, is seems OP uses the same ZendCasts.com setup for ZendFramework/Doctrine. I think the problem lies somewhere in there. Anyone got an idea?&lt;/p&gt;</comment>
                    <comment id="14842" author="skaverat" created="Fri, 26 Nov 2010 08:41:05 +0000"  >&lt;p&gt;Okay, found the problem, And I really hope there will be a fix soon, because it one of the biggest features of doctrine:&lt;/p&gt;

&lt;p&gt;To get autoloading in ZendFramework correct, Doctrine has to prefix all models with &quot;Model_&quot; (see &lt;a href=&quot;http://www.zendcasts.com/deep-integration-between-zend-and-doctrine-1-2/2010/01/&quot; class=&quot;external-link&quot;&gt;http://www.zendcasts.com/deep-integration-between-zend-and-doctrine-1-2/2010/01/&lt;/a&gt; for more information)&lt;br/&gt;
The problem is, that the Diff-generating script searches for i.e. the class &quot;User&quot; instead of &quot;Model_User&quot;, thinks that it doesnt exist, and wants to recreate it from scratch&lt;/p&gt;</comment>
                    <comment id="17933" author="tingham" created="Mon, 7 May 2012 16:41:47 +0000"  >&lt;p&gt;We&apos;re having this same issue in 1.2.3 right now. Has anyone found a workaround? It seems likely that given the age of the last comment - I&apos;m out of luck but yolo.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-801] Multiple template implementation (setImpl)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-801</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I feel curios when looking setImpl code on Doctrine. It set like this:&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 setImpl($template, $class)
{
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_impl[$template] = $class;

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I&apos;ve made a template:&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;class PersonTemplate &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Template
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() 
    {
        &lt;span class=&quot;code-comment&quot;&gt;//... Person fields (e.g. name, address, etc.)
&lt;/span&gt;    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now I create 2 class that implement PersonTemplate&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;class Student &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;PersonTemplate&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;class Teacher &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;PersonTemplate&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then I set implementation on Doctrine_Manager:&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;Doctrine_Manager::getInstance()-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Student&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Teacher&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now isn&apos;t it only Teacher record recognized as implementation of PersonTemplate ( when we see from this code: $this-&amp;gt;_impl&lt;span class=&quot;error&quot;&gt;&amp;#91;$template&amp;#93;&lt;/span&gt; = $class; )&lt;/p&gt;

&lt;p&gt;So how we can implement a template into seperated different doctrine record?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11691">DC-801</key>
            <summary>Multiple template implementation (setImpl)</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aristondarmayuda">B. Ariston Darmayuda</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 14:19:18 +0000</created>
                <updated>Sat, 28 Apr 2012 11:56:51 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17893" author="richhl" created="Sat, 28 Apr 2012 11:48:18 +0000"  >&lt;p&gt;As the doc says &quot;Tip The implementations for the templates can be set at manager, connection and even at the table level.&quot; it is supposed one can do:&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;Doctrine_Manager::getInstance()-&amp;gt;getTable(&apos;Student&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Student&apos;);
Doctrine_Manager::getInstance()-&amp;gt;getTable(&apos;Teacher&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Teacher&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but for me it throws an exception:&lt;/p&gt;

&lt;p&gt;&quot;Couldn&apos;t find concrete implementation for template PersonTemplate&quot;&lt;/p&gt;

&lt;p&gt;thx&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-919] Import/Pgsql.php: listTableColumns - SQL failure with PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-919</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;this issue was reported at the symfony project which uses Doctrine 1.2.3: &lt;br/&gt;
&lt;a href=&quot;http://trac.symfony-project.org/ticket/9152&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/9152&lt;/a&gt;&lt;br/&gt;
&quot;php symfony doctrine:build-schema failure with PostgreSQL for 1.4.7 and 1.4.8 version&quot;&lt;/p&gt;

&lt;p&gt;The SQL Statement &apos;listTableColumns&apos; fails with an SQL-Error &quot;missing from-clause&quot;&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/browser/tags/1.2.3/lib/Doctrine/Import/Pgsql.php#L96&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/tags/1.2.3/lib/Doctrine/Import/Pgsql.php#L96&lt;/a&gt;&lt;br/&gt;
I can reproduce the error directly in psql or pgadmin. The SQL Statement seems related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-697&quot; title=&quot;Doctrine Support of custom enum types in Pgsql&quot;&gt;&lt;del&gt;DC-697&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even when i turn on the add_missing_from option on the postgres-server it fails with &quot;missing relation&quot;.&lt;/p&gt;

&lt;p&gt;Now it seems to me, you already fixed this bug in the current 1.2 branch, because the current SQL-Statement is different and it works for me in psql/pgadmin.&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Import/Pgsql.php#L96&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Import/Pgsql.php#L96&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Could you please close this ticket, if you already fixed this issue, or confirm if it&apos;s still an issue?&lt;br/&gt;
Attached you find my proposed patch at the symfony project . the current statement in the branch looks too different from my version, so i am not sure to use this patch directly. Tell me if I should work out a proper patch.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;error&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[42P01]: Undefined table: 7 ERROR:  missing FROM-clause entry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; table &lt;span class=&quot;code-quote&quot;&gt;&quot;t&quot;&lt;/span&gt;                                               
 	  LINE 6: ...                                                  t.typtype ...                                                       
 	                                                               ^. Failing Query: &quot;SELECT                                           
 	                                                       ordinal_position as attnum,                                                 
 	                                                       column_name as field,                                                       
 	                                                       udt_name as type,                                                           
 	                                                       data_type as complete_type,                                                 
 	                                                       t.typtype AS typtype,                                                       
 	                                                       is_nullable as isnotnull,                                                   
 	                                                       column_default as &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;,                                                   
 	                                                       (                                                                           
 	                                                         SELECT &apos;t&apos;                                                                 
 	                                                           FROM pg_index, pg_attribute a, pg_class c, pg_type t                     
 	                                                           WHERE c.relname = table_name AND a.attname = column_name                 
 	                                                           AND a.attnum &amp;gt; 0 AND a.attrelid = c.oid AND a.atttypid = t.oid           
 	                                                           AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)       
 	                                                           AND pg_index.indisprimary = &apos;t&apos;                                         
 	                                                           AND format_type(a.atttypid, a.atttypmod) NOT LIKE &apos;information_schema%&apos; 
 	                                                       ) as pri,                                                                   
 	                                                       character_maximum_length as length                                           
 	                                                     FROM information_schema.COLUMNS                                               
 	                                                     WHERE table_name = &apos;matable&apos;                                   
 	                                                     ORDER BY ordinal_position&quot;  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Postgres Import Schema&lt;br/&gt;
</environment>
            <key id="12075">DC-919</key>
            <summary>Import/Pgsql.php: listTableColumns - SQL failure with PostgreSQL</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="christian_vogel">Christian Vogel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Nov 2010 04:49:56 +0000</created>
                <updated>Mon, 9 Apr 2012 14:17:24 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14691" author="nahuelon" created="Tue, 9 Nov 2010 10:43:50 +0000"  >&lt;p&gt;We apply the diff patch you submit and works perfect. We are using Doctrine 1.2.3 with PostgreSQL 8.4.&lt;br/&gt;
We could generates models from database with generateModelsFromDb() method.&lt;br/&gt;
Please add this patch to a new release.&lt;br/&gt;
Thank you very much.&lt;/p&gt;</comment>
                    <comment id="14803" author="tim.hemming@spgroup.co.uk" created="Tue, 23 Nov 2010 07:15:21 +0000"  >&lt;p&gt;We have applied this patch directly to our server-wide Doctrine library and it works fine. We look forward to it becoming a part of the Doctrine distribution.&lt;/p&gt;</comment>
                    <comment id="14981" author="chotchki" created="Sun, 19 Dec 2010 01:56:38 +0000"  >&lt;p&gt;I can confirm that this bug also affects symfony 1.4.8 and the attached fix works perfectly!&lt;/p&gt;</comment>
                    <comment id="15361" author="dla" created="Mon, 21 Feb 2011 06:51:30 +0000"  >&lt;p&gt;Confirmed to fix crash with symfony 1.3.8&lt;/p&gt;</comment>
                    <comment id="17833" author="koyot" created="Mon, 9 Apr 2012 14:17:24 +0000"  >&lt;p&gt;I use the version 1.4.17 and also had the error with postgres 9.1. Applying the correction suggested in DIFF. The system worked.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10847" name="trac_9152_patch_for_Pgsql.php.diff" size="5112" author="christian_vogel" created="Sun, 7 Nov 2010 04:49:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1054]  SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;b.title&apos; in &apos;field list&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1054</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;this is the my table creation .&lt;/p&gt;

&lt;p&gt;CREATE TABLE billboard(id BIGINT AUTO_INCREMENT,title VARCHAR (255),country_id BIGINT,zone_id BIGINT,place VARCHAR(255),occassion VARCHAR(255),itinerary VARCHAR(255),created_at DATETIME NOT NULL,description TEXT NOT NULL,PRIMARY KEY(id)) ENGINE=INNODB;&lt;/p&gt;



&lt;p&gt; public static function getInstance()&lt;/p&gt;
    {
        return Doctrine_Core::getTable(&apos;Billboard&apos;);
    }

&lt;p&gt; this is the my Doctrine Table&lt;/p&gt;

&lt;p&gt;   // public function getBillboardsForAUser($userId, $limit, $offset=0)&lt;br/&gt;
   public function getBillboardsForAUser($userId,$limit,$offset=0)&lt;br/&gt;
    {&lt;br/&gt;
              $query = $this-&amp;gt;createQuery(&apos;b&apos;)&lt;br/&gt;
              -&amp;gt;where(&apos;b.title=?&apos;,$title);&lt;br/&gt;
                // -&amp;gt;where(&apos;b.owner_id = ?&apos;, $userId);&lt;br/&gt;
        $followings = Doctrine::getTable(&apos;Follow&apos;)-&amp;gt;getAllFollowing($userId);&lt;br/&gt;
        foreach($followings as $following)&lt;/p&gt;
{
            $query-&amp;gt;orWhere(&apos;b.owner_id = ? &apos;,$following-&amp;gt;getOwnerId());
            $query-&amp;gt;orWhere(&apos;b.poster_id = ? &apos;,$following-&amp;gt;getOwnerId());
        }
&lt;p&gt;        $query-&amp;gt;orderBy(&apos;b.created_at DESC&apos;)&lt;br/&gt;
              -&amp;gt;limit($limit)&lt;br/&gt;
              -&amp;gt;offset($offset);&lt;br/&gt;
        return $query-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;plz help me what is the problem.&lt;/p&gt;</description>
                <environment>window vista</environment>
            <key id="13582">DC-1054</key>
            <summary> SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;b.title&apos; in &apos;field list&apos;</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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="suriyakala">suriyakala</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Mar 2012 02:10:05 +0000</created>
                <updated>Sat, 31 Mar 2012 06:58:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17694" author="beberlei" created="Sat, 31 Mar 2012 06:58:41 +0000"  >&lt;p&gt;Doctrine 1, not 2 ticket.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-363] Multiple connections and i18n</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-363</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I used to work with a single database named &quot;doctrine&quot;. The query was working properly.&lt;/p&gt;

&lt;p&gt;I then decided to use 2 databases so I got my schema like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;connection: doctrine&lt;/p&gt;

&lt;p&gt;Category:&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      actAs:&lt;br/&gt;
        Sluggable:&lt;br/&gt;
          fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name, description&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
    id: ~&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    description: string&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  connection: second&lt;br/&gt;
  columns:&lt;br/&gt;
    id: ~&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I did setup my connections in config/databases.yml this way:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;all:&lt;br/&gt;
  doctrine:&lt;br/&gt;
   // ....&lt;br/&gt;
  second:&lt;br/&gt;
   // ....&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;build-model, build-forms, build-filters and cc got ran. But now, I got an exception saying the &quot;Translation&quot; relation doesn&apos;t exist. The Base Models include correctly the bindComponent line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;Category&apos;, &apos;doctrine&apos;);&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;For now, I managed to kind of fixing it with simply swapping the databases order in my config/databases.yml and it&apos;s now working again perfectly.&lt;/p&gt;

&lt;p&gt;I forgot to mention that in the CategoryTable when i call $this-&amp;gt;getConnection()-&amp;gt;getName(), it outputs &quot;second&quot;&lt;/p&gt;</description>
                <environment>MySQL 5.1.37&lt;br/&gt;
PHP 5.2.11&lt;br/&gt;
symfony 1.2.11 DEV&lt;br/&gt;
&lt;br/&gt;
symfony 1.4.13&lt;br/&gt;
PHP 5.3.6 &lt;br/&gt;
Postgres 8.4.8&lt;br/&gt;
</environment>
            <key id="10626">DC-363</key>
            <summary>Multiple connections and i18n</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="xavismeh">Xav.</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Dec 2009 19:18:24 +0000</created>
                <updated>Wed, 28 Mar 2012 08:24:28 +0000</updated>
                    <resolved>Tue, 8 Jun 2010 15:04:20 +0000</resolved>
                            <version>1.0.14</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Connection</component>
                <component>I18n</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="11613" author="colin.darie" created="Thu, 4 Feb 2010 23:05:56 +0000"  >&lt;p&gt;I&apos;m experiencing the same issue with 4 connections. The I18n behavior is almost unusable for models whose connection is not the last one defined. I searched for an acceptable solution but I haven&apos;t found one (IMHO the setting to the right connection before each query is not acceptable in large projects). I tried to do like in Search behavior, but it didn&apos;t work, I doesn&apos;t know enough doctrine internals to understand why.&lt;/p&gt;</comment>
                    <comment id="11931" author="jwage" created="Mon, 1 Mar 2010 19:46:40 +0000"  >&lt;p&gt;Can you test this in Doctrine 1.2? I believe it is fixed.&lt;/p&gt;</comment>
                    <comment id="15330" author="geg" created="Thu, 17 Feb 2011 08:01:33 +0000"  >&lt;p&gt;I am using the latest symfony 1.4 which is doctrine 1.2.3 afaik, and this bug still exists.&lt;br/&gt;
Try&lt;/p&gt;

&lt;p&gt;  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;br/&gt;
      generateFiles: true&lt;br/&gt;
      generatePath: /project/lib/model/doctrine/i18n&lt;/p&gt;

&lt;p&gt;and the resulting model base class is not bound to the correct connection.&lt;/p&gt;</comment>
                    <comment id="15890" author="jsiponen" created="Fri, 27 May 2011 14:49:51 +0000"  >&lt;p&gt;I&apos;ve just now battled with the very same problem in Doctrine 1.2 (the version bundled with symfony 1.4) and the problem seems to be caused by the fact that Doctrine_Record_Generator simply isn&apos;t written such that it is able to reinitialize generators for unloaded table instances after a connection is closed. This problem also manifests itself after a table has been loaded in a connection and one tries retrieve a table again after Doctrine_Connection-&amp;gt;evictTables() has been called. This makes it impossible to to open more than one connection at a time in a request/script when using behaviors that dynamically modify table instances (such as the i18n behavior). The issue states that this has been fixed but I looked at the latest code and the problem still seems to be very much the same. &lt;/p&gt;

&lt;p&gt;Doctrine_Record_Generator determines if it needs to run its initialization methods simply by checking if the to-be generated class, as defined by the className option, exists using a class_exists call. This means that the first time this method is called the initialization happens but for every subsequent call no initialization is made. Now, in the i18m behavior, the important initialization happens in its setTableDefinition method in which it removes any of the translated fields from the table instance that is been setup and redefines them as relations on the to-be-created Translation class. It then finishes off by dynamically declaring the new class for the translation record using its generateClassFromTable method.&lt;/p&gt;

&lt;p&gt;Thus, the first time everything goes smoothly and the i18n generator&apos;s setTableDefinition is called and the table instance is properly initialized. Everything will now work as expected while the current connection is open since the connection instance keeps the i18n modified table instances alive and well for callers.&lt;/p&gt;

&lt;p&gt;But, when the current connection is closed the i18n modified table instances it holds are also removed (goes out of scope). Then, when a new connection is opened, this new connection will start without having any table instances. This means that the next time one asks the new connection for a table instance of the same class with the i18n behavior the i18n behaviors will fail to initialize because the generator at this time believes its class has actually been initialized which, in turn, means that the table using the i18n behavior isn&apos;t properly initialized. No initialization means that this table will now include the non-existant i18n fields in the select part of its queries (those are in the translation table) causing those queries to fail miserably.&lt;/p&gt;

&lt;p&gt;I believe this could be fixed by adding a static attribute to Doctrine_Record_Generator that tracks the spl_object_hash of the underlying dbh instance variable of the doctrine connection of the table parameter. If the hash is the same the next time that the initialize method is called the generator can decide not to reinitialize itself but if it detects that the hash of the current connection is different then that is definitely a clue to the generator that it needs to reinitialize itself (i.e. run all of the initialization methods but generateClassFromTable which should&apos;t be called more than once).&lt;/p&gt;

&lt;p&gt;Maybe do it like this perhaps:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
abstract class Doctrine_Record_Generator extends Doctrine_Record_Abstract
{
  public function initialize(Doctrine_Table $table)
  {
    /* ... */ 
  
    $currentConnectionHash = spl_object_hash($table-&amp;gt;getConnection()-&amp;gt;getDbh());
    
    //Next part is called if this is the first connection made or if this is a new open connection with new table instances
    if ($currentConnectionHash != self::$lastConnectionHash)
    {
      self::$lastConnectionHash = $currentConnectionHash;
      
      $this-&amp;gt;buildTable();

      $fk = $this-&amp;gt;buildForeignKeys($this-&amp;gt;_options[&apos;table&apos;]);

      $this-&amp;gt;_table-&amp;gt;setColumns($fk);

      $this-&amp;gt;buildRelation();

      $this-&amp;gt;setTableDefinition();
      $this-&amp;gt;setUp();
      
      if ($this-&amp;gt;_options[&apos;generateFiles&apos;] === false &amp;amp;&amp;amp; class_exists($this-&amp;gt;_options[&apos;className&apos;])) {
        $this-&amp;gt;generateClassFromTable($this-&amp;gt;_table); //Don&apos;t generate the class more than once ever
      }
      
      $this-&amp;gt;buildChildDefinitions();

      $this-&amp;gt;_table-&amp;gt;initIdentifier();
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="16369" author="sarcas" created="Tue, 23 Aug 2011 14:24:10 +0000"  >&lt;p&gt;I&apos;m also experiencing this issue, using the stable version of Symfony 1.4.13. If I define multiple database connections, the i18n Translation relations fail with this call: Doctrine_Relation_Parser-&amp;gt;getRelation(&apos;Translation&apos;, )&lt;/p&gt;

&lt;p&gt;&apos;Unknown relation alias Translation&apos;&lt;/p&gt;

&lt;p&gt;dev:&lt;br/&gt;
  mysql1:&lt;br/&gt;
      class: sfDoctrineDatabase&lt;br/&gt;
      param:&lt;br/&gt;
        dsn: &apos;mysql:host=localhost;dbname=microscooters&apos;&lt;br/&gt;
        username: microuser_uk&lt;br/&gt;
        password: sailing&lt;/p&gt;

&lt;p&gt;  mysql2:&lt;br/&gt;
    class: sfDoctrineDatabase&lt;br/&gt;
    param:&lt;br/&gt;
      dsn: &apos;mysql:host=localhost;dbname=microscooters_ie&apos;&lt;br/&gt;
      username: microuser_ie&lt;br/&gt;
      password: windy&lt;/p&gt;

&lt;p&gt;  postgresql:&lt;br/&gt;
    class: sfDoctrineDatabase&lt;br/&gt;
    param:&lt;br/&gt;
      dsn: &apos;pgsql:host=localhost;dbname=mses6&apos;&lt;br/&gt;
      username: postgres&lt;br/&gt;
      password: postgres&lt;/p&gt;

&lt;p&gt;In this case, the primary connection is the postgresql one, and that is where the i18n behaviour is defined:&lt;/p&gt;

&lt;p&gt;Category:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
    Auditable: ~&lt;br/&gt;
    NestedSet: ~&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;picture_id,  sort_type, name, handle, subheading, breadcrumb, description, enabled, meta_title, meta_keywords, meta_description&amp;#93;&lt;/span&gt;&lt;br/&gt;
      i18nField: culture&lt;br/&gt;
      length: 5&lt;br/&gt;
      actAs:&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
        Auditable: ~&lt;br/&gt;
      ...&lt;/p&gt;

&lt;p&gt;I tried to implement the suggest above (ie adding a static hash of the database handle to the Doctrine_Record_Generator class file, which does clear out the connections. However, I then have difficulty with Doctrine recognizing CategoryTranslation as a class:&lt;/p&gt;

&lt;p&gt;&quot;( ! ) Fatal error: Class &apos;CategoryTranslation&apos; not found in /sitename/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php on line 545&quot;&lt;/p&gt;

&lt;p&gt;Is there anything else I can to do test/fix this?&lt;/p&gt;</comment>
                    <comment id="16371" author="jsiponen" created="Tue, 23 Aug 2011 15:15:21 +0000"  >&lt;p&gt;This is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-373&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-373&lt;/a&gt;. I&apos;ve also added a failing test case to that issue that should reproduce the issue as described here.&lt;/p&gt;</comment>
                    <comment id="17665" author="lvqingan" created="Wed, 28 Mar 2012 08:24:28 +0000"  >&lt;p&gt;still exists in 1.2.4&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1031] CLONE -Multiple connections and i18n (raised as unresolved - original ticket marked as resolved)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1031</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I used to work with a single database named &quot;doctrine&quot;. The query was working properly.&lt;/p&gt;

&lt;p&gt;I then decided to use 2 databases so I got my schema like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;connection: doctrine&lt;/p&gt;

&lt;p&gt;Category:&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      actAs:&lt;br/&gt;
        Sluggable:&lt;br/&gt;
          fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name, description&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
    id: ~&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    description: string&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  connection: second&lt;br/&gt;
  columns:&lt;br/&gt;
    id: ~&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I did setup my connections in config/databases.yml this way:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;all:&lt;br/&gt;
  doctrine:&lt;br/&gt;
   // ....&lt;br/&gt;
  second:&lt;br/&gt;
   // ....&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;build-model, build-forms, build-filters and cc got ran. But now, I got an exception saying the &quot;Translation&quot; relation doesn&apos;t exist. The Base Models include correctly the bindComponent line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;Category&apos;, &apos;doctrine&apos;);&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;For now, I managed to kind of fixing it with simply swapping the databases order in my config/databases.yml and it&apos;s now working again perfectly.&lt;/p&gt;

&lt;p&gt;I forgot to mention that in the CategoryTable when i call $this-&amp;gt;getConnection()-&amp;gt;getName(), it outputs &quot;second&quot;&lt;/p&gt;</description>
                <environment>MySQL 5.1.37&lt;br/&gt;
PHP 5.2.11&lt;br/&gt;
symfony 1.2.11 DEV&lt;br/&gt;
&lt;br/&gt;
symfony 1.4.13&lt;br/&gt;
PHP 5.3.6 &lt;br/&gt;
Postgres 8.4.8&lt;br/&gt;
</environment>
            <key id="12962">DC-1031</key>
            <summary>CLONE -Multiple connections and i18n (raised as unresolved - original ticket marked as resolved)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="sarcas">James Bell</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Aug 2011 14:26:27 +0000</created>
                <updated>Wed, 28 Mar 2012 08:20:53 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Connection</component>
                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16370" author="sarcas" created="Tue, 23 Aug 2011 14:28:15 +0000"  >&lt;p&gt;Original issue: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-363&quot; title=&quot;Multiple connections and i18n&quot;&gt;&lt;del&gt;DC-363&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-363&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-363&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;There are some additional comments in there that explain the issue as currently being seen in released versions of Doctrine 1.2. Can I help verify that this is the same ticket? &lt;/p&gt;

&lt;p&gt;What is needed to help with debug (in addition to the extra information already provided)?&lt;/p&gt;
</comment>
                    <comment id="17664" author="lvqingan" created="Wed, 28 Mar 2012 08:20:53 +0000"  >&lt;p&gt;meet the same issue and it really blocked my project, seems no one will maintain 1.x. I&apos;m considering whether to replace symfony 1.4 with 2.0.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1053] Renaming a doctrine &apos;string&apos; field may result in loss of data as the field&apos;s type changes. (MySQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1053</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Consider the following schema:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;MyTable:
  columns:
    some_text:        string
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Doctrine creates the table with:&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-sql&quot;&gt;CREATE TABLE `my_table` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `some_text` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, the following migration should rename the field from &lt;tt&gt;some_text&lt;/tt&gt; to &lt;tt&gt;just_text&lt;/tt&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;&amp;lt;?php
class Version1 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Migration_Base
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;renameColumn(&apos;my_table&apos;, &apos;some_text&apos;, &apos;just_text&apos;);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function down()
    {
      $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;renameColumn(&apos;my_table&apos;, &apos;just_text&apos;, &apos;some_text&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;...however the field gets renamed and the type becomes &lt;tt&gt;VARCHAR(255)&lt;/tt&gt;, as the resulting &lt;tt&gt;SHOW CREATE TABLE my_table&lt;/tt&gt; shows:&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-sql&quot;&gt;CREATE TABLE `my_table` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `a_varchar` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Causes data in the column greater than 255 bytes to get truncated&lt;/p&gt;</description>
                <environment>PHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May  7 2011 03:12:27) &lt;br/&gt;
Zend Engine v2.3.0&lt;br/&gt;
Xdebug v2.0.5&lt;br/&gt;
Turnkey LAMP 10.04 LTS x86_64&lt;br/&gt;
Symfony 1.4.11&lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1</environment>
            <key id="13561">DC-1053</key>
            <summary>Renaming a doctrine &apos;string&apos; field may result in loss of data as the field&apos;s type changes. (MySQL)</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="benlancaster">Ben Lancaster</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Mar 2012 20:49:27 +0000</created>
                <updated>Mon, 26 Mar 2012 20:52:02 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1052] limit() get lost on multiple joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1052</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$strSql = UserFeedTable::getInstance()&lt;del&gt;&amp;gt;createQuery(&apos;q&apos;)&lt;/del&gt;&amp;gt;&lt;br/&gt;
                select(&apos;q.&lt;b&gt;, f.&lt;/b&gt;, fi.&lt;b&gt;, fav.&lt;/b&gt;&apos;)-&amp;gt;&lt;br/&gt;
                leftJoin(&apos;q.Feed f&apos;)-&amp;gt;&lt;br/&gt;
                leftJoin(&apos;f.FeedItem fi&apos;)-&amp;gt;&lt;br/&gt;
                leftJoin(&apos;fi.Favorite fav&apos;)-&amp;gt;&lt;br/&gt;
                andWhere(&apos;q.profile_id = ?&apos;, $intUserId)-&amp;gt;&lt;br/&gt;
                andWhere(&apos;q.is_active = ?&apos;, true)-&amp;gt;&lt;br/&gt;
                limit(10)-&amp;gt;getSqlQuery();&lt;br/&gt;
var_dump($strSql);&lt;/p&gt;

&lt;p&gt;string(1075) &quot;SELECT u.id AS u_&lt;em&gt;id, u.name AS u&lt;/em&gt;&lt;em&gt;name, u.image AS u&lt;/em&gt;&lt;em&gt;image, u.lead AS u&lt;/em&gt;&lt;em&gt;lead, u.headline AS u&lt;/em&gt;&lt;em&gt;headline, u.sort AS u&lt;/em&gt;&lt;em&gt;sort, u.is_active AS u&lt;/em&gt;&lt;em&gt;is_active, u.is_favorite AS u&lt;/em&gt;&lt;em&gt;is_favorite, u.feed_id AS u&lt;/em&gt;&lt;em&gt;feed_id, u.profile_id AS u&lt;/em&gt;&lt;em&gt;profile_id, u.category_id AS u&lt;/em&gt;&lt;em&gt;category_id, u.created_at AS u&lt;/em&gt;&lt;em&gt;created_at, u.updated_at AS u&lt;/em&gt;&lt;em&gt;updated_at, f.id AS f&lt;/em&gt;&lt;em&gt;id, f.url AS f&lt;/em&gt;&lt;em&gt;url, f.name AS f&lt;/em&gt;&lt;em&gt;name, f.created_at AS f&lt;/em&gt;&lt;em&gt;created_at, f.updated_at AS f&lt;/em&gt;&lt;em&gt;updated_at, f2.id AS f2&lt;/em&gt;&lt;em&gt;id, f2.lead AS f2&lt;/em&gt;&lt;em&gt;lead, f2.description AS f2&lt;/em&gt;&lt;em&gt;description, f2.image AS f2&lt;/em&gt;&lt;em&gt;image, f2.pub_date AS f2&lt;/em&gt;&lt;em&gt;pub_date, f2.link AS f2&lt;/em&gt;&lt;em&gt;link, f2.feed_id AS f2&lt;/em&gt;&lt;em&gt;feed_id, f2.created_at AS f2&lt;/em&gt;&lt;em&gt;created_at, f2.updated_at AS f2&lt;/em&gt;&lt;em&gt;updated_at, f3.id AS f3&lt;/em&gt;&lt;em&gt;id, f3.profile_id AS f3&lt;/em&gt;&lt;em&gt;profile_id, f3.feed_item_id AS f3&lt;/em&gt;&lt;em&gt;feed_item_id, f3.created_at AS f3&lt;/em&gt;&lt;em&gt;created_at, f3.updated_at AS f3&lt;/em&gt;_updated_at FROM user_feed u LEFT JOIN feed f ON u.feed_id = f.id LEFT JOIN feed_item f2 ON f.id = f2.feed_id LEFT JOIN favorite f3 ON f2.id = f3.feed_item_id WHERE u.id IN (&apos;7&apos;, &apos;8&apos;, &apos;9&apos;, &apos;10&apos;, &apos;11&apos;) AND (u.profile_id = ? AND u.is_active = ?)&quot;&lt;/p&gt;

&lt;p&gt;As you can see, the limit is missing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13543">DC-1052</key>
            <summary>limit() get lost on multiple joins</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="kempf-solutions">Michael Kempf</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Mar 2012 13:37:12 +0000</created>
                <updated>Tue, 20 Mar 2012 13:37:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1050] Doctrine_Relation_ForeignKey ignores ATTR_COLL_KEY attribute</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1050</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Relation_ForeignKey::fetchRelatedFor() executes the following code at line 70:&lt;/p&gt;

&lt;p&gt;$coll = $this-&amp;gt;getTable()&lt;del&gt;&amp;gt;getConnection()&lt;/del&gt;&amp;gt;query($dql, $id);&lt;br/&gt;
$related = $coll&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;As you can see it accesses the first element by using index &quot;0&quot; in $coll and hence ignores a modified ATTR_COLL_KEY-setting, for instance:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;setAttribute(Doctrine_Core::ATTR_COLL_KEY, &apos;id&apos;);&lt;/p&gt;

&lt;p&gt;Fortunately I had two models (ForeignA and ForeignB) in my project which both have an one-to-one relation to a third model (Main). That helped me finding this bug which causes the following strange behavior:&lt;/p&gt;

&lt;p&gt;// program 1:&lt;/p&gt;

&lt;p&gt;$m = new Main();&lt;br/&gt;
$m-&amp;gt;name = &apos;M1&apos;;&lt;br/&gt;
$m-&amp;gt;setForeignA(new ForeignA()); // has ATTR_COLL_KEY changed to &apos;id&apos;&lt;br/&gt;
$m-&amp;gt;setForeignB(new ForeignB());&lt;br/&gt;
$m-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;// program 2:&lt;/p&gt;

&lt;p&gt;$m = Doctrine_Core::getTable(&apos;M1&apos;)-&amp;gt;findOneBy(&apos;name&apos;, &apos;M1&apos;);&lt;br/&gt;
$m-&amp;gt;getForeignA()-&amp;gt;exists(); // false&lt;br/&gt;
$m-&amp;gt;getForeignB()-&amp;gt;exists(); // true&lt;/p&gt;

&lt;p&gt;-------------------------&lt;/p&gt;

&lt;p&gt;The big problem about this issue is that behavior is inconsistent. If you don&apos;t split the example above into two separate programs/processes you won&apos;t have problems, since Doctrine accesses the reference which was stored when calling save().&lt;/p&gt;

&lt;p&gt;You will get into trouble using functional tests in Symfony. Since there is only a single process for all requests I wasn&apos;t able to reproduce a problem caused by this bug which appeared in the production environment.&lt;/p&gt;

&lt;p&gt;-------------------------&lt;/p&gt;

&lt;p&gt;Edit:&lt;/p&gt;

&lt;p&gt;Doctrine_Connection::queryOne() is affected as well!&lt;/p&gt;

&lt;p&gt;A solution is to replace&lt;/p&gt;

&lt;p&gt;$coll = $this-&amp;gt;getTable()&lt;del&gt;&amp;gt;getConnection()&lt;/del&gt;&amp;gt;query($dql, $id);&lt;br/&gt;
$related = $coll&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;by&lt;/p&gt;

&lt;p&gt;$related = $this-&amp;gt;getTable()&lt;del&gt;&amp;gt;getConnection()&lt;/del&gt;&amp;gt;query($dql, $id)-&amp;gt;getFirst();&lt;/p&gt;</description>
                <environment>Windows 7 64Bit&lt;br/&gt;
PHP 5.3&lt;br/&gt;
Symfony 1.4</environment>
            <key id="13506">DC-1050</key>
            <summary>Doctrine_Relation_ForeignKey ignores ATTR_COLL_KEY attribute</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="fishbone">Uli Hecht</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Mar 2012 22:55:02 +0000</created>
                <updated>Wed, 7 Mar 2012 13:02:40 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Attributes</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17534" author="fishbone" created="Wed, 7 Mar 2012 13:02:40 +0000"  >&lt;p&gt;Suggested patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11167" name="ForeignKey.php.patch" size="642" author="fishbone" created="Wed, 7 Mar 2012 13:02:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-585] Hydrate Array does not return full array, when Hydrate Scalar does</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-585</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Description : Upon hydrating as array I will receive one row returned.  If I am to hydrate as Scalar, I will get 200+ rows.  Also, if i echo the sql ($q-&amp;gt;getSqlQuery()) and run that raw, it will also return around 200+ rows.&lt;/p&gt;


&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;select(&apos;DISTINCT(co.name) AS field, co.name AS value&apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;Model_Country co&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;co.City ci&apos;);&lt;/p&gt;

&lt;p&gt;//here we will get only the first row&lt;br/&gt;
$results = $q-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;//Here we will get all 200+ rows&lt;br/&gt;
$results = $q-&amp;gt;execute(array(), Doctrine::HYDRATE_SCALAR);&lt;/p&gt;

&lt;p&gt;I have yet to dig to deep into this, but if it is indeed a bug, my guess is it is in Doctrine_Hydrator_Graph::hydrateResultSet()&lt;/p&gt;

&lt;p&gt;I can provide more data if needed.&lt;/p&gt;
</description>
                <environment>OS : Ubuntu 9.04&lt;br/&gt;
PHP : PHP 5.2.6-3ubuntu4.5</environment>
            <key id="11085">DC-585</key>
            <summary>Hydrate Array does not return full array, when Hydrate Scalar does</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="solomonjames">James Solomon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2010 14:36:24 +0000</created>
                <updated>Fri, 2 Mar 2012 17:44:46 +0000</updated>
                                                                            <due></due>
                    <votes>4</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="12339" author="solomonjames" created="Thu, 18 Mar 2010 15:22:52 +0000"  >&lt;p&gt;I have found this in the google group, and he provides more detailed info, and appears to be the same exact issue : &lt;a href=&quot;http://groups.google.com/group/doctrine-user/msg/8e4a8a673428fff0&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/msg/8e4a8a673428fff0&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="12340" author="solomonjames" created="Thu, 18 Mar 2010 17:30:26 +0000"  >&lt;p&gt;seems to be another similar issue here : &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-328&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-328&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13013" author="jagalan" created="Wed, 19 May 2010 12:15:32 +0000"  >&lt;p&gt;I&apos;m having that problem and I taked a look into the code, found this:&lt;/p&gt;

&lt;p&gt;I have a query that looks like this:&lt;br/&gt;
 $q = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;select(&apos;af.id as id, af.user_id as user&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;ActivityFeed af&apos;)&lt;br/&gt;
-&amp;gt;innerJoin(&apos;af.user as afu&apos;)&lt;br/&gt;
-&amp;gt;orderBy(&apos;af.time DESC&apos;);&lt;/p&gt;

&lt;p&gt;The sql query without aliases in SELECT or without join is built that way:&lt;br/&gt;
SELECT a.id AS a_&lt;em&gt;id, a.user_id AS a&lt;/em&gt;_user_id ... -&amp;gt; This is returning all the records&lt;/p&gt;

&lt;p&gt;The sql query with aliases in SELECT is built that way:&lt;br/&gt;
SELECT a.id AS a_&lt;em&gt;0, a.user_id AS a&lt;/em&gt;_1 FROM ... -&amp;gt; This is returning only one record&lt;/p&gt;

&lt;p&gt;In Doctrine_Hydrator_Graph::_gatherRowData, line 288 there&apos;s the following call:&lt;/p&gt;

&lt;p&gt;$fieldName = $table-&amp;gt;getFieldName($last);&lt;br/&gt;
Where $last is the last part of the column alias, for example &quot;0&quot; in &quot;a__0&quot;. This way the call asks the table for the name of the &quot;0&quot; field and the table returns &quot;0&quot; so I think we&apos;re not getting the right field name (it must be &quot;id&quot;).&lt;/p&gt;

&lt;p&gt;I&apos;m not understanding the whole hydration process but replacing&lt;/p&gt;

&lt;p&gt;$fieldName = $table-&amp;gt;getFieldName($last);&lt;/p&gt;

&lt;p&gt;with:&lt;/p&gt;

&lt;p&gt;if(isset($this-&amp;gt;_queryComponents[ $cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;agg&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
              $fieldName = $table-&amp;gt;getFieldName($this-&amp;gt;_queryComponents[ $cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;agg&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$last&amp;#93;&lt;/span&gt;);&lt;br/&gt;
} else {&lt;br/&gt;
                $fieldName = $table-&amp;gt;getFieldName($last);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;solves the problem almost in my case.&lt;/p&gt;

&lt;p&gt;Hope it will help to solve the issue. &lt;/p&gt;</comment>
                    <comment id="13190" author="jwage" created="Tue, 8 Jun 2010 14:39:57 +0000"  >&lt;p&gt;It seems the suggested change causes many failures in our test suite. Can you give it a try and confirm?&lt;/p&gt;</comment>
                    <comment id="13721" author="ben.davies" created="Wed, 28 Jul 2010 12:45:51 +0000"  >&lt;p&gt;Just commenting to say that I can confirm this bug exists. It&apos;s happening for me too.  &lt;br/&gt;
I will try and dig deeper when I have some time.&lt;/p&gt;</comment>
                    <comment id="14129" author="jagalan" created="Sat, 28 Aug 2010 10:42:31 +0000"  >&lt;p&gt;As the error is located in Doctrine_Hydrator_Graph, HYDRATE_RECORD has the same behaviour.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to find a solution.&lt;/p&gt;</comment>
                    <comment id="14194" author="ben.davies" created="Tue, 31 Aug 2010 10:21:15 +0000"  >&lt;p&gt;This only occurs if your alias your identifier field.&lt;br/&gt;
Doctrine needs to know which field is the identifier to hydrate records.&lt;br/&gt;
The identifier aliases is formed to x__0, and then, as other commented has found.&lt;br/&gt;
Doctrine then has no way of determining which field is the identifier.&lt;/p&gt;</comment>
                    <comment id="14569" author="enrico" created="Fri, 15 Oct 2010 04:03:09 +0000"  >&lt;p&gt;Hi everybody,&lt;/p&gt;

&lt;p&gt;we really need a unit test here. The provided patch breaks all aliased queries in our application. I will provide a patch and it hopefully solves your problem Juan. If not, please provide more information or add another test-method to the provided unit test.&lt;/p&gt;

&lt;p&gt;I had to rewrite some of the unit tests cause the order of the fields in the generated sql statement has changed due the provided patch.&lt;/p&gt;

&lt;p&gt;Enrico&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine1/commit/e3ae69c2260dae6dfbceb4e24138b2379f3da2e6#commitcomment-169495&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/commit/e3ae69c2260dae6dfbceb4e24138b2379f3da2e6#commitcomment-169495&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-585&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-585&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15444" author="loops" created="Fri, 4 Mar 2011 03:56:07 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;


&lt;p&gt;I have a little issue with this bug report...&lt;/p&gt;

&lt;p&gt;I&apos;m currently using Doctrine 1.2 at revision 7691, and I&apos;ve encounter a bug when select the primary key of a model with a custom alias (typically &lt;em&gt;$query-&amp;gt;addSelect( &apos;r.id as my_id&apos; )&lt;/em&gt;), the issue was that Doctrine automatically add &lt;em&gt;`r`.```id``` AS `r&lt;/em&gt;_&lt;em&gt;1`&lt;/em&gt; to the select clause, in addition to the correct &lt;em&gt;`r`.`id` AS `r&lt;/em&gt;_&lt;em&gt;1`&lt;/em&gt; part.&lt;/p&gt;

&lt;p&gt;So, I&apos;ve browse the code to finally found where does this strange thing comes from, and I&apos;ve found it on Doctrine_Query::parseSelect() method, just at the line 663:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;                // Fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-585&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-585&lt;/a&gt;&lt;br/&gt;
                // Add selected columns to pending fields&lt;br/&gt;
                if (preg_match(&apos;/^(&lt;span class=&quot;error&quot;&gt;&amp;#91;^\(&amp;#93;&lt;/span&gt;+)\.(\&apos;?)(.*?)(\&apos;?)$/&apos;, $expression, $field)) {&lt;br/&gt;
                    $this-&amp;gt;_pendingFields&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentAlias&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = $field&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;;&lt;br/&gt;
                }&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;So I&apos;m wonder : where does this patch is related to this bug report?&lt;/p&gt;


&lt;p&gt;Whatever, the bug I&apos;ve encounter is very simple : the regular expression that extract the field name takes care about &lt;em&gt;&apos;&lt;/em&gt; but not &lt;em&gt;&#180;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You will find a patch for the bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-585&quot; title=&quot;Hydrate Array does not return full array, when Hydrate Scalar does&quot;&gt;DC-585&lt;/a&gt;-b in a few minutes... This patch just make the regular expression taking account of &lt;em&gt;&apos;&lt;/em&gt; and &lt;em&gt;&#180;&lt;/em&gt; and also remove all useless parentheses in expression (by this way PCRE get less matches to capture and we can earn some precious microseconds).&lt;/p&gt;

&lt;p&gt;Also, this patch should be completed because the query still have two &lt;em&gt;`r`.`id` AS `r&lt;/em&gt;_&lt;em&gt;1`&lt;/em&gt; parts, that may cause some other issues with some databases...&lt;/p&gt;

&lt;p&gt;IMPORTANT NOTE: The previous revision 7674 of Doctrine_Query does not cause the bug encounter with the few lines of code above, just because they were not there. They really must be review.&lt;/p&gt;



&lt;p&gt;Loops&lt;/p&gt;</comment>
                    <comment id="15750" author="loops" created="Thu, 28 Apr 2011 05:03:36 +0000"  >&lt;p&gt;Damn, the bug above was corrected during a few weeks and comes back with the new branch of Doctrine 1.2.14.&lt;/p&gt;

&lt;p&gt;Does anybody can re-apply the corrective patch (renamed &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-585&quot; title=&quot;Hydrate Array does not return full array, when Hydrate Scalar does&quot;&gt;DC-585&lt;/a&gt;-c), please ?&lt;/p&gt;

&lt;p&gt;I repeat it agin, but these few lines of code really need to be review.&lt;/p&gt;

&lt;p&gt;Loops&lt;/p&gt;</comment>
                    <comment id="17241" author="knagode" created="Fri, 13 Jan 2012 20:08:54 +0000"  >&lt;p&gt;I also have this problem .. Anyone know howt o fix it?&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY); // returns one row only&lt;br/&gt;
$query-&amp;gt;execute(array(), Doctrine::HYDRATE_RECORD); // returns one row only&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;execute(array(), Doctrine::HYDRATE_SCALAR); // returns result as expected&lt;/p&gt;</comment>
                    <comment id="17242" author="knagode" created="Sat, 14 Jan 2012 00:40:36 +0000"  >&lt;p&gt;I found solution for my  problem: &lt;/p&gt;

&lt;p&gt;Table had ID field but it was not primary key.  When I deleted this column, doctrine started to work as expected. &lt;/p&gt;</comment>
                    <comment id="17491" author="lacton" created="Fri, 2 Mar 2012 17:44:46 +0000"  >&lt;p&gt;I have run into the same issue.&lt;/p&gt;

&lt;p&gt;Using the default hydration, I get only one record.&lt;/p&gt;

&lt;p&gt;Using &quot;$query-&amp;gt;execute(array(), Doctrine::HYDRATE_SCALAR);&quot;, I get all the expected records.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10950" name="Doctrine-DC-585-b.patch" size="721" author="loops" created="Fri, 4 Mar 2011 04:04:39 +0000" />
                    <attachment id="10976" name="Doctrine-DC-585-c.patch" size="718" author="loops" created="Thu, 28 Apr 2011 05:18:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1049] error with Timestamp data Validation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1049</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The default value for timestamp is &quot;0000-00-00 00:00:00&quot;, so &lt;br/&gt;
$e = explode(&apos;T&apos;, trim($value))&lt;br/&gt;
should be changed to &lt;br/&gt;
$e = explode(&apos; &apos;, trim($value))&lt;/p&gt;

&lt;p&gt;public function validate($value)&lt;br/&gt;
    {&lt;br/&gt;
        if (is_null($value)) &lt;/p&gt;
{
            return true;
        }

&lt;p&gt;        $e = explode(&apos;T&apos;, trim($value));&lt;br/&gt;
        $date = isset($e&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;) ? $e&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;:null;&lt;br/&gt;
        $time = isset($e&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;) ? $e&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;:null;&lt;/p&gt;

&lt;p&gt;        $dateValidator = Doctrine_Validator::getValidator(&apos;date&apos;);&lt;br/&gt;
        $timeValidator = Doctrine_Validator::getValidator(&apos;time&apos;);&lt;/p&gt;

&lt;p&gt;        if ( ! $dateValidator-&amp;gt;validate($date)) &lt;/p&gt;
{
            return false;
        }&lt;br/&gt;
&lt;br/&gt;
        if ( ! $timeValidator-&amp;gt;validate($time)) {            return false;        }
&lt;p&gt; &lt;/p&gt;

&lt;p&gt;        return true;&lt;br/&gt;
    }&lt;/p&gt;</description>
                <environment>Linux </environment>
            <key id="13476">DC-1049</key>
            <summary>error with Timestamp data Validation</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="coiby">Coiby Xu</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Feb 2012 13:09:02 +0000</created>
                <updated>Sun, 26 Feb 2012 13:09:02 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11166" name="Timestamp.php" size="2171" author="coiby" created="Sun, 26 Feb 2012 13:09:02 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1048] MSSQL Connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1048</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Function spliti(); is deprecated.&lt;br/&gt;
It need to be change to (in my own opinion):&lt;/p&gt;

&lt;p&gt;$field_array = str_ireplace(&apos; as &apos;, &apos; as &apos;, $field_array);&lt;br/&gt;
$aux2 = explode(&apos; as &apos;, $field_array);&lt;/p&gt;

&lt;p&gt;thnx.&lt;/p&gt;</description>
                <environment>Microsoft Windows Server 2008 R2; IIS 7; PHP 2.3.8; Doctrine 1.2.4; Symfony 1.4.16</environment>
            <key id="13363">DC-1048</key>
            <summary>MSSQL Connection</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="psycho-coder">Constantine Tkachenko</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Jan 2012 08:35:40 +0000</created>
                <updated>Mon, 16 Jan 2012 08:35:40 +0000</updated>
                                    <version>1.2.4</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-582] DataDict entry missing for datetime type for MySQL causes migrations to fail due to sql error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-582</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I discovered this whilst trying out migrations via symfony. I added a datetime field to my schema.yml and generated the migrations, but upon running the migration I got the following error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;()&apos; at line 1. Failing Query: &quot;ALTER TABLE order_item ADD purchased_at datetime()&quot;&lt;/p&gt;

&lt;p&gt;The following code causes the failure in the actual migration:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;order_item&apos;, &apos;purchased_at&apos;, &apos;datetime&apos;, &apos;&apos;, array());&lt;/p&gt;

&lt;p&gt;because it generates the following sql:&lt;/p&gt;

&lt;p&gt;ALTER TABLE order_item ADD purchased_at datetime()&lt;/p&gt;

&lt;p&gt;The diff from my patched version which fixes the issue is as follows:&lt;/p&gt;

&lt;p&gt;Index: Doctrine/DataDict/Mysql.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; Doctrine/DataDict/Mysql.php	(revision 7415)&lt;br/&gt;
+++ Doctrine/DataDict/Mysql.php	(working copy)&lt;br/&gt;
@@ -227,6 +227,7 @@&lt;br/&gt;
                 return &apos;DATE&apos;;&lt;br/&gt;
             case &apos;time&apos;:&lt;br/&gt;
                 return &apos;TIME&apos;;&lt;br/&gt;
+            case &apos;datetime&apos;:&lt;br/&gt;
             case &apos;timestamp&apos;:&lt;br/&gt;
                 return &apos;DATETIME&apos;;&lt;br/&gt;
             case &apos;float&apos;:&lt;/p&gt;

&lt;p&gt;It&apos;s against the following repository file:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib/Doctrine/DataDict/Mysql.php&quot; class=&quot;external-link&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib/Doctrine/DataDict/Mysql.php&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;I hope this is useful and gets committed &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment>LAMP</environment>
            <key id="11080">DC-582</key>
            <summary>DataDict entry missing for datetime type for MySQL causes migrations to fail due to sql error</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="uncleringo">Rich Birch</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2010 09:27:27 +0000</created>
                <updated>Tue, 10 Jan 2012 10:11:51 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:29:12 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12426" author="uncleringo" created="Mon, 22 Mar 2010 11:19:18 +0000"  >&lt;p&gt;I&apos;ve just discovered that the same issue exists for fields of type &apos;text&apos;:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;) NOT NULL, session_time DATETIME NOT NULL, INDEX session_id_index_idx (session_&apos; at line 1. Failing Query: &quot;CREATE TABLE session (id BIGINT AUTO_INCREMENT, session_id VARCHAR(64) NOT NULL, session_data text() NOT NULL, session_time DATETIME NOT NULL, INDEX session_id_index_idx (session_id), PRIMARY KEY(id)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;from the following schema:&lt;/p&gt;

&lt;p&gt;Session:&lt;br/&gt;
  columns:&lt;br/&gt;
    session_id:       &lt;/p&gt;
{ type: string(64), notnull: true }
&lt;p&gt;    session_data:     &lt;/p&gt;
{ type: text, notnull: true }
&lt;p&gt;    session_time:     &lt;/p&gt;
{ type: timestamp, notnull: true }
&lt;p&gt;  indexes:&lt;br/&gt;
    session_id_index:&lt;br/&gt;
      fields: [ session_id ]&lt;br/&gt;
      unique: true&lt;/p&gt;

&lt;p&gt;I guess there may be other field entries missing too. Is there a comprehensive list of doctrine field types somewhere?&lt;/p&gt;</comment>
                    <comment id="12427" author="uncleringo" created="Mon, 22 Mar 2010 11:26:57 +0000"  >&lt;p&gt;Ok, I might have been being dumb here. I&apos;ve just checked the doctrine documentation for defining the schema (&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models&lt;/a&gt;) and there&apos;s no mention of a datetime or text field (I&apos;ve just realised that I should have used string instead of text anyway), but datetime still works as a column type so shouldn&apos;t it be documented?&lt;/p&gt;

&lt;p&gt;I guess either datetime should be fully removed or fully supported&lt;/p&gt;</comment>
                    <comment id="12497" author="jwage" created="Mon, 29 Mar 2010 14:29:12 +0000"  >&lt;p&gt;You should be using the Doctrine portable types. So you would use date or timestamp I believe and Doctrine will convert it to the appropriate type for your dbms.&lt;/p&gt;</comment>
                    <comment id="17210" author="tolean" created="Tue, 10 Jan 2012 10:11:51 +0000"  >&lt;p&gt;not correctly generated migration, in my case generated:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;tree&apos;, &apos;published_at&apos;, &apos;datetime&apos;, &apos;&apos;, array(&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;but if change the fourth parameters on null, all ok&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1047] hardDelete not resetting flag if exception is thrown</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1047</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;To be honest I don&apos;t know wich version I have but I believe it to be 1.2.3&lt;/p&gt;

&lt;p&gt;The problem is pretty simple, I was trying to do a hardDelete and if it fails I would do a softDelete.&lt;br/&gt;
Example&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;try&lt;/span&gt; {
    $record-&amp;gt;hardDelete();
}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($e &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Connection_Mysql_Exception &amp;amp;&amp;amp; $e-&amp;gt;getPortableCode() == Doctrine_Core::ERR_CONSTRAINT) {
        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $record-&amp;gt;delete();
        }
        &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e1) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e1;
        }
    }
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But when the first exception is thrown from hardDelete() in Doctrine_Template_SoftDelete(line 84) the listener flag for hardDelete is not set to false, so if I try to do the delete, it will still behave as if it was a hardDelete.&lt;/p&gt;

&lt;p&gt;The solution would be catch the exception, reset the flag and rethrow it.&lt;br/&gt;
Patch attached&lt;/p&gt;

&lt;p&gt;Hope this info is enough.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13334">DC-1047</key>
            <summary>hardDelete not resetting flag if exception is thrown</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="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="lonewolf4">Lone Wolf</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Jan 2012 11:46:54 +0000</created>
                <updated>Fri, 6 Jan 2012 11:46:54 +0000</updated>
                                                                    <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11140" name="softdelete_exception.patch" size="645" author="lonewolf4" created="Fri, 6 Jan 2012 11:46:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-534] Couldn&apos;t hydrate. Found non-unique key mapping named &apos;lang&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-534</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For the following query&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;   return $this-&amp;gt;createQuery(&apos;a&apos;)&lt;br/&gt;
   -&amp;gt;innerJoin(&apos;a.Translation t WITH t.lang = ?&apos;, $lang)&lt;br/&gt;
   -&amp;gt;innerJoin(&apos;a.UserAttributes ua&apos;)&lt;br/&gt;
   -&amp;gt;innerJoin(&apos;ua.AttrOptions o WITH o.attribute_id = a.id&apos;)&lt;br/&gt;
   -&amp;gt;innerJoin(&apos;o.Translation ot WITH ot.lang = ?&apos;, $lang)&lt;br/&gt;
   -&amp;gt;addWhere(&apos;ua.user_id = ?&apos;, $userId)&lt;br/&gt;
   -&amp;gt;addWhere(&apos;a.tab = ?&apos;, $tab)&lt;br/&gt;
   -&amp;gt;addOrderBy(&apos;a.ord asc&apos;)&lt;br/&gt;
   -&amp;gt;execute();&lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {/quote}&lt;/span&gt; &lt;/div&gt;

&lt;p&gt;i get &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Couldn&apos;t hydrate. Found non-unique key mapping named &apos;lang&apos;.&lt;/p&gt;
{/quote}
&lt;p&gt;error,  so i cannot join more than one translation table in one query because it cause error. &lt;/p&gt;</description>
                <environment>PHP 5.2.9 Symfony 1.4</environment>
            <key id="10978">DC-534</key>
            <summary>Couldn&apos;t hydrate. Found non-unique key mapping named &apos;lang&apos;</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="4">Incomplete</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vinylboy">Adamczewski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Mar 2010 06:10:11 +0000</created>
                <updated>Wed, 28 Dec 2011 12:01:29 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 16:24:13 +0000</resolved>
                            <version>1.2.1</version>
                                                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11950" author="jwage" created="Tue, 2 Mar 2010 10:37:14 +0000"  >&lt;p&gt;Can you create a test case for this? You can find information about Doctrine unit testing here: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="17129" author="menshinskiy" created="Wed, 28 Dec 2011 12:01:29 +0000"  >&lt;p&gt;I have the same error.&lt;br/&gt;
How to solve this issue?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1046] Connection MSSQL replaceBoundParamsWithInlineValuesInQuery</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1046</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;We found a bug in Doctrine1 MSSQL Connection.&lt;br/&gt;
When you would like to use the following functionality: find(One)By(p1,p2)&lt;br/&gt;
if you use the old functionality (Symfony 1.4 support it) like this: findBy(&quot;idAnddata&quot;, array(&quot;id&quot; =&amp;gt; ..., &quot;date&quot; =&amp;gt; ..)), you got an MSSQL error, because the values wasn&apos;t changed.&lt;/p&gt;

&lt;p&gt;Please find the patch for it, I hope it helps to you as well.&lt;/p&gt;

&lt;p&gt;Kind regards&lt;br/&gt;
Peter&lt;/p&gt;</description>
                <environment>Revision: 104&lt;br/&gt;
</environment>
            <key id="13272">DC-1046</key>
            <summary>Connection MSSQL replaceBoundParamsWithInlineValuesInQuery</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="eisi">Peter Eisenberg</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Dec 2011 13:01:23 +0000</created>
                <updated>Thu, 15 Dec 2011 13:39:29 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16988" author="eisi" created="Thu, 15 Dec 2011 13:39:29 +0000"  >&lt;p&gt;Small changes:&lt;br/&gt;
Unfortunately the notice wasn&apos;t set in my test environment, and I didn&apos;t realized this small error:&lt;/p&gt;

&lt;p&gt;please use the following instead of the original: &lt;br/&gt;
$replacement = &apos;is_null(\$value) ? \&apos;NULL\&apos; : \$this-&amp;gt;quote(\$params&lt;span class=&quot;error&quot;&gt;&amp;#91;\&amp;#39;\\1\&amp;#39;&amp;#93;&lt;/span&gt;)&apos;;&lt;/p&gt;

&lt;p&gt;another case you got the following error: Use of undefined constant xxx - assumed xxx. &lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Peter&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11130" name="replaceBoundParamsWithInlineValuesInQuery.patch" size="660" author="eisi" created="Thu, 15 Dec 2011 13:01:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-944] Precedence problem in SQL generation allows bypass of pending joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-944</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&apos;Pending join conditions&apos; are used by listeners to inject extra SQL conditions into a query. They are often used to add basic constraints on every query. An example is the bundled &lt;b&gt;SoftDelete&lt;/b&gt; template. Its listener adds extra constraints such as &lt;b&gt;s.deleted_at IS NULL&lt;/b&gt; to a query, to make sure that deleted rows are never retrieved on a query.&lt;/p&gt;

&lt;p&gt;However, in the emitted SQL, &lt;b&gt;Doctrine_Query&lt;/b&gt; does not use parentheses to group normal SQL conditions together. The pending join condition is simply added to the string without encapsulating existing expressions. This makes it possible to bypass the pending join conditions entirely by using the OR operator.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;For instance, the following query exhibits this problem:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$query = Doctrine_Query::create()&lt;br/&gt;
        -&amp;gt;from(&quot;SoftDeleteTest&quot;)&lt;br/&gt;
        -&amp;gt;where(&quot;name=?&quot;, &quot;faulty&quot;)&lt;br/&gt;
        -&amp;gt;orWhere(&quot;name=?&quot;, &quot;faulty&quot;);&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This query emits the following SQL:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT s.name AS s_&lt;em&gt;name, s.deleted_at AS s&lt;/em&gt;_deleted_at FROM soft_delete_test s WHERE (s.name = &apos;faulty&apos; OR s.name = &apos;faulty&apos; AND (s.deleted_at IS NULL))&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;which returns also a deleted row.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Expected behavior&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;One would expect the pending join conditions always to hold, and to have precedence over regularly added SQL conditions. This could be accomplished in the most simple fashion by:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT s.name AS s_&lt;em&gt;name, s.deleted_at AS s&lt;/em&gt;_deleted_at FROM soft_delete_test s WHERE ( ( s.name = &apos;faulty&apos; OR s.name = &apos;faulty&apos; ) AND (s.deleted_at IS NULL));&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;As the existing expressions are now encapsulated by parentheses, it is no longer possible to bypass the pending join conditions injected by the query listener.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Full test case details:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;init.sql&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;create database softdelete;
grant all privileges on softdelete.* to softdelete@localhost identified by &apos;uahwqeruwer&apos;;

use softdelete;
CREATE TABLE soft_delete_test (name VARCHAR(255), 
    deleted_at DATETIME DEFAULT NULL, 
    PRIMARY KEY(name)) ENGINE = INNODB;

insert into soft_delete_test values (&apos;fine&apos;, null);
insert into soft_delete_test values (&apos;faulty&apos;, now());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;run.php&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php

require &quot;./1.2.3/lib/Doctrine.php&quot;;

spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));

require &quot;SoftDeleteTest.php&quot;;

$conn = Doctrine_Manager::connection(&quot;mysql://softdelete:uahwqeruwer@localhost/softdelete&quot;);
$conn-&amp;gt;setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, true);

$query = Doctrine_Query::create()
    -&amp;gt;from(&quot;SoftDeleteTest&quot;)
    -&amp;gt;where(&quot;name=?&quot;, &quot;faulty&quot;)
    -&amp;gt;orWhere(&quot;name=?&quot;, &quot;faulty&quot;);

$found = $query-&amp;gt;execute();
foreach ($found as $f) {
    echo &quot;ERROR! Found a deleted row: $f-&amp;gt;name\n&quot;;
}
echo &quot;Done.\n&quot;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;SoftDeleteTest.php&lt;/b&gt; (copied from Doctrine manual)&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php

class SoftDeleteTest extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, null, array(
                &apos;primary&apos; =&amp;gt; true
            )
        );
    }

    public function setUp()
    {
        $this-&amp;gt;actAs(&apos;SoftDelete&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.2, 5.3</environment>
            <key id="12189">DC-944</key>
            <summary>Precedence problem in SQL generation allows bypass of pending joins</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="walter">Walter Hop</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Dec 2010 12:01:34 +0000</created>
                <updated>Sat, 10 Dec 2011 12:44:25 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14900" author="walter" created="Fri, 3 Dec 2010 12:02:23 +0000"  >&lt;p&gt;Fixing quote formatting&lt;/p&gt;</comment>
                    <comment id="14903" author="walter" created="Fri, 3 Dec 2010 12:06:05 +0000"  >&lt;p&gt;Final formatting fixes. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11127" name="Query.pendingjoin.diff" size="1878" author="walter" created="Sat, 10 Dec 2011 12:44:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1045] data-load with invalid filename leads to purging of all the data in the database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1045</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Adding an invalid filename to the data-load task results in purging of all the data in the database.&lt;/p&gt;

&lt;p&gt;I am attaching a patch that checks the loaded data if there were any values actually loaded from the fixtures. &lt;/p&gt;</description>
                <environment>symfony 1.4</environment>
            <key id="13241">DC-1045</key>
            <summary>data-load with invalid filename leads to purging of all the data in the database</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="artworx">Keszeg Alexandru</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Dec 2011 16:53:21 +0000</created>
                <updated>Tue, 6 Dec 2011 16:53:21 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11124" name="diff.patch" size="413" author="artworx" created="Tue, 6 Dec 2011 16:53:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1044] record Line 2430 Unlink method Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1044</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you have a new unpersisted object and you call a method to a referenced object - when calling the unlink() method on referenced object the above error is called.&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459 &lt;/p&gt;

&lt;p&gt;eg&lt;/p&gt;

&lt;p&gt;$foo = new foo();&lt;/p&gt;

&lt;p&gt;$foo-&amp;gt;getBar(); This call will bind a reference of Bar against the foo object.&lt;/p&gt;

&lt;p&gt;$foo-&amp;gt;unlink(&apos;bar&apos;);&lt;/p&gt;

&lt;p&gt;As no objects are yet persisted, the unlink method tries to match ids on the objects that do not exist.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13239">DC-1044</key>
            <summary>record Line 2430 Unlink method Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459</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="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="kylerclarke">Kyle Clarke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Dec 2011 00:01:28 +0000</created>
                <updated>Mon, 5 Dec 2011 00:01:28 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1043] Error:&quot;When using..ATTR_AUTO_ACCESSOR_OVERRIDE you cannot.. name &quot;data&quot; ...&quot; when running doctrine:build-schema ... except  I&apos;m NOT using that word</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1043</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Was able to resolve this - see comment below - but still think it counts as a bug since the source of the error is so unclear&lt;/p&gt;

&lt;p&gt;Hello,&lt;br/&gt;
I&apos;m familiarizing myself with symfony at this point, but doctrine seems like a very accessible ORM tool overall. This install will also use the apostrophe plugin though that is more a client request and it is seeming to complicate a lot of issues from what I can see. Right now, I am just trying to create some db tables in schema.yml and build them with doctrine. When running $ php symfony doctrine:build-schema I get the following error: When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name &quot;data&quot; because it is reserved by Doctrine. You must choose another field name.&lt;/p&gt;

&lt;p&gt;Which would be clear enough except I&apos;m NOT using &quot;data&quot; as a field name in my schema file: here&apos;s what I&apos;m using:&lt;/p&gt;

&lt;p&gt;sfTravelLodgingLocationsType:&lt;br/&gt;
   columns:&lt;br/&gt;
      lodging_name: &lt;/p&gt;
{ type: string(255) }
&lt;p&gt;      lodging_code: &lt;/p&gt;
{ type: string(255) }

&lt;p&gt;sfTravelLodgingLocations:&lt;br/&gt;
   columns:&lt;br/&gt;
      lodging_type_code: &lt;/p&gt;
{ type: integer, notnull: true }
&lt;p&gt;      name: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      address: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      city: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      distance: &lt;/p&gt;
{ type: integer, notnull: true }
&lt;p&gt;      phone: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      known_2b_sold_out: &lt;/p&gt;
{ type: boolean, notnull: true, default: 0 }
&lt;p&gt;   relations:&lt;br/&gt;
      Travel_Lodging_LocationsType: &lt;/p&gt;
{ local: type_id, foreign: id }

&lt;p&gt;I&apos;m assuming this is a misnamed error call ... I have found a few references to that same error in other threads but none that resolve it&lt;/p&gt;</description>
                <environment>Mac OSX 10.6.8 running MAMP Pro 2.0.5 with PHP 5.3.6 ... this is a local symfony install which is also using the apostrophe cms. </environment>
            <key id="13231">DC-1043</key>
            <summary>Error:&quot;When using..ATTR_AUTO_ACCESSOR_OVERRIDE you cannot.. name &quot;data&quot; ...&quot; when running doctrine:build-schema ... except  I&apos;m NOT using that word</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shotdsherrif">Maurice Stephens</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Nov 2011 21:32:10 +0000</created>
                <updated>Thu, 1 Dec 2011 02:01:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16936" author="shotdsherrif" created="Thu, 1 Dec 2011 01:59:12 +0000"  >&lt;p&gt;I was able to find a way to override the ATTR_AUTO_ACCESSOR_OVERRIDE with a method in the appConfiguration.class.php file&lt;/p&gt;

&lt;p&gt;based on this thread ... &lt;a href=&quot;http://stackoverflow.com/questions/7266293/attr-auto-accessor-override&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/7266293/attr-auto-accessor-override&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But it is still a difficult error to troubleshoot ... not clear on what the reserved keyword &quot;data&quot; had to do with it ... considering I wasn&apos;t even using it in the schema&lt;/p&gt;

&lt;p&gt;Would be interested in finding some resources that go into detail on the implications of the command line context that symfony relies on&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1042] submitted form accidentally - PLEASE DELETE</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1042</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This was accidentally submitted before being complete ... This one can be deleted ... sorry&lt;/p&gt;</description>
                <environment></environment>
            <key id="13230">DC-1042</key>
            <summary>submitted form accidentally - PLEASE DELETE</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="shotdsherrif">Maurice Stephens</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Nov 2011 21:20:19 +0000</created>
                <updated>Wed, 30 Nov 2011 21:34:39 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16934" author="shotdsherrif" created="Wed, 30 Nov 2011 21:34:39 +0000"  >&lt;p&gt;This was accidentally submitted before being complete ... This one can be deleted ... sorry&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1041] Using -&gt;limit() in conjunction with many-to-many with mysql generates wrong SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1041</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using -&amp;gt;limit() in conjunction with many-to-many relationships with mysql leads to strange SQL generated. The condition &lt;b&gt;id IS NULL&lt;/b&gt; is added in such case which is not correct at all.&lt;/p&gt;

&lt;p&gt;Here&apos;s example schema&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;User:
  columns:
    username: { type: string(255) }
  relations:
    Operators:
      foreignAlias: Users
      class:        Operator
      refClass:     OperatorUser

Operator:
  columns:
    username: { type: string(255) }
    type:     { type: integer }


OperatorUser:
  columns:
    user_id:      { type: integer }
    operator_id:  { type: integer }
  relations:
    Operator:
      foreignAlias: OperatorUser
    User:
      foreignAlias: OperatorUser
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here&apos;s query which generates wrong SQL&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;Doctrine_Core::getTable(&apos;User&apos;)
  -&amp;gt;createQuery(&apos;User&apos;)
  -&amp;gt;leftJoin(&apos;User.Operators Operator&apos;)
  -&amp;gt;addWhere(&apos;Operator.type = ?&apos;, 1)
  -&amp;gt;limit(10)
  -&amp;gt;offset(0)
  -&amp;gt;execute()
;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected SQL generated:&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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; u.id AS u__id, u.username AS u__username, o.id AS o__id, o.username AS o__username, o.type AS o__type
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; user u
LEFT JOIN operator_user o2  ON (u.id = o2.user_id)
LEFT JOIN operator o        ON o.id = o2.operator_id
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; (o.type = &apos;1&apos;)
LIMIT 10
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Actual SQL generated:&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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; u.id AS u__id, u.username AS u__username, o.id AS o__id, o.username AS o__username, o.type AS o__type
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; user u
LEFT JOIN operator_user o2  ON (u.id = o2.user_id)
LEFT JOIN operator o        ON o.id = o2.operator_id
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt;
  u.id IS NULL # is not expected
  AND (o.type = &apos;1&apos;)
# there&apos;s no LIMIT clause
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Seems like here&apos;s code which causes the bug &lt;a href=&quot;https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Query.php#L1307&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Query.php#L1307&lt;/a&gt;&lt;/p&gt;</description>
                <environment>mysql</environment>
            <key id="13229">DC-1041</key>
            <summary>Using -&gt;limit() in conjunction with many-to-many with mysql generates wrong SQL</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="smileua">Evgeniy Afonichev</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Nov 2011 09:26:19 +0000</created>
                <updated>Wed, 30 Nov 2011 09:51:21 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-934] One-to-one relationship with cascading deletion and softdelete creates empty records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-934</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using softdelete behaviour with cascading deletion on a one-to-one relationship, Doctrine will create a &apos;child&apos; record if it doesn&apos;t exist already, during the cascading deletion.  Eg:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Models Foo, Bar, both SoftDelete&lt;/li&gt;
	&lt;li&gt;Foo hasOne Bar&lt;/li&gt;
	&lt;li&gt;$myFoo-&amp;gt;delete()&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Result is:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;$myFoo-&amp;gt;deleted_at is set correctly as expected&lt;/li&gt;
	&lt;li&gt;New Bar record is created &amp;amp; saved in the process (but is not set to deleted)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Is this expected behaviour? I&apos;ve attached a test case script, tested against export from SVN of Doctrine 1.2.3 that demonstrates this.&lt;/p&gt;</description>
                <environment>Ubuntu 10.10, PHP 5.3.3</environment>
            <key id="12131">DC-934</key>
            <summary>One-to-one relationship with cascading deletion and softdelete creates empty records</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="richsage">Rich Sage</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Nov 2010 11:46:56 +0000</created>
                <updated>Tue, 29 Nov 2011 13:48:49 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16927" author="marltu" created="Tue, 29 Nov 2011 13:48:49 +0000"  >&lt;p&gt;I can confirm this issue on Ubuntu 11.10 PHP 5.3.6-13ubuntu3.2 &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10872" name="testcase.php" size="2233" author="richsage" created="Sun, 21 Nov 2010 11:46:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1040] allow queries with table joins across different databases</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1040</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m currently working on a project which relies upon several databases declared in databases.yml in symfony 1.4.8.&lt;/p&gt;

&lt;p&gt;I was facing an issue that has already been raised by other people, namely that you can&apos;t join tables which reference each other among different mysql databases.&lt;/p&gt;

&lt;p&gt;I&apos;ve dug a bit in the Doctrine_Query class and came to a solution that is acceptable for us, and allows now to make joins accross databases. Description follows :&lt;/p&gt;

&lt;p&gt;first change is in the Doctrine_Core class, that gets stuffed with a new constant :&lt;br/&gt;
const ATTR_DATABASE_NAME                = 0x1DB;&lt;/p&gt;

&lt;p&gt;this constant allows us to add a new attribute to the databases.yml file as in :&lt;br/&gt;
  gesdoc:&lt;br/&gt;
    class: sfDoctrineDatabase&lt;br/&gt;
    param:&lt;br/&gt;
      dsn:      mysql:host=127.0.0.1;dbname=gesdoc&lt;br/&gt;
      username: root&lt;br/&gt;
      password: &lt;br/&gt;
      attributes:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;************* NEW ATTRIBUTE BELOW ************&lt;br/&gt;
        database_name: gesdoc&lt;br/&gt;
        default_table_collate: utf8_general_ci&lt;br/&gt;
        default_table_charset: utf8&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;after that, a few changes have been done in the Doctrine_Query class which is attached to this issue for the sake of readability.&lt;/p&gt;

&lt;p&gt;This may not be optimal, and probably need some regression testing, but it is currently working fine on our test server.&lt;/p&gt;

&lt;p&gt;after this is done, I was able to issue queries like the following :&lt;br/&gt;
    $x = DocumentTable::getInstance()-&amp;gt;createQuery(&apos;d&apos;)&lt;br/&gt;
                                     -&amp;gt;distinct()&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;d.Travail t&apos;)&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;t.CdcIndInt ci&apos;)&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;ci.CdcIndExt ce&apos;)&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;ce.Cahierdescharge cdc&apos;)&lt;br/&gt;
                                     -&amp;gt;where(&apos;cdc.cdc_chro = ?&apos;, $cdc_chro)&lt;br/&gt;
                                    -&amp;gt;addWhere(&apos;d.id != ?&apos;, $document_id)&lt;br/&gt;
                                    -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;where the referenced tables are in different databases. The necessary object binding has been done in every model class following the paradigm :&lt;/p&gt;

&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;CdcIndInt &apos;, &apos;gescdc&apos;);&lt;br/&gt;
abstract class BaseCdcIndInt extends sfDoctrineRecord&lt;br/&gt;
{&lt;br/&gt;
...&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;I don&apos;t know if this description is clear enough, so let me know if something is missing/wrong.&lt;/p&gt;</description>
                <environment>Windows XP SP3, Apache 2, PHP 5.3, MySQL 5.1.36, Symfony 1.4.8, Doctrine 1.2.3</environment>
            <key id="13198">DC-1040</key>
            <summary>allow queries with table joins across different databases</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="fabrice.agnello">Fabrice Agnello</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Nov 2011 14:42:03 +0000</created>
                <updated>Thu, 17 Nov 2011 14:42:03 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11111" name="Query.php" size="86043" author="fabrice.agnello" created="Thu, 17 Nov 2011 14:42:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-914] Doctrine_Pager ignores custom COUNT query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-914</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>
&lt;p&gt;I found some problem when I tried to define custom query for results counting. Defined custom COUNT query is totally ignored and executed default one. I will give you full description of problem bellow.&lt;/p&gt;

&lt;p&gt;We have following source code:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$q_select = Doctrine_Query::create ()
-&amp;gt;select ( &apos;DISTINCT p.product_name AS product_name&apos; )
-&amp;gt;from ( &apos;Product p&apos; )
-&amp;gt;where( &apos;p.product_name LIKE ?&apos;, &apos;%motorola%&apos;);
				
$q_count = Doctrine_Query::create ()
-&amp;gt;select ( &apos;COUNT (DISTINCT p.product_name) num_results&apos; )
-&amp;gt;from ( &apos;Product p&apos; )
-&amp;gt;where( &apos;p.product_name LIKE ?&apos;, &apos;%motorola%&apos;);
												
$pager = new Doctrine_Pager( $q_select, 1, 25 );										
$pager-&amp;gt;setCountQuery($q_count);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Let&apos;s check custom query before calling $pager-&amp;gt;execute() method:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
echo $pager-&amp;gt;getCountQuery(); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Output:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
SELECT COUNT (DISTINCT p.product_name) num_results FROM Product p WHERE p.product_name LIKE ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Looks like until now is everything is correct.  Let&apos;s call $pager-&amp;gt;execute() method:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$products = $pager-&amp;gt;execute(); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Let&apos;s check executed queries using Symfony SQL queries log panel:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT COUNT(*) AS num_results FROM product p WHERE p.product_name LIKE &apos;%motorola%&apos;
7.27s, &quot;doctrine&quot; connection

SELECT DISTINCT p.product_name AS p__0 FROM product p WHERE (p.product_name LIKE &apos;%motorola%&apos;) LIMIT 25
3.25s, &quot;doctrine&quot; connection
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Executed COUNT query is not same we set using $pager-&amp;gt;setCountQuery($q_count). Our defined custom COUNT query is totally ignored and executed default one:&lt;/p&gt;

&lt;p&gt;INSTEAD OF THIS  CUSTOM COUNT  QUERY:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT COUNT (DISTINCT p.product_name) num_results FROM Product p WHERE p.product_name LIKE &apos;%motorola%&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;EXECUTED DEFAULT COUNT QUERY:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT COUNT(*) AS num_results FROM product p WHERE p.product_name LIKE &apos;%motorola%&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Zend Server CE</environment>
            <key id="12058">DC-914</key>
            <summary>Doctrine_Pager ignores custom COUNT query</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="arnlukas">Arnoldas Lukasevicius</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Nov 2010 06:23:30 +0000</created>
                <updated>Mon, 7 Nov 2011 22:54:46 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16774" author="blueskypoa" created="Mon, 7 Nov 2011 22:54:46 +0000"  >&lt;p&gt;I found a possible solution to the problem.&lt;/p&gt;

&lt;p&gt;That occurs not because the Pager countQuery but in a method used inside the Query class.&lt;/p&gt;

&lt;p&gt;When you set the Query or CountQuery for Pager and execute it, it calls a Query method called count(). This method by yourself call another Query class method named Query::getCountSqlQuery().&lt;/p&gt;

&lt;p&gt;This method rather than simply execute the query that you passed earlier, simply create a new query.&lt;/p&gt;

&lt;p&gt;Below is a possible solution to the problem:&lt;/p&gt;

&lt;p&gt;Query.php (Doctrine Stable 1.2.4)&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;
--- Query.php	2011-11-07 20:52:48.000000000 -0200
+++ Query.php	2011-11-07 20:51:58.000000000 -0200
@@ -2049,40 +2049,7 @@
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (count($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_queryComponents) == 1 &amp;amp;&amp;amp; empty($having)) {
             $q .= $from . $where . $groupby . $having;
         } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
-
-            &lt;span class=&quot;code-comment&quot;&gt;// Subselect fields will contain only the pk of root entity
&lt;/span&gt;-            $ta = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteIdentifier($tableAlias);
-
-            $map = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRootDeclaration();
-            $idColumnNames = $map[&apos;table&apos;]-&amp;gt;getIdentifierColumnNames();
-
-            $pkFields = $ta . &apos;.&apos; . implode(&apos;, &apos; . $ta . &apos;.&apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteMultipleIdentifier($idColumnNames));
-
-            &lt;span class=&quot;code-comment&quot;&gt;// We need to &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; some magic in select fields &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the query contain anything in having clause
&lt;/span&gt;-            $selectFields = $pkFields;
-
-            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($having)) {
-                &lt;span class=&quot;code-comment&quot;&gt;// For each field defined in select clause
&lt;/span&gt;-                foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;select&apos;] as $field) {
-                    &lt;span class=&quot;code-comment&quot;&gt;// We only include aggregate expressions to count query
&lt;/span&gt;-                    &lt;span class=&quot;code-comment&quot;&gt;// This is needed because HAVING clause will use field aliases
&lt;/span&gt;-                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strpos($field, &apos;(&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
-                        $selectFields .= &apos;, &apos; . $field;
-                    }
-                }
-                &lt;span class=&quot;code-comment&quot;&gt;// Add having fields that got stripped out of select
&lt;/span&gt;-                preg_match_all(&apos;/`[a-z0-9_]+`\.`[a-z0-9_]+`/i&apos;, $having, $matches, PREG_PATTERN_ORDER);
-                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (count($matches[0]) &amp;gt; 0) {
-                    $selectFields .= &apos;, &apos; . implode(&apos;, &apos;, array_unique($matches[0]));
-                }
-            }
-
-            &lt;span class=&quot;code-comment&quot;&gt;// If we &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; not have a custom group by, apply the &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; one
&lt;/span&gt;-            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (empty($groupby)) {
-                $groupby = &apos; GROUP BY &apos; . $pkFields;
-            }
-
-            $q .= &apos;(SELECT &apos; . $selectFields . &apos; FROM &apos; . $from . $where . $groupby . $having . &apos;) &apos;
+            $q .= &apos;( &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getSqlQuery().&apos; ) &apos;
                 . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteIdentifier(&apos;dctrn_count_query&apos;);
         }
         &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $q;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1039] Return value of function Doctrine_Tree_NestedSet::fetchRoot($id)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1039</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In api documentation about Doctrine_Tree_NestedSet::fetchRoot($id) said - it return void. But this is not true. This function return mixed - bool or model data.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13134">DC-1039</key>
            <summary>Return value of function Doctrine_Tree_NestedSet::fetchRoot($id)</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="dartanov">Dmitry Artanov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Oct 2011 07:22:13 +0000</created>
                <updated>Mon, 31 Oct 2011 07:22:13 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-992] I18n - Translated fields are not deleted when record in master table is deleted</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-992</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have used I18n behavior for my application using the following:&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 setTableDefinition()
{
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;products&apos;);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 4, 
            array(&apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 
                  &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 
                  &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;permalink&apos;, &apos;string&apos;, 255,
            array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;title&apos;, &apos;string&apos;, 255, 
            array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
            
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;teaser&apos;, &apos;string&apos;, 255, 
            array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
            
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;content&apos;, &apos;clob&apos;, 32767);
}

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
{   
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;I18n&apos;, array(
                &apos;fields&apos; =&amp;gt; array(&apos;title&apos;, &apos;teaser&apos;, &apos;content&apos;)
            )
        );
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine has created two tables db named products and products_translation.&lt;/p&gt;

&lt;p&gt;Insert and update of the record is working fine but when i perform a deletion of a record, the record is deleted from the products table but the translations stored in products translation table are not deleted.&lt;/p&gt;</description>
                <environment>Windows XP, xampp 1.7.3 (PHP 5.3.1)</environment>
            <key id="12525">DC-992</key>
            <summary>I18n - Translated fields are not deleted when record in master table is deleted</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tfotis">Thanasis Fotis</reporter>
                        <labels>
                    </labels>
                <created>Sun, 3 Apr 2011 07:28:13 +0000</created>
                <updated>Fri, 28 Oct 2011 05:42:02 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16707" author="gamesh" created="Fri, 28 Oct 2011 05:42:02 +0000"  >&lt;p&gt;if you are not using transaction type tables like innoDB you need to set &apos;appLevelDelete&apos; =&amp;gt; TRUE option for I18n&lt;br/&gt;
it&apos;s not documented feature as i found out.&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;actAs(&apos;I18n&apos;, array(&lt;br/&gt;
                &apos;fields&apos; =&amp;gt; array(&apos;title&apos;, &apos;teaser&apos;, &apos;content&apos;),&lt;br/&gt;
               &apos;appLevelDelete&apos; =&amp;gt; TRUE,&lt;br/&gt;
            )&lt;br/&gt;
        );&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-727] ReOpen DC-46 - Unexpected behavior with whereIn() and empty array</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-727</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I reopen the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-46&quot; title=&quot;Unexpected behavior with whereIn() and empty array&quot;&gt;&lt;del&gt;DC-46&lt;/del&gt;&lt;/a&gt; as it&apos;seems not fix at all. &lt;br/&gt;
When I do a whereIn with empty array, the condition is just drop and I get no Exception.&lt;/p&gt;

&lt;p&gt;Here is a simple 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;require_once(&apos;doctrine/lib/Doctrine.php&apos;);
spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));
$manager = Doctrine_Manager::getInstance();
$manager-&amp;gt;setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);
$conn = Doctrine_Manager::connection(&apos;mysql:&lt;span class=&quot;code-comment&quot;&gt;//root:root@localhost/test_doctrine&apos;);
&lt;/span&gt;echo &lt;span class=&quot;code-quote&quot;&gt;&quot;Connection is set up\n&quot;&lt;/span&gt;;

class Record &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record {
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition(){
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;record&apos;);
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// Create the db
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {Doctrine::dropDatabases();}&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(Exception $e){} &lt;span class=&quot;code-comment&quot;&gt;// Drop &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; exist :-)
&lt;/span&gt;Doctrine::createDatabases();Doctrine::createTablesFromArray(array(&apos;Record&apos;));

&lt;span class=&quot;code-comment&quot;&gt;// Test
&lt;/span&gt;echo Doctrine::getTable(&apos;Record&apos;)-&amp;gt;createQuery()-&amp;gt;select(&apos;id&apos;)-&amp;gt;whereIn(&apos;id&apos;, array())-&amp;gt;getSqlQuery() , &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
echo Doctrine::getTable(&apos;Record&apos;)-&amp;gt;createQuery()-&amp;gt;select(&apos;id&apos;)-&amp;gt;whereIn(&apos;id&apos;, array())-&amp;gt;fetchArray() , &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;

&lt;span class=&quot;code-comment&quot;&gt;// Result is:
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// SELECT r.id AS r__id FROM record r
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// Array&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22) &lt;br/&gt;
mysql Ver 14.14 Distrib 5.1.41, for apple-darwin9.5.0 (i386) using readline 5.1 &lt;br/&gt;
Doctrine version 1.2.2 from SVN: &lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/tags/1.2.2/lib/Doctrine.php&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/tags/1.2.2/lib/Doctrine.php&lt;/a&gt;</environment>
            <key id="11473">DC-727</key>
            <summary>ReOpen DC-46 - Unexpected behavior with whereIn() and empty array</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeanmonod">David Jeanmonod</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jun 2010 02:45:58 +0000</created>
                <updated>Wed, 12 Oct 2011 10:45:42 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="13334" author="gx" created="Wed, 16 Jun 2010 07:41:36 +0000"  >&lt;p&gt;The problem is that the change for &quot;new&quot; behavior (throw exception instead of return unchanged query) was only done in _&lt;em&gt;processWhereIn()&lt;/em&gt; but not cascaded to &lt;em&gt;andWhereIn()&lt;/em&gt; and &lt;em&gt;orWhereIn()&lt;/em&gt; (another example we should avoid code duplication).&lt;br/&gt;
The patch is simple, &lt;b&gt;but&lt;/b&gt; it causes &lt;em&gt;Doctrine_Ticket_1558_TestCase&lt;/em&gt; to fail. Indeed that (old) test expects the &quot;old&quot; behavior (return unchanged query, don&apos;t throw exception)... So the 2 fixes are incompatible, you&apos;ll have to choose :/&lt;/p&gt;

&lt;p&gt;I still attach a new test case and 2 versions of a patch (the first one just applies changes of _processWhereIn also to the 2 other functions but adds more duplicate code, the second is a little refactored and seems better to me).&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;</comment>
                    <comment id="13335" author="gx" created="Wed, 16 Jun 2010 07:51:37 +0000"  >&lt;p&gt;added a more specific test case (expects Doctrine_Query_Exception instead of simple Exception)&lt;/p&gt;</comment>
                    <comment id="14799" author="dracoblue" created="Mon, 22 Nov 2010 05:36:33 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;the issue is still present in 1.2.3. Are there any plans to apply it?&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;/p&gt;</comment>
                    <comment id="16575" author="jimpersson" created="Wed, 12 Oct 2011 10:45:42 +0000"  >&lt;p&gt;I would like to add that this also applies to delete-queries which can cause serious data loss.&lt;br/&gt;
We had a case where a table of serialized data was completely emptied which caused a database cascade that deleted quite a lot of data.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10659" name="DC-727_refactored.patch" size="2116" author="gx" created="Wed, 16 Jun 2010 07:42:29 +0000" />
                    <attachment id="10658" name="DC-727_with_duplicates.patch" size="1879" author="gx" created="Wed, 16 Jun 2010 07:42:29 +0000" />
                    <attachment id="10657" name="DC727TestCase.php" size="1321" author="gx" created="Wed, 16 Jun 2010 07:42:29 +0000" />
                    <attachment id="10660" name="DC727TestCase_more_specific.php" size="1459" author="gx" created="Wed, 16 Jun 2010 07:51:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1038] Missing Foreign Key Constraint in SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1038</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have the problem, that a foreign key constraint is not created in the SQL schema. This occurs, when the primary key is not the column &apos;id&apos;. &lt;/p&gt;

&lt;p&gt;Here is an example:&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
    columns:&lt;br/&gt;
        username:&lt;br/&gt;
            type: string(30)&lt;br/&gt;
            notnull: false&lt;br/&gt;
        email:&lt;br/&gt;
            type: string(80)&lt;br/&gt;
            notnull: true&lt;br/&gt;
        gender:&lt;br/&gt;
            type: enum&lt;br/&gt;
            values: &lt;span class=&quot;error&quot;&gt;&amp;#91;0,m,f&amp;#93;&lt;/span&gt;&lt;br/&gt;
            notblank: true&lt;br/&gt;
            notnull: true&lt;br/&gt;
        birthday:&lt;br/&gt;
            type: date&lt;/p&gt;

&lt;p&gt;Address:&lt;br/&gt;
    columns:&lt;br/&gt;
        user_id:&lt;br/&gt;
            type: integer(4)&lt;br/&gt;
            unsigned: 1&lt;br/&gt;
            notnull: true&lt;br/&gt;
            primary: true&lt;br/&gt;
        some_data:&lt;br/&gt;
            type: string(100)&lt;br/&gt;
    relations:&lt;br/&gt;
        User:&lt;br/&gt;
            local: user_id&lt;br/&gt;
            foreign: id&lt;br/&gt;
            foreignType: one&lt;/p&gt;

&lt;p&gt;The foreign key from contacts to users is not created in der SQL schema. But if I delete the attribute &apos;primary&apos; at the column &apos;user_id&apos; (and a primary key &apos;id&apos; will generated), everything is okay.&lt;/p&gt;

&lt;p&gt;Can you help me please?&lt;/p&gt;

&lt;p&gt;With kind regards&lt;br/&gt;
Stephan&lt;/p&gt;</description>
                <environment></environment>
            <key id="13041">DC-1038</key>
            <summary>Missing Foreign Key Constraint in SQL</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kiefer">Stephan</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Sep 2011 20:33:25 +0000</created>
                <updated>Sat, 24 Sep 2011 20:33:25 +0000</updated>
                                    <version>1.2.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-880] Versionable + I18n creates additional migration with irrelevant data</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-880</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;First run of generate-migrations-diff and migrate creates 2 migration diff files. First one for new tables, second one for new indexes and foreign keys. Than if I run generate-migrations-diff again another version is created although nothing was changed and following is inside:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;1st entry tries to drop a foreign key never been created and not existing in file&lt;/li&gt;
	&lt;li&gt;next entry tries to create a foreign key already existing&lt;/li&gt;
	&lt;li&gt;3rd entry tries to create an existing index&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;After a long try and errorI found out that it&apos;s only happening with I18n plus Versionable behavior.&lt;/p&gt;

&lt;p&gt;As I already have spent much time for a report please have also a look at: &lt;a href=&quot;http://forum.diem-project.org/viewtopic.php?f=2&amp;amp;t=173&amp;amp;sid=5e0e3349c0e15a169bc9990a3104b3f6#p465&quot; class=&quot;external-link&quot;&gt;http://forum.diem-project.org/viewtopic.php?f=2&amp;amp;t=173&amp;amp;sid=5e0e3349c0e15a169bc9990a3104b3f6#p465&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I&apos;m quite new to Doctrine and Symfony systems I cannot get further, but willing for more investigation if just one could give me a hint where to start.&lt;/p&gt;</description>
                <environment>PHP 5.2, Symfony 1.4, Diem 5.1, Doctrine 1.2.2</environment>
            <key id="11982">DC-880</key>
            <summary>Versionable + I18n creates additional migration with irrelevant data</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sanshao">Thomas</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Oct 2010 14:37:39 +0000</created>
                <updated>Mon, 19 Sep 2011 08:20:21 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Behaviors</component>
                <component>I18n</component>
                <component>Migrations</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14551" author="andrewcoulton" created="Sun, 10 Oct 2010 20:50:17 +0000"  >&lt;p&gt;I think this is because the versionable behaviour doesn&apos;t define a table name in the Doctrine_Template_Versionable class. As a result, if using model prefixes, the prefixes are not discarded from the table names when the behaviour model classes are built. This means that the tables have different names to what is expected, so they have different index keys, so the indexes are dropped and recreated as part of the migration.&lt;/p&gt;

&lt;p&gt;I have committed unit tests and patch for this issue (which applies to Searchable also) to &lt;a href=&quot;http://github.com/acoulton/doctrine1/tree/DC-880&quot; class=&quot;external-link&quot;&gt;http://github.com/acoulton/doctrine1/tree/DC-880&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16492" author="xdade" created="Mon, 19 Sep 2011 08:19:31 +0000"  >&lt;p&gt;I experienced the same problem in the latest version 1.2.4, and the patch proposed by Andrew Coulton solves the problem.&lt;br/&gt;
Why the fix is not included in official release?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-875] One-to-many relationship returns Doctrine_Record instead of Doctrine_Collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-875</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve run into a bit of a snag in my application where a relationship defined as a one-to-many relationship returns a model object (instance of Doctrine_Record) instead of a Doctrine_Collection when I try to access it as $model-&amp;gt;RelatedComponent[] = $child1. This, of course, yields an exception like so:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Doctrine_Exception: Add is not supported for AuditLogProperty&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#0 path\library\Doctrine\Access.php(131): Doctrine_Access-&amp;gt;add(Object(AuditLogProperty))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#1 path\application\models\Article.php(58): Doctrine_Access-&amp;gt;offsetSet(NULL, Object(AuditLogProperty))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#2 path\library\Doctrine\Record.php(354): Article-&amp;gt;postInsert(Object(Doctrine_Event))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#3 path\library\Doctrine\Connection\UnitOfWork.php(576): Doctrine_Record-&amp;gt;invokeSaveHooks(&apos;post&apos;, &apos;insert&apos;, Object(Doctrine_Event))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#4 path\library\Doctrine\Connection\UnitOfWork.php(81): Doctrine_Connection_UnitOfWork-&amp;gt;insert(Object(Article))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#5 path\library\Doctrine\Record.php(1718): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(Article))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#6 path\application\modules\my-page\controllers\ArticleController.php(26): Doctrine_Record-&amp;gt;save()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#7 path\library\Zend\Controller\Action.php(513): MyPage_ArticleController-&amp;gt;createAction()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#8 path\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action-&amp;gt;dispatch(&apos;createAction&apos;)&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#9 path\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(Zend_Controller_Request_Http),&lt;/tt&gt; &lt;tt&gt;Object(Zend_Controller_Response_Http))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#10 path\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front-&amp;gt;dispatch()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#11 path\library\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#12 path\public\index.php(11): Zend_Application-&amp;gt;run()&lt;/tt&gt;&lt;br/&gt;
    {{#13 &lt;/p&gt;
{main}
&lt;p&gt;}}&lt;/p&gt;

&lt;p&gt;This is what my yaml-schema looks like (excerpt):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;AuditLogEntry:
  tableName: audit_log_entries
  actAs:
    Timestampable:
      updated: {disabled: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
  columns:
    user_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    type: {type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    mode: {type: string(16)}
    article_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    comment_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    question_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    answer_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    message_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
  indexes:
#   Must index autoincrementing id-column since it&apos;s a compound primary key and 
#   the auto-incrementing column is not the first column and we use InnoDB.
    id: {fields: [id]}
    type: {fields: [type, mode]}
  relations:
    User:
      local: user_id
      foreign: user_id
      foreignAlias: AuditLogs
      type: one
      onDelete: CASCADE
      onUpdate: CASCADE
AuditLogProperty:
  tableName: audit_log_properties
  columns:
    auditlog_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    prop_id: {type: integer(2), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: 1}
    name: {type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    value: {type: string(1024)}
  relations:
    AuditLogEntry:
      local: auditlog_id
      foreign: id
      type: one
      foreignType: many
      foreignAlias: Properties
      onDelete: CASCADE
      onUpdate: CASCADE
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, if we look at the generated class-files, it looks fine:&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;/**
 * @property integer $user_id
 * @property integer $id
 * @property string $type
 * @property string $mode
 * @property integer $article_id
 * @property integer $comment_id
 * @property integer $question_id
 * @property integer $answer_id
 * @property integer $message_id
 * @property integer $news_comment_id
 * @property User $User
 * @property Doctrine_Collection $Properties
 * @property Doctrine_Collection $Notifications
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseAuditLogEntry &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record

/**
 * @property integer $auditlog_id
 * @property integer $prop_id
 * @property string $name
 * @property string $value
 * @property AuditLogEntry $AuditLogEntry
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseAuditLogProperty &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, when I later try to add properties I get the exception posted in the beginning of the question:&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;$auditLog = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AuditLogEntry();
$prop1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AuditLogProperty();
$prop1-&amp;gt;name = &apos;title&apos;;
$prop1-&amp;gt;value = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;Content-&amp;gt;title;
$prop2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AuditLogProperty();
$prop2-&amp;gt;name = &apos;length&apos;;
$prop2-&amp;gt;value = count($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;Content-&amp;gt;plainText);
$auditLog-&amp;gt;Properties[] = $prop1;
$auditLog-&amp;gt;Properties[] = $prop2;
$auditLog-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If I do the following:&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;var_dump(get_class($auditLog-&amp;gt;Properties));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I get that &lt;em&gt;Properties&lt;/em&gt; is of type &lt;em&gt;AuditLogProperty&lt;/em&gt;, instead of &lt;em&gt;Doctrine&amp;#95;Collection&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I use version 1.2.3 of Doctrine.&lt;/p&gt;</description>
                <environment>WAMP:&lt;br/&gt;
Windows 7 - 64bit&lt;br/&gt;
Apache 2.2&lt;br/&gt;
PHP 5.3.1&lt;br/&gt;
MySQL 5.1.41</environment>
            <key id="11965">DC-875</key>
            <summary>One-to-many relationship returns Doctrine_Record instead of Doctrine_Collection</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="patrik.akerstrand">Patrik &#197;kerstrand</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 08:22:37 +0000</created>
                <updated>Wed, 14 Sep 2011 23:01:49 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16476" author="twencl" created="Wed, 14 Sep 2011 23:01:49 +0000"  >&lt;p&gt;I am having the same issue and it is killing my application. Using your example, when I call:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;var_dump(get_class($auditLog-&amp;gt;Properties));&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;... and there are no AuditLogProperty records, I would expect either an empty Doctrine_Collection or null, but instead I get a new instance of AuditLogProperty with null values for the properties. &lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1037] Migration does not quote identifiers when checking migration version</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1037</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I happen to be using Symfony 1.4.14-DEV (r33007) and am trying to setup migrations with Oracle, which is using &lt;tt&gt;Doctrine_Core::ATTR_QUOTE_IDENTIFIER&lt;/tt&gt;. This issue is in core Doctrine.&lt;/p&gt;

&lt;p&gt;To reproduce:&lt;/p&gt;

&lt;p&gt;1. Make a change to your schema.yml&lt;br/&gt;
2. Create the migrations diff by executing &lt;tt&gt;php symfony doctrine:generate-migrations-diff&lt;/tt&gt;&lt;br/&gt;
3. New file have been created at ./lib/migration/doctrine/*_version1.php&lt;br/&gt;
4. Try to migrate using command &lt;tt&gt;php symfony doctrine:migrate&lt;/tt&gt;&lt;br/&gt;
5. Results in error:&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;ORA-00942: table or view does not exist : SELECT version FROM migration_version. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT version FROM migration_version&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cause: The current connection is using quoted identifiers, so the query used to create the &lt;tt&gt;migration_version&lt;/tt&gt; table when migrations are first instantiated was properly created as &lt;tt&gt;&quot;migration_version&quot;&lt;/tt&gt; (notice quotes). But the raw SQL query used in &lt;tt&gt;Doctrine_Migration::getCurrentVersion()&lt;/tt&gt; is not quoting the table or column identifiers, so Oracle can&apos;t find the table.&lt;/p&gt;

&lt;p&gt;There are several places in &lt;tt&gt;Doctrine_Migration&lt;/tt&gt; where the table and column identifiers are not quoted, thus breaking migrations when using a database with strict rules on the case of identifiers.&lt;/p&gt;

&lt;p&gt;Even though I&apos;m developing against Oracle, this also likely affects other drivers.&lt;/p&gt;</description>
                <environment>Linux version 2.4.21-63.ELsmp (&lt;a href=&apos;mailto:mockbuild@x86-005.build.bos.redhat.com&apos;&gt;mockbuild@x86-005.build.bos.redhat.com&lt;/a&gt;) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59)) #1 SMP Wed Oct 28 23:15:46 EDT 2009, Symfony 1.4.14-DEV, Oracle 11g</environment>
            <key id="13003">DC-1037</key>
            <summary>Migration does not quote identifiers when checking migration version</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="johnkary">John Kary</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Sep 2011 19:34:51 +0000</created>
                <updated>Wed, 7 Sep 2011 20:13:23 +0000</updated>
                                    <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16451" author="johnkary" created="Wed, 7 Sep 2011 20:13:23 +0000"  >&lt;p&gt;Pull request open which quotes all identifiers in Doctrine_Migration and fixes this issue:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/pull/41&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/pull/41&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-929] createIndexSql and dropIndexSql don&apos;t use the same logic to get the index name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-929</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the class Doctrine_Export the functions for creating and dropping indexes do not use the same logic to get the name of the index to be created or dropped.&lt;br/&gt;
When creating an index $this-&amp;gt;conn-&amp;gt;quoteIdentifier() is called on the index name. &lt;br/&gt;
When dropping an index $this-&amp;gt;conn-&amp;gt;quoteIdentifier($this-&amp;gt;conn-&amp;gt;formatter-&amp;gt;getIndexName()) is called on the name, which by default adds &apos;_idx&apos; to the index name. Hence, when an index should be dropped in a migration an index with that name is not found because it was created without the &apos;_idx&apos;.&lt;/p&gt;</description>
                <environment>Postgresql 8.4, Symfony 1.4, Doctrine 1.2</environment>
            <key id="12111">DC-929</key>
            <summary>createIndexSql and dropIndexSql don&apos;t use the same logic to get the index name</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lea">Lea Haensenberger</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 07:57:07 +0000</created>
                <updated>Wed, 7 Sep 2011 19:04:23 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14754" author="lsmith" created="Tue, 16 Nov 2010 08:04:21 +0000"  >&lt;p&gt;looks to me like this is a bug in index creation. then again fixing the bug will lead to potential BC issues. that being said, anyone affected could &quot;simply&quot; set the index format to empty. also &quot;fixing&quot; the names to the proper format does not require shuffeling around data. so imho the right fix would be to apply the drop naming logic in the create logic.&lt;/p&gt;

&lt;p&gt;what surprises me is that the main reason for appending _idx by default was that many RDBMS will otherwise break because they do not separate identifiers between constraints and indexes etc and therefore people run into collisions without the postfix.&lt;/p&gt;</comment>
                    <comment id="16450" author="johnkary" created="Wed, 7 Sep 2011 19:04:23 +0000"  >&lt;p&gt;Related/Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-830&quot; title=&quot;Migration for up() not adding suffix for index&quot;&gt;DC-830&lt;/a&gt; and &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-867&quot; title=&quot;Doctrine::ATTR_IDXNAME_FORMAT and Doctrine::ATTR_FKNAME_FORMAT are inconsistently applied during migrations&quot;&gt;DC-867&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-915] The PHP code is invalid in the &quot;Create Table&quot; example; there are missing commas in the array definition.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-915</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/migrations/en#writing-migration-classes:available-operations:create-table&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/migrations/en#writing-migration-classes:available-operations:create-table&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The PHP code is invalid in the &quot;Create Table&quot; example; there are missing commas in the array definition.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12060">DC-915</key>
            <summary>The PHP code is invalid in the &quot;Create Table&quot; example; there are missing commas in the array definition.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="mattalexx">Matt Alexander</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Nov 2010 14:37:03 +0000</created>
                <updated>Wed, 7 Sep 2011 18:58:56 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16449" author="johnkary" created="Wed, 7 Sep 2011 18:58:56 +0000"  >&lt;p&gt;Submitted pull request with fixes:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1-documentation/pull/1&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1-documentation/pull/1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10842" name="2010-11-02_123641.png" size="13713" author="mattalexx" created="Tue, 2 Nov 2010 14:37:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-867] Doctrine::ATTR_IDXNAME_FORMAT and Doctrine::ATTR_FKNAME_FORMAT are inconsistently applied during migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-867</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Given the following code:&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 up()
    {
        $idx = array(
            &apos;fields&apos; =&amp;gt; array(&apos;profile_id&apos;)
        );

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addIndex(&apos;schedules&apos;, &apos;ix_schedules_profile_id&apos;, $idx);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function down()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;removeIndex(&apos;schedules&apos;, &apos;ix_schedules_profile_id&apos;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &quot;up&quot; function will try to create &quot;ix_schedules_profile_id&quot;, but the &quot;down&quot; function will try to remove &quot;ix_schedules_profile_id_idx&quot;. The same problem exists with foreign keys. The add/remove functions should both use the formatter, or neither should.&lt;/p&gt;</description>
                <environment>postgres 8.4</environment>
            <key id="11923">DC-867</key>
            <summary>Doctrine::ATTR_IDXNAME_FORMAT and Doctrine::ATTR_FKNAME_FORMAT are inconsistently applied during migrations</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ryeguy">Ryan Lepidi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Sep 2010 15:36:34 +0000</created>
                <updated>Wed, 7 Sep 2011 18:52:04 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16448" author="johnkary" created="Wed, 7 Sep 2011 18:52:04 +0000"  >&lt;p&gt;Appears to be duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-830&quot; title=&quot;Migration for up() not adding suffix for index&quot;&gt;DC-830&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1036] Doctrine_Export_Oracle::alterTable() not properly quoting column identifier for change</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1036</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This bug was introduced by the person reporting the bug #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-592&quot; title=&quot;PHP Fatal error:  Call to undefined method Doctrine_Connection_Oracle::getDeclaration() in  ....\Doctrine\Export\Oracle.php on line 501&quot;&gt;&lt;del&gt;DC-592&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When trying to generate an ALTER TABLE statement with &lt;tt&gt;Doctrine_Core::ATTR_QUOTE_IDENTIFIER&lt;/tt&gt; enabled, the column identifier is not quoted, and a blank identifier is instead quoted, generating the following SQL:&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;ALTER TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;mytable&quot;&lt;/span&gt; MODIFY (username &quot;&quot; VARCHAR2(200))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The proper SQL to be generated should be:&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;ALTER TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;mytable&quot;&lt;/span&gt; MODIFY (&lt;span class=&quot;code-quote&quot;&gt;&quot;username&quot;&lt;/span&gt; VARCHAR2(200))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13001">DC-1036</key>
            <summary>Doctrine_Export_Oracle::alterTable() not properly quoting column identifier for change</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="johnkary">John Kary</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Sep 2011 16:55:12 +0000</created>
                <updated>Wed, 7 Sep 2011 18:48:09 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16447" author="johnkary" created="Wed, 7 Sep 2011 18:20:45 +0000"  >&lt;p&gt;Pull request opened with failing test case and bug fix:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/pull/40&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/pull/40&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-419] Sluggable and inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-419</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve the same problem than this post : &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/3737fd293fef5fda/d86a8bc2578e4bac&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/3737fd293fef5fda/d86a8bc2578e4bac&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, I&apos;ve set  &quot;uniqueBy: &lt;span class=&quot;error&quot;&gt;&amp;#91;name, type&amp;#93;&lt;/span&gt; &quot;, and my data goes in database BUT they can have the same slug.&lt;/p&gt;

&lt;p&gt;So I can&apos;t retrieve an objects wich has equal slug with another.&lt;/p&gt;

&lt;p&gt;The column aggregation inheritance does&apos;nt take care of others slugs.&lt;/p&gt;</description>
                <environment>Symfony 1.4.1 LAMP</environment>
            <key id="10714">DC-419</key>
            <summary>Sluggable and inheritance</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pier">Pierre B</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 22:43:38 +0000</created>
                <updated>Tue, 6 Sep 2011 08:52:11 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:11:27 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11885" author="jan.misek" created="Mon, 1 Mar 2010 12:08:12 +0000"  >&lt;p&gt;First, inheritance is great feature, thanks doctrine team.&lt;/p&gt;

&lt;p&gt;But I have this problem too.  &lt;/p&gt;

&lt;p&gt;I have identified, the problem is related to class: &quot;Doctrine_Template_Listener_Sluggable&quot;, to method: getUniqueSlug($record, $slugFromFields). In mentioned method, table is retrieved from $record ($record-&amp;gt;getTable()), but record could be inherited class, so query result on the table is limited only to records of the inherited class.  But there could be already rows of other inherited classes with same slug in the database.&lt;/p&gt;

&lt;p&gt;Fast hack to solve it, works for me:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Added option variable to behaviour  &quot;table&quot;&lt;/li&gt;
	&lt;li&gt;Replaced all calls $record-&amp;gt;getTable() as Doctrine::getTable($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;)&lt;/li&gt;
&lt;/ul&gt;





</comment>
                    <comment id="11979" author="ivarne" created="Tue, 2 Mar 2010 13:49:34 +0000"  >&lt;p&gt;Thanks for the solution. I do not like the idea of patching the core framework, but it&apos;s just how we will have to deal with it. I hope someone will comment on this bugreport so that I&apos;ll be informed when the issue is fixed.&lt;/p&gt;

&lt;p&gt;The point of sluggable with column aggregation inheritance is to have a unique identifier to make a common interface for all entitis. Like /events/:slug where the presentation is dependent on the modell. &lt;br/&gt;
Ofcourse I could have set up one route for every child class, but that will make more code for configuration, whitch is a pain to maintain.&lt;/p&gt;</comment>
                    <comment id="11983" author="jwage" created="Tue, 2 Mar 2010 14:00:30 +0000"  >&lt;p&gt;Can anyone provide a patch for the change so I can see everything clearly? Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12000" author="ivarne" created="Wed, 3 Mar 2010 07:22:35 +0000"  >&lt;p&gt;Here is a simple patch implementing the changes Jan M&#237;&#353;ek proposed. (as far as I understod them)&lt;/p&gt;

&lt;p&gt;To make the solution better, it would be nice if the Behaviour somhow found out that it was a child class (without requirering me to specify the parent ) and made sure that it made a slug unique across all subclases, unless the unique by setting spesified the type column. I&apos;m realy glad I had a lot of data to import from a previous site, so that I discovered this bug. I use column aggregation inheritance to make the code for presenting different events in a different way simple. But every event sholud be accessable trough the same route mysite.com/events/:slug.&lt;/p&gt;</comment>
                    <comment id="12007" author="ivarne" created="Wed, 3 Mar 2010 12:18:00 +0000"  >&lt;p&gt;I hope this patch and test cases solves more than my problems.&lt;/p&gt;</comment>
                    <comment id="12030" author="ivarne" created="Thu, 4 Mar 2010 08:37:02 +0000"  >&lt;p&gt;Updated the patch a little, so that it does not try to instanciate an abstract class as doctrine generates them.&lt;/p&gt;

&lt;p&gt;I was walking up the inheritance tree and tried to instanciate the class right under DoctrineRecord unfortunatly in symfony there is many layers of abstract classes before you find the base class. Now the plugin walks back to the highes not abstract class&lt;/p&gt;</comment>
                    <comment id="12207" author="jwage" created="Mon, 15 Mar 2010 14:11:27 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                    <comment id="12610" author="klemens_u" created="Fri, 9 Apr 2010 08:12:36 +0000"  >&lt;p&gt;This fix breaks my system.&lt;/p&gt;

&lt;p&gt;@see: &lt;a href=&quot;http://groups.google.com/group/doctrine-dev/browse_thread/thread/8028e51d5bde27eb&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-dev/browse_thread/thread/8028e51d5bde27eb&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="12611" author="ivarne" created="Fri, 9 Apr 2010 09:19:55 +0000"  >&lt;p&gt;Hmm.. I&apos;m sory that my ugly fix to remove the &apos;where type = $type&apos; part of the query to find existing slugs that might cause a colission with the proposed slug. &lt;/p&gt;

&lt;p&gt;Does anyone have a better idea on how to ask for all slugs in the same model? I had a pretty hard time traversing the inheritance tree to find the right parent class that were not abstract. I see that something similar has been done about soft delete, so that a new record would not get the same slug as a record marked as deleted, but not removed from the databse.&lt;/p&gt;</comment>
                    <comment id="16441" author="klemens_u" created="Tue, 6 Sep 2011 08:52:11 +0000"  >&lt;p&gt;Here&apos;s an improved patch with a better algorithm to find the column aggregation inhertiance base class:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.ullright.org/browser/trunk/plugins/ullCorePlugin/patch/Sluggable.patch?rev=3067&quot; class=&quot;external-link&quot;&gt;http://trac.ullright.org/browser/trunk/plugins/ullCorePlugin/patch/Sluggable.patch?rev=3067&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This fixes my problem (see above)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10426" name="sluggable.patch" size="8915" author="ivarne" created="Thu, 4 Mar 2010 08:37:02 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1035] ORA-01791 due to bad driver name in Doctrine_Adapter_Oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1035</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When i execute this code:&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; 
$q = Doctrine_Query::create()
            -&amp;gt;from(&apos;AGENT ag&apos;)
            -&amp;gt;leftJoin(&apos;ag.CHANTIER_AGENT cag)
            -&amp;gt;orderBy(&apos;ag.nom&apos;)
            -&amp;gt;limit(10)
            -&amp;gt;execute();
$q2 = Doctrine_Query::create()
            -&amp;gt;from(&apos;AGENT ag&apos;)
            -&amp;gt;leftJoin(&apos;ag.CHANTIER_AGENT cag)
            -&amp;gt;orderBy(&apos;ag.nom&apos;)
            -&amp;gt;limit(10)
            -&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine executes :&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 a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, 
a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, 
c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent 
FROM AGENT a 
LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent 
WHERE a.ck_agent IN (
SELECT a2.ck_agent FROM ( 
SELECT DISTINCT a2.ck_agent, a2.nom FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) 
a2 WHERE ROWNUM &amp;lt;= 10) ORDER BY a.nom

SELECT a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, 
a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, 
c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent 
FROM AGENT a 
LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent 
WHERE a.ck_agent IN (
SELECT a2.ck_agent FROM ( 
SELECT DISTINCT a2.ck_agent FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) 
a2 WHERE ROWNUM &amp;lt;= 10) ORDER BY a.nom
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;This causes &quot;Oracle DB Error ORA-01791 not a SELECTed expression&quot; because the sql query don&apos;t have a2.nom in SELECT DISTINCT and it&apos;s indispensable for ORDER BY a2.nom&lt;br/&gt;
The problem is caused by the variable $attributes in Doctrine_Adapter_Oracle :&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;protected&lt;/span&gt; $attributes = array(Doctrine_Core::ATTR_DRIVER_NAME    =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;oci8&quot;&lt;/span&gt;,
                                  Doctrine_Core::ATTR_ERRMODE        =&amp;gt; Doctrine_Core::ERRMODE_SILENT);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The problem is in Query.php line 1417 : &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; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The driver name declared in Doctrine_Adapter_Oracle not in this conditional. &lt;br/&gt;
To resolve this we have to modify the declaration of $attributes in Doctrine_Adapter_Oracle to :&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;protected&lt;/span&gt; $attributes = array(Doctrine_Core::ATTR_DRIVER_NAME    =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;oracle&quot;&lt;/span&gt;,
                                  Doctrine_Core::ATTR_ERRMODE        =&amp;gt; Doctrine_Core::ERRMODE_SILENT);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;An other problem is probably located at line 1409 &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; (($driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos;) &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isOrderedByJoinedColumn()) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and 1497&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; (($driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos;) &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isOrderedByJoinedColumn()) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;if don&apos;t correct the declaration of $attributes in Doctrine_Adapter_Oracle.&lt;/p&gt;</description>
                <environment>Windows 7 64 bits, PHP 5.2.11, Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi, Symfony 1.4.13</environment>
            <key id="12988">DC-1035</key>
            <summary>ORA-01791 due to bad driver name in Doctrine_Adapter_Oracle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="jayson">Jayson LE PAPE</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Sep 2011 09:30:57 +0000</created>
                <updated>Thu, 1 Sep 2011 09:31:24 +0000</updated>
                                    <version>1.2.4</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1034] ORA-00904 in Doctrine_Connection_Oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1034</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When i execute this code:&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; 
$q = Doctrine_Query::create()
            -&amp;gt;from(&apos;AGENT ag&apos;)
            -&amp;gt;leftJoin(&apos;ag.CHANTIER_AGENT cag)
            -&amp;gt;orderBy(&apos;ag.nom&apos;)
            -&amp;gt;limit(10)
            -&amp;gt;offset(10)
            -&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine executes :&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 a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, 
c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent 
FROM AGENT a 
LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent 
WHERE a.ck_agent IN 
(SELECT b.ck_agent 
FROM ( SELECT a.*, ROWNUM AS doctrine_rownum 
FROM ( SELECT DISTINCT a2.ck_agent, a2.nom FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) 
a2 ) 
b 
WHERE doctrine_rownum BETWEEN 11 AND 20) 
ORDER BY a.nom
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The problem is in function _createLimitSubquery in Doctrine_Connection_Oracle :&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; 
                    $query= &apos;SELECT &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;b&apos;).&apos;.&apos;.$column.&apos; FROM ( &apos;.
                                 &apos;SELECT &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;a&apos;).&apos;.*, ROWNUM AS doctrine_rownum FROM ( &apos;
                                   . $query . &apos; ) &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;a&apos;) . &apos; &apos;.
                              &apos; ) &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;b&apos;) . &apos; &apos;.
                              &apos;WHERE doctrine_rownum BETWEEN &apos; . $min .  &apos; AND &apos; . $max;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Error occures, because table name is  AGENT and Doctrine give the first letter of the table name for identifier. &lt;br/&gt;
To correct this. Use more than one letter in the quoteIdentifier.&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; 
                    $query = &apos;SELECT &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;limb&apos;).&apos;.&apos;.$column.&apos; FROM ( &apos;.
                                 &apos;SELECT &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;lima&apos;).&apos;.*, ROWNUM AS doctrine_rownum FROM ( &apos;
                                   . $query . &apos; ) &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;lima&apos;) . &apos; &apos;.
                              &apos; ) &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;limb&apos;) . &apos; &apos;.
                              &apos;WHERE doctrine_rownum BETWEEN &apos; . $min .  &apos; AND &apos; . $max;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Windows 7 64 bits, PHP 5.2.11, Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi, Symfony 1.4.13&lt;br/&gt;
</environment>
            <key id="12987">DC-1034</key>
            <summary>ORA-00904 in Doctrine_Connection_Oracle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="jayson">Jayson LE PAPE</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Sep 2011 08:43:20 +0000</created>
                <updated>Thu, 1 Sep 2011 08:43:20 +0000</updated>
                                    <version>1.2.4</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-651] [PATCH] Doctrine_Record::option(&apos;orderBy&apos;, ...) of join&apos;s right side being applied to refTable in m2m relationship</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-651</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using the &lt;tt&gt;Doctrine_Record::option(&apos;orderBy&apos;, ...)&lt;/tt&gt; feature on a table definition, where that table is the target of a many-to-many join, the specified orderBy columns are applied to the relation table&apos;s alias. So for example, given the following definitions:&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;class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record {
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;uid&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;option(&apos;orderBy&apos;, &apos;uid&apos;);
  }

  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Group as groups&apos;, array(&apos;refClass&apos; =&amp;gt; &apos;UserGroup&apos;, &apos;local&apos; =&amp;gt; &apos;user_uid&apos;, &apos;foreign&apos; =&amp;gt; &apos;group_id&apos;));
  }
}

class Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record {
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;gid&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
  }

  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;User as users&apos;, array(&apos;refClass&apos; =&amp;gt; &apos;UserGroup&apos;, &apos;local&apos; =&amp;gt; &apos;group_gid&apos;, &apos;foreign&apos; =&amp;gt; &apos;user_id&apos;));
  }
}

class UserGroup &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record {
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;user_uid&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;group_gid&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
  }

  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;User as user&apos;, array(&apos;local&apos; =&amp;gt; &apos;user_uid&apos;, &apos;foreign&apos; =&amp;gt; &apos;uid&apos;));
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Group as group&apos;, array(&apos;local&apos; =&amp;gt; &apos;group_gid&apos;, &apos;foreign&apos; =&amp;gt; &apos;gid&apos;));
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the following queries:&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;$query = Doctrine_Query::create()
  -&amp;gt;select(&apos;u.*&apos;)
  -&amp;gt;from(&apos;User u&apos;)
  -&amp;gt;leftJoin(&apos;u.groups g WITH g.gid=?&apos;, 1);
echo $query-&amp;gt;getSqlQuery() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;

$query = Doctrine_Query::create()
  -&amp;gt;select(&apos;g.*&apos;)
  -&amp;gt;from(&apos;Group g&apos;)
  -&amp;gt;leftJoin(&apos;g.users u WITH u.uid=?&apos;, 1);
echo $query-&amp;gt;getSqlQuery() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;will output the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SELECT u.uid AS u__uid FROM user u LEFT JOIN user_group u2 ON (u.uid = u2.user_uid) LEFT JOIN group g ON g.gid = u2.group_id AND (g.gid = ?) ORDER BY u.uid&lt;br/&gt;
SELECT g.gid AS g__gid FROM group g LEFT JOIN user_group u2 ON (g.gid = u2.group_gid) LEFT JOIN user u ON u.uid = u2.user_id AND (u.uid = ?) ORDER BY u.uid, u2.uid&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The &lt;tt&gt;orderBy&lt;/tt&gt; &lt;tt&gt;option()&lt;/tt&gt; call is applied to the &lt;tt&gt;User&lt;/tt&gt; definition. The SQL for the first query is correct (where &lt;tt&gt;User&lt;/tt&gt; is on the left side of the join). The SQL for the second query (where &lt;tt&gt;User&lt;/tt&gt; is on the right-most side of the join), however, is obviously incorrect (&lt;tt&gt;UserGroup&lt;/tt&gt; doesn&apos;t even have a &lt;tt&gt;uid&lt;/tt&gt; column). Basically, &lt;tt&gt;User&lt;/tt&gt;&apos;s &lt;tt&gt;orderBy&lt;/tt&gt; option is being applied to both the &lt;tt&gt;User&lt;/tt&gt; table and its respective reference table, &lt;tt&gt;UserGroup&lt;/tt&gt;, when it is the target of a join.&lt;/p&gt;

&lt;p&gt;After digging through the source for a while, I believe I&apos;ve come up with a patch for this issue (which should be checked by someone more knowledgeable of Doctrine&apos;s internals). Basically, in the &lt;tt&gt;Doctrine_Query::buildSqlQuery()&lt;/tt&gt; function, a call is made to &lt;tt&gt;Doctrine_Relation::getOrderByStatement()&lt;/tt&gt; with the reference table (&lt;tt&gt;UserGroup&lt;/tt&gt;)&apos;s alias (&lt;tt&gt;u2&lt;/tt&gt;), which in turn makes a call to &lt;tt&gt;Doctrine_Table::getOrderByStatement()&lt;/tt&gt; on the referenced table (&lt;tt&gt;User&lt;/tt&gt;), filling in the &lt;tt&gt;ORDER BY&lt;/tt&gt; clause with &lt;tt&gt;User&lt;/tt&gt; columns using &lt;tt&gt;UserGroup&lt;/tt&gt;&apos;s alias. My solution was to reorder the logic so that the test for a reference class is made before the initial call to &lt;tt&gt;getOrderByStatement()&lt;/tt&gt; is made. It seems to work against my test case and the test cases in the repository. I&apos;ll post my patch momentarily.&lt;/p&gt;

&lt;p&gt;This bug was first mentioned in the comments in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-313&quot; title=&quot;Ordering m2m relationship with column from related table (with orderBy option)&quot;&gt;DC-313&lt;/a&gt;, but the original ticket comes across as more of a feature request for the &lt;tt&gt;hasMany()&lt;/tt&gt; &lt;tt&gt;orderBy&lt;/tt&gt; feature.&lt;/p&gt;</description>
                <environment>CentOS 5.4&lt;br/&gt;
PHP 5.3.2&lt;br/&gt;
MySQL 5.1.44, for unknown-linux-gnu (x86_64)</environment>
            <key id="11270">DC-651</key>
            <summary>[PATCH] Doctrine_Record::option(&apos;orderBy&apos;, ...) of join&apos;s right side being applied to refTable in m2m relationship</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="suhock">suhock</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Apr 2010 12:22:21 +0000</created>
                <updated>Wed, 31 Aug 2011 12:43:09 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.3</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                <component>Query</component>
                <component>Relations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="12750" author="suhock" created="Mon, 26 Apr 2010 12:45:12 +0000"  >&lt;p&gt;attached a test case for this bug&lt;/p&gt;</comment>
                    <comment id="12751" author="suhock" created="Mon, 26 Apr 2010 13:01:03 +0000"  >&lt;p&gt;patch against /branches/1.2 HEAD (should also work apply to 1.2.2 tag)&lt;/p&gt;</comment>
                    <comment id="14179" author="dordille" created="Mon, 30 Aug 2010 17:22:44 +0000"  >&lt;p&gt;I can confirm this as an issue.  However I don&apos;t think the above patch adequately fixes the problem it seems like with it an order by is still added for the ref column however the relation alias is lost.&lt;/p&gt;

&lt;p&gt;My query with the patch became&lt;br/&gt;
SELECT g.gid AS g__gid FROM group g LEFT JOIN user_group u2 ON (g.gid = u2.group_gid) LEFT JOIN user u ON u.uid = u2.user_id AND (u.uid = ?) ORDER BY u.uid, uid &lt;/p&gt;

&lt;p&gt;I made an another patch that prevents this extra order by clause from being added and have attached it.&lt;/p&gt;
</comment>
                    <comment id="14428" author="suhock" created="Tue, 21 Sep 2010 08:53:25 +0000"  >&lt;p&gt;I tried out the new patch (Query_orderby_relation.diff), but it provides a reversed diff (patching goes from a patched version to the original). After applying it manually, it fails the provided test case and several additional test cases from the repository.&lt;/p&gt;

&lt;p&gt;The original patch DOES pass the provided test case, when applied against 1.2.2, 1.2.3, or the 1.2 branch from the repository. It does not pass, however, Doctrine_Query_Orderby_TestCase. As the previous poster mentioned, it fails to resolve aliases in instances where the &apos;orderBy&apos; option is specified in a relation definition.&lt;/p&gt;

&lt;p&gt;I deleted the original patch and am providing a revised patch (Ticket_DC651.patch) against branch 1.2 HEAD (also works with 1.2.3), which fixes this issue. It passes all working test cases, including Doctrine_Query_Orderby_TestCase and DC651TestCase.&lt;/p&gt;</comment>
                    <comment id="16406" author="deraujoj" created="Wed, 31 Aug 2011 12:43:08 +0000"  >&lt;p&gt;I had this issue recently on a application I&apos;m working on as described the oderBy option was applied on the joined table on a column that even doesn&apos;t exist in it. I used the DC651 patch provided and it solved the issue, so far I haven&apos;t seen any side effect to it. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10585" name="DC651TestCase.php" size="3335" author="suhock" created="Mon, 26 Apr 2010 12:45:12 +0000" />
                    <attachment id="10751" name="Query_orderBy_relation.diff" size="1122" author="dordille" created="Mon, 30 Aug 2010 17:22:56 +0000" />
                    <attachment id="10806" name="Ticket_DC651.patch" size="1448" author="suhock" created="Tue, 21 Sep 2010 08:53:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-425] I18n - Can&apos;t create lang column as varchar(5)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-425</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I need to override the LANG column size on i18n tables, so I can use &quot;pt_BR&quot; language. I&apos;d like the LANG column to be varchar(5) and not char(5) as it happens if I modify the field length to 5.&lt;/p&gt;

&lt;p&gt;I&apos;ve also tried to set the &quot;fixed&quot; option as false, but I noticed that the I18n generator overrides this option (I18n.php - line 98).&lt;/p&gt;

&lt;p&gt;The only workaround I could find was setting the length option as null and the type as varchar(5), but at least for me, it doesn&apos;t seem to be the most correct way to define it.&lt;/p&gt;

&lt;p&gt;I&apos;d suggest modifying the I18n table definition generator to not override this option.&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a patch with the proposed fix.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10727">DC-425</key>
            <summary>I18n - Can&apos;t create lang column as varchar(5)</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cgonser">Carlos Gonser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jan 2010 13:51:55 +0000</created>
                <updated>Tue, 30 Aug 2011 17:54:09 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 18:18:32 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14374" author="gpupo" created="Tue, 14 Sep 2010 12:55:56 +0000"  >&lt;p&gt;I confirm the problem by using en_US.&lt;br/&gt;
I ended up using a modified trunk of lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php&lt;/p&gt;</comment>
                    <comment id="16403" author="gpupo" created="Tue, 30 Aug 2011 17:54:09 +0000"  >&lt;p&gt;SImple fix:&lt;/p&gt;

&lt;p&gt;&amp;#8212; a/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php&lt;br/&gt;
+++ b/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php&lt;br/&gt;
@@ -42,7 +42,7 @@ class Doctrine_I18n extends Doctrine_Record_Generator&lt;br/&gt;
                             &apos;children&apos;      =&amp;gt; array(),&lt;br/&gt;
                             &apos;i18nField&apos;     =&amp;gt; &apos;lang&apos;,&lt;br/&gt;
                             &apos;type&apos;          =&amp;gt; &apos;string&apos;,&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&apos;length&apos;        =&amp;gt; 2,&lt;br/&gt;
+                            &apos;length&apos;        =&amp;gt; 5,&lt;br/&gt;
                             &apos;options&apos;       =&amp;gt; array(),&lt;br/&gt;
                             &apos;cascadeDelete&apos; =&amp;gt; true,&lt;br/&gt;
                             &apos;appLevelDelete&apos;=&amp;gt; false&lt;br/&gt;
@@ -131,4 +131,4 @@ class Doctrine_I18n extends Doctrine_Record_Generator&lt;br/&gt;
             }&lt;br/&gt;
         }&lt;br/&gt;
     }&lt;br/&gt;
-}&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="10284" name="I18n.patch" size="576" author="cgonser" created="Thu, 14 Jan 2010 13:51:55 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1033] [PATCH] Use multibyte version of strtolower</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1033</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While trying to develop a new Symfony frontend to an existing database - whcih unfortunately contains non-ascii character names - I ran into a lot of problems where non-ascii characters had been mangled.&lt;br/&gt;
After installing XDebug and digging into the issue I found that the use of strtolower on the column names was the issue, since it&apos;s not safe to use on UTF-8 strings.&lt;br/&gt;
I replaced all calls to strtolower with mb_strtolower and UTF-8 encoding which solved my issue. I don&apos;t know if that is the correct way of doing it or if there is a better way.&lt;br/&gt;
I saw one other use of mb_strtolower in doctrine and it was guarded with an if function exists... Also it might be an issue in other files as well...&lt;br/&gt;
I provide my patch file incase it is of any use.&lt;/p&gt;</description>
                <environment>PHP 5.3.7, Symfony 1.4.13</environment>
            <key id="12979">DC-1033</key>
            <summary>[PATCH] Use multibyte version of strtolower</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="flojon">Jonas Flod&#233;n</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Aug 2011 21:28:54 +0000</created>
                <updated>Sun, 28 Aug 2011 21:43:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16398" author="flojon" created="Sun, 28 Aug 2011 21:43:03 +0000"  >&lt;p&gt;Here is a Git pull request with the same patch:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/pull/39&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/pull/39&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11060" name="0001-Use-multibyte-version-of-strtolower.patch" size="2809" author="flojon" created="Sun, 28 Aug 2011 21:28:55 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-268] Calling isValid with Versionable set for a table throughs an unexpected exception when it encounters invalid data</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-268</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you have Versionable set for a table and attempt to check if the changes submitted are valid by calling isValid() it throws an Doctrine_Valdiator_Exception which one would not expect since that is what the call is suppose to check for.  If I disabled Versionable for the table then no exception is thrown.  I traced down where the exception was arising from and it is in AuditLog/Listener.php in the preUpdate call.  In the call it saves the new version record to the version table, which occurs before any attempt is made to check the validity of the data with the primary table.  So it attempts to save to the version table without any try/catch around it and thus fails on the data validation check and throws an exception.  I think a fair solution to this is to replace the save call with trySave since if it fails the same should hold true when it validates the data for the primary record.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10472">DC-268</key>
            <summary>Calling isValid with Versionable set for a table throughs an unexpected exception when it encounters invalid data</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="froggywwu">David Engeset</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Nov 2009 20:45:54 +0000</created>
                <updated>Thu, 25 Aug 2011 13:22:15 +0000</updated>
                    <resolved>Tue, 24 Nov 2009 21:28:23 +0000</resolved>
                            <version>1.1.5</version>
                <version>1.2.0-BETA3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10797" author="jwage" created="Thu, 19 Nov 2009 20:49:46 +0000"  >&lt;p&gt;I am confused, if you are calling isValid() then preUpdate() would not be triggered. Are you sure that something else is not happening?&lt;/p&gt;</comment>
                    <comment id="10798" author="froggywwu" created="Thu, 19 Nov 2009 21:04:35 +0000"  >&lt;p&gt;I do a DQL query to get the record and I replace values in the record that are different then I call isValid() on the record and I get the exception.  I agree that preUpdate should not be called but I did notice if I called isValid and did not call save for the record the version table gets a new record with the next version number.  So somehow preUpdate is being called.  My table has Timestampable and Versionable set on it.&lt;/p&gt;</comment>
                    <comment id="10805" author="froggywwu" created="Fri, 20 Nov 2009 17:28:01 +0000"  >&lt;p&gt;Example code to demonstrate the exception being thrown.  YAML of the table used is included.&lt;/p&gt;</comment>
                    <comment id="10807" author="froggywwu" created="Fri, 20 Nov 2009 23:12:24 +0000"  >&lt;p&gt;I looked over the source code to see what was triggering preUpdate() to be called and looking in the Record.php class in the isValid call I see that hooks is set by default to true and then I see it is set the invokeSaveHooks for pre on save and update or insert.  So a plain call to isValid() will always cause these hooks to be set.  So I was able to successfully check the validity of the parameters by $rec-&amp;gt;isValid(false, false).  Is the invoking of the save hooks on a plain call to isValid() the expected action?&lt;/p&gt;</comment>
                    <comment id="10854" author="jwage" created="Tue, 24 Nov 2009 21:28:23 +0000"  >&lt;p&gt;This is the expected behavior. If you want to use isValid() standalone then you should pass false to the 2nd argument so that it does not invoke those hooks. It invokes these hooks by default since a behavior or listener could manipulate the objects data before it is validated and saved, so we need to run these first so they have a chance to change the object properties which can change the result of the validation. It is &quot;weird&quot;, but this is just the way it is. If you have any ideas or suggestions on how to fix this or make it better, I am all ears.&lt;/p&gt;</comment>
                    <comment id="16373" author="rowanreid" created="Thu, 25 Aug 2011 13:22:15 +0000"  >&lt;p&gt;I&apos;d like to motivate that the original solution proposed in the description of this issue be implemented.  Replacing the save() call in the preUpdate() Listener method with trySave() would resolve this issue would it not?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10177" name="bootstrap.php" size="1692" author="froggywwu" created="Fri, 20 Nov 2009 17:28:01 +0000" />
                    <attachment id="10178" name="test.php" size="2140" author="froggywwu" created="Fri, 20 Nov 2009 17:28:01 +0000" />
                    <attachment id="10179" name="test.yml" size="643" author="froggywwu" created="Fri, 20 Nov 2009 17:28:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1032] [PATCH] Doctrine_Collection::isModified() does not support deep like Doctrine_Record but probably should</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1032</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$record instanceof Doctrine_Record;&lt;br/&gt;
$collection instanceof Doctrine_Collection;&lt;/p&gt;

&lt;p&gt;Using the $record object I can find out if it has been modified : $record-&amp;gt;isModified().&lt;br/&gt;
I can also have this check all the relations also by passing true : $record-&amp;gt;isModified(true);&lt;/p&gt;

&lt;p&gt;However, the $collection object only support the first level and not the relations of its member records,&lt;br/&gt;
$collection-&amp;gt;isModified() returns false if one of the entry has one its relations modified (as it should).&lt;/p&gt;

&lt;p&gt;The improvement would be to allow this method to accept true, like it&apos;s $record counterpart, which would return true instead.&lt;/p&gt;

&lt;p&gt;See attached patch.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12963">DC-1032</key>
            <summary>[PATCH] Doctrine_Collection::isModified() does not support deep like Doctrine_Record but probably should</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="roychri">Christian Roy</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Aug 2011 18:05:04 +0000</created>
                <updated>Tue, 23 Aug 2011 18:24:25 +0000</updated>
                                    <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11058" name="DC-1032.patch" size="865" author="roychri" created="Tue, 23 Aug 2011 18:05:04 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1019] **REMOVED SPAM**</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1019</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;*&lt;b&gt;REMOVED SPAM&lt;/b&gt;*&lt;/p&gt;</description>
                <environment>**REMOVED SPAM**</environment>
            <key id="12830">DC-1019</key>
            <summary>**REMOVED SPAM**</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="yahwehyahweh">betty akamissnigger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jul 2011 15:32:01 +0000</created>
                <updated>Tue, 23 Aug 2011 18:08:40 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16372" author="roychri" created="Tue, 23 Aug 2011 18:08:40 +0000"  >&lt;p&gt;This issue was filled with spam text so I removed it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1030] [PATCH] doctrine 1.2.4 ADD/DROP CONSTRAINT UNIQUE</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1030</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Adding/dropping UNIQUE CONSTRAINT doesn&apos;t work on PostgreSQL.&lt;/p&gt;

&lt;p&gt;I&apos;m attaching patch for this problem.&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
Michal&lt;/p&gt;</description>
                <environment></environment>
            <key id="12935">DC-1030</key>
            <summary>[PATCH] doctrine 1.2.4 ADD/DROP CONSTRAINT UNIQUE</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="m">MichalKJP</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Aug 2011 12:02:34 +0000</created>
                <updated>Fri, 19 Aug 2011 12:02:34 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11057" name="symfony_0010_doctrine_fix_unique_add_drop.patch" size="1339" author="m" created="Fri, 19 Aug 2011 12:02:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1029] Extensions of Doctrine_Template_I18n incompatible with Doctrine_Import</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1029</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Extending Doctrine_Template_I18n class make Doctrine_Import on YAML data with translation fails...&lt;/p&gt;

&lt;p&gt;Why ? Just because of this line :&lt;/p&gt;

&lt;p&gt;Doctrine_Import.php, line 135 :&lt;br/&gt;
                if ($table-&amp;gt;hasRelation($key) &amp;amp;&amp;amp; is_array($value) &amp;amp;&amp;amp; ! $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;)) {&lt;/p&gt;

&lt;p&gt;In fact, having a template named &quot;Doctrine_Template_I18n&quot; is not strong enough to be sure that the current object has an I18n behavior.&lt;/p&gt;


&lt;p&gt;The bug is very simple to reproduce :&lt;/p&gt;

&lt;p&gt;1. Get a classic I18n fixtures like :&lt;/p&gt;

&lt;p&gt;Article:&lt;br/&gt;
  Translation:&lt;br/&gt;
     en:&lt;br/&gt;
       title: Lorem Ipsum&lt;/p&gt;

&lt;p&gt;2. Then make a simple extension of the I18n template (do not do anything else but extends the Doctrine_Template_I18n class) :&lt;/p&gt;

&lt;p&gt;class My_Doctrine_Template_I18n extends Doctrine_Template_I18n {}&lt;/p&gt;

&lt;p&gt;3. Load the extension, assign it to your model and try to import your fixtures again. It will not work anymore.&lt;/p&gt;


&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>Windows 7, XAMPP 1.7.4 with APC and Curl, symfony 1.4.8</environment>
            <key id="12931">DC-1029</key>
            <summary>Extensions of Doctrine_Template_I18n incompatible with Doctrine_Import</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="loops">Pierrot Evrard</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Aug 2011 11:16:34 +0000</created>
                <updated>Thu, 18 Aug 2011 11:36:19 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Data Fixtures</component>
                <component>I18n</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16350" author="loops" created="Thu, 18 Aug 2011 11:18:51 +0000"  >&lt;p&gt;See this patch where to check if the table has the I18n plugin, I check if one of the templates has a getI18n() method.&lt;/p&gt;

&lt;p&gt;This is probably not strong enough but it can do the job until you find a better solution.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="16351" author="loops" created="Thu, 18 Aug 2011 11:36:19 +0000"  >&lt;p&gt;Another possibility to check that templates are I18n template, will be to create an Doctrine_I18n_Interface. Also, every template that include this interface can be considered as I18n templates.&lt;/p&gt;

&lt;p&gt;What do you think about that ?&lt;/p&gt;

&lt;p&gt;NB: May the interface can define the method getI18n() to be declared...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11056" name="DC-1029.patch" size="1184" author="loops" created="Thu, 18 Aug 2011 11:18:51 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1013] [PATCH] Doctrine ignores unique option for integers (PostgreSQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1013</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This issue is exactly the same as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-252&quot; title=&quot;Doctrine ignores UNIQUE:true on int&quot;&gt;&lt;del&gt;DC-252&lt;/del&gt;&lt;/a&gt;, but refers to  PostgreSQL&lt;/p&gt;</description>
                <environment></environment>
            <key id="12761">DC-1013</key>
            <summary>[PATCH] Doctrine ignores unique option for integers (PostgreSQL)</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rybakit">Eugene Leonovich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Jun 2011 11:42:21 +0000</created>
                <updated>Thu, 18 Aug 2011 08:05:21 +0000</updated>
                                                                    <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16349" author="m" created="Thu, 18 Aug 2011 08:05:21 +0000"  >&lt;p&gt;Your patch fixed the problem for me. Thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11019" name="integer_unique.patch" size="832" author="rybakit" created="Wed, 29 Jun 2011 11:42:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1028] Doctrine Migrate functions for current version and for creating the migrations table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1028</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I always tend to find myself needing to implement migrations after the fact. It would be really nice to have a method of having doctrine creating the migration_version table as well as a method of setting that value and getting that value.&lt;/p&gt;

&lt;p&gt;This would in-turn allow the implementation in a framework such as symfony to allow you insert the table after the fact, allow you to update the migration version without running the migration and to let you know what version you&apos;re currently on.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12927">DC-1028</key>
            <summary>Doctrine Migrate functions for current version and for creating the migrations table</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="isleshocky77">Stephen Ostrow</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Aug 2011 18:54:25 +0000</created>
                <updated>Tue, 16 Aug 2011 18:54:25 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1027] CLONE -Foreign key creation fails with MySQL 5.1.54</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1027</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;When executing symfony doctrine:build --all --and-load  on a machine using Mysql 5.0.44 I get the following error:&lt;/p&gt;

&lt;p&gt;  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;dimension(id)&apos; at line 1. Failing Query: &quot;ALTER TABLE kpi_dimension ADD CONSTRAINT kpi_dimension_dimension_id_dimension_id FOREIGN KEY (dimension_id) REFERENCES dimension(id)&quot;. &lt;/p&gt;

&lt;p&gt;The problem can be fixed by adding a space between the table name and the column name that is referenced. So instead of&lt;br/&gt;
&lt;tt&gt;REFERENCES dimension(id)&lt;/tt&gt;&lt;br/&gt;
it should be&lt;br/&gt;
&lt;tt&gt;REFERENCES dimension (id)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Since it works fine on MySQL 5.1.37, I normally would file this under Mysql bug. But as the &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html&quot; class=&quot;external-link&quot;&gt;syntax for a foreign key constraint in MySQL&lt;/a&gt; mentions this space it should be ok to simply add the space to the script creating the sql for the foreign key. I have not tried any other DBMS though.&lt;/p&gt;

&lt;p&gt;The patch for the file Export.php is attached.&lt;/p&gt;

&lt;p&gt;Best regards&lt;/p&gt;

&lt;p&gt;Claudia&lt;/p&gt;</description>
                <environment>gentoo, MySQL 5.0.44-log, Doctrine 1.2, symfony 1.4.4</environment>
            <key id="12924">DC-1027</key>
            <summary>CLONE -Foreign key creation fails with MySQL 5.1.54</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="frecon">Frej Connolly</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Aug 2011 14:20:42 +0000</created>
                <updated>Tue, 16 Aug 2011 14:21:41 +0000</updated>
                    <resolved>Tue, 16 Aug 2011 14:21:41 +0000</resolved>
                            <version>1.2.0</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-385] Behavior geographical generates latitude FLOAT(18, 2), longitude FLOAT(18, 2) - it&apos;s not exact</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-385</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem was already described by another person at &lt;a href=&quot;http://trac.symfony-project.org/ticket/7763&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7763&lt;/a&gt; &lt;br/&gt;
the generated field-type is wrong, so the stored lat/long values have lost precision.&lt;/p&gt;</description>
                <environment>symfony 1.4.1 / mysql </environment>
            <key id="10660">DC-385</key>
            <summary>Behavior geographical generates latitude FLOAT(18, 2), longitude FLOAT(18, 2) - it&apos;s not exact</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="freakx0">Dominik.Roser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Dec 2009 09:29:40 +0000</created>
                <updated>Thu, 11 Aug 2011 03:47:27 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:15:20 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12012" author="mrhash" created="Wed, 3 Mar 2010 13:22:04 +0000"  >&lt;p&gt;This change doesn&apos;t fix the problem. The problem here is that float and double types default to (18,2) for no good reason. See line 233: &lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/DataDict/Mysql.php?rev=7253&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/DataDict/Mysql.php?rev=7253&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think u need to let the default mysql float and double types be set if options are not specified explicitly for length/scale. This problem causes &lt;b&gt;all&lt;/b&gt; doubles and floats to have poor 2 decimal precision.&lt;/p&gt;</comment>
                    <comment id="12027" author="jwage" created="Thu, 4 Mar 2010 08:22:31 +0000"  >&lt;p&gt;Doctrine always sets the default if nothing is specified currently so we can&apos;t change that &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; we can set our own length and scale though. However, I don&apos;t  know what proper values would be. I&apos;ll do some tests and report back, let me know if you have any additional information. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12743" author="mrhash" created="Fri, 23 Apr 2010 18:50:00 +0000"  >&lt;p&gt;Well it seems that Doctrine sets the default to 18,2 but afaik that is not necessary. I would suggest that if no scale is specified then the data type is simply defined as FLOAT or DOUBLE with no scale. This works fine for Mysql in my project.&lt;/p&gt;</comment>
                    <comment id="14561" author="zevero" created="Wed, 13 Oct 2010 10:54:03 +0000"  >&lt;p&gt;On Symfony 1.4.8 / Mysql it is still not working&lt;br/&gt;
Setting to&lt;br/&gt;
type: float(18), scale: 6&lt;br/&gt;
enhances precission, but the numbers are rounded weirdly in the database:&lt;br/&gt;
for example 76.86 is stored as 76.860001&lt;br/&gt;
I really would appreciate a true mysql float!!!&lt;/p&gt;</comment>
                    <comment id="16307" author="indiekiduk" created="Thu, 11 Aug 2011 03:47:27 +0000"  >&lt;p&gt;Still broken on 1.2.4 the last release of 1.2 unfortunately. This is the fix I used:&lt;/p&gt;

&lt;p&gt;Change line 239 of lib/Doctrine/DataDict/Mysql.php from:&lt;/p&gt;

&lt;p&gt;return &apos;DOUBLE(&apos;.$length.&apos;, &apos;.$scale.&apos;)&apos;;&lt;/p&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;p&gt;return &apos;DOUBLE&apos;;&lt;/p&gt;

&lt;p&gt;This gets rid of scale completely but I think its better than all doubles that don&apos;t have a defined scale limited to decimal places, which is just awful for anyone using the Geographical behaviour.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1026] PgSQL driver does not create indexes on foreign key columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1026</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Just like in Doctrine 2 (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-50):&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DBAL-50):&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The PostgreSQL database does not create indexes for foreign key columns, the user has to create them by hand. I think that indexes for foreign keys should be created automatically&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="12907">DC-1026</key>
            <summary>PgSQL driver does not create indexes on foreign key columns</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="szjani">Szurovecz J&#225;nos</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Aug 2011 11:42:26 +0000</created>
                <updated>Mon, 8 Aug 2011 11:42:26 +0000</updated>
                                    <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1025] Doctrine is unable to handle table names with spaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1025</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to query a table which contains spaces I get the following exception&lt;/p&gt;

&lt;p&gt;I have attached an simple example to reproduce&lt;/p&gt;


&lt;p&gt;C:\Documents and Settings\daniel\Dokumenter\NetBeansProjects\test&amp;gt;php doctrineTest.php&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Query_Exception&apos; with message &apos;Unknown table alias with&apos; in C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php:856&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 C:\Doctrine-1.2.3\Doctrine\Query.php(1022): Doctrine_Query_Abstract-&amp;gt;getComponentAlias(&apos;with&apos;)&lt;br/&gt;
#1 C:\Doctrine-1.2.3\Doctrine\Query.php(1239): Doctrine_Query-&amp;gt;_buildSqlFromPart()&lt;br/&gt;
#2 C:\Doctrine-1.2.3\Doctrine\Query.php(1133): Doctrine_Query-&amp;gt;buildSqlQuery(true)&lt;br/&gt;
#3 C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php(958): Doctrine_Query-&amp;gt;getSqlQuery(Array)&lt;br/&gt;
#4 C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php(1026): Doctrine_Query_Abstract-&amp;gt;_execute(Array)&lt;br/&gt;
#5 C:\Documents and Settings\daniel\Dokumenter\NetBeansProjects\test\doctrineTest.php(18): Doctrine_Query_Abstract-&amp;gt;execute()&lt;br/&gt;
#6 &lt;/p&gt;
{main}
&lt;p&gt;  thrown in C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php on line 856&lt;/p&gt;</description>
                <environment>PHP Version 5.2.14&lt;br/&gt;
Apache 2&lt;br/&gt;
MySQL&lt;br/&gt;
Windows Xp</environment>
            <key id="12892">DC-1025</key>
            <summary>Doctrine is unable to handle table names with spaces</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="sajbar">Daniel Borg</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Aug 2011 07:43:13 +0000</created>
                <updated>Tue, 2 Aug 2011 10:37:03 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11041" name="doctrineTest.php" size="509" author="sajbar" created="Tue, 2 Aug 2011 07:43:14 +0000" />
                    <attachment id="11042" name="tbl.php" size="810" author="sajbar" created="Tue, 2 Aug 2011 07:43:14 +0000" />
                    <attachment id="11043" name="tbl_1.php" size="234" author="sajbar" created="Tue, 2 Aug 2011 07:43:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-509] Oracle don&apos;t close cursor</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-509</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you doing a big loop of insertion you have a &quot;too many open cursor&quot;.&lt;br/&gt;
The problem is in Doctrine_Connection class&lt;br/&gt;
At line 1005 you should replace :&lt;br/&gt;
$stmt = $this-&amp;gt;prepare($query);&lt;br/&gt;
by&lt;br/&gt;
$stmt = $this-&amp;gt;dbh-&amp;gt;prepare($query);&lt;/p&gt;

&lt;p&gt;and at line 1041 you should replace :&lt;br/&gt;
$stmt = $this-&amp;gt;prepare($query);&lt;br/&gt;
by&lt;br/&gt;
$stmt = $this-&amp;gt;dbh-&amp;gt;prepare($query);&lt;/p&gt;

&lt;p&gt;After this correction, you never have the problem &quot;too many open cursor&quot;&lt;/p&gt;

&lt;p&gt;Thanks to Ota to point that on google groups.&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/fe6cd03c8fb18b64/728ec1b4e42b1f0b?lnk=gst&amp;amp;q=doctrine_oracle_adapter#728ec1b4e42b1f0b&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/fe6cd03c8fb18b64/728ec1b4e42b1f0b?lnk=gst&amp;amp;q=doctrine_oracle_adapter#728ec1b4e42b1f0b&lt;/a&gt;&lt;/p&gt;</description>
                <environment>PHP 5.3.1</environment>
            <key id="10912">DC-509</key>
            <summary>Oracle don&apos;t close cursor</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="oxman">oxman</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Feb 2010 04:17:46 +0000</created>
                <updated>Thu, 28 Jul 2011 16:18:46 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11978" author="jwage" created="Tue, 2 Mar 2010 13:49:33 +0000"  >&lt;p&gt;Hmm. This change is invalid because it then doesn&apos;t return the proper statement object. What is the real issue we get the too many cursors open error?&lt;/p&gt;</comment>
                    <comment id="12023" author="oxman" created="Thu, 4 Mar 2010 06:37:57 +0000"  >&lt;p&gt;Why ?&lt;br/&gt;
The both return Doctrine_Adapter_Statement_Interface&lt;/p&gt;</comment>
                    <comment id="12026" author="jwage" created="Thu, 4 Mar 2010 08:18:16 +0000"  >&lt;p&gt;The change makes it so they return PDOStatement, and we need it to return the Doctrine statement wrapper, right?&lt;/p&gt;</comment>
                    <comment id="12029" author="oxman" created="Thu, 4 Mar 2010 08:32:21 +0000"  >&lt;p&gt;It seems not.&lt;/p&gt;

&lt;p&gt;At line 1005 in Doctrine/Connection.php :&lt;br/&gt;
                $stmt = $this-&amp;gt;dbh-&amp;gt;prepare($query);&lt;br/&gt;
                var_dump(get_class($stmt));&lt;br/&gt;
                die;&lt;/p&gt;

&lt;p&gt;I see :&lt;br/&gt;
string(33) &quot;Doctrine_Adapter_Statement_Oracle&quot;&lt;/p&gt;

&lt;p&gt;And with :&lt;br/&gt;
                $stmt = $this-&amp;gt;prepare($query);&lt;br/&gt;
                var_dump(get_class($stmt));&lt;br/&gt;
                die;&lt;/p&gt;

&lt;p&gt;I see :&lt;br/&gt;
string(29) &quot;Doctrine_Connection_Statement&quot;&lt;/p&gt;

&lt;p&gt;The both implements Doctrine_Adapter_Statement_Interface&lt;/p&gt;</comment>
                    <comment id="12776" author="richard" created="Thu, 29 Apr 2010 04:24:43 +0000"  >&lt;p&gt;I have this problem in Symfony 1.4.3 when I use comand:&lt;br/&gt;
symfony doctrine:data-load&lt;/p&gt;

&lt;p&gt;I have 3000 - 4000 lines in my fixtures and max open cursor at 300 on my database oracle.&lt;/p&gt;

&lt;p&gt;This problem can an issue???&lt;/p&gt;</comment>
                    <comment id="13220" author="jwage" created="Tue, 8 Jun 2010 17:06:50 +0000"  >&lt;p&gt;I see, well the change still is not right because it bypasses all the logic in Doctrine_Connection::prepare() which is for sure required and can&apos;t just be removed. We need to determine the real issue here in order to properly patch it.&lt;/p&gt;</comment>
                    <comment id="13458" author="pkwooster" created="Tue, 29 Jun 2010 13:44:32 +0000"  >&lt;p&gt;I&apos;m encountering the same ORA-1000 problem running the symfony doctrine:build-schema command. We are still using PDO, but I have asked in the users group if that&apos;s the best choice. The problem is that the listTableColumns and listTableRelations methods both leave a cursor open. They both call Connection::fetchAssoc, so they should be reading all the records.&lt;/p&gt;

&lt;p&gt;I narrowed it down a little:&lt;/p&gt;

&lt;p&gt;This works properly when no parameters are provided:&lt;/p&gt;

&lt;p&gt;$sql = &quot;SELECT * FROM all_tab_columns tc WHERE tc.table_name = &apos;DEAL&apos;&quot;;&lt;br/&gt;
$result = $connection-&amp;gt;fetchAssoc($sql, array());&lt;/p&gt;

&lt;p&gt;This doesn&apos;t release the cursor when a named parameter is provided&lt;/p&gt;

&lt;p&gt;$sql = &quot;SELECT * FROM all_tab_columns tc WHERE tc.table_name = :tn&quot;;&lt;br/&gt;
$result = $connection-&amp;gt;fetchAssoc($sql, array(&apos;:tn&apos; =&amp;gt; &apos;DEAL&apos;)); // doesn&apos;t release cursor&lt;/p&gt;

&lt;p&gt;This doesn&apos;t release the cursor when a positional parameter is provided&lt;/p&gt;

&lt;p&gt;$sql = &quot;SELECT * FROM all_tab_columns tc WHERE tc.table_name = ?&quot;;&lt;br/&gt;
$result = $connection-&amp;gt;fetchAssoc($sql, array(&apos;DEAL&apos;)); // doesn&apos;t release cursor&lt;/p&gt;

&lt;p&gt;This works properly when the PDO connection is used directly&lt;/p&gt;

&lt;p&gt;$sql = &quot;SELECT * FROM all_tab_columns tc WHERE tc.table_name = :tn&quot;;&lt;br/&gt;
$dbh = $connection-&amp;gt;getDbh();&lt;br/&gt;
$stmt = $dbh-&amp;gt;prepare($sql);&lt;br/&gt;
$stmt-&amp;gt;execute(array(&apos;:tn&apos; =&amp;gt; &apos;DEAL&apos;));&lt;br/&gt;
$result = $stmt-&amp;gt;fetchAll();&lt;/p&gt;</comment>
                    <comment id="16226" author="clemherreman" created="Thu, 28 Jul 2011 16:18:46 +0000"  >&lt;p&gt;As I went through this bug, I looked for a fix. I found one here &lt;a href=&quot;https://github.com/derflocki/doctrine1/commit/47b926a523f9f6e3b88042ef2939af0646285ea2&quot; class=&quot;external-link&quot;&gt;https://github.com/derflocki/doctrine1/commit/47b926a523f9f6e3b88042ef2939af0646285ea2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically it consist of freeing cursors that aren&apos;t used by a SELECT query, thus preventing Oracle from throwing an exception on batch insert/delete.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1024] i am executing </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1024</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$query = new Doctrine_Query();&lt;br/&gt;
					$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,c.country_id,c.country_name&apos;)    &lt;br/&gt;
						  //$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,ea.Country&apos;)&lt;br/&gt;
						  -&amp;gt;from(&apos;Entities e&apos;)&lt;br/&gt;
						  -&amp;gt;leftJoin(&apos;e.EntityAddresses ea ON ea.entity_id = e.entity_id AND ea.address_type =&quot;M&quot;&apos;)&lt;br/&gt;
						 -&amp;gt;leftJoin(&apos;ea.Country c ON ea.country = c.country_id&apos;)&lt;br/&gt;
						  -&amp;gt;leftJoin(&apos;e.ActiveFactories s&apos;)&lt;br/&gt;
						  -&amp;gt;where(&apos;e.status=1&apos;);&lt;br/&gt;
						  if(!empty($alpha))&lt;/p&gt;
						  {	
							$query-&amp;gt;andWhere(&quot;e.entity_name like &apos;&quot;.$alpha.&quot;%&apos;&quot;);
						  }
&lt;p&gt;						  $query-&amp;gt;andWhere(&quot;s.company_id=&quot;.$parentId)&lt;br/&gt;
						  -&amp;gt;andWhere(&quot;e.entity_type=2&quot;)&lt;br/&gt;
						  -&amp;gt;andWhere(&apos;s.status=1&apos;)&lt;br/&gt;
						  -&amp;gt;groupBy(&apos;e.entity_id&apos;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="12844">DC-1024</key>
            <summary>i am executing </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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rajani">cherukuri</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Jul 2011 15:07:21 +0000</created>
                <updated>Tue, 26 Jul 2011 20:35:33 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1023] i am executing doctrine type query i am geting error  please gave me reply my query  i am typed in descrition field</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1023</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$query = new Doctrine_Query();&lt;br/&gt;
$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,c.country_id,c.country_name&apos;)&lt;br/&gt;
//$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,ea.Country&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;Entities e&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.EntityAddresses ea ON ea.entity_id = e.entity_id AND ea.address_type =&quot;M&quot;&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ea.Country c ON ea.country = c.country_id&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.ActiveFactories s&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;e.status=1&apos;);&lt;br/&gt;
if(!empty($alpha))&lt;br/&gt;
{&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;e.entity_name like &apos;&quot;.$alpha.&quot;%&apos;&quot;);&lt;br/&gt;
}&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;s.company_id=&quot;.$parentId)&lt;br/&gt;
-&amp;gt;andWhere(&quot;e.entity_type=2&quot;)&lt;br/&gt;
-&amp;gt;andWhere(&apos;s.status=1&apos;)&lt;br/&gt;
-&amp;gt;groupBy(&apos;e.entity_id&apos;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="12850">DC-1023</key>
            <summary>i am executing doctrine type query i am geting error  please gave me reply my query  i am typed in descrition field</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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rajani">cherukuri</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Jul 2011 15:08:48 +0000</created>
                <updated>Tue, 26 Jul 2011 20:35:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1022] Doctrine migration does not set version when MySQL autocommit is false</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1022</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With autocommit set to off in mysqld, &lt;tt&gt;Doctrine_Migration::setCurrentVersion()&lt;/tt&gt; does not have any effect.  This is because the method uses raw PDO calls, which are discarded without either autocommit or an explicit &lt;tt&gt;COMMIT;&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;We patched Doctrine as in the attachment.  It works for us, but may not be the best general solution.&lt;/p&gt;

&lt;p&gt;The patch only fixes this one issue.  There are likely many areas in Doctrine that rely upon autocommit behavior in MySQL.  We will continue to look for them, and supply patches as we find them.  However, as we are only concerned about MySQL, our solutions will probably not apply to other PDO drivers.&lt;/p&gt;</description>
                <environment>RHEL 6.0, mysql 5.1.52</environment>
            <key id="12856">DC-1022</key>
            <summary>Doctrine migration does not set version when MySQL autocommit is false</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="afineman">Adam Fineman</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jul 2011 01:02:48 +0000</created>
                <updated>Tue, 26 Jul 2011 01:41:01 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11040" name="migration.patch" size="501" author="afineman" created="Tue, 26 Jul 2011 01:02:48 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1021] i am executing doctrine type query i am geting error  please gave me reply</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1021</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$query = new Doctrine_Query();&lt;br/&gt;
$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,c.country_id,c.country_name&apos;)&lt;br/&gt;
//$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,ea.Country&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;Entities e&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.EntityAddresses ea ON ea.entity_id = e.entity_id AND ea.address_type =&quot;M&quot;&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ea.Country c ON ea.country = c.country_id&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.ActiveFactories s&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;e.status=1&apos;);&lt;br/&gt;
if(!empty($alpha))&lt;br/&gt;
{&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;e.entity_name like &apos;&quot;.$alpha.&quot;%&apos;&quot;);&lt;br/&gt;
}&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;s.company_id=&quot;.$parentId)&lt;br/&gt;
-&amp;gt;andWhere(&quot;e.entity_type=2&quot;)&lt;br/&gt;
-&amp;gt;andWhere(&apos;s.status=1&apos;)&lt;br/&gt;
-&amp;gt;groupBy(&apos;e.entity_id&apos;);&lt;/p&gt;</description>
                <environment>windows ,wamp,php</environment>
            <key id="12849">DC-1021</key>
            <summary>i am executing doctrine type query i am geting error  please gave me reply</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="rajani">cherukuri</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Jul 2011 15:05:33 +0000</created>
                <updated>Sun, 24 Jul 2011 15:05:33 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-735] Imported objects not converted to objects and parsed as string when a setter method exists</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-735</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you set a setter method for a model which is for a relation the data import no longer works. This seems to be because in the _processRow method it checks if a method exists and then passes the default value rather than checking whether a relation exists first and passing the imported object. &lt;/p&gt;

&lt;p&gt;This effectively means you can&apos;t overload a setter method and still use the data import. &lt;/p&gt;</description>
                <environment>Mac OS X 10.6</environment>
            <key id="11492">DC-735</key>
            <summary>Imported objects not converted to objects and parsed as string when a setter method exists</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="kev">Kevin Dew</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 17:32:09 +0000</created>
                <updated>Fri, 22 Jul 2011 05:09:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16191" author="ryan" created="Fri, 22 Jul 2011 05:09:34 +0000"  >&lt;p&gt;added testcase here&lt;br/&gt;
&lt;a href=&quot;https://github.com/rahx/doctrine1/commit/ba5628abaa5b3d60638d833d90b1cf439504d560&quot; class=&quot;external-link&quot;&gt;https://github.com/rahx/doctrine1/commit/ba5628abaa5b3d60638d833d90b1cf439504d560&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-743] Incompatibilty between fixture import and accessors extends</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-743</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I had a problem when i try to import data with an extended accessors when i try to insert a content with a relation. I discovered this problem in symfony.&lt;/p&gt;

&lt;p&gt;For example, here is my table :&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; 
News:
  tableName: ne_news
  columns:
    id:           { type: integer(4), primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    author_id:    { type: integer(4), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    name:         { type: string(255) }
    description:  { type: text }
  relations:
    author: { class: sfGuardUser, onDelete: NULL, local: author_id, foreign: id, foreignAlias: sfGuardUser }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the fixture :&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; 
SfGuardUser:
  sadmin:
    username:       admin
    password:       admin
    is_super_admin: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  author1:
    username: myname
    
News:
  News1:
    name: Test 1
    description: Description of news 1
    author: author1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I import it with  symfony doctrine:data-load and it works.&lt;/p&gt;

&lt;p&gt;If i add a news.class.php and extends the autogenerated class it fails.&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 setAuthor($v)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//__log(&apos;extending setter&apos;);
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_set(&apos;author&apos;, $v);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;WhenDoctrine_Data_Import finds the setAuthor function, it wont transform author1 in object so $v will be a string, not an sfGuardUser object. &lt;/p&gt;

&lt;p&gt;What do you think? Is a common behavior, how can i extends my accessor?&lt;/p&gt;</description>
                <environment>Window, PHP5, Symfony</environment>
            <key id="11508">DC-743</key>
            <summary>Incompatibilty between fixture import and accessors extends</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="bricef">Brice Favre</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 11:06:58 +0000</created>
                <updated>Fri, 22 Jul 2011 02:28:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Data Fixtures</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="16190" author="ryan" created="Fri, 22 Jul 2011 02:28:49 +0000"  >&lt;p&gt;this is the same issue as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-735&quot; class=&quot;external-link&quot;&gt;DC-735&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1020] In the Timestampable Listener, the &apos;alias&apos; behavior option is not used when determining the database fieldname</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1020</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I noticed this issue after setting up timestampable behavior on an aliased column in a legacy table:&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; 
&amp;lt;?php

&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Content_Article &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{

  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
  {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;t_content&apos;);
    
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 11, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;datePost as posted_at&apos;, &apos;timestamp&apos;);
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;dateEdit as updated_at&apos;, &apos;timestamp&apos;);
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;    
  }
  
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
  { 
    &lt;span class=&quot;code-comment&quot;&gt;// ..
&lt;/span&gt;    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;Timestampable&apos;, array(&apos;created&apos; =&amp;gt; array( &apos;name&apos; =&amp;gt; &apos;datePost&apos;,
                                                            &apos;alias&apos; =&amp;gt; &apos;posted_at&apos;),
                                        &apos;updated&apos; =&amp;gt; array( &apos;name&apos; =&amp;gt; &apos;dateEdit&apos;,
                                                            &apos;alias&apos; =&amp;gt; &apos;updated_at&apos;)));
  }

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Before I added timestampable to this model, I was setting the timestamp fields manually, which worked fine.&lt;/p&gt;

&lt;p&gt;I had to look at the source to find the alias option in the timestampable behavior, since it does not appear to be in the 1.2 documentation. (If this issue is invalid because it&apos;s not an officially supported option, I apologize).&lt;/p&gt;

&lt;p&gt;After I added timestampable to the model, Doctrine began throwing an exception when I tried to save a new record:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Error: Doctrine_Record_UnknownPropertyException [ 0 ]: Unknown record property / related component &quot;datePost&quot; on &quot;Content_Article&quot; ~ &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;/Doctrine-1.2.4/Doctrine/Record/Filter/Standard.php&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It appears that the alias option is used when setting the table definition in the behavior template, but not used by the template&apos;s listener when creating, updating, etc.&lt;/p&gt;

&lt;p&gt;I&apos;m attaching a zip with a copy of the changes I made to fix this in 1.2.4 and a git patch.&lt;/p&gt;</description>
                <environment>PHP 5.3.5, MySQL 5.5.9; as well as PHP 5.3.6, MySQL 5.0.92</environment>
            <key id="12834">DC-1020</key>
            <summary>In the Timestampable Listener, the &apos;alias&apos; behavior option is not used when determining the database fieldname</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="wam">Will Mitchell</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jul 2011 05:41:26 +0000</created>
                <updated>Tue, 19 Jul 2011 05:41:26 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Timestampable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11030" name="Doctrine_Timestampable_Alias.zip" size="6474" author="wam" created="Tue, 19 Jul 2011 05:41:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1018] Circular references to named entities break during data importing</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1018</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If the schema specifies that records relate to each other in both directions:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
Kitten:&lt;br/&gt;
 columns:&lt;br/&gt;
   basket_id: integer&lt;br/&gt;
 relations:&lt;br/&gt;
  Basket:&lt;br/&gt;
   local: basket_id&lt;/p&gt;

&lt;p&gt;Basket:&lt;br/&gt;
  columns:&lt;br/&gt;
   fluffiest_kitten_id: integer&lt;br/&gt;
  relaitons:&lt;br/&gt;
   FluffiestKitten:&lt;br/&gt;
    type: one&lt;br/&gt;
    class: Kitten&lt;br/&gt;
    local: fluffiest_kitten_id&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Then a data dump for such a schema won&apos;t properly load one of the keys, e.g:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
Kitten:&lt;br/&gt;
 Kitten1:&lt;br/&gt;
  Basket: Basket1&lt;/p&gt;

&lt;p&gt;Basket:&lt;br/&gt;
 Basket1:&lt;br/&gt;
  FluffiestKitten: Kitten1&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Will result in either fluffiest_kitten_id or basket_id being set to 0&lt;/p&gt;

&lt;p&gt;See also ticket &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-555&quot; title=&quot;infinite recursion happens when saving models with circular reference&quot;&gt;&lt;del&gt;DC-555&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12826">DC-1018</key>
            <summary>Circular references to named entities break during data importing</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="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="mikeseth">Mike Seth</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jul 2011 10:59:18 +0000</created>
                <updated>Thu, 14 Jul 2011 10:59:18 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1017] Floats persisted in the database are retrieve as strings.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1017</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Someone complained about symfony padding 0&apos;s after floats &lt;a href=&quot;http://stackoverflow.com/questions/6650786/remove-extra-decimal-place-in-float-datatype-on-symfony/6663829&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/6650786/remove-extra-decimal-place-in-float-datatype-on-symfony/6663829&lt;/a&gt; , I think it&apos;s a doctrine problem, since the doctrine:dql task seems to have the same problem:&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: FROM UcVideoAspect&lt;br/&gt;
found 1 results&lt;br/&gt;
-&lt;br/&gt;
  id: &apos;1&apos;&lt;br/&gt;
  video_id: null&lt;br/&gt;
  pixel_ratio: &apos;12.50&apos;&lt;br/&gt;
  width: null&lt;br/&gt;
  height: null&lt;/p&gt;

&lt;p&gt;Here, pixel ratio is defined as a float in the schema.yml file&lt;br/&gt;
Getting the property from a transient object returns a float, while getting it from the db returns a string.&lt;/p&gt;</description>
                <environment>Ubuntu 64 bits, php 5.3</environment>
            <key id="12817">DC-1017</key>
            <summary>Floats persisted in the database are retrieve as strings.</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="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="greg0ire">Gr&#233;goire Paris</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jul 2011 12:11:53 +0000</created>
                <updated>Tue, 12 Jul 2011 12:11:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-618] [PATCH] Local key relations without modifed fields but with modified relations are not saved</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-618</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Assume the following test setup:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Email&amp;#93;&lt;/span&gt; * &amp;#8212; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;Author&amp;#93;&lt;/span&gt; 1 &amp;#8212; * &lt;span class=&quot;error&quot;&gt;&amp;#91;Book&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Assume further that you have a new Email, Author and Book object. Email and book have modified fields, author does not, except for the foreign key relation.&lt;/p&gt;

&lt;p&gt;Now, when you save the Email object, the related Author is not saved because isModified($deep = false) returns false since no local field is modified. The solution is to pass the parameter $deep = true to isModified().&lt;/p&gt;

&lt;p&gt;Patch and test case are attached. No existing test is broken by this fix.&lt;/p&gt;

&lt;p&gt;PS: This patch fixes the correlated bug that objects with I18N behaviour are not saved if only their Translation objects are modified, but not their own fields.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11178">DC-618</key>
            <summary>[PATCH] Local key relations without modifed fields but with modified relations are not saved</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="11502">DC-740</parent>
                        <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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bschussek">Bernhard Schussek</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Apr 2010 13:41:52 +0000</created>
                <updated>Sun, 10 Jul 2011 23:28:08 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10547" name="DC618TestCase.php" size="3518" author="bschussek" created="Tue, 6 Apr 2010 13:48:26 +0000" />
                    <attachment id="11028" name="directadmin-logo.gif" size="1508" author="bozzine" created="Sun, 10 Jul 2011 23:26:45 +0000" />
                    <attachment id="10546" name="ticket_dc618.patch" size="671" author="bschussek" created="Tue, 6 Apr 2010 13:48:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-797] Records containing a one-to-one relation are hydrated as dirty/modified</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-797</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Attached is a self-contained 80 line test. In the test, Foo has an one to one relation to Bar. There is a null value in the foreign key column (at least one Foo without a Bar). And the relation is being used via this DQL:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Doctrine_Query::create()&amp;#45;&amp;gt;from(&apos;Foo f&apos;)&amp;#45;&amp;gt;leftJoin(&apos;f.Bar b&apos;)-&amp;gt;execute();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;At around line 254 of Doctrine_Hydrator_Graph/Graph.php, the hydrator sets the value of the relation column to Doctrine_Null if there is no related record:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;$prev&lt;span class=&quot;error&quot;&gt;&amp;#91;$parent&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$relationAlias&amp;#93;&lt;/span&gt; = $this-&amp;gt;getNullPointer();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This causes Doctrine_Record to check if the value of the foreign key field was updated, which it does by calling Doctrine_Record::_isValueModified(). However, that method considers an update from null to Doctrine_Null as a modification. So, the record (and eventually the entire Collection returned) is marked as Doctrine_Record::STATE_DIRTY, even though it contains no modifications. This occurs during hydration, so the caller never sees the record as being clean.&lt;/p&gt;

&lt;p&gt;The workaround I&apos;m using is to subclass Doctrine_Record, and return false from _isValueModified() when moving from null to Doctrine_Null. But I think this could also be fixed in the hydrator.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11680">DC-797</key>
            <summary>Records containing a one-to-one relation are hydrated as dirty/modified</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dominic.scheirlinck">Dominic Scheirlinck</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Jul 2010 02:26:49 +0000</created>
                <updated>Wed, 6 Jul 2011 19:31:56 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14403" author="dominic.scheirlinck" created="Wed, 15 Sep 2010 21:39:12 +0000"  >&lt;p&gt;Patch is here: &lt;a href=&quot;http://github.com/doctrine/doctrine1/pull/7&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/pull/7&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14576" author="dominic.scheirlinck" created="Sun, 17 Oct 2010 17:25:36 +0000"  >&lt;p&gt;New pull request, done on a topic branch this time (and rebased to be much nicer)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine1/pull/8&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/pull/8&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16122" author="derek" created="Wed, 6 Jul 2011 19:16:40 +0000"  >&lt;p&gt;Record.php.diff contains basically the patch Dominic attached but also makes sure that the internal property value is set regardless of whether the record is marked as dirty or not.  Some code will break when the internal property value is left &amp;lt;unset&amp;gt; instead of Doctrine_Null.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11025" name="Record.php.diff" size="1762" author="derek" created="Wed, 6 Jul 2011 19:16:40 +0000" />
                    <attachment id="10708" name="test.php" size="1829" author="dominic.scheirlinck" created="Mon, 26 Jul 2010 02:26:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-644] _getCacheKeys() exhausts memory</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-644</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>
&lt;p&gt;My scripts have excessive memory consumption and I&apos;ve often saw in my logs:&lt;/p&gt;

&lt;p&gt;PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 2097152 bytes) in /proj/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cache/Apc.php on line 111&lt;/p&gt;

&lt;p&gt;Looking into the code I&apos;ve found which function to blame:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;    protected function _getCacheKeys()&lt;br/&gt;
    {&lt;br/&gt;
        $ci = apc_cache_info(&apos;user&apos;);&lt;br/&gt;
        $keys = array();&lt;/p&gt;

&lt;p&gt;        foreach ($ci&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;cache_list&amp;#39;&amp;#93;&lt;/span&gt; as $entry) &lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {          $keys[] = $entry[&amp;#39;info&amp;#39;]; ######### THIS IS THE LINE        }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;        return $keys;&lt;br/&gt;
    }&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;My server extensively uses APC caching and it&apos;s normal to have many cache keys.&lt;br/&gt;
Obviously retrieving ALL of them is time and memory consuming.&lt;br/&gt;
As I&apos;m not well versed with Doctrine&apos;s code, I didn&apos;t want to dive further in.&lt;/p&gt;

&lt;p&gt;Is there another way to avoid this pitfall? &lt;/p&gt;</description>
                <environment>Doctrine is installed as a Symfony plugin. Using the latest Symfony from SVN.</environment>
            <key id="11258">DC-644</key>
            <summary>_getCacheKeys() exhausts memory</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="colnector">Amir W</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Apr 2010 12:54:15 +0000</created>
                <updated>Wed, 6 Jul 2011 08:17:14 +0000</updated>
                                                                    <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12757" author="colnector" created="Mon, 26 Apr 2010 20:38:25 +0000"  >&lt;p&gt;Is there any patch that could be provided meanwhile? This is quite a problem on a live website.&lt;/p&gt;</comment>
                    <comment id="12887" author="colnector" created="Mon, 10 May 2010 02:44:24 +0000"  >&lt;p&gt;Is this not a critical issue for Doctrine&apos;s cache? It&apos;s been up for 2 weeks with not even a comment...&lt;/p&gt;</comment>
                    <comment id="12896" author="jwage" created="Mon, 10 May 2010 12:34:16 +0000"  >&lt;p&gt;Hi, what are you calling that is invoking _getCacheKeys()? The only methods that call it are the deleteBy*() methods. It is expected that these methods have to get the entire list of cache keys from the driver in order to perform the delete by operation. These cache clearing operations should probably be done in the CLI environment where the memory limits are higher. If you want to avoid _getCacheKeys() being invoked, then you must not use the deleteBy*() methods.&lt;/p&gt;</comment>
                    <comment id="12897" author="colnector" created="Mon, 10 May 2010 13:15:10 +0000"  >&lt;p&gt;Thank you for commenting. Yes, I am using deleteByRegex() since I need to expire some result cache entries upon an update operation. What other choice do I have if I wish to keep using the result cache offered by Doctrine? Is there any other mechanism?&lt;/p&gt;

&lt;p&gt;Can&apos;t _getCacheKeys() be optimized some way?&lt;/p&gt;</comment>
                    <comment id="12898" author="jwage" created="Mon, 10 May 2010 13:22:50 +0000"  >&lt;p&gt;No, it is not able to be optimized anymore. It has to load all the keys into a php array in memory in order to loop over them to compare against the regex. You should probably not be doing cache clearing operations in the browser under apache. If you do, you&apos;ll need to raise your memory limit.&lt;/p&gt;</comment>
                    <comment id="12899" author="colnector" created="Mon, 10 May 2010 13:29:32 +0000"  >&lt;p&gt;My code actually had a few of these calls and I&apos;ve now removed use of the result cache with Doctrine. What you&apos;re writing means the result cache is not usable for dynamic websites. IMHO, it&apos;s a good practice to cache results and remove them once an update is made to the data (which naturally can happen due to an update from a user). However, if that by itself creates an overload on the server (and as you know even a temporary memory abuse leads to an overload), I cannot see how it can be useful.&lt;br/&gt;
Please tell me if you think there&apos;s a way the results cache can still be usable for a dynamic website.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="12900" author="jwage" created="Mon, 10 May 2010 13:37:08 +0000"  >&lt;p&gt;This is the only way to allow more complex delete functionality. How you use it, is not up to us. We intended that cache clearing is done from the command line or in an environment where the memory limit is high enough to be able to load all those keys. It may not be able to be used by everyone, if it is not working for how you are using it then you will need to think of another solution I suppose.&lt;/p&gt;</comment>
                    <comment id="12901" author="colnector" created="Mon, 10 May 2010 13:58:34 +0000"  >&lt;p&gt;Thank you for your response and I&apos;ll think of another solution for my application.&lt;/p&gt;

&lt;p&gt;I did dive into the code and there&apos;s a relevant &lt;b&gt;optimization&lt;/b&gt; that could be made.&lt;/p&gt;

&lt;p&gt;_getCacheKeys() is actually creating another array for all the cache keys which needlessly increases the memory used.&lt;br/&gt;
If the deleteBy*() method would be implemented at the driver level (such as with Apc.php) and not at the general level (Driver.php as it is now) this array would not have to be created. It won&apos;t be such a code bloat and would surely lessen memory use.&lt;/p&gt;

&lt;p&gt;There could be a way around the problem which also implements another feature I miss with the results cache. By allowing some sort of cache tagging to mark the items that may need to be deleted we could easily delete relevant entries. I&apos;ll describe the interface here.&lt;/p&gt;

&lt;p&gt;Instead of &lt;br/&gt;
$q = $q-&amp;gt;useResultCache(true, 86400);&lt;/p&gt;

&lt;p&gt;There should be&lt;br/&gt;
$q = $q-&amp;gt;useTagResultCache(&apos;SomeTag&apos;, true, 86400);&lt;br/&gt;
which does the same PLUS update a cached variable (such as &apos;Doctrine_Result_Cache_Tag_SomeTag&apos;) which references the result cache keys of &apos;SomeTag&apos;.&lt;/p&gt;

&lt;p&gt;We can then easily implement deletion of relevant result cache entries with&lt;/p&gt;

&lt;p&gt;deleteByTag(&apos;SomeTag&apos;)&lt;/p&gt;

&lt;p&gt;which would read  &apos;Doctrine_Result_Cache_Tag_SomeTag&apos; to figure out which entries should be removed from the cache.&lt;/p&gt;

&lt;p&gt;I&apos;m pretty sure my usage scenario is not marginal but let me know what you think.&lt;/p&gt;</comment>
                    <comment id="12902" author="jwage" created="Mon, 10 May 2010 14:08:13 +0000"  >&lt;p&gt;This is already possible if I understand what you describe.&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;$q-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;key_to_store_cache_under&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now you can do:&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;$cacheDriver-&amp;gt;delete(&apos;key_to_store_cache_under&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also what you describe useTagResultCache() and keeping up with our own list of cache keys is the way it used to be and was changed to this after worse performance problems were discovered with that approach.&lt;/p&gt;</comment>
                    <comment id="12903" author="colnector" created="Mon, 10 May 2010 14:44:26 +0000"  >&lt;p&gt;Perhaps I&apos;ve been misunderstood so I&apos;ll try explain from the start.&lt;/p&gt;

&lt;p&gt;In my system a few queries do relate to the same pieces of information. That information can be updated by a user and thus I would need to remove anywhere between 0 and 50 related result cache variables. I cannot easily name each and every one of my queries thus giving a specific key name doesn&apos;t help. So what I did was to prefix the name of each of the queries to indicate that I&apos;ll know how to remove them. I may have thousands of results cached and would need to clear just a few. That&apos;s why I use the deleteBy*() which proves to be extremely inefficient as it retrieves ALL the keys in my cache driver and not only the Doctrine related ones.&lt;/p&gt;

&lt;p&gt;I really don&apos;t know how it has been implemented before but what I suggest wouldn&apos;t hurt performance as tagging would be an optional addition managed with another variable. If you think that won&apos;t b useful to other Doctrine users, I&apos;ll simply implement it for my system.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="12904" author="jwage" created="Mon, 10 May 2010 14:54:35 +0000"  >&lt;p&gt;I think the best solution is the one you suggested earlier. That each cache driver should directly implement this functionality and bypass the creation of the array. What do you think? It is backwards compatible so that way we can commit it in 1.2.&lt;/p&gt;</comment>
                    <comment id="12905" author="colnector" created="Mon, 10 May 2010 15:20:07 +0000"  >&lt;p&gt;Bypassing the array is a required optimization which is easy to implement but it&apos;s not really a solution to the problem I&apos;m facing and I believe is common enough (Zend_Cache for example implements tagging) and need to be offered. As it&apos;ll be 2 new functions that will implement tagging only when specifically requested, it&apos;ll also be backward compatible. The only thing I&apos;m not sure about is if an implementation of some locking mechanism would be needed for the cached variable which would hold the list of cache keys for a specific tag.&lt;/p&gt;</comment>
                    <comment id="12906" author="jwage" created="Mon, 10 May 2010 15:38:52 +0000"  >&lt;p&gt;Let me know what you come up with and we&apos;ll have a look at including it in the next 1.2.x release.&lt;/p&gt;</comment>
                    <comment id="12981" author="colnector" created="Sun, 16 May 2010 14:21:37 +0000"  >&lt;p&gt;Bypassing the extra array is still not good enough and IMHO the whole idea of deleteBy() should NOT be used if many such requests could be made, as is my case.&lt;/p&gt;

&lt;p&gt;What I&apos;ve done now is what I mentioned before with a patch that is quite ugly.&lt;/p&gt;

&lt;p&gt;In Doctrine/Query/Abstract.php right after the line&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;$cacheDriver-&amp;gt;save($hash, $cached, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getResultCacheLifeSpan());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;ve added &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($GLOBALS[&apos;rcache_users_in_query&apos;])) {
                	MyCache::keepRelatedCacheKey($GLOBALS[&apos;rcache_users_in_query&apos;], $hash);
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which saves another cache key which holds the hash tags that would have to be deleted on an update.&lt;br/&gt;
My global variable is actually an array as a Doctrine query result may be associated with more than one user and possibly other parameters.&lt;br/&gt;
Before calling the $q-&amp;gt;execute(), I simply update this variable.&lt;/p&gt;

&lt;p&gt;When a user on my system does the update, I then delete all relevant Doctrine keys with something 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;		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_null($cacheDriver)) $cacheDriver = Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_RESULT_CACHE);
		
		foreach($arKeys as $key) {
			$cacheDriver-&amp;gt;delete($key);			
		}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and then delete my other cache key.&lt;/p&gt;

&lt;p&gt;This solution works well for me. Sorry I cannot make a nice Doctrine patch for it as I&apos;m not well versed with your code. I still believe it should be supported by Doctrine with an optional extra parameter for $q-&amp;gt;useResultCache()&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="13191" author="hobodave" created="Tue, 8 Jun 2010 14:42:42 +0000"  >&lt;p&gt;Hi Amir,&lt;/p&gt;

&lt;p&gt;Zend_Cache does not implement tagging for either APC or Memcached backends, see the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-460&quot; class=&quot;external-link&quot;&gt;documentation&lt;/a&gt;. It also likely never will, all requests for this functionality have been closed with Wont Fix.&lt;/p&gt;

&lt;p&gt;I don&apos;t think the deleteBy methods should have ever been implemented. When initially implemented they cached a &quot;doctrine_cache_keys&quot; variable to store the keys known to Doctrine. This however led to a crippling bug that would crash my production servers after a few hours. Not even a friendly &quot;out of memory&quot; limit, but a slowdown and eventual crash. Please see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-460&quot; class=&quot;external-link&quot;&gt;DDC-460&lt;/a&gt; for details. Note that I don&apos;t use the magic delete methods, just simple saves with timeouts and this was affecting me.&lt;/p&gt;

&lt;p&gt;I fixed the solution as you&apos;ve seen using the _getCacheKeys() method. I don&apos;t believe this functionality should have ever been added to Doctrine to begin with, but this is what we have to work with. It should be the responsibility of the cache store to handle tagging and such, not poorly hacked on with application code.&lt;/p&gt;

&lt;p&gt;As it stands, the current implementation doesn&apos;t affect people who aren&apos;t even using this functionality, as it should be. As Jon suggested, you shouldn&apos;t be using this in the context of a page request. Use a CLI script or work on another solution. Your idea of tracking your keys in application code is a good idea, but it doesn&apos;t belong in Doctrine imo.&lt;/p&gt;</comment>
                    <comment id="13263" author="colnector" created="Thu, 10 Jun 2010 02:07:13 +0000"  >&lt;p&gt;Thanks David for your comment.&lt;/p&gt;

&lt;p&gt;I agree with you that my implementation should not belong in Doctrine and that tagging should have been a part of the cache backends.&lt;/p&gt;

&lt;p&gt;Continuing with the same logic you&apos;ve presented, deleteBy...() functionality **&lt;b&gt;should be removed&lt;/b&gt;** from Doctrine if it causes the system to crash as it does so in an obnoxious way so that it would take too long for most developers to notice this is where the problem lies. It has certainly taken too much of my time and efforts and I&apos;d rather save the pain from others.&lt;/p&gt;</comment>
                    <comment id="16119" author="carsten" created="Wed, 6 Jul 2011 08:17:13 +0000"  >&lt;p&gt;We had the exact same problem. We used a &quot;deleteAll()&quot; of a ApcCache object and ran into the &quot;allowed memory size exhausted&quot; pitfall. We helped ourselves with a new class that extends ApcCache and uses the simpler apc_clear_cache function.&lt;/p&gt;


&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
namespace Foo\Cache;

class ApcCache extends \Doctrine\Common\Cache\ApcCache
{
    /**
     * Delete all cache entries. Memory saving version...
     *
     * @return bool
     */
    public function deleteAll()
    {
        return apc_clear_cache(&apos;user&apos;);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
use Foo\Cache\ApcCache as Apc;
...
$this-&amp;gt;_apc = new Apc();
$this-&amp;gt;_apc-&amp;gt;deleteAll();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;This doesn&apos;t return the ids of the deleted entries like the original function but we don&apos;t need that. So this works fine for us.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1016] Set method in update query ignores &apos;false&apos; if passed as boolean</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1016</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I had to define this function:&lt;/p&gt;

&lt;p&gt;public function deactivate($segment_id)&lt;/p&gt;
    {
        $query = $this-&amp;gt;createQuery()
                -&amp;gt;update(&apos;Segment s&apos;)
                -&amp;gt;set(&apos;s.is_active &apos;, false) //not working
//              -&amp;gt;set(&apos;s.is_active &apos;, (int)false) //works ok
//              -&amp;gt;set(&apos;s.is_active &apos;, true) //works ok
                -&amp;gt;where(&apos;s.id = ?&apos;, $segment_id);
//        var_dump($query-&amp;gt;getSqlQuery());die;
        return $query-&amp;gt;execute();
    }

&lt;p&gt;Problem is that when setting a column using boolean false you get invalid SQL query like this:&lt;br/&gt;
UPDATE segment SET is_active  =  WHERE (id = ?)&lt;/p&gt;

&lt;p&gt;Workaround is to do it like this: set(&apos;s.is_active &apos;, (int)false) , but since setting the same column with boolean true works, false should work too.&lt;/p&gt;</description>
                <environment>Symfony 1.4.11 , Ubuntu 11, PHP 5.3</environment>
            <key id="12788">DC-1016</key>
            <summary>Set method in update query ignores &apos;false&apos; if passed as boolean</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="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="pawelbaranski">Pawe&#322; Bara&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jul 2011 10:23:33 +0000</created>
                <updated>Tue, 5 Jul 2011 10:23:33 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1015] bindComponent not called before inherited classes base definitions</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1015</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I define a base model:&lt;/p&gt;

&lt;p&gt;Entity:&lt;br/&gt;
  connection:  other&lt;br/&gt;
  columns:&lt;br/&gt;
    name: {}&lt;br/&gt;
    size:    {}&lt;/p&gt;

&lt;p&gt;and inherited model:&lt;/p&gt;

&lt;p&gt;Box:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;/p&gt;


&lt;p&gt;Then file with base definition of Box does not contain bindComponent sentence to bind Box model with connection specified for Entity model.&lt;/p&gt;</description>
                <environment>symfony 1.4</environment>
            <key id="12786">DC-1015</key>
            <summary>bindComponent not called before inherited classes base definitions</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="ardi">Adrian Nowicki</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jul 2011 21:21:12 +0000</created>
                <updated>Mon, 4 Jul 2011 21:21:12 +0000</updated>
                                                                    <component>Inheritance</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1014] Geographical behaviour generates wrong INSERT statement in PostgreSQL if latitude/logitude not specified</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1014</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Added &quot;Geographical&quot; behaviour to an entity:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
ZipCode:
  actAs: [Geographical]
  columns:
    code: string
    [...]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Using the standard Symfony-generated admin manager, when trying to insert a new record without specifying both &lt;b&gt;latitude&lt;/b&gt; and &lt;b&gt;longitude&lt;/b&gt;, Doctrine generates a wrong INSERT statement for PostgreSQL, including  &lt;b&gt;latitude&lt;/b&gt; and &lt;b&gt;longitude&lt;/b&gt; as &lt;b&gt;&apos;&apos;&lt;/b&gt; (empty string)&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
Doctrine_Connection-&amp;gt;exec(&apos;INSERT INTO zip_code (hidden, code,  country_id, latitude, longitude) VALUES (?, ?, ?, ?, ?)&apos;, array(&apos;false&apos;, &apos;20133&apos;, &apos;1&apos;, &apos;&apos;, &apos;&apos;))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;This cause this error:&lt;br/&gt;
&lt;b&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22P02&amp;#93;&lt;/span&gt;: Invalid text representation: 7 ERROR: invalid input syntax for type double precision: &quot;&quot;&lt;/b&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Workaround&quot;&gt;&lt;/a&gt;Workaround&lt;/h3&gt;
&lt;p&gt; explicitly specifying &lt;b&gt;float&lt;/b&gt; type for latitude and longitude...&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
  actAs: 
    Geographical:
      latitude: {type: float}
      longitude: {type: float}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;...still generate the column correctly as &lt;b&gt;double precision&lt;/b&gt; in the database, but will not cause any error on inserting records.&lt;/p&gt;</description>
                <environment>Symphony 1.4, PostgreSQL 8.4.8</environment>
            <key id="12768">DC-1014</key>
            <summary>Geographical behaviour generates wrong INSERT statement in PostgreSQL if latitude/logitude not specified</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicus">Lorenzo Nicora</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Jul 2011 09:52:36 +0000</created>
                <updated>Fri, 1 Jul 2011 09:52:36 +0000</updated>
                                                                    <component>Geographical</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1011] wierd behaviour with setTableName - table name doesn&apos;t get set</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1011</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;if i create class called Attribute_set that extends Doctrine_Record and setTableName in setUpTableDefinintion like in documentation setting up models section, the table name appears not to be set&lt;br/&gt;
getTableName returns &quot;doctrine_&lt;em&gt;record&lt;/em&gt;_abstract&quot;&lt;/p&gt;

&lt;p&gt;any joins or relations fail.&lt;/p&gt;

&lt;p&gt;if i set it in the setUp function the setTableName appear working and returns &quot;attribute_sets&quot; table name. This only happens with this particular class, and relations have no effect.&lt;/p&gt;

&lt;p&gt;I attached class example i&apos;m expiriencing problems with, that should help reproducte this issue&lt;/p&gt;</description>
                <environment>Linux 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 19:00:26 UTC 2011 i686 GNU/Linux&lt;br/&gt;
PHP 5.3.3-1ubuntu9.5</environment>
            <key id="12758">DC-1011</key>
            <summary>wierd behaviour with setTableName - table name doesn&apos;t get set</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gamesh">Justinas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Jun 2011 08:58:55 +0000</created>
                <updated>Tue, 28 Jun 2011 13:03:34 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16087" author="gamesh" created="Tue, 28 Jun 2011 09:56:07 +0000"  >&lt;p&gt;fixed misstype and it appears that it was not the problem, i get the same:&lt;/p&gt;

&lt;p&gt;Base table or view not found: 1146 Table &apos;db.doctrine_&lt;em&gt;record&lt;/em&gt;_abstract&apos; doesn&apos;t exist&lt;/p&gt;

&lt;p&gt;maybe attribute_set is somekind reserved word in doctrine library ?&lt;/p&gt;</comment>
                    <comment id="16089" author="gamesh" created="Tue, 28 Jun 2011 13:03:34 +0000"  >&lt;p&gt;the problem appears to come from Doctrine Formatter&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11018" name="attribute_set.php" size="750" author="gamesh" created="Tue, 28 Jun 2011 09:56:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1012] Doctrine_core specified twice in documentation Defining Models -&gt; Join Table Associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1012</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$manager-&amp;gt;setAttribute(Doctrine_Core::Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true);&lt;/p&gt;

&lt;p&gt;should be:&lt;/p&gt;

&lt;p&gt;$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true);&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/en#relationships:join-table-associations&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/en#relationships:join-table-associations&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12759">DC-1012</key>
            <summary>Doctrine_core specified twice in documentation Defining Models -&gt; Join Table Associations</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="gamesh">Justinas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Jun 2011 10:04:44 +0000</created>
                <updated>Tue, 28 Jun 2011 10:04:44 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-999] Query cache key can be incorrectly generated</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-999</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;1. We have two versions of the application on the same server. &lt;br/&gt;
2. Second application has an updated database. New field is added to one of the models. &lt;br/&gt;
3. When the second app is hit first, query is stored in APC.&lt;br/&gt;
4. First app finds cached query and tries to call it. Exception is thrown as it doesn&apos;t know anything about the new field yet.&lt;/p&gt;

&lt;p&gt;Situation often happens on shared development machine when one developer adds a field but others don&apos;t have in their models yet. It also happens on staging server if it&apos;s shared with production.&lt;/p&gt;

&lt;p&gt;I suspect it only affects &lt;b&gt;queries without explicitly listed fields&lt;/b&gt;. &lt;/p&gt;

&lt;p&gt;To quickly fix the issue in my symfony project I extended Doctrine_Cache_Apc to implement namespaces (&lt;a href=&quot;https://gist.github.com/944524&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/944524&lt;/a&gt;). More appropriate place to fix it would be Doctrine_Query_Abstract::calculateQueryCacheHash().&lt;/p&gt;</description>
                <environment></environment>
            <key id="12587">DC-999</key>
            <summary>Query cache key can be incorrectly generated</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="kuba">Jakub Zalas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Apr 2011 04:50:07 +0000</created>
                <updated>Mon, 27 Jun 2011 18:20:20 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Caching</component>
                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16084" author="grass" created="Mon, 27 Jun 2011 18:20:20 +0000"  >&lt;p&gt;Could this be a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-389&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-389&lt;/a&gt; ?&lt;br/&gt;
Are you querying a model with a *-to-many relation and applying a limit?&lt;/p&gt;

&lt;p&gt;See also &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language:limit-and-offset-clauses:the-limit-subquery-algorithm&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language:limit-and-offset-clauses:the-limit-subquery-algorithm&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1001] Doctrine Caching page does not mention the &quot;prefix&quot; option</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1001</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_1/en/caching&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_1/en/caching&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When not using a prefix with multiple / yet similay projects a mixup of query caching will occur (for example with sfDoctrineGuard queries). This is very easialy fixed with a prefix - but I only realized after two months - that this feature actually existed. There is no mention of this in the documention.&lt;/p&gt;

&lt;p&gt;A mention of the feature &lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
    -&amp;gt;useResultCache(new Doctrine_Cache_Apc(array(&apos;prefix&apos;=&amp;gt;&apos;myproject_&apos;)));&lt;/p&gt;

&lt;p&gt;Would have helped me and I think it will also help others.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12595">DC-1001</key>
            <summary>Doctrine Caching page does not mention the &quot;prefix&quot; option</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="arendvw">Arend van Waart</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Apr 2011 19:26:40 +0000</created>
                <updated>Mon, 27 Jun 2011 18:14:37 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Caching</component>
                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16083" author="grass" created="Mon, 27 Jun 2011 18:14:37 +0000"  >&lt;p&gt;I concur with Arend - mentioning of &apos;prefix&apos; in the documentation could make this valuable feature much less of a pain to find...&lt;br/&gt;
Still holds true in 1.2. documentation: &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/caching/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/caching/en&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-389] query cache doesn&apos;t cache _isLimitSubqueryUsed</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-389</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem is that _isLimitSubqueryUsed is not cached with query cache. &lt;br/&gt;
It gets calculated when building query, but when the query is coming &lt;br/&gt;
from cache it&apos;s not. &lt;br/&gt;
Because of this, line 1087 of Query/Abstract.php is never executed, &lt;br/&gt;
when coming from cache: &lt;br/&gt;
if ($this-&amp;gt;isLimitSubqueryUsed() &amp;amp;&amp;amp; &lt;br/&gt;
    $this-&amp;gt;_conn-&amp;gt;getAttribute(Doctrine::ATTR_DRIVER_NAME) !== &lt;br/&gt;
&apos;mysql&apos;) &lt;/p&gt;
{ 
    $params = array_merge((array) $params, (array) $params); 
} 

Maybe it is on purpose, but I didn&apos;t get any answer on the google-groups.

Here is a diff I use now: 
Index: trunk/gui/doctrine-library/Doctrine/Query/Abstract.php 
=================================================================== 
--- a/trunk/gui/doctrine-library/Doctrine/Query/Abstract.php 
+++ b/trunk/gui/doctrine-library/Doctrine/Query/Abstract.php 
@@ -1286,4 +1286,5 @@ 
         $cached = unserialize($cached); 
         $this-&amp;gt;_tableAliasMap = $cached[2]; 
+        $this-&amp;gt;_isLimitSubqueryUsed = $cached[3]; 
         $customComponent = $cached[0]; 
@@ -1346,5 +1347,5 @@ 
         }
&lt;p&gt; &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;return serialize(array($customComponent, $componentInfo,&lt;br/&gt;
$this-&amp;gt;getTableAliasMap())); &lt;br/&gt;
+        return serialize(array($customComponent, $componentInfo, &lt;br/&gt;
$this-&amp;gt;getTableAliasMap(), $this-&amp;gt;isLimitSubqueryUsed())); &lt;br/&gt;
     }&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Postgres db, php5.2, linux</environment>
            <key id="10664">DC-389</key>
            <summary>query cache doesn&apos;t cache _isLimitSubqueryUsed</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="szotyi">Peter Kovacs</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Dec 2009 20:53:34 +0000</created>
                <updated>Mon, 27 Jun 2011 18:06:25 +0000</updated>
                                    <version>1.1.5</version>
                <version>1.1.6</version>
                <version>1.2.4</version>
                                                <component>Caching</component>
                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16082" author="grass" created="Mon, 27 Jun 2011 18:06:25 +0000"  >&lt;p&gt;This still seems to be a problem in version 1.2.4, rendering the query cache unusable for our project.&lt;br/&gt;
The suggested fix works fine, and seems to hold litte potential for trouble.&lt;/p&gt;

&lt;p&gt;Anyone still listening/reading here? We are aware of the EOL, but would love to produce a test case to anyone (&quot;official&quot;) trying to fix this - just not sure if it is still worth bothering...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-611] import models from db fails when a foreign key exists in another database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-611</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m not sure if multiple databases are officially supported but in the off-chance they are here&apos;s what I ran into.&lt;/p&gt;

&lt;p&gt;I have a table in db 1 that has a foreign key that references a table in db 2.  If I run generateModelsFromDb I get this error:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;31-Mar-2010 16:18:08&amp;#93;&lt;/span&gt; PHP Fatal error:  Uncaught exception &apos;Doctrine_Import_Builder_Exception&apos; with message &apos;Missing class name.&apos; in /home/user/src/web/vendor/Doctrine-1.2.2/lib/Doctrine/Import/Builder.php:995&lt;/p&gt;

&lt;p&gt;I find the problem is in the Doctrine/Import.php file on line 427.  It assigns a relationship in the definitions list without checking that the table actually exists in the definition list.&lt;/p&gt;

&lt;p&gt;$definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;br/&gt;
                    &apos;type&apos; =&amp;gt; Doctrine_Relation::MANY,&lt;br/&gt;
                    &apos;alias&apos; =&amp;gt; $alias,&lt;br/&gt;
                    &apos;class&apos; =&amp;gt; $className,&lt;br/&gt;
                    &apos;local&apos; =&amp;gt; $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;foreign&amp;#39;&amp;#93;&lt;/span&gt;,&lt;br/&gt;
                    &apos;foreign&apos; =&amp;gt; $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;local&amp;#39;&amp;#93;&lt;/span&gt;&lt;br/&gt;
                  );&lt;/p&gt;

&lt;p&gt;In order to fix this I just added the following before&lt;br/&gt;
if (! isset($definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)])) &lt;/p&gt;
{
                      continue;
                  }
</description>
                <environment>Linux</environment>
            <key id="11160">DC-611</key>
            <summary>import models from db fails when a foreign key exists in another database</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jbranca">John Branca</reporter>
                        <labels>
                    </labels>
                <created>Wed, 31 Mar 2010 16:35:30 +0000</created>
                <updated>Tue, 21 Jun 2011 18:41:10 +0000</updated>
                    <resolved>Tue, 8 Jun 2010 14:47:16 +0000</resolved>
                            <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13193" author="jwage" created="Tue, 8 Jun 2010 14:47:16 +0000"  >&lt;p&gt;I don&apos;t think this is a valid fix. What if it is just not in $definitions yet and is added later. Anyways, not all databases support foreign keys across databases. This is sort of a mysql only thing so it can&apos;t be added cleanly.&lt;/p&gt;</comment>
                    <comment id="16038" author="mmuru06" created="Tue, 21 Jun 2011 18:41:10 +0000"  >&lt;p&gt;I run into the above issue and the suggested workaround (or fix) resolve the issue. It should check before assign a relationship especially working with multiple databases. I think it should be fixed hence reopening this ticket as major. &lt;/p&gt;

&lt;p&gt;Wage: It is a symfony base plugin, is there way to override Import.php class in the apps level? &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<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>

<item>
            <title>[DC-1009] save() also updates fields which should not be</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1009</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I want to do a simple update like this :&lt;/p&gt;

&lt;p&gt; $batches = ExamResultsBatchTable::getInstance()-&amp;gt;retrieveByExamBatchStatus(ExamResultsBatch::valid_status_code);&lt;br/&gt;
foreach($batches as $batch)&lt;br/&gt;
{&lt;br/&gt;
        $batch-&amp;gt;setExamBatchStatusId($batchStatusId);&lt;br/&gt;
        $batch-&amp;gt;setStatusDate(date(&apos;Y-m-d&apos;));&lt;br/&gt;
        $batch-&amp;gt;save();&lt;br/&gt;
}&lt;br/&gt;
Only exam_batch_status_id and status_date should be updated (see screenshot before), but columns exam_batch_status_id ,status_date AND exam_subject_id are updated,with the same value (23) (screenshot after_with_save).&lt;/p&gt;

&lt;p&gt;If I run this:&lt;br/&gt;
        $toto = Doctrine_Query::create()&lt;br/&gt;
                       -&amp;gt;update(&apos;ExamResultsBatch erb&apos;)&lt;br/&gt;
                        -&amp;gt;set(&apos;erb.exam_batch_status_id&apos;, 23)&lt;br/&gt;
                        -&amp;gt;set(&apos;erb.status_date&apos;, date(&apos;Y-m-d&apos;))&lt;br/&gt;
                       &lt;del&gt;&amp;gt;where(&apos;erb.id = ?&apos; , $batch&lt;/del&gt;&amp;gt;getId())&lt;br/&gt;
                       -&amp;gt;execute(); &lt;br/&gt;
Everything is correctly done.&lt;/p&gt;

&lt;p&gt;here is the simpliest case.&lt;/p&gt;

&lt;p&gt;The same problems are signaled on other tables in the database, but different tables can be impacted by one save() (the execute() query still works fine).&lt;/p&gt;

&lt;p&gt;Example : 2 foreign tables will be updated , even if the save() action should only concern the main table, and one field (which is not a foreign key).&lt;br/&gt;
The corresponding foreign key fields in the 2 foreign tables, will be updated with the value given (here 23).&lt;/p&gt;

&lt;p&gt;Because save() is used in a lot of different places in our app, I need to find a solution to fix save(), or if not possible to override it to run a execute()like query.&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;br/&gt;
Don&apos;t hesitate to ask if you want more details.&lt;/p&gt;

&lt;p&gt;Yan&lt;/p&gt;</description>
                <environment>Windows server 2003  PHP 5.2.17 / XP PRO 32bits XAMPP PHP 5.3.5&lt;br/&gt;
MSSQL / MYSQL&lt;br/&gt;
Symfony 1.4.6</environment>
            <key id="12702">DC-1009</key>
            <summary>save() also updates fields which should not be</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="karibusan">Yan Urquiza</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Jun 2011 15:24:12 +0000</created>
                <updated>Wed, 8 Jun 2011 15:40:42 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11012" name="after_with_execute.PNG" size="110183" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11011" name="after_with_save.PNG" size="110270" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11010" name="before.PNG" size="108968" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11014" name="retrieveByExamBatchStatus.php" size="1246" author="karibusan" created="Wed, 8 Jun 2011 15:29:50 +0000" />
                    <attachment id="11013" name="schema.yml" size="4243" author="karibusan" created="Wed, 8 Jun 2011 15:29:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-329] Problem saving Self Referencing (Nest Relations)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-329</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There is a problem when you save Many to Many Self Referencing (Nest Relations).&lt;/p&gt;

&lt;p&gt;I used the same example that it&apos;s used on Doctrine 1.2 Self Referencing (Nest Relations) Documentation:&lt;/p&gt;

&lt;p&gt;My Schema:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;User:&lt;br/&gt;
  columns:&lt;br/&gt;
    name: &lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: { type}&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;  relations:&lt;br/&gt;
    Parents:&lt;br/&gt;
      class: User&lt;br/&gt;
      local: child_id&lt;br/&gt;
      foreign: parent_id&lt;br/&gt;
      refClass: UserReference&lt;br/&gt;
      foreignAlias: Children&lt;/p&gt;

&lt;p&gt;UserReference:&lt;br/&gt;
  columns:&lt;br/&gt;
    parent_id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      primary: true&lt;br/&gt;
    child_id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      primary: true&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Fixtures:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;User:&lt;br/&gt;
  james:&lt;br/&gt;
    name: James&lt;br/&gt;
  alexander:&lt;br/&gt;
    name: Alexander&lt;br/&gt;
  david:&lt;br/&gt;
    name: David&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The problem happens with the Children. The first time I assigned children and saved the User, there is no problem; but when I saved the User again (without any change on him) the values in the UserReference? table changes: the &quot;parent_id&quot; takes the value of the &quot;child_id&quot;.&lt;/p&gt;

&lt;p&gt;I test it with Sf 1.4 and with Sf 1.3 stable versions, and I&apos;ve got the same error.&lt;/p&gt;

&lt;p&gt;If it not clear to understand what I&apos;m saying, I put a &quot;very ilustrative&quot; image about the form and how change the values of the UserReference? table. Please see it, because it would be very usefull for understanding (explains better than my terrible English)&lt;/p&gt;

&lt;p&gt;Thanks for all your work! &lt;/p&gt;

&lt;p&gt;P. D. &lt;/p&gt;

&lt;p&gt;I forgot to to say that watching the stack trace I think that the problem is in:&lt;/p&gt;

&lt;p&gt;symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php&lt;/p&gt;

&lt;p&gt;In the line 429:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;public function saveAssociations(Doctrine_Record $record)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I would like to help more, but I couldn&apos;t figure out how this function works.&lt;/p&gt;</description>
                <environment>Mac OSX 10.5, Symfony 1.4 and MAMP</environment>
            <key id="10566">DC-329</key>
            <summary>Problem saving Self Referencing (Nest Relations)</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jaimesuez">Jaime Suez</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Dec 2009 17:48:37 +0000</created>
                <updated>Fri, 3 Jun 2011 13:14:55 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>14</votes>
                        <watches>14</watches>
                        <comments>
                    <comment id="11033" author="jaimesuez" created="Mon, 7 Dec 2009 00:38:52 +0000"  >&lt;p&gt;This picture explains the error that it&apos;s done when you do an insert and then you save it again.&lt;/p&gt;</comment>
                    <comment id="11048" author="jwage" created="Mon, 7 Dec 2009 17:59:04 +0000"  >&lt;p&gt;Can you provide a failing Doctrine test case? This may be a problem with Symfony and not Doctrine.&lt;/p&gt;</comment>
                    <comment id="11079" author="jaimesuez" created="Tue, 8 Dec 2009 12:55:47 +0000"  >&lt;p&gt;First I published this bug on Symfony, because I thought that was a problem with Symfony, but you set it as invalid because it&apos;s belong to Doctrine.&lt;/p&gt;

&lt;p&gt;This is the ticket on symfony: &lt;br/&gt;
&lt;a href=&quot;http://trac.symfony-project.org/ticket/7690&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7690&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I could do the Doctrine test case, but in one more mounth, because tomorrow I go out for vacations.&lt;br/&gt;
When I come back I&apos;ll do them.&lt;/p&gt;</comment>
                    <comment id="11244" author="psylosss" created="Sun, 20 Dec 2009 20:01:08 +0000"  >&lt;p&gt;Yes, I have got the same problem. During hours of debugging and exploring Doctrine&apos;s code, I found that problem localized in Hydrator component. I cannot digg deeper, so I ask you to fix it very much&lt;/p&gt;</comment>
                    <comment id="11296" author="p16" created="Sat, 26 Dec 2009 15:09:43 +0000"  >&lt;p&gt;Hi,&lt;br/&gt;
I had this problem in the 1.0 version of doctrine as well.&lt;br/&gt;
Using symfony, I upgraded to symfony 1.3 and doctrine 1.2 and I&apos;ve found the same problem.&lt;/p&gt;

&lt;p&gt;Attached to this comment you can find the files containing the schema I used (it is the same as that describe on this ticket but with a different class naming), and 2 unit tests. One using the symfony form  and one using directly the doctrine objects. They report the bug discussed on this ticket and show another bug saving objects that already have one ore more relations.&lt;/p&gt;

&lt;p&gt;As fixtures I used a fixtures.yml file containing: &lt;/p&gt;

&lt;p&gt;Issue:&lt;br/&gt;
&amp;lt;?php for ($i = 1; $i &amp;lt;= 30; $i++): ?&amp;gt;&lt;br/&gt;
  Issue_&amp;lt;?php echo $i; ?&amp;gt;:&lt;br/&gt;
    title: &quot;new issue &amp;lt;?php echo $i ?&amp;gt;&quot;&lt;br/&gt;
&amp;lt;?php endfor; ?&amp;gt;&lt;/p&gt;


&lt;p&gt;The following are the tests results:&lt;/p&gt;

&lt;p&gt;&amp;#8211; testEqualNestRelationsTest.php (using the forms) &amp;#8211; &lt;/p&gt;

&lt;p&gt;&amp;gt; First form for first issue: creation of the relation &quot;issue 1 -&amp;gt; issue 2&quot;&lt;br/&gt;
ok 1 - the edit form for issue 1 is valid&lt;br/&gt;
ok 2 - form1 saved&lt;br/&gt;
ok 3 - issue 1 is related with another issue&lt;br/&gt;
ok 4 - issue 1 is really related with issue 2&lt;/p&gt;

&lt;p&gt;&amp;gt; Second form for first issue: saving the relation between &quot;issue 1&quot; and &quot;issue 2&quot; from &quot;issue 2&quot;&apos;s form&lt;br/&gt;
ok 5 - the edit form for issue 2 is valid&lt;br/&gt;
ok 6 - form2 saved&lt;br/&gt;
not ok 7 - issue 2 is related with another issue  ******** this is the problem reported on this ticket ********&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testEqualNestRelationsTest.php at line 57)&lt;/li&gt;
	&lt;li&gt;got: 0&lt;/li&gt;
	&lt;li&gt;expected: 1&lt;br/&gt;
not ok 8 - issue 2 is really related with issue 1&lt;/li&gt;
	&lt;li&gt;Failed test (./test/unit/testEqualNestRelationsTest.php at line 58)&lt;/li&gt;
	&lt;li&gt;got: NULL&lt;/li&gt;
	&lt;li&gt;expected: 1&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;ok 9 - issue 1 is related with another issue&lt;br/&gt;
not ok 10 - issue 1 is really related with issue 2  ******** this is the problem reported on this ticket ********&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testEqualNestRelationsTest.php at line 63)&lt;/li&gt;
	&lt;li&gt;got: &apos;1&apos;&lt;/li&gt;
	&lt;li&gt;expected: 2&lt;br/&gt;
&amp;gt; Checking the relation table IssueReference ...&lt;br/&gt;
ok 11 - There is only one relation saved on IssueReference&lt;br/&gt;
ok 12 - 1 is the issue1 field of the relation&lt;br/&gt;
not ok 13 - 2 is the issue2 field of the relation ******** this is the problem reported on this ticket ********&lt;/li&gt;
	&lt;li&gt;Failed test (./test/unit/testEqualNestRelationsTest.php at line 71)&lt;/li&gt;
	&lt;li&gt;got: &apos;1&apos;&lt;/li&gt;
	&lt;li&gt;expected: &apos;2&apos;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&amp;gt; multi selection proof&lt;br/&gt;
ok 14 - the edit form for issue 1 is valid&lt;br/&gt;
ok 15 - form1 saved&lt;br/&gt;
ok 16 - the edit form for issue 2 is valid&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;ul&gt;
					&lt;li&gt;
					&lt;ul&gt;
						&lt;li&gt;
						&lt;ul&gt;
							&lt;li&gt;
							&lt;ul&gt;
								&lt;li&gt;this is the other bug I&apos;ve found ********&lt;br/&gt;
not ok 17 - form2 exception catched : SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1-1&apos; for key 1&lt;/li&gt;
							&lt;/ul&gt;
							&lt;/li&gt;
						&lt;/ul&gt;
						&lt;/li&gt;
					&lt;/ul&gt;
					&lt;/li&gt;
				&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testEqualNestRelationsTest.php at line 114)&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&amp;#8211; testNestedEqualRelationWithObjectsTest.php (test using the &quot;doctrine&quot; objects ) &amp;#8211;&lt;/p&gt;

&lt;p&gt;&amp;gt; Saving relation directly from the objects and not using the forms...&lt;br/&gt;
ok 1 - issue1 saved&lt;br/&gt;
&amp;gt; checking issue1 relations&lt;br/&gt;
ok 2 - issue 1 is related with another issue&lt;br/&gt;
ok 3 - issue 1 is really related with issue 2&lt;/p&gt;

&lt;p&gt;&amp;gt; checking &quot;reverse&quot; relation on issue2&lt;br/&gt;
ok 4 - issue 2 is related with another issue&lt;br/&gt;
ok 5 - issue 2 is really related with issue 1&lt;/p&gt;

&lt;p&gt;&amp;gt; adding a relation issue2-&amp;gt;issue1 directly&lt;br/&gt;
ok 6 - issue2 saved&lt;/p&gt;

&lt;p&gt;&amp;gt; checking issue2 relations&lt;br/&gt;
not ok 7 - issue 2 is related with another issue  ******** this is the problem reported on this ticket ********&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testNestedEqualRelationWithObjectsTest.php at line 56)&lt;/li&gt;
	&lt;li&gt;got: 0&lt;/li&gt;
	&lt;li&gt;expected: 1&lt;br/&gt;
not ok 8 - issue 2 is really related with issue 1&lt;/li&gt;
	&lt;li&gt;Failed test (./test/unit/testNestedEqualRelationWithObjectsTest.php at line 57)&lt;/li&gt;
	&lt;li&gt;got: NULL&lt;/li&gt;
	&lt;li&gt;expected: 1&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&amp;gt; checking issue1 relations&lt;br/&gt;
ok 9 - issue 1 is related with another issue&lt;br/&gt;
not ok 10 - issue 1 is really related with issue 2  ******** this is the problem reported on this ticket ********&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testNestedEqualRelationWithObjectsTest.php at line 63)&lt;/li&gt;
	&lt;li&gt;got: &apos;1&apos;&lt;/li&gt;
	&lt;li&gt;expected: 2&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&amp;gt; Checking the relation table IssueReference ...&lt;br/&gt;
ok 11 - There is only one relation saved on IssueReference&lt;br/&gt;
ok 12 - 1 is the issue1 field of the relation&lt;br/&gt;
not ok 13 - 2 is the issue2 field of the relation&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testNestedEqualRelationWithObjectsTest.php at line 71)&lt;/li&gt;
	&lt;li&gt;got: &apos;1&apos;&lt;/li&gt;
	&lt;li&gt;expected: &apos;2&apos;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&amp;gt; object multi adding relation proof&lt;br/&gt;
ok 14 - issue1 saved&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;ul&gt;
					&lt;li&gt;
					&lt;ul&gt;
						&lt;li&gt;
						&lt;ul&gt;
							&lt;li&gt;
							&lt;ul&gt;
								&lt;li&gt;this is the other bug I&apos;ve found ********&lt;br/&gt;
not ok 15 - issue2 exception catched : SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1-1&apos; for key 1&lt;/li&gt;
							&lt;/ul&gt;
							&lt;/li&gt;
						&lt;/ul&gt;
						&lt;/li&gt;
					&lt;/ul&gt;
					&lt;/li&gt;
				&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
	&lt;li&gt;Failed test (./test/unit/testNestedEqualRelationWithObjectsTest.php at line 112)&lt;/li&gt;
&lt;/ol&gt;


</comment>
                    <comment id="11370" author="jaimesuez" created="Wed, 13 Jan 2010 15:27:21 +0000"  >&lt;p&gt;With the test provided by Filippo De Santis is any other thing needed??&lt;/p&gt;

&lt;p&gt;I still on vacations untill 3 of febrary, so then I could do any other thing needed.&lt;/p&gt;
</comment>
                    <comment id="11571" author="jaimesuez" created="Mon, 1 Feb 2010 15:54:37 +0000"  >&lt;p&gt;The necessary test have to be how are illustrated in this link???&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="11648" author="bgm" created="Tue, 9 Feb 2010 22:35:23 +0000"  >&lt;p&gt;What has happen with this bug?? I also have the same problem...&lt;/p&gt;</comment>
                    <comment id="11968" author="jwage" created="Tue, 2 Mar 2010 12:43:43 +0000"  >&lt;p&gt;Hi, yes. We still need a unit test case like described here: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we can run it with all the other tests and reproduce the issue in Doctrine by itself. Not in Symfony.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="11988" author="psylosss" created="Tue, 2 Mar 2010 15:13:30 +0000"  >&lt;p&gt;Jon, here is the test for this bug: &lt;a href=&quot;http://gist.github.com/319856&quot; class=&quot;external-link&quot;&gt;http://gist.github.com/319856&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please, fix it.. my work has been stopped cause of it&lt;/p&gt;</comment>
                    <comment id="12203" author="jaimesuez" created="Mon, 15 Mar 2010 13:12:55 +0000"  >&lt;p&gt;Yes... please fix it... I&apos;m also stuck in my work since a lot of time that the bug it&apos;s open.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="12212" author="lilawolf" created="Mon, 15 Mar 2010 14:24:37 +0000"  >&lt;p&gt;I&apos;m affected with this bug as well, fortunately, I found a way to get over it, it&apos;s ugly and innefficient, but at least my work isn&apos;t stopped due to this bug. I&apos;ll try to explain what I did commenting here later. Anyway, I really need this bug fixed too before I can start betatesting my app.&lt;br/&gt;
Thanks!&lt;/p&gt;

&lt;p&gt;P.D: I&apos;m using Doctrine 1.2.1.&lt;/p&gt;</comment>
                    <comment id="12215" author="jwage" created="Mon, 15 Mar 2010 14:35:09 +0000"  >&lt;p&gt;I am trying to understand the issue but it just doesn&apos;t make much sense to me yet. The test case is wrong because you are dealing with instances of objects that have previously loaded references, then you try and re-fetch the same object instance. If you do $user1-&amp;gt;free(true); then re-fetch the object the test passes as expected. So, I don&apos;t really have a proper failing test case still that actually exposes the problem. I&apos;ll keep playing around see if I can understand. let me know if anyone else has more information or a patch to test.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12296" author="p16" created="Tue, 16 Mar 2010 17:22:33 +0000"  >&lt;p&gt;Hi Jonathan,&lt;br/&gt;
This is the &quot;translated&quot; version of my unit test for symfony in &quot;doctrine unit test&quot;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/ideato/phpcollab3/blob/phpcollabsf13/test/doctrine_unit_test/DC329TestCase.php&quot; class=&quot;external-link&quot;&gt;http://github.com/ideato/phpcollab3/blob/phpcollabsf13/test/doctrine_unit_test/DC329TestCase.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first test is to show the error &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 19 columns issue1, issue2 are not unique&quot;.&lt;br/&gt;
The second one is to show the fact that the relation are saved with wrong data.&lt;/p&gt;

&lt;p&gt;Sorry for the late translation.&lt;/p&gt;

&lt;p&gt;Filippo &lt;/p&gt;</comment>
                    <comment id="12299" author="hckurniawan" created="Tue, 16 Mar 2010 21:55:53 +0000"  >&lt;p&gt;Hi Jonathan,&lt;/p&gt;

&lt;p&gt;It seems that the problem is caused by Doctrine_Collection::add() method line 456 (I could be totally wrong).&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; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;referenceField)) {
    $value = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;reference-&amp;gt;get($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;relation-&amp;gt;getLocalFieldName());
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($value !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
        $record-&amp;gt;set($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;referenceField, $value, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
        $record-&amp;gt;set($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;referenceField, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;reference, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
    }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What is trying to do is to set the reference field value to the reference value that it&apos;s linked to.&lt;/p&gt;

&lt;p&gt;This only happens when you try to fetch record from the &quot;children&quot;.&lt;/p&gt;

&lt;p&gt;Consider the following:&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;Employees:
  tableName: employees
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    name:
      type: string(100)
  relations:
    managing:
      class: Employees
      type: many
      local: manager_id
      foreign: employee_id
      foreignAlias: managedBy
      refClass: EmployeeManager

EmployeeManager:
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Code:&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-comment&quot;&gt;// ----- The following will not give you any issues
&lt;/span&gt;  $manager = Doctrine::getTable(&apos;Issue&apos;)-&amp;gt;findOneBy(&apos;id&apos;, &apos;1&apos;); &lt;span class=&quot;code-comment&quot;&gt;// This is a manager
&lt;/span&gt;  foreach ($manager-&amp;gt;managing as $employee) {
    ....
  }

  &lt;span class=&quot;code-comment&quot;&gt;// This will not save anything
&lt;/span&gt;  $manager-&amp;gt;save();
&lt;span class=&quot;code-comment&quot;&gt;// -----
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// ----- The following will
&lt;/span&gt;  $employee = Doctrine::getTable(&apos;Issue&apos;)-&amp;gt;findOneBy(&apos;id&apos;, &apos;2&apos;); &lt;span class=&quot;code-comment&quot;&gt;// This is an employee
&lt;/span&gt;  foreach ($employee-&amp;gt;managedBy as $manager) {
    ...
  }

  &lt;span class=&quot;code-comment&quot;&gt;// This will save the wrong data to the &lt;span class=&quot;code-quote&quot;&gt;&quot;EmployeeManager&quot;&lt;/span&gt; table
&lt;/span&gt;  &lt;span class=&quot;code-comment&quot;&gt;// because the code from Doctrine_Collection is overwriting &lt;span class=&quot;code-quote&quot;&gt;&quot;EmployeeManager&quot;&lt;/span&gt; records
&lt;/span&gt;  &lt;span class=&quot;code-comment&quot;&gt;// When they were being added to the collection by the Hydrator.
&lt;/span&gt;  $employee-&amp;gt;save();
&lt;span class=&quot;code-comment&quot;&gt;// -----&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Debug backtrace when this happens:&lt;/p&gt;
&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;string(100) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Record.php @ line 1432&quot;&lt;br/&gt;
string(103) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Collection.php @ line 461&quot;&lt;br/&gt;
string(99) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Access.php @ line 131&quot;&lt;br/&gt;
string(107) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Hydrator/Graph.php @ line 229&quot;&lt;br/&gt;
string(101) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Hydrator.php @ line 137&quot;&lt;br/&gt;
string(108) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Query/Abstract.php @ line 1036&quot;&lt;br/&gt;
string(105) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Relation/Nest.php @ line 84&quot;&lt;br/&gt;
string(100) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Record.php @ line 1362&quot;&lt;br/&gt;
string(100) &quot;File: /Data/app/onlinevw-drupalvividwireless/libs/external-doctrine1/Doctrine/Record.php @ line 1333&quot;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12372" author="loops" created="Fri, 19 Mar 2010 12:33:35 +0000"  >&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;For people who are looking for a workaround, I&apos;ve found one that work for me.&lt;/p&gt;

&lt;p&gt;Get the doctrine extension h2aEqualable (h2aEqualable.zip), register it as a doctrine extension (see &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/0_11/extensions&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/0_11/extensions&lt;/a&gt;) and make your refClass of every equal nest relation acting as h2aEqualable.&lt;/p&gt;

&lt;p&gt;In your PHP script :&lt;br/&gt;
{{&lt;br/&gt;
Doctrine::setExtensionsPath( &apos;path/to/unzip/place&apos; );&lt;br/&gt;
Doctrine_Manager::getInstance()-&amp;gt;registerExtension( &apos;h2aEqualable&apos; );&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;In your YAML schema :&lt;br/&gt;
{{&lt;br/&gt;
MyEqualNestRelationRefClassModel:&lt;br/&gt;
  actAs:&lt;br/&gt;
    h2aEqualable:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;id_1,id_2&amp;#93;&lt;/span&gt;&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;As I&apos;ve said before, it works for me, so let me know if it solve your issues too...&lt;/p&gt;</comment>
                    <comment id="13365" author="pgueguin" created="Fri, 18 Jun 2010 12:57:55 +0000"  >&lt;p&gt;I have the very same issue with non equal nest relations.&lt;br/&gt;
It is stopping my project&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;87-87&apos; for key &apos;PRIMARY&apos;&lt;/p&gt;

&lt;p&gt;execute : UPDATE cop_job_stream_successor SET job_stream_destination_id = ?, updated_at = ? WHERE job_stream_source_id = ? AND job_stream_destination_id = ? - (87, 2010-06-18 18:55:32, 87, 94) &lt;/p&gt;

&lt;p&gt;CopJobStream:&lt;br/&gt;
  columns:&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: false&lt;br/&gt;
....&lt;br/&gt;
  relations:&lt;br/&gt;
   SuccessorJobStreams:&lt;br/&gt;
     class: CopJobStream&lt;br/&gt;
     local: job_stream_source_id&lt;br/&gt;
     foreign: job_stream_destination_id    &lt;br/&gt;
     refClass: CopJobStreamSuccessor&lt;br/&gt;
     foreignAlias: PredecessorJobStreams&lt;br/&gt;
     onDelete: CASCADE &lt;br/&gt;
     onUpdate: CASCADE &lt;/p&gt;

&lt;p&gt;CopJobStreamSuccessor:&lt;br/&gt;
  columns:&lt;br/&gt;
   job_stream_source_id:&lt;br/&gt;
     type: integer&lt;br/&gt;
     primary: true&lt;br/&gt;
   job_stream_destination_id:&lt;br/&gt;
     type: integer&lt;br/&gt;
     primary: true&lt;br/&gt;
  relations:&lt;br/&gt;
    CopJobStream:&lt;br/&gt;
      local: job_stream_source_id&lt;br/&gt;
      foreignAlias: CopJobStreamSuccessors&lt;br/&gt;
      onDelete: CASCADE&lt;br/&gt;
      onUpdate: CASCADE    &lt;/p&gt;</comment>
                    <comment id="13367" author="pgueguin" created="Fri, 18 Jun 2010 14:20:28 +0000"  >&lt;p&gt;It works anyway with above   h2aEqualable extension&lt;/p&gt;</comment>
                    <comment id="15186" author="bigbadbassman" created="Wed, 26 Jan 2011 02:39:36 +0000"  >&lt;p&gt;after stumbling into the same pit as everyone, i created a fresh report as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-958&quot; title=&quot;updating Models with Intra-Table Relations cascades strangely&quot;&gt;DC-958&lt;/a&gt;. Later I found out that it has been reported before, so please mark &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-958&quot; title=&quot;updating Models with Intra-Table Relations cascades strangely&quot;&gt;DC-958&lt;/a&gt; as duplicate of this. (or at least related, as I was using a Non-Equal Nested Set) also &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-952&quot; title=&quot;Non-Equal Nest Relations Not Working - from &amp;quot;Children&amp;quot; side&quot;&gt;DC-952&lt;/a&gt; refers to the same problem, but also with Non-Equal nestet sets.&lt;/p&gt;

&lt;p&gt;My Case:  Non-Equal-Nested-Set. Problems occur on saving Objects for 2nd or more time. Doctrine deletes all Child-Relations of the Object to be saved and updates Relations of the Childs to other Objects (other parents of the children objects) with references to the child itself!&lt;/p&gt;

&lt;p&gt;the proposed h2aEqualable extension does prevent the wrong update statements but not the initial delete of the child-relations.&lt;/p&gt;

&lt;p&gt;What exactly is missing on this bug to be fixed? It is now a year old, and clearly preventing people from using Self-Referencing relations with doctrine.&lt;/p&gt;

&lt;p&gt;How can we help? More sample data, schema definitions, test cases?&lt;/p&gt;</comment>
                    <comment id="15309" author="flevour" created="Tue, 15 Feb 2011 06:41:46 +0000"  >&lt;p&gt;Here is a better and simpler test case for the equal relation: &lt;a href=&quot;https://gist.github.com/827414&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/827414&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is clearly a memory problem here. I&apos;ll leave it up to Jonathan to decide whether it&apos;s a scenario which can be avoided in Doctrine itself or must be handled by Symfony (&lt;a href=&quot;http://trac.symfony-project.org/ticket/9398&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/9398&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;In the Symfony context calls to refresh() might not be an option when modifying an object (aka saving a form).&lt;/p&gt;</comment>
                    <comment id="15333" author="yitznewton" created="Thu, 17 Feb 2011 12:06:55 +0000"  >&lt;p&gt;h2aEqualable seems to work for me.&lt;/p&gt;</comment>
                    <comment id="15898" author="pavel.campr" created="Thu, 2 Jun 2011 07:48:44 +0000"  >&lt;p&gt;h2aEqualable works only partly for me (same as Daniel Reiche wrote).&lt;/p&gt;

&lt;p&gt;I tried to identify the problem. &lt;/p&gt;

&lt;p&gt;My usecase was: &lt;br/&gt;
1) I have an Article record in $article&lt;br/&gt;
2) I called $article-&amp;gt;RelatedArticles-&amp;gt;getPrimaryKeys() , where RelatedArticles is a name of my self reference&lt;br/&gt;
3) $article-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;The problem originates from step 2), during hydratation process for related articles, which are added to a collection of related articles, in Collection-&amp;gt;add() method (line 465) here:&lt;/p&gt;

&lt;p&gt;            if ($value !== null) &lt;/p&gt;
{
                $record-&amp;gt;set($this-&amp;gt;referenceField, $value, false);
            }
&lt;p&gt; else {&lt;/p&gt;

&lt;p&gt;but, $this-&amp;gt;referenceField contains wrong name of reference field. Self referenced model (Article) has two relations to the same class (one from &quot;owning&quot; side, second from &quot;referencing&quot; side). $this-&amp;gt;referenceField in the collection is somewhere filled with the wrong relation name (not the&quot;referencing&quot; one, but the &quot;owning&quot; one). &lt;/p&gt;

&lt;p&gt;When I save the $article, all referenced records are saved too and this is the problem, why the Doctrine tries to save corrupted data:&lt;/p&gt;

&lt;p&gt;In my example, I have this data:&lt;/p&gt;

&lt;p&gt;in Doctrine_Collection-&amp;gt;add on line 457: $record) is a RelatedArticle (&lt;br/&gt;
    article1 = string(1) &quot;4&quot;&lt;br/&gt;
    article2 = string(1) &quot;9&quot;&lt;br/&gt;
)&lt;br/&gt;
in Doctrine_Collection-&amp;gt;add on line 458: $this-&amp;gt;referenceField) = string(19) &quot;article1&quot;&lt;br/&gt;
in Doctrine_Collection-&amp;gt;add on line 459: $value) = string(1) &quot;9&quot;   &lt;/p&gt;

&lt;p&gt;BUT expected data is:&lt;/p&gt;

&lt;p&gt;in Doctrine_Collection-&amp;gt;add on line 458: $this-&amp;gt;referenceField) = string(19) &quot;article2&quot;&lt;/p&gt;


&lt;p&gt;This wrong behavior modified my RelatedArticle into this: RelatedArticle (&lt;br/&gt;
    article1 = string(1) &quot;9&quot;&lt;br/&gt;
    article2 = string(1) &quot;9&quot;&lt;br/&gt;
)&lt;/p&gt;


&lt;p&gt;I have no idea how to fix it, but maybe someone can, I hope &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;(&lt;br/&gt;
my schema is:&lt;/p&gt;

&lt;p&gt;Article&lt;br/&gt;
  relations:&lt;br/&gt;
    RelatedArticles:&lt;br/&gt;
      class: Article&lt;br/&gt;
      local: article1&lt;br/&gt;
      foreign: article2&lt;br/&gt;
      refClass: RelatedArticle&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;Maybe, when &quot;refClassRelationAlias&quot; option was invented to specifically point to a relation, instead of using &quot;refClass&quot;, which can be used more times for one record and thus is not unambiguous, something for self referenced relations should be added as well. My &quot;refClass: RelatedArticle&quot; creates (probably) a relation from the foreign side too and Article contains two relations, which uses same refClass. Doctrine then doesn&apos;t know, which one should be used. &lt;/p&gt;
</comment>
                    <comment id="15901" author="pavel.campr" created="Fri, 3 Jun 2011 13:14:55 +0000"  >&lt;p&gt;&lt;b&gt;Non-equal&lt;/b&gt; nest relations work properly, when &lt;b&gt;refClassRelationAlias&lt;/b&gt; undocumented option is used, e.g.&lt;/p&gt;


&lt;p&gt;Article:&lt;br/&gt;
  ...&lt;br/&gt;
  relations:&lt;br/&gt;
    RelatedArticles:&lt;br/&gt;
      class: Article&lt;br/&gt;
      local: article1&lt;br/&gt;
      foreign: article2&lt;br/&gt;
      refClass: RelatedArticle&lt;br/&gt;
      refClassRelationAlias: RelatedArticleAlias&lt;/p&gt;

&lt;p&gt;Anything can be used as a value for refClassRelationAlias.&lt;/p&gt;

&lt;p&gt;Unfortunately, &lt;b&gt;this doesn&apos;t fix equal nest relations&lt;/b&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10505" name="h2aEqualable.zip" size="3041" author="loops" created="Fri, 19 Mar 2010 12:33:52 +0000" />
                    <attachment id="10216" name="saving process.png" size="64255" author="jaimesuez" created="Mon, 7 Dec 2009 00:38:52 +0000" />
                    <attachment id="10260" name="schema.yml" size="443" author="p16" created="Sat, 26 Dec 2009 15:09:43 +0000" />
                    <attachment id="10261" name="testEqualNestRelationsTest.php" size="3598" author="p16" created="Sat, 26 Dec 2009 15:09:43 +0000" />
                    <attachment id="10262" name="testNestedEqualRelationWithObjectsTest.php" size="3391" author="p16" created="Sat, 26 Dec 2009 15:09:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1008] missing oci_type in Doctrine_Adapter_Statement_Oracle-&gt;bindParam</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1008</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;in bindParam method there is:&lt;br/&gt;
switch ($type) {&lt;br/&gt;
            case Doctrine_Core::PARAM_STR:&lt;br/&gt;
                $oci_type = SQLT_CHR;&lt;br/&gt;
             break;&lt;br/&gt;
}&lt;br/&gt;
I think there should be other oci_types too. I had to add:&lt;br/&gt;
case Doctrine_Core::PARAM_INT:&lt;br/&gt;
                $oci_type = SQLT_INT;&lt;br/&gt;
because I got ORA-06502: PL/SQL: numeric or value error: character string buffer too small. while executing&lt;br/&gt;
$stmt-&amp;gt;bindParam(&quot;:result&quot;, $result,  Doctrine_Core::PARAM_INT);&lt;/p&gt;

&lt;p&gt;After adding SQLT_INT everything is ok&lt;/p&gt;</description>
                <environment></environment>
            <key id="12685">DC-1008</key>
            <summary>missing oci_type in Doctrine_Adapter_Statement_Oracle-&gt;bindParam</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="madeyt">Tomasz Madeyski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 May 2011 08:51:35 +0000</created>
                <updated>Tue, 31 May 2011 08:51:35 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1007] Cannot update a field to NULL with MSSQL connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1007</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to update a field to NULL in a MSSQL database, Doctrine generates the following request:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    UPDATE table SET fieldThatMustBeNull = , anotherField = &apos;blabla&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;therefore generating a syntax error.&lt;/p&gt;

&lt;p&gt;A fix would be to override the update method in the Doctrine_Connection_Mssql and add the following behavior:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine_Connection_Mssql&lt;/b&gt;&lt;/div&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 update(Doctrine_Table $table, array $fields, array $identifier)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (empty($fields)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        }

        $set = array();
        foreach ($fields as $fieldName =&amp;gt; $value) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($value &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Expression) {
                $set[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName)) . &apos; = &apos; . $value-&amp;gt;getSql();
                unset($fields[$fieldName]);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_null($value)) {
                $set[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName)) . &apos; = NULL&apos;;
                unset($fields[$fieldName]);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                $set[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName)) . &apos; = ?&apos;;
            }
        }

        $params = array_merge(array_values($fields), array_values($identifier));

        $sql  = &apos;UPDATE &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getTableName())
              . &apos; SET &apos; . implode(&apos;, &apos;, $set)
              . &apos; WHERE &apos; . implode(&apos; = ? AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteMultipleIdentifier($table-&amp;gt;getIdentifierColumnNames()))
              . &apos; = ?&apos;;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;exec($sql, $params);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows 7 32 bits with Apache 2.2.x, PHP 5.2.17, Sql Server 2008, Symfony 1.4.11 and Doctrine 1.2.4</environment>
            <key id="12667">DC-1007</key>
            <summary>Cannot update a field to NULL with MSSQL connection</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="guitio2002">guitio2002</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 May 2011 19:37:07 +0000</created>
                <updated>Wed, 25 May 2011 19:43:52 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-998] MySQL Driver possibly subject to sql injections with PDO::quote()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-998</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Prior to 5.3.6, the MySQL PDO driver ignored the character set parameter to options. Due to MySQL&apos;s C api (and MySQLND), this is required for the proper function of mysql_real_escape_string() (the C API call). Since PDO uses the mres() C call for PDO::quote(), this means that the quoted string does not take into account the connection character set.&lt;/p&gt;

&lt;p&gt;Starting with 5.3.6, that was fixed. So now if you pass the proper character set to PDO via driver options, sql injection is impossible while using the PDO::quote() api call.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;PDO proof of concept&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$dsn = &apos;mysql:dbname=INFORMATION_SCHEMA;host=127.0.0.1;charset=GBK;&apos;;
$pdo = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PDO($dsn, $user, $pass);
$pdo-&amp;gt;exec(&apos;SET NAMES GBK&apos;);
$string = chr(0xbf) . chr(0x27) . &apos; OR 1 = 1; /*&apos;;
$sql = &quot;SELECT TABLE_NAME
            FROM INFORMATION_SCHEMA.TABLES
            WHERE TABLE_NAME LIKE &lt;span class=&quot;code-quote&quot;&gt;&quot;.$pdo-&amp;gt;quote($string).&quot;&lt;/span&gt; LIMIT 1;&quot;;
$stmt = $pdo-&amp;gt;query($sql);
var_dump($stmt-&amp;gt;rowCount());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Expected Result: `int(0)`.&lt;br/&gt;
Actual Result: `int(1)`.&lt;/p&gt;


&lt;p&gt;There are 2 issues to fix. First, the documentation does not indicate that you can pass the `charset` option to the MySQL Driver. This should be fixed so that users are given the proper option to set character sets.&lt;/p&gt;

&lt;p&gt;Secondly, `Connection::setCharset()` should be modified for MySQL to throw an exception, since the character set is only safely setable using the DSN with PDO. This is a limitation of the driver and could be asked as a feature request for the PHP core. Either that, or a big warning should be put on the documentation of the API to indicate the unsafe character set change&lt;/p&gt;

&lt;p&gt;Note that this is the same issue reported for Doctrine2 with link: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-111&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DBAL-111&lt;/a&gt; &lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12570">DC-998</key>
            <summary>MySQL Driver possibly subject to sql injections with PDO::quote()</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ircmaxell">Anthony Ferrara</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Apr 2011 13:30:02 +0000</created>
                <updated>Mon, 23 May 2011 13:43:37 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15872" author="fabpot" created="Mon, 23 May 2011 13:43:37 +0000"  >&lt;p&gt;Any news on this one? It has been &quot;fixed&quot; in Doctrine2 and must be also fixed in Doctrine1.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1006] Custom geometric query error with orderBy</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1006</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Mi Doctrine_Query with this Geometric Query fails with orderBy , but with where works.&lt;/p&gt;

&lt;p&gt;$distance = &quot;glength(linestringfromwkb(linestring(GeomFromText(&apos;POINT( &quot;.$object-&amp;gt;getLatitude().&quot; &quot;.$object-&amp;gt;getLongitude() .&quot;)&apos;),l.point))) &quot;&lt;/p&gt;

&lt;p&gt;This works:&lt;br/&gt;
SomeObjectTable::getInstance()&lt;del&gt;&amp;gt;createQuery()&lt;/del&gt;&amp;gt;where($distance.&apos; &amp;lt; ?&apos;,0.05 )&lt;/p&gt;

&lt;p&gt;But this one fails at version 1.2.4, with older version was working.&lt;br/&gt;
SomeObjectTable::getInstance()&lt;del&gt;&amp;gt;createQuery()&lt;/del&gt;&amp;gt;where($distance.&apos; &amp;lt; ?&apos;,0.05 )-&amp;gt;orderBy($distance)&lt;/p&gt;

&lt;p&gt;Well the problem is at line 74 of OrderBy.php :&lt;br/&gt;
$componentAlias = implode(&apos;.&apos;, $e);&lt;/p&gt;



&lt;p&gt;the rendered query in the distance has some &quot;.&quot;, for example:&lt;br/&gt;
POINT( -34.470829 -58.5286102)&lt;/p&gt;

&lt;p&gt;then the after line 74 in OrderBy tries to search por &apos;58&apos; class.&lt;/p&gt;

&lt;p&gt;I manually added to DataDict in Mysql.php the POINT datatype (this fix solve me the problem in older versions of Doctrine).&lt;/p&gt;
</description>
                <environment>Symfony 1.4.11 and Doctrine 1.2.4. Ubuntu 11.04 Apache2 with mod php5. php5 version PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch </environment>
            <key id="12659">DC-1006</key>
            <summary>Custom geometric query error with orderBy</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="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="llazzaro">Leonardo Lazzaro</reporter>
                        <labels>
                    </labels>
                <created>Sun, 22 May 2011 19:41:17 +0000</created>
                <updated>Sun, 22 May 2011 19:41:17 +0000</updated>
                                    <version>1.2.4</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Attributes</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-927] Query with left join and group clause returns only one row, even though there are multiple results</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-927</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;under certain circumstances, Doctrine will only return one result out of a bunch of results, for example:&lt;/p&gt;

&lt;p&gt;$ symfony doctrine:dql &quot;from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)&quot;&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;1&apos;&lt;/p&gt;

&lt;p&gt;Expected outcome:&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-16&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;0&apos;&lt;/p&gt;

&lt;p&gt;The query works fine without the left join:&lt;br/&gt;
$ symfony doctrine:dql &quot;from Tafel t where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels group by date(t.tijd)&quot;&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: from Tafel t  where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, group by date(t.tijd)&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-16&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;/p&gt;</description>
                <environment>Windows 7-64 bit&lt;br/&gt;
Symfony 1.4.8</environment>
            <key id="12102">DC-927</key>
            <summary>Query with left join and group clause returns only one row, even though there are multiple results</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="dareaper">Bart van den Burg</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Nov 2010 07:55:55 +0000</created>
                <updated>Thu, 19 May 2011 07:50:36 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14734" author="dareaper" created="Sun, 14 Nov 2010 07:56:37 +0000"  >&lt;p&gt;As you can see, by the way, it does actually say &quot;found 2 results&quot;, but then returns only one.&lt;/p&gt;</comment>
                    <comment id="15239" author="geckow" created="Tue, 8 Feb 2011 07:08:14 +0000"  >&lt;p&gt;There are multiple reports from people that are hurt by this bug:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm&quot; class=&quot;external-link&quot;&gt;http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.devcomments.com/Problem-with-Doctrine-and-Join-GroupBy-query-at87536.htm&quot; class=&quot;external-link&quot;&gt;http://www.devcomments.com/Problem-with-Doctrine-and-Join-GroupBy-query-at87536.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting the Hydration-mode to HYDRATE_NONE yields multiple result rows (but is not useful). &lt;/p&gt;</comment>
                    <comment id="15337" author="victoruiz" created="Fri, 18 Feb 2011 13:49:55 +0000"  >&lt;p&gt;Related in some way with multiple order by clauses. If I remove all of them but one it works, the problem appears when I put more than one order by criteria.&lt;/p&gt;</comment>
                    <comment id="15865" author="mikeseth" created="Thu, 19 May 2011 07:50:36 +0000"  >&lt;p&gt;This is a hydration problem that occurs because the ID columns of the joined tables are not SELECT&apos;ed explicitly. The offending code is a loop in the graph base hydrator, but I don&apos;t understand it well enough to fix it with any certainty that I don&apos;t break anything. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1005] Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1005</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The bugfix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-281&quot; title=&quot;Generate Models Db changes case in Relationship definition.&quot;&gt;&lt;del&gt;DC-281&lt;/del&gt;&lt;/a&gt; (r6802) contains an issue:&lt;/p&gt;

&lt;p&gt;When between two tables in a MySQL database there are two relations, one on both sides (i.e. both tables have a FK field to each other), one of the two is overwritten with the second by the schema importer. That is, at one class, there seems to be only one relation instead of both.&lt;/p&gt;

&lt;p&gt;The issue came in when the decision was made to store all class names in the definition array lower case, as one of the lookups in the array was not updated appropriately.&lt;/p&gt;

&lt;p&gt;See Doctrine/Import.php (1.2.4) line 416 - 435. In line 427, you can clearly see the change made in 6802&lt;/p&gt;

&lt;p&gt;Old:&lt;br/&gt;
&lt;tt&gt;$definitions[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;/tt&gt;&lt;br/&gt;
New:&lt;br/&gt;
&lt;tt&gt;$definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Line 421 however should also have been updated:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;if (in_array($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;, $relClasses) || isset($definitions[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;br/&gt;
Proposed fix:&lt;br/&gt;
&lt;tt&gt;if (in_array($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;, $relClasses) || isset($definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This error results in relations that already exist sometimes being overwritten.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12641">DC-1005</key>
            <summary>Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281</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="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="pelleke">Pelle ten Cate</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 May 2011 11:47:49 +0000</created>
                <updated>Tue, 17 May 2011 11:47:49 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1004] ATTR_TBLNAME_FORMAT not used when creating models from database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1004</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;if you set prefix to &quot;xyz_%s&quot; and have the model &quot;BackgroundColor&quot; it will become the table =&amp;gt; &quot;xyz_background_color&quot;&lt;br/&gt;
if you have the table &quot;xyz_background_color&quot; with unknown model and create the the model from the table, you will get =&amp;gt; &quot;XyzBackgroundColor&quot;.&lt;/p&gt;

&lt;p&gt;The fix (diff):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;368a369,370&lt;br/&gt;
&amp;gt;         $tablePrefix = $manager-&amp;gt;getAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT);&lt;br/&gt;
&amp;gt;         &lt;br/&gt;
381d382&lt;br/&gt;
&amp;lt; &lt;br/&gt;
385c386&lt;br/&gt;
&amp;lt;               $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt; = Doctrine_Inflector::classify(Doctrine_Inflector::tableize($table));&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;               $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt; = Doctrine_Inflector::classify(Doctrine_Inflector::tableize(preg_replace(sprintf(&apos;/\A%s\z/&apos;, str_replace(&apos;%s&apos;, &apos;(.*?)&apos;, $tablePrefix)), &apos;$1&apos;, $table)));&lt;br/&gt;
396c397&lt;br/&gt;
&amp;lt;                       $class = Doctrine_Inflector::classify(Doctrine_Inflector::tableize($table));&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;                       $class = Doctrine_Inflector::classify(Doctrine_Inflector::tableize(preg_replace(sprintf(&apos;/\A%s\z/&apos;, str_replace(&apos;%s&apos;, &apos;(.*?)&apos;, $tablePrefix)), &apos;$1&apos;, $table)));&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="12621">DC-1004</key>
            <summary>ATTR_TBLNAME_FORMAT not used when creating models from database</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="to-rparker">Robin Parker</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 May 2011 04:34:20 +0000</created>
                <updated>Sun, 8 May 2011 04:34:52 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15814" author="to-rparker" created="Sun, 8 May 2011 04:34:52 +0000"  >&lt;p&gt;The diff output as .diff&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10990" name="doctrine_bug_diff.diff" size="746" author="to-rparker" created="Sun, 8 May 2011 04:34:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1003] _processWhereIn does not allow the use of named query parameters</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1003</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When writing a query such as &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$query = $query-&amp;gt;where(&apos;entity.myValue = :value&apos;, array(&apos;:value&apos;=&amp;gt;5));&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;you are unable to then&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$query = $query-&amp;gt;whereIn(&apos;entity.otherValue&apos;, array(&apos;:otherValues&apos;=&amp;gt;array(1,2,3)));&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Doctrine complains that you may not mix positional and named query parameters.&lt;/p&gt;

&lt;p&gt;The attached patch fixes this by checking if the key of the passed in parameter is non numeric and if so setting the &quot;value&quot; of the parameter place holder to the value of the key.&lt;/p&gt;</description>
                <environment>karmic, php 5.2.10, apache2</environment>
            <key id="12615">DC-1003</key>
            <summary>_processWhereIn does not allow the use of named query parameters</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="alex.pilon">alex pilon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 May 2011 21:22:56 +0000</created>
                <updated>Fri, 6 May 2011 00:06:42 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15809" author="alex.pilon" created="Thu, 5 May 2011 21:59:01 +0000"  >&lt;p&gt;I discovered an issue with the above patch. I am working on a better version.&lt;/p&gt;</comment>
                    <comment id="15810" author="alex.pilon" created="Fri, 6 May 2011 00:06:42 +0000"  >&lt;p&gt;Here is a second version.. it is a little bit sloppy. Is there a resource I can find on here that will help me to improve code quality/unit test this?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10987" name="_processWhereIn-named-parameter-v2.patch" size="884" author="alex.pilon" created="Fri, 6 May 2011 00:06:42 +0000" />
                    <attachment id="10986" name="_processWhereIn-named-parameter.patch" size="581" author="alex.pilon" created="Thu, 5 May 2011 21:22:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1002] Typos in filename and php tags</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1002</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Two typos in Doctrine files prevents usage of symfony core_compile.yml system, or any similar compiler system :&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;According to its class name, &quot;Doctrine_Validator_HtmlColor&quot;, the file &quot;Doctrine/Validator/Htmlcolor.php&quot;, should be named &quot;HtmlColor.php&quot; (note the uppercase &quot;C&quot; of &quot;Color&quot;)&lt;/li&gt;
	&lt;li&gt;The php tag of the file &quot;Doctrine/Locking/Exception.php&quot; is uppercased. It should be &quot;&amp;lt;?php&quot; instead of &quot;&amp;lt;?PHP&quot;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12610">DC-1002</key>
            <summary>Typos in filename and php tags</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nervo">nervo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 May 2011 22:35:32 +0000</created>
                <updated>Mon, 2 May 2011 22:35:32 +0000</updated>
                                    <version>1.2.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1000] Wrong parsing on HAVING clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1000</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With Doctrine::ATTR_QUOTE_IDENTIFIER enabled, when you launch a query with a complex having clause, Doctrine_Query_Having class does not handle it correctly.&lt;/p&gt;

&lt;p&gt;By example, when you track the having clause interpretation:&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;addHaving( &apos;SUM( IF( s.id = ? , 1 , 0 ) ) = 0&apos; , 7 );&lt;/p&gt;

&lt;p&gt;At some point, Doctrine_Query_Having at line 70 return something like &quot;`s10`.`id = ?`&quot; instead of  &quot;`s10`.`id` = ?&quot;.&lt;/p&gt;

&lt;p&gt;I just fix it using: &lt;/p&gt;

&lt;p&gt;return $this-&amp;gt;query-&amp;gt;parseClause($func);&lt;/p&gt;

&lt;p&gt;instead of:&lt;/p&gt;

&lt;p&gt;return $this-&amp;gt;_parseAliases($func);&lt;/p&gt;

&lt;p&gt;Now, the parseAliases function is not used anymore...&lt;/p&gt;

&lt;p&gt;See patch attached...&lt;/p&gt;

&lt;p&gt;Loops&lt;/p&gt;</description>
                <environment>symfony 1.4.12-DEV / Windows XP / Apache 2.0 / MySQL 5.1.37 / PHP 5.3.0</environment>
            <key id="12588">DC-1000</key>
            <summary>Wrong parsing on HAVING clause</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="loops">Pierrot Evrard</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Apr 2011 04:54:42 +0000</created>
                <updated>Thu, 28 Apr 2011 05:19:36 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10977" name="Doctrine-DC-1000.patch" size="383" author="loops" created="Thu, 28 Apr 2011 05:19:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-963] Doctrine cache - Salt dissociation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-963</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine Cache store data into a persistence storage.&lt;/p&gt;

&lt;p&gt;Regarding APC, Doctrine use a share storage.&lt;br/&gt;
Doctrine is able to cache SQL from DQL, and DOM from SQL.&lt;br/&gt;
To do this, Doctrine create a DQL hash, and store the SQL result refer to the hash. &lt;/p&gt;

&lt;p&gt;I&apos;m using a server to host two Doctrine project, a preproduction &amp;amp; production Website. In some case, DQL is the same on both project, but the data model definition isn&apos;t.&lt;/p&gt;

&lt;p&gt;Preproduction convert DQL to SQL using data model definition, and store the SQL result into APC cache refer to the DQL hash.&lt;br/&gt;
Production create a DQL hash, this is the same hash as preproduction.. So production instance use the SQL refer to the preproduction.. &lt;/p&gt;

&lt;p&gt;I&apos;m not sure about the quality of this explanation... But I can add some information is needed.&lt;/p&gt;


&lt;p&gt;The solution of this problem is easy. Just add a SALT to any cache id&apos;s. It&apos;s a Doctrine_Cache problem, not only a Doctrine_Cache_APC problem..&lt;br/&gt;
For Query cache it&apos;s not really important because this cache is optional, but for result cache.. It&apos;s more critical.&lt;br/&gt;
The SALT can be define when instantiate the Doctrine_Cache object, it&apos;s just an option..&lt;/p&gt;


&lt;p&gt;$cacheDriver = new doctrine_Cache_Apc ();&lt;br/&gt;
$cacheDriver-&amp;gt;setOption (&quot;salt&quot;, &quot;domain.tld&quot;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="12351">DC-963</key>
            <summary>Doctrine cache - Salt dissociation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 05:05:19 +0000</created>
                <updated>Mon, 18 Apr 2011 10:13:28 +0000</updated>
                                                                    <component>Caching</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15219" author="armetiz" created="Thu, 3 Feb 2011 05:12:45 +0000"  >&lt;p&gt;to complete this bug, I think it&apos;s also a problem on DC 2..&lt;/p&gt;</comment>
                    <comment id="15737" author="jaikdean" created="Mon, 18 Apr 2011 10:13:28 +0000"  >&lt;p&gt;There is already an (undocumented?) option &quot;prefix&quot; that allows this.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$cacheDriver = new Doctrine_Cache_Apc(array(&apos;prefix&apos; =&amp;gt; &apos;MY UNIQUE SALT&apos;));&lt;/tt&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-997] Doctrine collections are overwritten when created by inner join queries that agree on the WHERE</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-997</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In brief:&lt;br/&gt;
Doing $result1 = Doctrine_Query::create()&lt;del&gt;&amp;gt;... followed by $result2 = Doctrine_Query::create()&lt;/del&gt;&amp;gt;... can lead to a situation where the content of $result1 has become the value in $result2.&lt;/p&gt;

&lt;p&gt;In detail:&lt;br/&gt;
The attached models.yml defines two simple tables with a One-to-Many relationship; we have people and names and each person can have multiple names.  The DB can be propagated along the lines of:&lt;/p&gt;

&lt;p&gt;INSERT INTO `tblname` VALUES (1,1,&apos;alpha&apos;),(2,2,&apos;beta&apos;),(3,3,&apos;gamma&apos;),(4,4,&apos;delta&apos;),(5,5,&apos;epsilon&apos;),(6,1,&apos;aleph&apos;);&lt;br/&gt;
INSERT INTO `tblperson` VALUES (1),(2),(3),(4),(5);&lt;/p&gt;

&lt;p&gt;Applying the query:&lt;/p&gt;

&lt;p&gt;$results1 = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;from(&apos;Person ppa&apos;)&lt;br/&gt;
      -&amp;gt;innerJoin(&apos;ppa.Name n&apos;)&lt;br/&gt;
      -&amp;gt;where(&apos;ppa.id = ?&apos;, 1)&lt;br/&gt;
      -&amp;gt;andWhere(&apos;n.text = ?&apos;, &apos;alpha&apos;)&lt;br/&gt;
      -&amp;gt;execute()&lt;br/&gt;
      -&amp;gt;getFirst()&lt;br/&gt;
      -&amp;gt;Name;&lt;/p&gt;

&lt;p&gt;and then producing output though&lt;/p&gt;

&lt;p&gt;print &apos;Results (1): &apos;.count($results1).&quot;\n&quot;;&lt;br/&gt;
foreach ($results1 as $result) print $result&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;text&amp;#39;&amp;#93;&lt;/span&gt; . &quot;\n&quot;;  &lt;br/&gt;
print &quot;\n\n&quot;;&lt;/p&gt;

&lt;p&gt;produces the expected:&lt;/p&gt;

&lt;p&gt;Results (1): 1&lt;br/&gt;
alpha&lt;/p&gt;

&lt;p&gt;Doing a similarly query to a new variable:&lt;/p&gt;

&lt;p&gt;$results2 = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;from(&apos;Person ppa&apos;)&lt;br/&gt;
      -&amp;gt;innerJoin(&apos;ppa.Name n&apos;)&lt;br/&gt;
      -&amp;gt;where(&apos;ppa.id = ?&apos;, 1)&lt;br/&gt;
      -&amp;gt;andWhere(&apos;n.text = ?&apos;, &apos;aleph&apos;)&lt;br/&gt;
      -&amp;gt;execute()&lt;br/&gt;
      -&amp;gt;getFirst()&lt;br/&gt;
      -&amp;gt;Name;&lt;/p&gt;

&lt;p&gt;and printing with&lt;/p&gt;

&lt;p&gt;print &apos;Results (2): &apos;.count($results2).&quot;\n&quot;;&lt;br/&gt;
foreach ($results2 as $result) print $result&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;text&amp;#39;&amp;#93;&lt;/span&gt; . &quot;\n&quot;;  &lt;br/&gt;
print &quot;\n\n&quot;;&lt;/p&gt;

&lt;p&gt;produces the expected:&lt;/p&gt;

&lt;p&gt;Results (2): 1&lt;br/&gt;
aleph&lt;/p&gt;

&lt;p&gt;but printing out the first result object again at this point gives:&lt;/p&gt;

&lt;p&gt;Results (1): 1&lt;br/&gt;
aleph&lt;/p&gt;

&lt;p&gt;which is unexpected - &quot;aleph&quot; rather than &quot;alpha&quot;.&lt;/p&gt;

&lt;p&gt;If, the second query was altered to&lt;/p&gt;

&lt;p&gt;      -&amp;gt;where(&apos;ppa.id = ?&apos;, 2)&lt;br/&gt;
      -&amp;gt;andWhere(&apos;n.text = ?&apos;, &apos;beta&apos;)&lt;/p&gt;

&lt;p&gt;then all three output results are as expected.&lt;/p&gt;

&lt;p&gt;test.zip contains corresponding test files.&lt;/p&gt;</description>
                <environment>OS X 10.6.6 with PHP 5.3.3, Windows with PHP 5.3.1</environment>
            <key id="12560">DC-997</key>
            <summary>Doctrine collections are overwritten when created by inner join queries that agree on the WHERE</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="borrible">Richard Forster</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Apr 2011 08:54:24 +0000</created>
                <updated>Wed, 13 Apr 2011 08:54:34 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10969" name="models.yml" size="488" author="borrible" created="Wed, 13 Apr 2011 08:54:24 +0000" />
                    <attachment id="10970" name="test.zip" size="1452" author="borrible" created="Wed, 13 Apr 2011 08:54:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-996] UPDATE query generate ambiguous statement</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-996</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When creating an UPDATE query, the table names are not aliased like in a SELECT statement. This causes ambiguous column names when JOINING in an UPDATE. &lt;/p&gt;

&lt;p&gt;E.g.&lt;br/&gt;
$q = $this-&amp;gt;createQuery(&apos;st&apos;)&lt;br/&gt;
-&amp;gt;update(&apos;SomeTable st&apos;)&lt;br/&gt;
-&amp;gt;set(&apos;st.position&apos;,&apos;st.position + 1&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;st.SomeOtherTable sot ON st.some_id = sot.id&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;st.id &amp;lt;&amp;gt; ?&apos;, $someId)&lt;br/&gt;
-&amp;gt;andWhere(&apos;sot.some_column = ?&apos;, $someValue)&lt;/p&gt;

&lt;p&gt;The generated SQL for this is : &lt;br/&gt;
UPDATE some_table &lt;br/&gt;
LEFT JOIN some_other_table sot ON st.some_id = sot.id &lt;br/&gt;
SET position = position + 1, updated_at = 2011-04-13 11:01:03, updated_at = 2011-04-13 11:01:03&lt;br/&gt;
WHERE (id &amp;lt;&amp;gt; 4 AND some_column = 7)&lt;/p&gt;

&lt;p&gt;Clearly here &quot;updated_at&quot; and &quot;id&quot; are ambiguous columns. Why the tables are not automatically aliased with unique aliases like in a SELECT statement, and the aliases written before the column name ?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment>MAMP on MacBook Pro 10.6.7, with Symfony 1.4.9</environment>
            <key id="12559">DC-996</key>
            <summary>UPDATE query generate ambiguous statement</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="john">John</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Apr 2011 06:35:35 +0000</created>
                <updated>Wed, 13 Apr 2011 06:37:28 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-400] bit(1) columns are broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-400</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Ihave the following Doctrine schema:&lt;/p&gt;

&lt;p&gt;&amp;#8212;&lt;br/&gt;
TestTable:&lt;br/&gt;
    columns:&lt;br/&gt;
        bitty: bit(1)&lt;/p&gt;

&lt;p&gt;I have created the database and table for this. I then have the following PHP code:&lt;/p&gt;

&lt;p&gt;$obj1 = new TestTable();&lt;br/&gt;
$obj1&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;bitty&amp;#39;&amp;#93;&lt;/span&gt; = b&apos;0&apos;;&lt;br/&gt;
$obj1-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;$obj2 = new TestTable();&lt;br/&gt;
$obj2&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;bitty&amp;#39;&amp;#93;&lt;/span&gt; = 0;&lt;br/&gt;
$obj2-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;Clearly my attempt is to save the bit value 0 in the bitty column.&lt;/p&gt;

&lt;p&gt;However after running this PHP code I get the following odd results:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select * from test_table;&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; bitty &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;  1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&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;
2 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select * from test_table where bitty = 1;&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; bitty &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;  1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&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;
2 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select * from test_table where bitty = 0;                &lt;br/&gt;
Empty set (0.00 sec)&lt;/p&gt;

&lt;p&gt;Those boxes are the 0x01 character, i.e. Doctrine has set the value to 1, not 0.&lt;/p&gt;

&lt;p&gt;However I can insert 0&apos;s into that table direct from MySQL:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; insert into test_table values (4, b&apos;0&apos;);&lt;br/&gt;
Query OK, 1 row affected (0.00 sec)&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select * from test_table where bitty = 0;&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; bitty &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;  4 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&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;
1 row in set (0.00 sec)&lt;/p&gt;


&lt;p&gt;See also this question on StackOverflow &lt;a href=&quot;http://stackoverflow.com/questions/2008021/php-doctrine-orm-not-able-to-handle-bit1-types-correctly&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/2008021/php-doctrine-orm-not-able-to-handle-bit1-types-correctly&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Ubuntu 9.10 php 5.2 mysql 5.1, all installed with ubuntu&amp;#39;s apt</environment>
            <key id="10688">DC-400</key>
            <summary>bit(1) columns are broken</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rorymccann">Rory McCann</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Jan 2010 09:33:34 +0000</created>
                <updated>Mon, 11 Apr 2011 15:38:55 +0000</updated>
                                                                    <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-970] Diff Tool doesn&apos;t generate the down() method if a field attribute is changed in YAML</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-970</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Diff Tool doesn&apos;t generate the down() method if a field attribute is changed in YAML. Below is an example&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;scheme.yaml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    email:
      type: string(255)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;scheme2.yaml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    email:
      type: string(160)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;And below is the generated migration class (down() method is missing): &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;1239898949_Version39.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Version39 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Migration_Base
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;changeColumn(&apos;support_tickets&apos;, &apos;email&apos;, &apos;string&apos;, &apos;160&apos;, array(
             &apos;fixed&apos; =&amp;gt; &apos;0&apos;,
             &apos;unsigned&apos; =&amp;gt; &apos;&apos;,
             &apos;primary&apos; =&amp;gt; &apos;&apos;,
             &apos;notnull&apos; =&amp;gt; &apos;&apos;,
             &apos;autoincrement&apos; =&amp;gt; &apos;&apos;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function down()
    {

    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Doctrine 1.2 </environment>
            <key id="12096">DC-970</key>
            <summary>Diff Tool doesn&apos;t generate the down() method if a field attribute is changed in YAML</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="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="tbayrak">taha bayrak</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Nov 2010 12:39:14 +0000</created>
                <updated>Thu, 7 Apr 2011 05:43:56 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15706" author="66ton99" created="Thu, 7 Apr 2011 05:43:56 +0000"  >&lt;p&gt;How I can see &quot;changeColumn&quot; doesn&apos;t work in the &quot;down&quot; section&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-995] Doctrine deprecated in favor of Doctrine_Core - phpdoc</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-995</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/whats-new/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/whats-new/en&lt;/a&gt; clearly states that the Doctrine class is deprecated - e.g. in order to allow for proper autoloading.&lt;br/&gt;
To enable IDEs to perform proper autocomplete and to encourage programmers not to use the Doctrine class anymore, it&apos;s phpdoc block shuld by changed in order to contain a&lt;/p&gt;

&lt;p&gt;@deprecated In favor of Doctrine_Core - this class extends Doctrine_Core for BC&lt;/p&gt;</description>
                <environment>all environments</environment>
            <key id="12540">DC-995</key>
            <summary>Doctrine deprecated in favor of Doctrine_Core - phpdoc</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="grass">Pablo Grass</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Apr 2011 13:23:53 +0000</created>
                <updated>Wed, 6 Apr 2011 13:23:53 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-994] Doctrine_Data_Import creates unnecessary transactions, big slowdown </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-994</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While trying to load ~25M data fixtures (one big table with relations to 4 smaller ones, sfGuard included in that, row size around 500 bytes) in Symfony i ended up waiting around 80 minutes, while waiting i looked at what could have make it so dreadfully slow. Turns out, when Doctrine_Data_Load gets UnitOfWorks it executes save() on every new record. Save makes it&apos;s own transaction - not a problem if it&apos;s nested, but when this is the main transactions, 70000 of them make quite a difference. Remember - one of the main factors of DBMS speed is transactions/second.&lt;/p&gt;

&lt;p&gt;I patched Doctrine_Data_Import to wrap everything in one transaction, and the results were great - from 80 minutes i got down to around 10. Still, not as fast as it should be but now it&apos;s usable. The time difference is notable also in smaller dumps.&lt;/p&gt;

&lt;p&gt;Patch to speed up loading times included, would be great if you add it to trunk.&lt;/p&gt;

&lt;p&gt;Please note - i have not checked this patch with any other setup or DBMS, please do so. &lt;/p&gt;

&lt;p&gt;Also i have noticed something that might be a problem in much larger loads - if wrapping in a single transaction, my total memory usage went up for about 500M higher than in 70000 transactions. At some point, about 5 minutes in the process some kind of garbage collector fired and freed around 1 gig, so perhaps on larger dumps it might be a good idea to wrap the import not in one, but more transactions (like one transaction every 10000 operations).&lt;/p&gt;</description>
                <environment>MySQL, symfony doctrine:load-data</environment>
            <key id="12537">DC-994</key>
            <summary>Doctrine_Data_Import creates unnecessary transactions, big slowdown </summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="chanibal">Krzysztof Bociurko / ChanibaL</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Apr 2011 14:29:27 +0000</created>
                <updated>Tue, 5 Apr 2011 14:29:27 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10966" name="Doctrine_Data_Import-wrap-in-transaction.patch" size="810" author="chanibal" created="Tue, 5 Apr 2011 14:29:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-993] Many-to-many Relation defined one way </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-993</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When a many-tomany relation has been defined on only one of the end of the relation, and ofcourse in the cross-refClass, things get weird. I&apos;ll use the &lt;b&gt;user-groups&lt;/b&gt; relation (as found in the documentation) as example.&lt;/p&gt;

&lt;p&gt;If in the &lt;b&gt;group&lt;/b&gt; model has not defined the &lt;tt&gt;hasMany&lt;/tt&gt;, then a &lt;b&gt;user&lt;/b&gt; can be instantiated and saved. When instantiated, the relation &lt;em&gt;groups&lt;/em&gt; would return an empty array, groups can ben added 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;$u = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
var_dump($u-&amp;gt;groups);
$u-&amp;gt;groups[] = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Group();
var_dump($u-&amp;gt;groups);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;This would output an empty array, and subsequently an array containing the new group.&lt;/p&gt;

&lt;p&gt;However, if a &lt;b&gt;user&lt;/b&gt; would be retrieved from the database, and the relation &lt;em&gt;groups&lt;/em&gt; would be called, then the following message will appear (which is not helpfull at alllll, I&apos;ve spend hours figuring it out!):&lt;/p&gt;

&lt;p&gt;Uncaught exception &apos;Doctrine_Record_UnknownPropertyException&apos; with message &apos;Unknown record property / related component &quot;groups&quot;&apos; .....&lt;/p&gt;

&lt;p&gt;I will never forget this, but it&apos;s not described in the documentation and the error is not helping either. So either one of these step hvae to be taken. Or even better, making it work without requiring the &lt;tt&gt;hasMany&lt;/tt&gt; in &lt;b&gt;group&lt;/b&gt;, to &lt;em&gt;users&lt;/em&gt;.&lt;/p&gt;</description>
                <environment>MySQL database, Lenny</environment>
            <key id="12535">DC-993</key>
            <summary>Many-to-many Relation defined one way </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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="kweij">Klaas van der Weij</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Apr 2011 07:09:51 +0000</created>
                <updated>Tue, 5 Apr 2011 07:09:51 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-892] Typo. in Import/Pgsql.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-892</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;There is maybe a typo. l. 194 in Doctrine/Import/Pgsql.php : typtype should be type?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>Linux and symfony1.4.9</environment>
            <key id="12014">DC-892</key>
            <summary>Typo. in Import/Pgsql.php</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nippo">Nicolas Ippolito</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 04:41:23 +0000</created>
                <updated>Thu, 31 Mar 2011 06:42:50 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15644" author="leszczu" created="Thu, 31 Mar 2011 06:42:50 +0000"  >&lt;p&gt;Happens to me as well, on windows.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-143] php warnings and fatal errors when &quot;package&quot; attribute value is without &quot;.&quot; (file config/doctrine/schema.yml)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-143</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;h2&gt;&lt;a name=&quot;BugN1&quot;&gt;&lt;/a&gt;Bug N1&lt;/h2&gt;

&lt;p&gt;When i define &lt;tt&gt;&quot;package: user&quot;&lt;/tt&gt; (to store my Comment, Photo and etc. models in 1 directory lib/models/doctrine/user/) and run &lt;tt&gt;&quot;doctrine:build-all-reload --no-confirmation&quot;&lt;/tt&gt; task, it creates unnecessary to me Plugin* models in plugin/ folder and task dies with fatal error:&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;red&quot;&gt;&lt;br/&gt;
PHP Fatal error:  Class &apos;PluginCommentTable&apos; not found in /home/username/www/sfpro/dev/playground/lib/model/doctrine/user/CommentTable.class.php on line 4&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;here is my schema.yml:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Comment:
  tableName: comment
  &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: user
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    message: varchar(255)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h2&gt;&lt;a name=&quot;BugN2&quot;&gt;&lt;/a&gt;Bug N2&lt;/h2&gt;

&lt;p&gt;ok, i have changed &quot;package&quot; value to &quot;user.sometext&quot; and runned  &lt;tt&gt;&quot;doctrine:build-all-reload --no-confirmation&quot;&lt;/tt&gt; task - it creates all models without errors, but does not create subfolders &quot;user/sometext&quot;&lt;/p&gt;

&lt;p&gt;here is my schema.yml&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Comment:
  tableName: comment
  &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: user.sometext
  package_custom_path: lib/model/doctrine/user/plugin
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    message: varchar(255)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a name=&quot;BugN3&quot;&gt;&lt;/a&gt;Bug N3&lt;/h3&gt;

&lt;p&gt;my schema.yml is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Comment:
  tableName: comment
  &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: user
  package_custom_path: lib/model/doctrine/user/plugin
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    message: varchar(255)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;when i run symfony task &lt;tt&gt;&quot;doctrine:build-all-reload --no-confirmation&quot;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;i got php warning:&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;red&quot;&gt;&lt;br/&gt;
PHP Warning:  file_get_contents(/home/username/www/sfpro/dev/playground/lib/model/doctrine//base/BaseComment.class.php): failed to open stream: No such file or directory in /usr/lib/symfony/1.3-svn/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildModelTask.class.php on line 78&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;warning message shows &quot;//&quot; where i should have &quot;user&quot; value&lt;/p&gt;</description>
                <environment>Linux (Fedora 10), symfony 1.3 Beta1, php 5.2.8</environment>
            <key id="10238">DC-143</key>
            <summary>php warnings and fatal errors when &quot;package&quot; attribute value is without &quot;.&quot; (file config/doctrine/schema.yml)</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fruit">Ilya Sabelnikov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Oct 2009 20:53:26 +0000</created>
                <updated>Wed, 30 Mar 2011 15:29:06 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:21:18 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10429" author="jwage" created="Mon, 2 Nov 2009 23:21:18 +0000"  >&lt;p&gt;Packages should work now with Symfony 1.3 and Doctrine 1.2. Though, I would still not recommend using it since packages are for symfony plugins.&lt;/p&gt;</comment>
                    <comment id="15640" author="emgillis" created="Wed, 30 Mar 2011 15:27:25 +0000"  >&lt;p&gt;note on &quot;Bug N2&quot;:&lt;br/&gt;
When you have the &quot;.&quot; in the package name (i.e. &quot;user.sometext&quot; in this example), symfony does generate &quot;lib/model/doctrine/packages/user/sometext&quot; with a &quot;PluginYourClassName&quot; set of files in it. The &quot;packages&quot; folder gets generated here because symfony uses it for plugins (as Jonathan mentions in his comment.&lt;/p&gt;

&lt;p&gt;I would like to see that Symfony supports syntax for the products they supposedly support. IMO, if they are using doctrine, they should allow the dull syntax of doctrine, which includes packages. If that conflicts with Symfony&apos;s &quot;plugin&quot; format, then they should redesign the plugins. Unfortunately, we may not see that, or see a complete overhaul as they push out both Symfony2 and Doctrine2.0&lt;/p&gt;</comment>
                    <comment id="15641" author="emgillis" created="Wed, 30 Mar 2011 15:29:06 +0000"  >&lt;p&gt;need to proof before posting, eep! &quot;dull syntax&quot; should say &quot;full syntax&quot; &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-991] Views abstraction model </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-991</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;View abstraction model &lt;/p&gt;

&lt;p&gt;Hi, i&apos;ve been using doctrine from about six months, i&apos;m not an expert but i know the basics and this has been enough for me and my web-app requirements. The problem begins cause i need a kind of &quot;dynamic table model&quot; in other words an specific one table&apos;s abstraction, i thought implement a view for this purpose, but i can&apos;t figure out how define the BaseModel for the view to use it like a table, thus allowing the use of methods like save(), find() and build (logicals) relationships with others entities. in few words: can i build a table model from a query/view?, it is possible? i read the posts from above but this issue still being not realy clear at all for me.&lt;/p&gt;

&lt;p&gt;me realy will apreciate any help, thanks in advance.&lt;/p&gt;

&lt;p&gt;Regards.&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12506">DC-991</key>
            <summary>Views abstraction model </summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lacroixdj">Jesus Far&#237;as Lacroix</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Mar 2011 11:06:48 +0000</created>
                <updated>Mon, 28 Mar 2011 11:06:48 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-990] Values not escaped</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-990</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I save inputs from a form, special characters such as single quotes are inserted into the mysql database without being escaped.  It&apos;s my understanding that doctrine uses PDO and PDO should handle this escaping automatically, but it is not.  Is there a configuration setting that I can set with doctrine to enable this? &lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Nick&lt;/p&gt;</description>
                <environment>windows and linux OS, mysql database</environment>
            <key id="12501">DC-990</key>
            <summary>Values not escaped</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="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="knford">Nick Bartlett</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Mar 2011 16:14:15 +0000</created>
                <updated>Sat, 26 Mar 2011 16:14:15 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-439] Import of table with (silly) name &quot;index&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-439</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Doctrine/Import/Mssql.php are this procedure calls:&lt;/p&gt;

&lt;p&gt; 92: $sql = &apos;EXEC sp_primary_keys_rowset @table_name = &apos; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true); &lt;br/&gt;
 99: $sql     = &apos;EXEC sp_columns @table_name = &apos; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true);&lt;br/&gt;
219: $query = &apos;EXEC sp_statistics @table_name = &apos; . $table;&lt;br/&gt;
222: $query = &apos;EXEC sp_pkeys @table_name = &apos; . $table;&lt;/p&gt;

&lt;p&gt;which fail with sql &quot;keyword&quot; table names.&lt;/p&gt;

&lt;p&gt;Using ...&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;. $table . &amp;#39; &amp;#93;&lt;/span&gt;&apos; around the table name worked for me.&lt;br/&gt;
I don&apos;t know anything about the backend of doctrine.&lt;br/&gt;
Should this be done by quoteIdentifier, or is this fix okay?&lt;br/&gt;
.. @table_name = &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true) . &amp;#39;&amp;#93;&lt;/span&gt;&apos;;&lt;/p&gt;

&lt;p&gt;Many thanx for all!&lt;br/&gt;
Jochen Bayer&lt;/p&gt;</description>
                <environment>MS-SQL-Server 2005&lt;br/&gt;
php 5.2.11&lt;br/&gt;
openSUSE 11.1</environment>
            <key id="10752">DC-439</key>
            <summary>Import of table with (silly) name &quot;index&quot;</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jocl">Jochen Bayer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jan 2010 08:43:21 +0000</created>
                <updated>Thu, 24 Mar 2011 12:51:22 +0000</updated>
                    <resolved>Wed, 9 Jun 2010 12:48:37 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13215" author="jwage" created="Tue, 8 Jun 2010 16:58:11 +0000"  >&lt;p&gt;It is hard to understand what you changed exactly. Can you provide a diff?&lt;/p&gt;</comment>
                    <comment id="13245" author="jocl" created="Wed, 9 Jun 2010 04:31:26 +0000"  >&lt;p&gt;Index: Mssql.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; Mssql.php   (Revision 49)&lt;br/&gt;
+++ Mssql.php   (Arbeitskopie)&lt;br/&gt;
@@ -89,14 +89,14 @@&lt;br/&gt;
      */&lt;br/&gt;
     public function listTableColumns($table)&lt;br/&gt;
     {&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;$sql = &apos;EXEC sp_primary_keys_rowset @table_name = &apos; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true);&lt;br/&gt;
+        $sql = &apos;EXEC sp_primary_keys_rowset @table_name = &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true) . &amp;#39;&amp;#93;&lt;/span&gt;&apos;;&lt;br/&gt;
         $result = $this-&amp;gt;conn-&amp;gt;fetchAssoc($sql);&lt;br/&gt;
         $primary = array();&lt;br/&gt;
         foreach ($result as $key =&amp;gt; $val) 
{
             $primary[] = $val[&apos;COLUMN_NAME&apos;];
         }&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;$sql     = &apos;EXEC sp_columns @table_name = &apos; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true);&lt;br/&gt;
+        $sql     = &apos;EXEC sp_columns @table_name = &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table, true) . &amp;#39;&amp;#93;&lt;/span&gt;&apos;;&lt;br/&gt;
         $result  = $this-&amp;gt;conn-&amp;gt;fetchAssoc($sql);&lt;br/&gt;
         $columns = array();&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;@@ -216,10 +216,10 @@&lt;br/&gt;
             }&lt;br/&gt;
         }&lt;br/&gt;
         $table = $this-&amp;gt;conn-&amp;gt;quote($table, &apos;text&apos;);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;$query = &apos;EXEC sp_statistics @table_name = &apos; . $table;&lt;br/&gt;
+        $query = &apos;EXEC sp_statistics @table_name = &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39; . $table . &amp;#39;&amp;#93;&lt;/span&gt;&apos;;&lt;br/&gt;
         $indexes = $this-&amp;gt;conn-&amp;gt;fetchColumn($query, $keyName);&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;$query = &apos;EXEC sp_pkeys @table_name = &apos; . $table;&lt;br/&gt;
+        $query = &apos;EXEC sp_pkeys @table_name = &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39; . $table. &amp;#39;&amp;#93;&lt;/span&gt;&apos;;&lt;br/&gt;
         $pkAll = $this-&amp;gt;conn-&amp;gt;fetchColumn($query, $pkName);&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;         $result = array();&lt;/p&gt;</comment>
                    <comment id="13252" author="jwage" created="Wed, 9 Jun 2010 12:47:17 +0000"  >&lt;p&gt;You need to turn on identifier quoting. The quoteIdentifier() method takes care of this for you.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration:identifier-quoting&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration:identifier-quoting&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13253" author="jwage" created="Wed, 9 Jun 2010 12:48:37 +0000"  >&lt;p&gt;Fixed missed calls to quoteIdentifier(). Turn on identifier quoting for identifiers to be wrapped with []&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration:identifier-quoting&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration:identifier-quoting&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15576" author="tba99" created="Thu, 24 Mar 2011 12:51:22 +0000"  >&lt;p&gt;I have a similar problem after executing the symfony (1.4.10) build-schema task:&lt;/p&gt;

&lt;p&gt;  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 2812 &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Could not find stored procedure &apos;sp_primary_keys_rowset&apos;. (SQLExecute&lt;span class=&quot;error&quot;&gt;&amp;#91;2812&amp;#93;&lt;/span&gt; at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: &quot;EXEC sp_primary_keys_rowset @table_name = Appointment&quot;&lt;/p&gt;

&lt;p&gt;I hoped ATTR_QUOTE_IDENTIFIER will also solve my problem but I get the sama error message:&lt;/p&gt;

&lt;p&gt;  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 2812 &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Could not find stored procedure &apos;sp_primary_keys_rowset&apos;. (SQLExecute&lt;span class=&quot;error&quot;&gt;&amp;#91;2812&amp;#93;&lt;/span&gt; at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: &quot;EXEC sp_primary_keys_rowset @table_name = &lt;span class=&quot;error&quot;&gt;&amp;#91;Appointment&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;

</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-952] Non-Equal Nest Relations Not Working - from &quot;Children&quot; side</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-952</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve copy &amp;amp; pasted example from &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/1_0#relationships:join-table-associations:self-referencing-nest-relations:non-equal-nest-relations&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/1_0#relationships:join-table-associations:self-referencing-nest-relations:non-equal-nest-relations&lt;/a&gt; .&lt;br/&gt;
I&apos;ve created User backend module using doctrine:generate-admin backend User task. On how to reproduce the error:&lt;/p&gt;

&lt;p&gt;1. Add 3 User objects (A,B,C)&lt;br/&gt;
2. Open generated edit form for User A.&lt;br/&gt;
3. Set User B as Children from Children list and Save&lt;br/&gt;
4. Set User B and C as Chidren from Children list and Save&lt;/p&gt;

&lt;p&gt;As a result you will see only C set as Children, and strange situation in database : &lt;/p&gt;

&lt;p&gt;UserReference Table:&lt;/p&gt;

&lt;p&gt;parent_id  |  child_id&lt;br/&gt;
    pk_B      |    pk_B       (!!!)&lt;br/&gt;
    pk_A      |    pk_C&lt;/p&gt;
</description>
                <environment>Ubuntu 10.04 + PHP 5.3.3 + Symfony 1.4.8</environment>
            <key id="12278">DC-952</key>
            <summary>Non-Equal Nest Relations Not Working - from &quot;Children&quot; side</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="pawelbaranski">Pawe&#322; Bara&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jan 2011 10:15:37 +0000</created>
                <updated>Thu, 24 Mar 2011 04:59:10 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15111" author="pawelbaranski" created="Thu, 6 Jan 2011 09:41:02 +0000"  >&lt;p&gt;Same ticket on symfony trac because I&apos;m not sure whose fault is it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.symfony-project.org/ticket/9398&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/9398&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also some new error path there&lt;/p&gt;</comment>
                    <comment id="15574" author="bigbadbassman" created="Thu, 24 Mar 2011 04:56:07 +0000"  >&lt;p&gt;Test Case of Non-Equal Self-Referencing Relations, based on #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-329&quot; title=&quot;Problem saving Self Referencing (Nest Relations)&quot;&gt;DC-329&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Failure occures in line 75 of the test case file. This should not happen!&lt;br/&gt;
Only the parent object is modified in line 73 and saving should not interfere with the relations.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10958" name="DC952TestCase.php" size="4075" author="bigbadbassman" created="Thu, 24 Mar 2011 04:56:07 +0000" />
                </attachments>
            <subtasks>
            <subtask id="12323">DC-958</subtask>
        </subtasks>
        </item>

<item>
            <title>[DC-986] createIndexSql and dropConstant do not correct set index name suffix</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-986</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Current export methods are inconsitent with index/constraint name suffix (defautl %_idx). Both createConstraintSql() and dropIndex() methods correctly set the suffix, but dropConstraint() and createIndexSql() do not.&lt;/p&gt;

&lt;p&gt;this causes associated down() methods to fail when reverting changes to indexes/constraints&lt;/p&gt;

&lt;p&gt;Erros occur in : Export.php - lines 137 and 473&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12480">DC-986</key>
            <summary>createIndexSql and dropConstant do not correct set index name suffix</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:17:26 +0000</created>
                <updated>Wed, 23 Mar 2011 10:52:48 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-989] Doctrine_Connection::execute() and Doctrine_Connection::exec() fail if Doctrine_Event::skipOperation() is triggered</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-989</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In order to generate SQL from migrations, an event listener was attached to the migration system to monitor for preQuery and preExec events.&lt;/p&gt;

&lt;p&gt;In an attempt to prevent the migration from additionally writing the query to the database, the skipOperation method was triggered, and supposedly allowed for n the execute() and exec() methods of Doctrine_Connection&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;eg. Doctrine_Connection::execute()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; 
$this-&amp;gt;getAttribute(Doctrine_Core::ATTR_LISTENER)-&amp;gt;preQuery($event);

if ( ! $event-&amp;gt;skipOperation) {
    $stmt = $this-&amp;gt;dbh-&amp;gt;query($query);
    $this-&amp;gt;_count++;
}
$this-&amp;gt;getAttribute(Doctrine_Core::ATTR_LISTENER)-&amp;gt;postQuery($event);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;unfortunately setting this option in the event listener breaks execution of the migration system as the $count/$stmtn variables (used in the methods) are no longer defined, triggering E_NOTICE, and the fetch* methods (eg fetchColumn) also break as they are chaining methods without testing for the return. theerfore, even if the $stmnt variable was created as initially null, the system would still throw an E_FATAL as the NULL variable doest provide the ::fetchColumn() methods (etc).&lt;/p&gt;

&lt;p&gt;Quite a serious flaw as 2 areas of code do not provide a consistent approach to how to work with events.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12486">DC-989</key>
            <summary>Doctrine_Connection::execute() and Doctrine_Connection::exec() fail if Doctrine_Event::skipOperation() is triggered</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Mar 2011 07:43:36 +0000</created>
                <updated>Tue, 22 Mar 2011 07:43:36 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-988] migrations should allow generation of SQL in place of DB manipulation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-988</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;At present migrations only allow for direct manipulation of the underlying database. However, many enterprise release processes disallow automated manipulation of databases (especially Oracle) due to a number of reasons (eg placing different objects in different table spaces). &lt;/p&gt;

&lt;p&gt;Because of this, it is preferable for developers to auto generate SQL and then hand over the specialist DBAs who may then filter/alter as needed on a per-environment basis.&lt;/p&gt;

&lt;p&gt;this is currently very easy to achieve with initial database query generation, as outputting SQL is an option, but there is no such option for migration scripts. Therefore I would like to request this option to be added to the migration class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12482">DC-988</key>
            <summary>migrations should allow generation of SQL in place of DB manipulation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:44:19 +0000</created>
                <updated>Mon, 21 Mar 2011 12:44:19 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-987] redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-987</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;line 121-128 of Doctrine_Export_Oracle appears to generate redundant code for creating a primary key constraint as primary keys (defined in schema.yml) are already generated during CREATE TABLE statements.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12481">DC-987</key>
            <summary>redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement()</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="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="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:35:54 +0000</created>
                <updated>Mon, 21 Mar 2011 12:35:54 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-985] doctrine migration does not use tblname_format</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-985</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Migration commands update the database without correcting the default tablename using pre-set tblename_format parameters in databases.yml.&lt;/p&gt;

&lt;p&gt;There is a method for updating the tablename, but this appears to not be used by any script.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12479">DC-985</key>
            <summary>doctrine migration does not use tblname_format</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:13:28 +0000</created>
                <updated>Mon, 21 Mar 2011 12:13:28 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-591] cli migrate not updating migration_version (ORACLE)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-591</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I try to use the migrate task from the CLI, the version number is not updated in the table migration_version, even though the migration is successfull.&lt;/p&gt;</description>
                <environment>Windows</environment>
            <key id="11105">DC-591</key>
            <summary>cli migrate not updating migration_version (ORACLE)</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="zebulon303">zebulon303</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Mar 2010 08:41:18 +0000</created>
                <updated>Mon, 21 Mar 2011 12:06:04 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:49:24 +0000</resolved>
                            <version>1.2.1</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12503" author="jwage" created="Mon, 29 Mar 2010 14:49:24 +0000"  >&lt;p&gt;Hi, we&apos;ll need some more information than you provide in order to help resolve any bug that exists inside Doctrine. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="15562" author="temperedvision" created="Mon, 21 Mar 2011 12:06:04 +0000"  >&lt;p&gt;I get same problem here. Often find initial migration works successfully, but update fails to trigger change (although $this-&amp;gt;_connection-&amp;gt;returns true).&lt;/p&gt;

&lt;p&gt;However, I also note that the migration number is no always inserted first time round. Table permissions are correct (table auto generated by migration), and manually setting version in tabl works correctly.&lt;/p&gt;

&lt;p&gt;If you need further info, please confirm what info you need to trace. From here, it looks like the exec method fails but does not report the failure.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-815] Model&apos;s default sorting breaks subqueries</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-815</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It works except subqueries. Main table&apos;s order is added to subquery and vice versa. SQL query looks like this:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
SELECT t.id AS t_&lt;em&gt;id FROM ticket&lt;/em&gt;_d_c9999_&lt;em&gt;record t WHERE (t.id = (SELECT MAX(t2.id) AS t2&lt;/em&gt;&lt;em&gt;0 FROM ticket&lt;/em&gt;_d_c9999__record t2 ORDER BY t.id ASC, t2.id ASC)) ORDER BY t.id ASC, t2.id ASC&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Query fails because there is &amp;gt;&amp;gt;no such column &quot;t.id&quot;&amp;lt;&amp;lt;.&lt;/p&gt;

&lt;p&gt;I include a testcase when it is all visible.&lt;/p&gt;

&lt;p&gt;BTW. there is nothing about that feature (and relation orderBy) in docs. It is only in UPGRADE file.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11752">DC-815</key>
            <summary>Model&apos;s default sorting breaks subqueries</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="extreme">Jacek J&#281;drzejewski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Aug 2010 07:31:23 +0000</created>
                <updated>Mon, 14 Mar 2011 18:01:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14064" author="extreme" created="Wed, 25 Aug 2010 07:26:04 +0000"  >&lt;p&gt;Anyone?&lt;/p&gt;</comment>
                    <comment id="15487" author="beverage" created="Thu, 10 Mar 2011 08:57:34 +0000"  >&lt;p&gt;Am having the same issue!&lt;/p&gt;

&lt;p&gt;Eventually found the orderBy option on both the model and on relationships and was over joyed as I&apos;d been trying to find a way of doing this, but it didn&apos;t work!!&lt;/p&gt;

&lt;p&gt;Found the patch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-651&lt;/a&gt; which solved the first problem I encountered but now I&apos;m getting this.&lt;/p&gt;</comment>
                    <comment id="15498" author="beverage" created="Mon, 14 Mar 2011 18:01:49 +0000"  >&lt;p&gt;Had a look at the code and tried only setting the orderBy if the current component is actually referenced in the from sql part of the query.&lt;/p&gt;

&lt;p&gt;Looking at what is selected from, &lt;tt&gt;$this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;from&amp;#39;&amp;#93;&lt;/span&gt;&lt;/tt&gt;, it appears that the main table (&lt;tt&gt;$map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getTableName()&lt;/tt&gt;) and &lt;tt&gt;$sqlAlias&lt;/tt&gt; is include with a zero index and joined tables are keyed by their &lt;tt&gt;$alias&lt;/tt&gt; (or at least the content of these variables within the loop).&lt;/p&gt;

&lt;p&gt;From this I believe I could detect if the current entry in the loop was from a table that was in the current &quot;FROM&quot; part of the query by looking for the table name and alias as an entry or the current alias as a key in the &quot;FROM&quot; array.&lt;/p&gt;

&lt;p&gt;Within my sub query the orderBy valeus would still get applied but only in the subquery and not in the main query where they were included before, out of scope.&lt;/p&gt;

&lt;p&gt;With patch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; title=&quot;[PATCH] Doctrine_Record::option(&amp;#39;orderBy&amp;#39;, ...) of join&amp;#39;s right side being applied to refTable in m2m relationship&quot;&gt;DC-651&lt;/a&gt; applied my code in Query.php at line 1315 noew looks 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-comment&quot;&gt;// Note: Only include orderBy values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; tables we&apos;re actually selecting from (both the root table or
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// tables referenced from it)
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array(&lt;span class=&quot;code-quote&quot;&gt;&quot;{$map[&apos;table&apos;]-&amp;gt;getTableName()} {$sqlAlias}&quot;&lt;/span&gt;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) || array_key_exists($alias, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;])) {
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($map[&apos;relation&apos;])) {
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($map[&apos;ref&apos;])) {
                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($map[&apos;relation&apos;][&apos;orderBy&apos;] &amp;amp;&amp;amp; $orderBy == $map[&apos;relation&apos;][&apos;orderBy&apos;]) {
                                $orderBy = $map[&apos;relation&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            }
                        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                            $orderBy = $map[&apos;relation&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderBy == $map[&apos;relation&apos;][&apos;orderBy&apos;]) {
                                $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                            }
                        }
                    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                        $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                    }
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                        $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Am I correct in my assumptions?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10735" name="DC9999TestCase.php" size="997" author="extreme" created="Wed, 11 Aug 2010 07:31:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-839] Version classes not built for models using package attribute</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-839</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For models using the &apos;package&apos; attribute in the schema definition, the version classes do not get created. However, the version table gets created.&lt;/p&gt;

&lt;p&gt;There is no problem during the build, but when loading fixtures, there is a fatal error: Class TaxCodeVersion not found&lt;/p&gt;

&lt;p&gt;TaxCode:&lt;br/&gt;
  package: Masters&lt;br/&gt;
  tableName: Fin_Tax_Codes&lt;br/&gt;
  actAs:&lt;br/&gt;
    Activateable: ~&lt;br/&gt;
    SoftDelete: ~&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Versionable:&lt;/li&gt;
	&lt;li&gt;tableName: fin_tax_codes_version
	&lt;ol&gt;
		&lt;li&gt;versionColumn: version&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
	&lt;li&gt;className: %CLASS%Version
	&lt;ol&gt;
		&lt;li&gt;auditLog: true&lt;br/&gt;
    Auditable: ~&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
.......&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment>PHP 5.2.3 / Symfony 1.4.6</environment>
            <key id="11819">DC-839</key>
            <summary>Version classes not built for models using package attribute</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="prasadgupte">Prasad Gupte</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Aug 2010 08:51:41 +0000</created>
                <updated>Tue, 8 Mar 2011 11:06:47 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15475" author="hetsch" created="Tue, 8 Mar 2011 11:06:47 +0000"  >&lt;p&gt;Same here,&lt;/p&gt;

&lt;p&gt;If i use this yaml file:&lt;/p&gt;


&lt;p&gt;Page:&lt;br/&gt;
  actAs: &lt;br/&gt;
    NestedSet:&lt;br/&gt;
      hasManyRoots: true&lt;br/&gt;
      rootColumnName: root_id&lt;br/&gt;
    Versionable:&lt;br/&gt;
      versionColumn: version&lt;br/&gt;
      className: %CLASS%Version&lt;br/&gt;
      auditLog: true&lt;br/&gt;
    Timestampable:&lt;br/&gt;
      created:&lt;br/&gt;
        name: created_at&lt;br/&gt;
        type: timestamp&lt;br/&gt;
        format: Y-m-d H&lt;br/&gt;
      updated:&lt;br/&gt;
        name: updated_at&lt;br/&gt;
        type: timestamp&lt;br/&gt;
        format: Y-m-d H&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;  &lt;br/&gt;
  columns:&lt;br/&gt;
    name: string(255)&lt;/p&gt;

&lt;p&gt;PageVersion and PageTranslation Models don&apos;t get generated if i use &apos;build-models-yaml&apos;. Have to create the Models manually then it works fine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-983] Fixtures loading is repeated for each database connections</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-983</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Bug found when working on project ma-residence.fr. Data loading was repeated twice, and in the second run, empty rows were inserted in database, resulting in major headache in development team.&lt;/p&gt;

&lt;p&gt;A same flush tree is built for each connections. It results in multiple loops of data load when there is more than one connection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12459">DC-983</key>
            <summary>Fixtures loading is repeated for each database connections</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ludovicv">Ludovic Vigouroux</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Mar 2011 08:44:04 +0000</created>
                <updated>Tue, 8 Mar 2011 09:03:51 +0000</updated>
                                                                    <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15474" author="ludovicv" created="Tue, 8 Mar 2011 09:03:51 +0000"  >&lt;p&gt;A proposition to fix it is on github &lt;a href=&quot;https://github.com/ludovig/doctrine1&quot; class=&quot;external-link&quot;&gt;https://github.com/ludovig/doctrine1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-841] Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery regex failing to replace all &apos;?&apos; instances [patch+]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-841</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When executing queries with WHERE statements using multiple instances of the &quot;&amp;lt;&amp;gt;&quot; operator (as well as other non &lt;tt&gt;=,(&lt;/tt&gt; symbols inbetween definitions), the method &lt;tt&gt;Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery&lt;/tt&gt; fails to identify all ? replacements.&lt;/p&gt;

&lt;p&gt;In the following piece of code I have a query (trimmed for readability and renamed for privacy) that fails to have all &quot;?&quot; symbols replaced as well as the relevant code from the method mentioned above (minus the return statement) doing a simple demonstration:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php 
$query = &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; ? AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;;

$params = array(
	&quot;&apos;param1&apos;&quot;,
	&quot;&apos;param2&apos;&quot;,
	&quot;&apos;param3&apos;&quot;
);


/**
 * Replaces bound parameters and their placeholders with explicit values.
 *
 * Workaround for http://bugs.php.net/36561
 *
 * @param string $query
 * @param array $params
 */
//protected function replaceBoundParamsWithInlineValuesInQuery($query, array $params) {

	foreach($params as $key =&amp;gt; $value) {
		if(is_null($value)) {
			$value = &apos;NULL&apos;;
		}
		else {
			//$value = $this-&amp;gt;quote($value); //REMOVED AS PRE-ADDED QUOTES TO ABOVE PARAMETER LIST
		}

		$re = &apos;/([=,\(][^\\\&apos;]*)(\?)/iU&apos;;
		
		$matches = array();
		preg_match($re,$query,$matches);
		
		var_dump($matches); //ADDED FOR DEMONSTRATION

		$query = preg_replace($re, &quot;\\1 {$value}&quot;, $query, 1);
		
		var_dump($query); //ADDED FOR DEMONSTRATION
	}

//	return $query;
//
//}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Running this code produces: &lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;array(3) {
  [0]=&amp;gt;
  string(18) &quot;([t].[field1] &amp;lt;&amp;gt; ?&quot;
  [1]=&amp;gt;
  string(17) &quot;([t].[field1] &amp;lt;&amp;gt; &quot;
  [2]=&amp;gt;
  string(1) &quot;?&quot;
}
string(108) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt;  &apos;param1&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;
array(0) {
}
string(108) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt;  &apos;param1&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;
array(0) {
}
string(108) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt;  &apos;param1&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately the regex will not identify all the ? instances properly in the query when run like &lt;tt&gt;preg_match_all()&lt;/tt&gt;, which was my first idea to fix (pre-identify all ? instances, then go through and replace them).&lt;/p&gt;

&lt;p&gt;The only 3 potential solutions I can think of are:&lt;/p&gt;

&lt;p&gt;1. Pre-identify all ?&apos;s and note their position in the string, to do this using a much looser regex, then replace all the ?&apos;s found&lt;br/&gt;
2. Use a stack a loop and a switch statement to scan for eligible ? replacements. I have some sample code that shows this should work, but performance is not something I have tested.&lt;br/&gt;
3. Revert back to the previous behavior. Scanning the changelogs I really don&apos;t know where this broke, other than queries that worked prior to 1.2.3 have since broken and this method is the cause.&lt;/p&gt;</description>
                <environment>PHP 5.2.11, Apache, Microsoft SQL Server 2005</environment>
            <key id="11826">DC-841</key>
            <summary>Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery regex failing to replace all &apos;?&apos; instances [patch+]</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dcousineau">Daniel Cousineau</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 18:14:54 +0000</created>
                <updated>Sat, 5 Mar 2011 17:54:59 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14072" author="dcousineau" created="Wed, 25 Aug 2010 18:18:41 +0000"  >&lt;p&gt;I am probably way over thinking a solutions, however since I have to run home and don&apos;t have time to flesh this out further at the moment, my initial idea is something like this:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php 
$query = &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field?] LIKE ? AND [t].[field3] = ?)&quot;;

$params = array(
	&quot;&apos;param1&apos;&quot;,
	&quot;param2?&quot;,
	&quot;&apos;param3&apos;&quot;
);

var_dump($query);

$stack = array();
$stringDelim = array(&quot;&apos;&quot;, &apos;&quot;&apos;);

$i = 0;
foreach( str_split($query) as $char )
{
	switch($char) {
		
		case &quot;[&quot;:
			if( !in_array(end($stack), $stringDelim) )
				array_push($stack, $char);
			
			break;
			
		case &quot;]&quot;:
			if( end($stack) == &quot;[&quot; ) {
				array_pop($stack);
			} else
				array_push($stack, $char);
				
			break;
		
		case &quot;\&quot;&quot;:
		case &quot;&apos;&quot;:
			if( end($stack) == $char )
				array_pop($stack);
			else
				array_push($stack, $char);
			
			break;
		
		case &quot;?&quot;:
			if( !in_array(end($stack), array_merge($stringDelim, array(&quot;[&quot;, &quot;]&quot;))) )
			{
				$param = array_shift($params);
				$query = substr_replace($query, $param, $i, 1);
				
				$i += strlen($param) - 1;
				var_dump($query);
			}
			
			
			break;
		
		default:
	}
	
	$i++;
}

var_dump($query);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which produces&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;string(131) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field?] LIKE ? AND [t].[field3] = ?)&quot;
string(138) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE ? AND [t].[field3] = ?)&quot;
string(144) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE param2? AND [t].[field3] = ?)&quot;
string(151) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE param2? AND [t].[field3] = &apos;param3&apos;)&quot;
string(151) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE param2? AND [t].[field3] = &apos;param3&apos;)&quot;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which is what we would expect, as well as it doesn&apos;t take into account for newly inserted data containing &apos;?&apos; symbols.&lt;/p&gt;

&lt;p&gt;But again this is just playing around with potential solutions.&lt;/p&gt;</comment>
                    <comment id="14113" author="enrico" created="Fri, 27 Aug 2010 10:54:27 +0000"  >&lt;p&gt;The patch for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-545&quot; title=&quot;MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.&quot;&gt;&lt;del&gt;DC-545&lt;/del&gt;&lt;/a&gt; broke some queries or didn&apos;t worked at all. Unfortunately there was no Test Case for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-545&quot; title=&quot;MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.&quot;&gt;&lt;del&gt;DC-545&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The patch and a Test Case can be found at: &lt;a href=&quot;http://github.com/estahn/doctrine1/compare/master...DC-841&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/master...DC-841&lt;/a&gt;&lt;/p&gt;
</comment>
                    <comment id="14233" author="enrico" created="Thu, 2 Sep 2010 08:01:50 +0000"  >&lt;p&gt;I made a mistake with github, the updated branch can be found at&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-841-2&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-841-2&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15465" author="rotoclap" created="Sat, 5 Mar 2011 17:54:59 +0000"  >&lt;p&gt;Doesn&apos;t work with :&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-sql&quot;&gt;&apos;Test&apos; &amp;lt;&amp;gt; &apos;Test !?&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The question mark is captured...&lt;/p&gt;

&lt;p&gt;This code seems working :&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;foreach($params as $key =&amp;gt; $value) {
  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(is_null($value)) {
    $value = &apos;NULL&apos;;
  }
  &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
    $value = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quote($value);
  }

  $re = &apos;/((?:[=&amp;lt;&amp;gt;,\(]|LIKE|IS)[^\\\&apos;]*)(\?)/iuU&apos;;

  $query = preg_replace($re, &lt;span class=&quot;code-quote&quot;&gt;&quot;\\1 {$value}&quot;&lt;/span&gt;, $query, 1);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-982] Options for building models aren&apos;t forwarded from CLI to Manager instance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-982</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I.e.: generate_models_options and classPrefix option isn&apos;t forwared from CLI configuration to create table task (which uses the Manager&apos;s options).&lt;/p&gt;</description>
                <environment></environment>
            <key id="12448">DC-982</key>
            <summary>Options for building models aren&apos;t forwarded from CLI to Manager instance</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="maciej.strzelecki">Maciej Strzelecki</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 08:39:10 +0000</created>
                <updated>Fri, 4 Mar 2011 08:39:10 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-981] Class prefix isn&apos;t being appended when importing data</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-981</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Configuration:&lt;/p&gt;

&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX, &apos;Foo_&apos;);&lt;/p&gt;

&lt;p&gt;Schema:&lt;/p&gt;

&lt;p&gt;Bar:&lt;br/&gt;
  columns:&lt;br/&gt;
    baz: int&lt;/p&gt;

&lt;p&gt;Fixtures:&lt;/p&gt;

&lt;p&gt;Bar:&lt;br/&gt;
    Bar_1:&lt;br/&gt;
      baz: 1&lt;/p&gt;

&lt;p&gt;Error on importing data: &quot;Couldn&apos;t find class Bar.&quot;&lt;/p&gt;

&lt;p&gt;Doctrine should use Foo_Bar class for Bar model instead Bar class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12447">DC-981</key>
            <summary>Class prefix isn&apos;t being appended when importing data</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="maciej.strzelecki">Maciej Strzelecki</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 08:23:40 +0000</created>
                <updated>Fri, 4 Mar 2011 08:23:40 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-980] Moving all ALTERS queries to the end of generated sql file (task build-sql)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-980</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Actual in case of using multi database configuration and foreign keys between them.&lt;/p&gt;

&lt;p&gt;Now build-sql task generates SQL query for database by database in alphabetical order. It&apos;s ugly when we have multidatabase configuration and foreign keys between their tables. It&apos;s impossible to do &apos;import-sql&apos; without errors beucase foreign keys constrains to nonexisting tables are in next database in order. &lt;/p&gt;

&lt;p&gt;I have added some code to strings 1176-...&lt;/p&gt;</description>
                <environment></environment>
            <key id="12446">DC-980</key>
            <summary>Moving all ALTERS queries to the end of generated sql file (task build-sql)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="seremenko">Sergey Eremenko</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 06:42:03 +0000</created>
                <updated>Fri, 4 Mar 2011 06:42:03 +0000</updated>
                                                                    <component>Cli</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10951" name="Export.php" size="56058" author="seremenko" created="Fri, 4 Mar 2011 06:42:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-933] Results from Doctrine_Query::execute inconsistent with results from Doctrine_Query::getSqlQuery()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-933</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The DQL Query:&lt;/p&gt;

&lt;p&gt;                $query = Doctrine_Query::create()&lt;br/&gt;
                                -&amp;gt;select(&quot;&lt;br/&gt;
                                        b.borrowers_date as borrowers_date,&lt;br/&gt;
                                        b.borrower_id as borrower_id,&lt;br/&gt;
                                        borrower_contact.first_name as borrower_first_name,&lt;br/&gt;
                                        borrower_contact.last_name as borrower_last_name,&lt;br/&gt;
                                        lo_contact.first_name as lo_first_name,&lt;br/&gt;
                                        lo_contact.last_name as lo_last_name,&lt;br/&gt;
                                        realtor_contact.first_name as realtor_first_name,&lt;br/&gt;
                                        realtor_contact.last_name as realtor_last_name,&lt;br/&gt;
                                        lo_company_contact.first_name as lender,&lt;br/&gt;
                                        b.current_status as current_status&lt;br/&gt;
                                &quot;)&lt;br/&gt;
                                -&amp;gt;from(&quot;Borrowers b&quot;)&lt;br/&gt;
                                &lt;del&gt;&amp;gt;innerJoin(&quot;b.UserBorrowerAssigned ubass WITH ubass.user_id = &quot; . $this&lt;/del&gt;&amp;gt;user_id)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;b.ContactInfo borrower_contact&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;b.LoBorrowerAssigned lobass&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;lobass.LoanOfficers lo&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;lo.ContactInfo lo_contact&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;lo.Companies lo_company&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;lo_company.ContactInfo lo_company_contact&quot;)&lt;br/&gt;
                                -&amp;gt;leftJoin(&quot;b.RealtorBorrowerAssigned realbass&quot;)&lt;br/&gt;
                                -&amp;gt;leftJoin(&quot;realbass.Realtors realtor&quot;)&lt;br/&gt;
                                -&amp;gt;leftJoin(&quot;realtor.ContactInfo realtor_contact&quot;);&lt;br/&gt;
...&lt;br/&gt;
                $query-&amp;gt;where(&quot;b.current_status != &apos;finialized&apos;&quot;)&lt;br/&gt;
                        -&amp;gt;andWhere(&quot;b.current_status != &apos;ignored&apos;&quot;)&lt;br/&gt;
                        -&amp;gt;andWhere(&quot;b.current_status != &apos;dead&apos;&quot;);&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;execute Returns only 1 row&lt;/p&gt;

&lt;p&gt;--------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;getSqlQuery() returns: &lt;/p&gt;

&lt;p&gt;SELECT b.borrowers_date AS b_&lt;em&gt;0, b.borrower_id AS b&lt;/em&gt;&lt;em&gt;1, c.first_name AS c&lt;/em&gt;&lt;em&gt;2, c.last_name AS c&lt;/em&gt;&lt;em&gt;3, c2.first_name AS c2&lt;/em&gt;&lt;em&gt;4, c2.last_name AS c2&lt;/em&gt;&lt;em&gt;5, c5.first_name AS c5&lt;/em&gt;&lt;em&gt;6, c5.last_name AS c5&lt;/em&gt;&lt;em&gt;7, c4.first_name AS c4&lt;/em&gt;&lt;em&gt;8, b.current_status AS b&lt;/em&gt;_9 FROM borrowers b INNER JOIN user_borrower_assigned u ON b.borrower_id = u.borrower_id AND (u.user_id = 129) INNER JOIN contact_info c ON b.contact_info_id = c.contact_info_id INNER JOIN lo_borrower_assigned l ON b.borrower_id = l.borrower_id INNER JOIN loan_officers l2 ON l.loan_officer_id = l2.loan_officer_id INNER JOIN contact_info c2 ON l2.contact_info_id = c2.contact_info_id INNER JOIN companies c3 ON l2.company_id = c3.company_id INNER JOIN contact_info c4 ON c3.contact_info_id = c4.contact_info_id INNER JOIN realtor_borrower_assigned r ON b.borrower_id = r.borrower_id INNER JOIN realtors r2 ON r.realtor_id = r2.realtor_id INNER JOIN contact_info c5 ON r2.contact_info_id = c5.contact_info_id WHERE (b.current_status != &apos;finialized&apos; AND b.current_status != &apos;ignored&apos; AND b.current_status != &apos;dead&apos;)&lt;/p&gt;

&lt;p&gt;Running this query in PhpMyAdmin returns 1,095 rows.&lt;/p&gt;

&lt;p&gt;-----------------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;Results Inconsistent&lt;/p&gt;</description>
                <environment>Redhat Linux, Apache, PHP 5, </environment>
            <key id="12126">DC-933</key>
            <summary>Results from Doctrine_Query::execute inconsistent with results from Doctrine_Query::getSqlQuery()</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="webb.roger">Roger Webb</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2010 11:30:14 +0000</created>
                <updated>Mon, 28 Feb 2011 15:55:50 +0000</updated>
                    <resolved>Mon, 28 Feb 2011 15:55:50 +0000</resolved>
                            <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14790" author="webb.roger" created="Fri, 19 Nov 2010 11:49:02 +0000"  >&lt;p&gt;I have stripped the query down to this:&lt;/p&gt;

&lt;p&gt;                                -&amp;gt;select(&quot;&lt;br/&gt;
                                        b.borrowers_date as borrowers_date,&lt;br/&gt;
                                        b.borrower_id as borrower_id,&lt;br/&gt;
                                        borrower_contact.first_name as borrower_first_name,&lt;br/&gt;
                                        borrower_contact.last_name as borrower_last_name,&lt;br/&gt;
                                        b.current_status as current_status&lt;br/&gt;
                                &quot;)&lt;br/&gt;
                                -&amp;gt;from(&quot;Borrowers b&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;b.ContactInfo borrower_contact&quot;)&lt;br/&gt;
                                -&amp;gt;innerJoin(&quot;b.UserBorrowerAssigned ubass&quot;);&lt;/p&gt;

&lt;p&gt;                $query-&amp;gt;where(&quot;b.current_status != &apos;finialized&apos;&quot;)&lt;br/&gt;
                        -&amp;gt;andWhere(&quot;b.current_status != &apos;ignored&apos;&quot;)&lt;br/&gt;
                        -&amp;gt;andWhere(&quot;b.current_status != &apos;dead&apos;&quot;)&lt;br/&gt;
                        &lt;del&gt;&amp;gt;andWhere(&quot;ubass.user_id = ?&quot;, $this&lt;/del&gt;&amp;gt;user_id);&lt;/p&gt;

&lt;p&gt;Results are still consistent with but report above.&lt;/p&gt;

&lt;p&gt;Classes:&lt;/p&gt;

&lt;p&gt;class Borrowers extends BaseBorrowers&lt;br/&gt;
{&lt;/p&gt;

&lt;p&gt;        function setUp() &lt;/p&gt;
{
                parent::setUp();

                $this-&amp;gt;hasOne(&apos;ContactInfo&apos;, array(&apos;local&apos; =&amp;gt; &apos;contact_info_id&apos;, &apos;foreign&apos; =&amp;gt; &apos;contact_info_id&apos;));
                $this-&amp;gt;hasOne(&apos;LoBorrowerAssigned&apos;, array(&apos;local&apos; =&amp;gt; &apos;borrower_id&apos;, &apos;foreign&apos; =&amp;gt; &apos;borrower_id&apos;));
                $this-&amp;gt;hasOne(&apos;RealtorBorrowerAssigned&apos;, array(&apos;local&apos; =&amp;gt; &apos;borrower_id&apos;, &apos;foreign&apos; =&amp;gt; &apos;borrower_id&apos;));
                $this-&amp;gt;hasOne(&apos;UserBorrowerAssigned&apos;, array(&apos;local&apos; =&amp;gt; &apos;borrower_id&apos;, &apos;foreign&apos; =&amp;gt; &apos;borrower_id&apos;));
                $this-&amp;gt;unshiftFilter(new Doctrine_Record_Filter_Compound(array(&apos;ContactInfo&apos;)));
        }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;class UserBorrowerAssigned extends BaseUserBorrowerAssigned {&lt;/p&gt;

&lt;p&gt;        function setUp() &lt;/p&gt;
{
                parent::setUp();

                $this-&amp;gt;hasOne(&quot;Borrowers&quot;, array(&quot;local&quot; =&amp;gt; &quot;borrower_id&quot;, &quot;foreign&quot; =&amp;gt; &quot;borrower_id&quot;));
                $this-&amp;gt;hasOne(&quot;Users&quot;, array(&quot;local&quot; =&amp;gt; &quot;user_id&quot;, &quot;foreign&quot; =&amp;gt; &quot;user_id&quot;));
        }

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;class Users extends BaseUsers {&lt;/p&gt;

&lt;p&gt;        function setUp() &lt;/p&gt;
{
                parent::setUp();

                $this-&amp;gt;hasOne(&quot;ContactInfo&quot;, array(&quot;local&quot; =&amp;gt; &quot;contact_info_id&quot;, &quot;foreign&quot; =&amp;gt; &quot;contact_info_id&quot;));

                $this-&amp;gt;unshiftFilter(new Doctrine_Record_Filter_Compound(array(&apos;ContactInfo&apos;)));
        }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;The users class also contains the function that issues the query in question.&lt;/p&gt;</comment>
                    <comment id="15418" author="webb.roger" created="Mon, 28 Feb 2011 15:55:50 +0000"  >&lt;p&gt;Non issue.  Wasn&apos;t familiar with use of Doctrine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-979] Doctrine save() only checks one level deep on one-to-one relations.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-979</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Updating/saving an object fails when trying to update the nth-level of an existing object/relation where n is more than one level away from the root node of one-to-one relation chain.  For example, with the yaml model below the following does not update the name of the Company object:&lt;/p&gt;

&lt;p&gt;Image-&amp;gt;Product-&amp;gt;Category-&amp;gt;Company-&amp;gt;name = &quot;Acme&quot;.&lt;/p&gt;

&lt;p&gt;If &quot;Product&quot; has no changes it appears to stop checking for changes there.  If we do a save on a one-to-many relation chain such as the following, it works fine:&lt;/p&gt;

&lt;p&gt;Company-&amp;gt;Category-&amp;gt;Product-&amp;gt;Image-&amp;gt;name = &quot;image1.jpg&quot;   &lt;/p&gt;

&lt;p&gt;I was able to fix this issue by modifying the saveRelatedLocalKeys() function in UnitOfWork.php to use isModified() with deep=true:&lt;/p&gt;

&lt;p&gt;if ($obj instanceof Doctrine_Record &amp;amp;&amp;amp; $obj-&amp;gt;isModified(true)) {&lt;/p&gt;

&lt;p&gt;This works but I&apos;m not sure if changing this has any repercussions on more complex queries.&lt;/p&gt;


&lt;p&gt;&amp;#8212;&lt;br/&gt;
detect_relations: true&lt;br/&gt;
options:&lt;br/&gt;
  collate: utf8_general_ci&lt;br/&gt;
  charset: utf8&lt;br/&gt;
  type: InnoDB&lt;/p&gt;

&lt;p&gt;Company:&lt;br/&gt;
  tableName: Company&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;/p&gt;

&lt;p&gt;Category:&lt;br/&gt;
  tableName: Category&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    companyId:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;br/&gt;
  relations:&lt;br/&gt;
    Company:&lt;br/&gt;
      class: Company&lt;br/&gt;
      local: companyId&lt;br/&gt;
      foreign: id&lt;br/&gt;
      foreignAlias: categories&lt;br/&gt;
      onDelete: cascade&lt;br/&gt;
      onUpdate: cascade&lt;br/&gt;
  indexes:&lt;br/&gt;
    fk_Category_Company1:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;companyId&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Product:&lt;br/&gt;
  tableName: Product&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    categoryId:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;br/&gt;
  relations:&lt;br/&gt;
    Category:&lt;br/&gt;
      class: Category&lt;br/&gt;
      local: categoryId&lt;br/&gt;
      foreign: id&lt;br/&gt;
      foreignAlias: products&lt;br/&gt;
      onDelete: cascade&lt;br/&gt;
      onUpdate: cascade&lt;br/&gt;
  indexes:&lt;br/&gt;
    fk_Product_Category1:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;categoryId&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Image:&lt;br/&gt;
  tableName: Image&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    productId:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;br/&gt;
  relations:&lt;br/&gt;
    Product:&lt;br/&gt;
      class: Product&lt;br/&gt;
      local: productId&lt;br/&gt;
      foreign: id&lt;br/&gt;
      foreignAlias: images&lt;br/&gt;
      onDelete: cascade&lt;br/&gt;
      onUpdate: cascade&lt;br/&gt;
  indexes:&lt;br/&gt;
    fk_Image_Product1:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;productId&amp;#93;&lt;/span&gt;&lt;/p&gt;
</description>
                <environment>MySQL 5.1.38, PHP 5.3.3</environment>
            <key id="12435">DC-979</key>
            <summary>Doctrine save() only checks one level deep on one-to-one relations.</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cesaric">Robert Cesaric</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Feb 2011 23:36:08 +0000</created>
                <updated>Sun, 27 Feb 2011 23:36:08 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-254] getLimitSubquery Not Including All Order By Parts</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-254</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The getLimitSubquery function is only including the first orderby field and ignoring all remaining parts. The function also needs to be changed to include mssql and odbc.&lt;/p&gt;

&lt;p&gt;The diff&apos;s below provide corrections.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Mike&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;diff -r Doctrine-1.1.2\lib\Doctrine\Query.php Doctrine-1.1.2-Fixes\lib\Doctrine\Query.php
1367c1367
&amp;lt;         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos;) {
---
&amp;gt;         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {
1371,1387c1371,1392
&amp;lt;                 $part_original = trim($e[0]);
&amp;lt;                 $callback = create_function(&apos;$e&apos;, &apos;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; trim($e, \&apos;[]`&quot;\&apos;);&apos;);
&amp;lt;                 $part = trim(implode(&apos;.&apos;, array_map($callback, explode(&apos;.&apos;, $part_original))));
&amp;lt; 
&amp;lt;                 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strpos($part, &apos;.&apos;) === &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
&amp;lt;                     &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
&amp;lt;                 }
&amp;lt; 
&amp;lt;                 &lt;span class=&quot;code-comment&quot;&gt;// don&apos;t add functions
&lt;/span&gt;&amp;lt;                 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strpos($part, &apos;(&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
&amp;lt;                     &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
&amp;lt;                 }
&amp;lt; 
&amp;lt;                 &lt;span class=&quot;code-comment&quot;&gt;// don&apos;t add primarykey column (its already in the select clause)
&lt;/span&gt;&amp;lt;                 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($part !== $primaryKey) {
&amp;lt;                     $subquery .= &apos;, &apos; . $part_original;
&amp;lt;                 }
---
&amp;gt; 
&amp;gt;                 foreach ($e as $f) {
&amp;gt;                     &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($f == 0 || $f % 2 == 0) {
&amp;gt;                         $part_original = trim($f);
&amp;gt;                         $callback = create_function(&apos;$e&apos;, &apos;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; trim($e, \&apos;[]`&quot;\&apos;);&apos;);
&amp;gt;                         $part = trim(implode(&apos;.&apos;, array_map($callback, explode(&apos;.&apos;, $part_original))));
&amp;gt; 
&amp;gt;                         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strpos($part, &apos;.&apos;) === &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
&amp;gt;                             &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
&amp;gt;                         }
&amp;gt; 
&amp;gt;                         &lt;span class=&quot;code-comment&quot;&gt;// don&apos;t add functions
&lt;/span&gt;&amp;gt;                         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strpos($part, &apos;(&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
&amp;gt;                             &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
&amp;gt;                         }
&amp;gt; 
&amp;gt;                         &lt;span class=&quot;code-comment&quot;&gt;// don&apos;t add primarykey column (its already in the select clause)
&lt;/span&gt;&amp;gt;                         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($part !== $primaryKey) {
&amp;gt;                             $subquery .= &apos;, &apos; . $part_original;
&amp;gt;                         }
&amp;gt;                     }
&amp;gt;                 }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10450">DC-254</key>
            <summary>getLimitSubquery Not Including All Order By Parts</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="gensisns">Michael Card</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Nov 2009 15:58:12 +0000</created>
                <updated>Sun, 27 Feb 2011 18:39:08 +0000</updated>
                                    <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11276" author="gensisns" created="Tue, 22 Dec 2009 20:41:01 +0000"  >&lt;p&gt;Additonal fix for this issue, was missing dblib originally.&lt;/p&gt;

&lt;p&gt;Mike&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;
diff -r Doctrine-1.1.2\lib\Doctrine\Query.php Doctrine-1.1.2-Fixes\lib\Doctrine\Query.php
1367c1367
&amp;lt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {
&#8212;
&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos; || $driverName == &apos;dblib&apos;) {

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15403" author="andrej.pavlovic" created="Sun, 27 Feb 2011 18:39:08 +0000"  >&lt;p&gt;Come on guys, please include this fix into 1.2.4...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-978] Doctrine_Connection_Mssql dies on modifyLimitSubquery every time</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-978</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Looking at the latest version of Doctrine_Connection_Mssql in git repo:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/blob/b4dc8e66a89a7e17cd195c489b18005e19ca9ea5/lib/Doctrine/Connection/Mssql.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/blob/b4dc8e66a89a7e17cd195c489b18005e19ca9ea5/lib/Doctrine/Connection/Mssql.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Doctrine_Query:getLimitSubquery() there is a call to Doctrine_Connection_Mssql::modifyLimitSubquery().&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 modifyLimitSubquery(Doctrine_Table $rootTable, $query, $limit = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $offset = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isManip = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
{
	&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;modifyLimitQuery($query, $limit, $offset, $isManip, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This in turn calls Doctrine_Connection_Mssql::modifyLimitQuery() wihtout passing the $queryOrigin parameter:&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 modifyLimitQuery($query, $limit = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $offset = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isManip = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isSubQuery = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, Doctrine_Query $queryOrigin = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($limit === &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; || !($limit &amp;gt; 0)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query;
        }

        $orderby = stristr($query, &apos;ORDER BY&apos;);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; &amp;amp;&amp;amp; $orderby === &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Connection_Exception(&lt;span class=&quot;code-quote&quot;&gt;&quot;OFFSET cannot be used in MSSQL without ORDER BY due to emulation reasons.&quot;&lt;/span&gt;);
        }
        
        $count = intval($limit);
        $offset = intval($offset);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset &amp;lt; 0) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Connection_Exception(&lt;span class=&quot;code-quote&quot;&gt;&quot;LIMIT argument offset=$offset is not valid&quot;&lt;/span&gt;);
        }

        $orderbySql = $queryOrigin-&amp;gt;getSqlQueryPart(&apos;orderby&apos;);
        $orderbyDql = $queryOrigin-&amp;gt;getDqlPart(&apos;orderby&apos;);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderby !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
            $orders = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;parseOrderBy(implode(&apos;, &apos;, $queryOrigin-&amp;gt;getDqlPart(&apos;orderby&apos;)));

            &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; count($orders); $i++) {
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From just looking at the above code, the query chokes on the first call to a $queryOrigin method. It seems like there is a lot of missing code here which should work with the $query directly when $queryOrigin is not available...&lt;/p&gt;

&lt;p&gt;What is the point of $orderbySql and $orderbyDql variables when they are not used anywhere?&lt;/p&gt;

&lt;p&gt;This code looks like it&apos;s half way done and untested.&lt;/p&gt;</description>
                <environment>windows</environment>
            <key id="12434">DC-978</key>
            <summary>Doctrine_Connection_Mssql dies on modifyLimitSubquery every time</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="andrej.pavlovic">Andrej Pavlovic</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Feb 2011 17:14:51 +0000</created>
                <updated>Sun, 27 Feb 2011 17:17:16 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-969] When I add a text field to a mysql table the migration code generated fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-969</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using a database designed using schema.yml with a MySql Server.&lt;/p&gt;

&lt;p&gt;When I add a field of type text the generated code for the migrations (using diff) is as follows:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, &apos;&apos;, array(&lt;br/&gt;
             &apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;Which produces a MySQL error like this:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;)&apos; at line 1. Failing Query: &quot;ALTER TABLE &amp;lt;tableName&amp;gt; ADD &amp;lt;fieldName&amp;gt; text()&quot;&lt;/p&gt;

&lt;p&gt;The solution I found was to manipulate manually the generated class to use an addColumn like this:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, null, array(&lt;br/&gt;
             &apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;Which would generate an SQL statement like this:&lt;/p&gt;

&lt;p&gt;ALTER TABLE &amp;lt;tableName&amp;gt; ADD &amp;lt;fieldName&amp;gt; text&lt;/p&gt;

&lt;p&gt;Which works fine with MySQL, don&apos;t know about other RDBMS&lt;/p&gt;</description>
                <environment>Linux, Symfony 1.4, Doctrine 1.2</environment>
            <key id="11333">DC-969</key>
            <summary>When I add a text field to a mysql table the migration code generated fails</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="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="mchojrin">Mauro Chojrin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 May 2010 09:51:58 +0000</created>
                <updated>Wed, 23 Feb 2011 14:24:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15365" author="siegfried1e" created="Wed, 23 Feb 2011 14:24:35 +0000"  >&lt;p&gt;My understanding is that you need to put a size to the text so it will choose between tinytext, text, mediumtext, bigtext, so instead of &lt;br/&gt;
$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, &apos;&apos;, array(&lt;br/&gt;
&apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
));&lt;br/&gt;
use &lt;br/&gt;
$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, &apos;&amp;lt;somenumber&amp;gt;&apos;, array(&lt;br/&gt;
&apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
));&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-977] wrong offset in sfDoctrinePager</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-977</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;as reported in symfony &lt;a href=&quot;http://trac.symfony-project.org/ticket/8979&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8979&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In sfDoctrinePager::init() the offset for the query is determined by the statement:&lt;/p&gt;

&lt;p&gt;$offset = ($this-&amp;gt;getPage() - 1) * $this-&amp;gt;getMaxPerPage()&lt;/p&gt;

&lt;p&gt;Immediately after that, the $this-&amp;gt;lastPage value is set:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;setLastPage(ceil($this-&amp;gt;getNbResults() / $this-&amp;gt;getMaxPerPage()));&lt;/p&gt;

&lt;p&gt;However, sfPager::setLastPage() corrects the page number ($this-&amp;gt;page) in case $this-&amp;gt;getPage() &amp;gt; $this-&amp;gt;lastPage.&lt;/p&gt;

&lt;p&gt;Thus, the calculation of the offset should happen after the $this-&amp;gt;setLastPage(...) statement, because $this-&amp;gt;getPage() is used.&lt;/p&gt;

&lt;p&gt;The attached patch (in symfony trac) moves the $offset = ... below the $this-&amp;gt;setLastPage(...) line. &lt;/p&gt;</description>
                <environment></environment>
            <key id="12409">DC-977</key>
            <summary>wrong offset in sfDoctrinePager</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="6">Invalid</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="pavel.campr">Pavel Campr</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Feb 2011 06:52:32 +0000</created>
                <updated>Tue, 22 Feb 2011 08:02:39 +0000</updated>
                    <resolved>Tue, 22 Feb 2011 08:02:39 +0000</resolved>
                            <version>1.2.3</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15363" author="pavel.campr" created="Tue, 22 Feb 2011 08:02:39 +0000"  >&lt;p&gt;sorry, this is not doctrine related issue, it&apos;s just symfony&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-976] Invalid long constraint name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-976</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When the constraint&apos;s name is too long, a shorter one is generated using information such as the name of the database. If the database&apos;s name begins with a numeric value, the constraint name also begins with a numeric value which results in an invalid constraint name.&lt;/p&gt;</description>
                <environment>OS: Linux&lt;br/&gt;
Soft platform: Symfony 1.4.8, mysql5</environment>
            <key id="12407">DC-976</key>
            <summary>Invalid long constraint name</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="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="mxs">S&#233;bastien Rannou</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Feb 2011 12:46:21 +0000</created>
                <updated>Sat, 19 Feb 2011 12:47:26 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10943" name="constraint_name.patch" size="483" author="mxs" created="Sat, 19 Feb 2011 12:46:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-313] Ordering m2m relationship with column from related table (with orderBy option)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-313</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I find no way to define automatic orderBy in m2m relations with column not from reference table, but actual related table.&lt;/p&gt;

&lt;p&gt;E.g. BlogPost &amp;lt;= m2m through BlogPostCategory =&amp;gt; BlogCategory&lt;br/&gt;
I need BlogPost-&amp;gt;Categories ordered by BlogCategory.name&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;class BlogPost &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;title&apos;, &apos;string&apos;, 128);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;content&apos;, &apos;string&apos;);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;BlogCategory as BlogCategories&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_post&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_blog_category&apos;, &apos;refClass&apos; =&amp;gt; &apos;BlogPostCategory&apos;, &apos;orderBy&apos; =&amp;gt; &apos;name&apos;));        
    }
}

class BlogCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 128);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;BlogPost as BlogPosts&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_category&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_blog_post&apos;, &apos;refClass&apos; =&amp;gt; &apos;BlogPostCategory&apos;));
    }
}

class BlogPostCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_blog_post&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_blog_category&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;BlogPost&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_post&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;BlogCategory&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_category&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The resulting query contains doubled &apos;name&apos; column in ORDER BY clause, both from reference table and related table, e.g. ORDER BY t2.name, t3.name&lt;/p&gt;

&lt;p&gt;I tried putting the following code in BlogCategory::setTableDefinition() instead of attribute in relation definition in BlogPost record:&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;this&lt;/span&gt;-&amp;gt;option(&apos;orderBy&apos;, &apos;name&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but the result was the same.&lt;/p&gt;

&lt;p&gt;Maybe I&apos;m doing something wrong? Is there a possibility to define an alias, where to get column name from - in orderBy attribute?&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description>
                <environment>php 5.3/win, doctrine 1.2 svn, ATTR_QUOTE_IDENTIFIER = true, ATTR_USE_DQL_CALLBACKS = true</environment>
            <key id="10546">DC-313</key>
            <summary>Ordering m2m relationship with column from related table (with orderBy option)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 12:53:05 +0000</created>
                <updated>Fri, 18 Feb 2011 03:32:42 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10969" author="mh" created="Wed, 2 Dec 2009 12:53:49 +0000"  >&lt;p&gt;Attached test case.&lt;/p&gt;</comment>
                    <comment id="11080" author="mh" created="Tue, 8 Dec 2009 12:59:05 +0000"  >&lt;p&gt;I find this issue as critical one now, because when I use e.g.&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;this&lt;/span&gt;-&amp;gt;option(&apos;orderBy&apos;, &apos;name&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;in a model&apos;s definition (not ref class), then when other model is related m2m with it, a query loading both of them with relations will fail because of name column duplicated in ref table.&lt;/p&gt;</comment>
                    <comment id="12740" author="suhock" created="Fri, 23 Apr 2010 05:18:13 +0000"  >&lt;p&gt;I am having the same issue with an equivalent test case. For some reason, the &lt;tt&gt;&apos;orderBy&apos;&lt;/tt&gt; option on the target of the join (set by calling the &lt;tt&gt;option()&lt;/tt&gt; function inside the &lt;tt&gt;setUp()&lt;/tt&gt; method of the model class, not the ref class) is being applied to the relation table. After digging through the 1.2.2 tag a bit, I found altering line 1319 of Query.php as follows seems to fix the problem (at least against my test cases):&lt;/p&gt;

&lt;p&gt;&lt;del&gt;&lt;tt&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;/del&gt;&lt;br/&gt;
&lt;ins&gt;&lt;tt&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getTable() === $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;/tt&gt;&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ll do some more thorough testing and submit a patch if I find time.&lt;/p&gt;</comment>
                    <comment id="15332" author="bwegrzyn" created="Thu, 17 Feb 2011 09:45:31 +0000"  >&lt;p&gt;I had this issue as well. suhock&apos;s solution fixed it for me. It would be nice if this was merged in to a bug fix release of Doctrine 1.x.&lt;/p&gt;</comment>
                    <comment id="15336" author="suhock" created="Fri, 18 Feb 2011 03:32:42 +0000"  >&lt;p&gt;I ended up creating a new ticket, &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; class=&quot;external-link&quot;&gt;DC-651&lt;/a&gt;, which addresses a more general problem with the orderBy feature. You should use the attached Ticket_DC651.patch instead, as I found the solution I provided here is not completely correct and does not pass all test cases.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10202" name="DC313TestCase.php" size="3659" author="mh" created="Wed, 2 Dec 2009 12:53:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-975] Treat sql server error 2601 as Doctrine_Core::ERR_ALREADY_EXISTS</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-975</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Patch attached to treat sql server error 2601 (Integrity constraint violation) as Doctrine_Core::ERR_ALREADY_EXISTS&lt;/p&gt;</description>
                <environment>Sql server</environment>
            <key id="12401">DC-975</key>
            <summary>Treat sql server error 2601 as Doctrine_Core::ERR_ALREADY_EXISTS</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="ben.davies">Ben Davies</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 11:31:01 +0000</created>
                <updated>Thu, 17 Feb 2011 11:31:01 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10942" name="Doctrine_Connection_Mssql_Exception.patch" size="844" author="ben.davies" created="Thu, 17 Feb 2011 11:31:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-974] generateFile = true - problematic implementation, see symfony ticket #4522</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-974</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;see &lt;a href=&quot;http://trac.symfony-project.org/ticket/4522&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/4522&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using a behaviour with generateFile=true, som eproblematic issues occur:&lt;/p&gt;

&lt;p&gt;Let&apos;s take for example i18n:&lt;/p&gt;

&lt;p&gt;schema.yml&lt;br/&gt;
...&lt;br/&gt;
actAs:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;text&amp;#93;&lt;/span&gt;&lt;br/&gt;
      generateFiles: true&lt;br/&gt;
      generatePath: &amp;lt;?php echo sfConfig::get(&apos;sf_lib_dir&apos;) ?&amp;gt;/model/doctrine/translations&lt;/p&gt;

&lt;p&gt;1) The translation model class and it&apos;s base class are not created with generate.php (aka symfony doctrine:build --model), but every time a translation model is used. This is not the expected behaviour, because &lt;br/&gt;
  a) this makes autoloading these classes impossible.&lt;br/&gt;
  b) the APC cache always sees a new change time, and recaches the fiels. This results in a quick fragmentation of the cache with segmentation faults in the long run.&lt;br/&gt;
2) The permissions for the created files are wrong. Normal executable php scripts should not be writable by the web server (admitting that with the current implementation, this is not problem, because the files are created again for each request)&lt;br/&gt;
3) The path is hard coded. This brakes deployment by svn update, and I would prefer not to build models on a production server.&lt;/p&gt;

&lt;p&gt;Proposal:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;generate the files at build model time&lt;/li&gt;
	&lt;li&gt;hopefully find a solution with the path&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I realize that most development resources are now in the new doctrine, but this issue (especially the apc fragmentation) is a huge problem for me. If you won&apos;t fix it, let me know, then I would try to propose a patch. I checked the code, and the building and behaviour internal part of doctrine are not too well documented, and my patch would be far from perfect. &lt;/p&gt;</description>
                <environment>symfony</environment>
            <key id="12400">DC-974</key>
            <summary>generateFile = true - problematic implementation, see symfony ticket #4522</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="geg">Georg</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 08:31:49 +0000</created>
                <updated>Thu, 17 Feb 2011 08:31:49 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-973] Statements with empty results are not correctly closed</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-973</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Statements that return no result are not correctly closed in Doctrine_Hydrator_Graph::hydrateResultSet().&lt;/p&gt;

&lt;p&gt;Oracle has limited number of opened cursors, and this bug prevents unsing doctrine in batch task like indexing models with sfSolrPlugin.&lt;/p&gt;

&lt;p&gt;Oracle throws an error `ORA-01000: maximum open cursors exceeded : ` in my case after indexing only 100 records.&lt;/p&gt;

&lt;p&gt;I&apos;ll send a pull request via github for this issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12399">DC-973</key>
            <summary>Statements with empty results are not correctly closed</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="adrive">Miloslav &quot;adrive&quot; Kmet</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 05:00:08 +0000</created>
                <updated>Thu, 17 Feb 2011 05:00:08 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-972] MySQL field aliases with triple ticks</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-972</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In revision 7691 something has happened. Ever since I updated my Doctrine to that revision all my queries having &quot; ... fieldname AS aliasname ... &quot; go crazy and make the PHP to throw an exception, like this:&lt;/p&gt;

&lt;p&gt;&apos;Doctrine_Connection_Mysql_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;t.`id`&apos; in &apos;field list&apos;.  Failing Query:&lt;br/&gt;
&quot;SELECT `t`.`id` AS `t_&lt;em&gt;id`, `t`.```id``` AS `t&lt;/em&gt;&lt;em&gt;0`, `t`.```name``` AS `t&lt;/em&gt;&lt;em&gt;1`, `t`.`id` AS `t&lt;/em&gt;&lt;em&gt;0`, `t`.`name` AS `t&lt;/em&gt;_1` FROM `territoryCombined` `t` ORDER BY `t`.`name` asc&quot;&apos;&lt;br/&gt;
in ...path here.../doctrine/lib/Doctrine/Connection.php:1082&lt;/p&gt;

&lt;p&gt;The problem is that the DQL parser somewhere along the process encapsualtes aliases in ticks, but then it does it again in lib/Doctrine/Formatter.php : quoteIdentifier() , which is called in lib/Doctrine/Connection : quoteIdentifier() , which is called in lib/Doctrine/Query.php : processPendingFields() @ between lines 485 and 512. The problem is that by the time the alias name gets to line 507 it is already encapsualted in ticks, but it does it again. At the end we end up with ```alias``` , which is not good.&lt;/p&gt;

&lt;p&gt;It only happens to aliases. If I say select(&apos;*&apos;) or select(&quot;t.id, t.name&quot;) then it executes properly. Only the aliases couse problems.&lt;/p&gt;

&lt;p&gt;A test query:&lt;/p&gt;

&lt;p&gt;$vTerritories = Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&quot;t.id as territory_id, t.name as territory_name&quot;)&lt;br/&gt;
                    -&amp;gt;from(&apos;TerritoryCombined t&apos;)&lt;br/&gt;
                    -&amp;gt;orderBy(&apos;t.name asc&apos;)&lt;br/&gt;
                    -&amp;gt;fetchArray();&lt;/p&gt;


&lt;p&gt;MY PROPOSED PATCH:&lt;/p&gt;

&lt;p&gt;If I change the Formatter::quoteIdentifier() to this:&lt;/p&gt;

&lt;p&gt;    public function quoteIdentifier($str, $checkOption = true)&lt;/p&gt;
    {
        $tmp = $this-&amp;gt;conn-&amp;gt;identifier_quoting; // I move up this line to here because I need it

        if ( (substr($str, 0, 1) == $tmp[&apos;start&apos;]) &amp;amp;&amp;amp; (substr($str, -1) == $tmp[&apos;end&apos;]) ) return $str; // new line; is it already quoted? if yes, then don&apos;t do it again

        // the rest is unchanged
    }

&lt;p&gt;then it works correctly. Please note I only tested that in MySQL, as we use MySQL in all our projects.&lt;/p&gt;</description>
                <environment>MySQL 5, PHP 5</environment>
            <key id="12396">DC-972</key>
            <summary>MySQL field aliases with triple ticks</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="hroland">Roland Huszti</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 11:14:24 +0000</created>
                <updated>Wed, 16 Feb 2011 11:14:24 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10941" name="BaseTerritoryCombined.php" size="2337" author="hroland" created="Wed, 16 Feb 2011 11:14:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-971] Tree result sets hydrators are checking for column level not field level</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-971</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Tree hierarchy hydrators (Doctrine_Collection::toHierarchy and Doctrine_Array_Hierarchy_Driver::hydrateResultSet) are checking wheter the column `level` exists.&lt;/p&gt;

&lt;p&gt;The level column can be aliased, and for oracle, it is required to do so. Therefor it is better to check, whether the aliased field level exists.&lt;/p&gt;

&lt;p&gt;Patch included in pull request&lt;/p&gt;</description>
                <environment></environment>
            <key id="12392">DC-971</key>
            <summary>Tree result sets hydrators are checking for column level not field level</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="adrive">Miloslav &quot;adrive&quot; Kmet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 06:37:11 +0000</created>
                <updated>Wed, 16 Feb 2011 06:37:11 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-968] I18n and PostgreSQL and DmVersionable</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-968</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using PHP 5.3.2 and PostgreSQL 8.4.5, Diem passed all checks in green - OK.&lt;/p&gt;

&lt;p&gt;I started with &quot;A week of Diem Ipsum&quot; and all went ok until I reached building of blog engine. Blog engine example fails in step: &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;php symfony doctrine:migrate&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with error message:&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;The following errors occurred:

    * SQLSTATE[42830]: Invalid foreign key: 7 ERROR: there is no unique constraint matching given keys &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; referenced table &lt;span class=&quot;code-quote&quot;&gt;&quot;article_translation&quot;&lt;/span&gt;. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;ALTER TABLE article_translation_version ADD CONSTRAINT article_translation_version_id_article_translation_id FOREIGN KEY (id) REFERENCES article_translation(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_image ON article (image)&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_author ON article (author)&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_translation_id ON article_translation (id)&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_translation_version_id ON article_translation_version (id)&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I removed i18n support in blog engine example and after that migrate went ok. But in Admin interface when I wanted to add&lt;br/&gt;
blog article, although Diem confirmed it saved article, article would not show up in the list, I checked db table, it was empty also.&lt;br/&gt;
Further, if I try to loremize, for 1 fixture I get no error but table is again empty, and for more fixtures then 1, Diem reports error:&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;SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Again I reviewed the model and removed DmVersionable, migrated again and after that I could loremize or create articles without errors.&lt;/p&gt;

&lt;p&gt;Additionally, not related directly to this blog engine example but doctrine related, I noticed errors in Diem Admin interface&lt;br/&gt;
itself when I try to access System-&amp;gt;Configuration-&amp;gt;Settings . If I access System settings over link &lt;br/&gt;
admin_dev.php/system/configuration/settings/index it shows settings. But when I click on &lt;br/&gt;
dmin_dev.php/system/configuration in menu path and after again to settings &lt;br/&gt;
admin_dev.php/system/configuration/settings/index, error is generated:&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;500 | Internal Server Error | Doctrine_Connection_Pgsql_Exception
SQLSTATE[08P01]: &amp;lt;&amp;gt;: 7 ERROR: bind message supplies 1 parameters, but prepared statement &lt;span class=&quot;code-quote&quot;&gt;&quot;pdo_stmt_00000008&quot;&lt;/span&gt; requires 2&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Are this bugs corrected?&lt;/p&gt;


</description>
                <environment>PHP 5.3.2, PostgreSQL 8.4.5, Diem 5.1.x</environment>
            <key id="12061">DC-968</key>
            <summary>I18n and PostgreSQL and DmVersionable</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sasha">Sasha</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Nov 2010 04:39:37 +0000</created>
                <updated>Tue, 15 Feb 2011 15:39:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-967] Problems with fetchArray() combined with leftJoin() by using  aliases of columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-967</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;They are some strange problems with hydration to array combined with aliases of columns and JOINS. Let&apos;s see this example:&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;$q = Doctrine_Query::create ()
-&amp;gt;select(&apos;c.id AS id, c.path AS path, c.name AS name, cbc.product_count&apos;)
-&amp;gt;from(&apos;Category c&apos;)
-&amp;gt;leftJoin(&apos;c.CategoryBrowserCache cbc&apos;);

$categories = $q-&amp;gt;fetchArray();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This example will throw exception: &quot;The root class of the query (alias lc) must have at least one field selected.&quot;&lt;/p&gt;

&lt;p&gt;OK. Let&apos;s change code  a little bit. Let&apos;s add alias for cbc.product_count column too:&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;$q = Doctrine_Query::create ()
-&amp;gt;select(&apos;c.id AS id, c.path AS path, c.name AS name, cbc.product_count AS product_count&apos;)
-&amp;gt;from(&apos;Category c&apos;)
-&amp;gt;leftJoin(&apos;c.CategoryBrowserCache cbc&apos;);

$categories = $q-&amp;gt;fetchArray();
print_r($categories);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now code executed without exception, BUT  $q-&amp;gt;fetchArray()  returned only ONE (first) record hydrated to array. Other results were ignored.  &lt;/p&gt;

&lt;p&gt;Let&apos;s change code  one more time:&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;$q = Doctrine_Query::create ()
-&amp;gt;select(&apos;c.id, c.path, c.name, cbc.product_count AS product_count&apos;)
-&amp;gt;from(&apos;Category c&apos;)
-&amp;gt;leftJoin(&apos;c.CategoryBrowserCache cbc&apos;);
$categories = $q-&amp;gt;fetchArray();
print_r($categories);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Like you see I just removed all aliases for columns for Category. Now code will be executed without exceptions, All results will be hydrated into array as expected to be. Actually the same result can be reached by removing at least one alias for any Category column. &lt;/p&gt;</description>
                <environment>Symfony Framework v1.3.8, Windows 7</environment>
            <key id="12385">DC-967</key>
            <summary>Problems with fetchArray() combined with leftJoin() by using  aliases of columns</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="arnlukas">Arnoldas Lukasevicius</reporter>
                        <labels>
                    </labels>
                <created>Sun, 13 Feb 2011 18:30:56 +0000</created>
                <updated>Sun, 13 Feb 2011 18:46:58 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-966] Default Order By incorrectly propagating to relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-966</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Symfony Version 1.4.9 ORM: Doctrine&lt;/p&gt;

&lt;p&gt;Schema.yml:&lt;/p&gt;

&lt;p&gt;Table1:&lt;br/&gt;
    actAs:&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
    options:&lt;br/&gt;
        orderBy: sort_order ASC&lt;br/&gt;
    columns:&lt;br/&gt;
        name: &lt;/p&gt;
{ string(255), notnull: true }
&lt;p&gt; sort_order: &lt;/p&gt;
{ string(255), notnull: true }

&lt;p&gt;Table2:&lt;br/&gt;
    columns:&lt;br/&gt;
        table1_id: &lt;/p&gt;
{ integer, notnull: true }
&lt;p&gt; value: &lt;/p&gt;
{ string(255), notnull: true }
&lt;p&gt;    relations:&lt;br/&gt;
        Table1: &lt;/p&gt;
{ local: table1_id, foreign: id, foreignAlias: Table2 }

&lt;p&gt;This generates models and I can see the following: BaseTable?1.class.php: $this-&amp;gt;option(&apos;sort_order&apos;, &apos;sort_order ASC&apos;);&lt;/p&gt;

&lt;p&gt;BaseTable?2.class.php: No option for sort_order&lt;/p&gt;

&lt;p&gt;But when I run the following, I get errors: Doctine::getTable(&apos;Table1&apos;)&lt;del&gt;&amp;gt;createQuery(&apos;t&apos;)&lt;/del&gt;&amp;gt;leftJoin(&apos;t.Table2 t2&apos;).execute();&lt;/p&gt;

&lt;p&gt;Error: Column not found: 1054 Unknown column &apos;t2.sort_order&apos; in &apos;order clause&apos;&lt;/p&gt;

&lt;p&gt;Looking at the sql executed, it included t1.sort_order ASC, but also incorrectly added t2.sort_order ASC as well even though it was never defined anywhere.&lt;/p&gt;

&lt;p&gt;I am unsure if this is a Doctrine problem or a symfony one, so I will post i on both bug tracking systems. &lt;/p&gt;</description>
                <environment>Windows 7 WAMP, PHP 5.3, MySQL 5.1.36, Apache 2.2.11</environment>
            <key id="12381">DC-966</key>
            <summary>Default Order By incorrectly propagating to relations</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="f00dmonsta">Jason Yang</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Feb 2011 02:20:27 +0000</created>
                <updated>Sat, 12 Feb 2011 02:20:27 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-965] Doctrine is passing timestamps to Doctrine_Validator_Unsigned</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-965</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Since April last year I&apos;ve been unable to use Doctrine Timestampable functionality because I get errors like this:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Uncaught exception &apos;Doctrine_Validator_Exception&apos; with message &apos;Validation failed in class XXX 1 field had validation error: * 1 validator failed on created_at (unsigned) &apos; in ...&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I&apos;ve tried lots of different configurations for the timestampable functionality (see &lt;a href=&quot;http://stackoverflow.com/questions/2594736/doctrine-unsigned-validation-error-storing-created-at&quot; class=&quot;external-link&quot;&gt;my Stack Overflow question&lt;/a&gt; for details) to no avail.&lt;/p&gt;

&lt;p&gt;I&apos;ve done some further investigation and the reason for the problem is that the timestamps are being sent to Doctrine_Validator_Unsigned for validation; they are then failing the following regexp test:&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; (preg_match(&apos;/[^0-9\-\.]/&apos;, $value)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m not smart enough to figure out why Doctrine is calling an unsigned validation test for these timestamps, so for now I&apos;ve fixed the problem by hacking the following into Doctrine_Validator_Unsigned:&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; (preg_match(&apos;/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/&apos;, $value)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Very ugly I know, but when I add this in the rest of the timestamping functionality works perfectly. Would love to get to the bottom of this bug - is particularly strange because nobody else seems to be experiencing it.&lt;/p&gt;</description>
                <environment>Debian Lenny (5.0.8) with MySQL (5.0.51a-24+lenny5O). Doctrine hosted within CodeIgniter v1.7.2</environment>
            <key id="12377">DC-965</key>
            <summary>Doctrine is passing timestamps to Doctrine_Validator_Unsigned</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="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="alexatkeplar">Alex Dean</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Feb 2011 05:15:38 +0000</created>
                <updated>Fri, 11 Feb 2011 05:57:09 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15250" author="alexatkeplar" created="Fri, 11 Feb 2011 05:57:09 +0000"  >&lt;p&gt;Added CodeIgniter details to environment&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-499] Doctrine_Query_Set incorrectly rewrites expressions</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-499</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;First up Doctrine_Query_Set should extend Doctrine_Query_Condition so that the parseLiteralValue method is available in _processPossibleAggExpression().&lt;/p&gt;

&lt;p&gt;However I am not sure what this method is really supposed to do. It seems to do some reordering of clauses, but in my case it actually drops off some parts of my expression:&lt;br/&gt;
            Doctrine_Query::create()&lt;br/&gt;
                -&amp;gt;update(&apos;Document&apos;)&lt;br/&gt;
                -&amp;gt;set(&apos;clause_ordering&apos;, &quot;IF(clause_ordering IS NULL, &apos;$id&apos;, CONCAT(clause_ordering, &apos;,$id&apos;))&quot;)&lt;br/&gt;
                -&amp;gt;where(&apos;id = ?&apos;, $document_id)&lt;br/&gt;
                -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;Results in &quot;UPDATE document SET clause_ordering = IF(clause_ordering IS NULL, &apos;67&apos;, CONCAT(clause_ordering)) WHERE (id = ?)&quot;&lt;/p&gt;

&lt;p&gt;And not as expected &quot;UPDATE document SET clause_ordering = IF(clause_ordering IS NULL, &apos;67&apos;, CONCAT(clause_ordering, &apos;,67&apos;)) WHERE (id = ?)&quot;&lt;/p&gt;

&lt;p&gt;Adding a space after IF and CONCAT fixes the issue, but is obviously a hack to get around the regexp in _processPossibleAggExpression()&lt;/p&gt;</description>
                <environment></environment>
            <key id="10890">DC-499</key>
            <summary>Doctrine_Query_Set incorrectly rewrites expressions</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="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Feb 2010 11:27:55 +0000</created>
                <updated>Fri, 4 Feb 2011 13:38:04 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13371" author="raphox" created="Sat, 19 Jun 2010 15:23:57 +0000"  >&lt;p&gt;Guilherme,&lt;br/&gt;
Como eu sei que voc&#234; fala portuguese e I dont speek english, vou falar em portugu&#234;s mesmo. Qualquer coisa voc&#234; traduz.&lt;/p&gt;

&lt;p&gt;Implementei uma solu&#231;&#227;o meio nebulosa aqui: &lt;a href=&quot;http://pastie.org/1011675&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1011675&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O que esta pegando &#233; a express&#227;o regular. Ela n&#227;o esta aceitando muito bem quando existe na &quot;$hasAggExpression&quot; argumentos separados por v&#237;rgula.&lt;br/&gt;
O meu teste foi um pouco diferente do que o criado pelo Lukas. Veja:&lt;/p&gt;

&lt;p&gt;-&amp;gt;set(&apos;p.tempo_atual&apos;, &apos;IFNULL(p.tempo_atual, p.lance_tempo) - 1&apos;)&lt;/p&gt;

&lt;p&gt;Na implementa&#231;&#227;o atual ele descarto o segundo argumento do IFNULL(). N&#227;o tenho certeza se minha proposta de implementa&#231;&#227;o &#233; correta. n&#227;o entendi muito bem o funcionamento do preg_match_all. Ao meu ver ele sempre retornaria apenas a posicao 0, mas foi uitlizado um foreach, n&#227;o entendi o pq. Ent&#227;o como esta com foreach eu deixei e coloquei uma &apos;glue&apos; vari&#225;vel para o implode no final.&lt;/p&gt;</comment>
                    <comment id="15229" author="overond" created="Fri, 4 Feb 2011 13:38:04 +0000"  >&lt;p&gt;Tem como ignorar esta verifica&#231;&#227;o? Pq o que esta acontecendo e que se eu digitar numa frase, exemplo, &quot; teste( 89,0%), &quot;  o doctrine pensa que &#233; uma express&#227;o, como evitar isto?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-964] Alias name error when using interval(MySQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-964</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using Doctrine with Symfony and i have some troubles when i&apos;m using the mysql command: interval. Here&apos;s a detailed explanation:&lt;br/&gt;
Part of the schema:&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-xml&quot;&gt;User:
  columns:
    name: { type: string(255), notnull: true }
    nick: { type: string(255), notnull: true, unique: true }
    email: { type: string(255), notnull: true, unique: true }
    password: { type: string(40), notnull: true }

VirtualConferenceRoom:
  columns:
    adminId: { type: integer, notnull: true }
    name: { type: string(255), notnull: true }
    startDate: { type: timestamp, notnull: true }
    duration: { type: integer, notnull: true }
  relations:
    Admin:
      class: User
      foreign: id
      local: adminId

VirtualConferenceRoomUser:
  columns:
    virtualConferenceRoomId: { type: integer, notnull: true }
    userId: { type: integer, notnull: true }
  relations:
    VirtualConferenceRoom:
      class: VirtualConferenceRoom
      foreign: id
      local: virtualConferenceRoomId
    User:
      class: User
      foreign: id
      local: userId
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I&apos;ve generated my model with symfony&apos;s built in command(symfony doctrine:build --model --sql)&lt;br/&gt;
When I try to get the conference rooms which are in progress at the moment I try it like this:&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-comment&quot;&gt;// In the project/lib/model/doctrine/VirtualConferenceRoomTable.class.php which is &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; from Doctrine_Table
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getRoomsInProgressByUserId($userId)
{
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Query::create()
                -&amp;gt;select(&apos;vcr.*&apos;)
                -&amp;gt;from(&apos;VirtualConferenceRoom vcr&apos;)
                -&amp;gt;innerJoin(&apos;vcr.VirtualConferenceRoomUser vcru&apos;)
                -&amp;gt;where(&apos;(vcr.StartDate &amp;lt; now()) and (vcr.StartDate + interval vcr.Duration minute &amp;gt; now()) and vcru.UserId = ?&apos;, array($userId))
                -&amp;gt;execute();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When I try to run my app I get an error message: &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;vcr.Duration&apos; in &apos;where clause&apos;&quot;&lt;br/&gt;
The generated sql command is: &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-sql&quot;&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot; &lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; v.id AS v__id, v.userid AS v__userid, v.name AS v__name, v.startdate AS v__startdate, v.duration AS v__duration &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; virtual_conference_room v INNER JOIN virtual_conference_room_user v2 ON v.id = v2.virtualconferenceroomid &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; (v.startdate &amp;lt; NOW() AND v.startdate + interval vcr.Duration minute &amp;gt; NOW() AND v2.userid = ?) - (2)&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem is the vcr.Duration section. If I change my function from:&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;-&amp;gt;where(&apos;(vcr.StartDate &amp;lt; now()) and (vcr.StartDate + interval vcr.Duration minute &amp;gt; now()) and vcru.UserId = ?&apos;, array($userId))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to:&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;-&amp;gt;where(&apos;(vcr.StartDate &amp;lt; now()) and (vcr.StartDate + interval v.Duration minute &amp;gt; now()) and vcru.UserId = ?&apos;, array($userId))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it works perfectly. &lt;/p&gt;

&lt;p&gt;I hope my report is useful and clear and i can help you to improve this great ORM &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
Best wishes: Tibor Erd&#233;sz &amp;lt;erdeszt@gmail.com&amp;gt;&lt;/p&gt;</description>
                <environment>PHP Version 5.3.3-1ubuntu9.3; Apache/2.2.16 (Ubuntu); MySQL: 5.1.41; Symfony 1.4; Doctrine 1.2.3 (Revision: 7490)</environment>
            <key id="12352">DC-964</key>
            <summary>Alias name error when using interval(MySQL)</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="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="erdeszt">Tibor Erd&#233;sz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 07:29:35 +0000</created>
                <updated>Thu, 3 Feb 2011 07:37:28 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15221" author="erdeszt" created="Thu, 3 Feb 2011 07:34:38 +0000"  >&lt;p&gt;Just figured out that I can use &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;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; notations and I fixed my report. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-962] Broken logic when doctrine translates limit&apos;s into subqueries, with joins. (with patch)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-962</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Problem exists when Doctrine formulates a subquery to perform a limit when a join in included.&lt;/p&gt;

&lt;p&gt;The problem is that the where clause that doctrine creates for the subquery (the WHERE IN clause) is inserted as the first where clause.&lt;br/&gt;
This will break the parameter duplicate done at Doctrine_Query_Abstract:969, as the order of the parameters is now wrong.&lt;/p&gt;

&lt;p&gt;Consider:&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 * from table
join metadata WITH c = ?
where a = ? and b = ?
limit 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;with parameters be (1, 2, 3)&lt;/p&gt;

&lt;p&gt;Doctrine will translate this to&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 * from table
join metadata WITH c = ?
where table.id IN (
    select id from table
    join metadata WITH c = ?
    where a = ? and b = ?
    limit 1
)
and a = ? and b = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Doctrine will duplicate the params (Doctrine_Query_Abstract:969) to (1, 2, 3, 1, 2, 3), but now they are in the wrong order completely.&lt;br/&gt;
They should be (1,1,2,3,2,3).&lt;/p&gt;

&lt;p&gt;The easy fix is to move the limit subquery to the LAST where clause, which would reuslt in a query like so:&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 * from table
join metadata WITH c = ?
where a = ? and b = ?
and table.id IN (
    select id from table
    join metadata WITH c = ?
    where a = ? and b = ?
    limit 1
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Attached is a patch to fix this issue, along with a patch that fixes all unit tests referring to the old query format.&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12347">DC-962</key>
            <summary>Broken logic when doctrine translates limit&apos;s into subqueries, with joins. (with patch)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="ben.davies">Ben Davies</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 10:11:22 +0000</created>
                <updated>Wed, 2 Feb 2011 10:19:59 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15207" author="ben.davies" created="Wed, 2 Feb 2011 10:19:59 +0000"  >&lt;p&gt;upping to blocker since this breaks very basic queries&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10926" name="Query.php.patch" size="1381" author="ben.davies" created="Wed, 2 Feb 2011 10:11:22 +0000" />
                    <attachment id="10927" name="Tests.patch" size="17500" author="ben.davies" created="Wed, 2 Feb 2011 10:11:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-961] Copy uses mutators but does not use accessors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-961</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a column that contains a serialized string of data. The accessor for that column unserializes the data and the mutator serializes. When calling copy the accessor is not used but the mutator is causing the mutator to fail because it receives a string instead of an object as its value.&lt;/p&gt;

&lt;p&gt;The lines of code creating this problem follow:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Record.php&lt;/b&gt;&lt;/div&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 copy($deep = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
 {
    $data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_data; &lt;span class=&quot;code-comment&quot;&gt;//does not use accessor
&lt;/span&gt;...
    $ret = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;create($data); &lt;span class=&quot;code-comment&quot;&gt;// does use mutator
&lt;/span&gt;...
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have currently patched my copy function with the following:&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-comment&quot;&gt;// $data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_data
&lt;/span&gt;$data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;toArray(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12334">DC-961</key>
            <summary>Copy uses mutators but does not use accessors</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shagreel">Paul Jones</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Jan 2011 13:39:23 +0000</created>
                <updated>Fri, 28 Jan 2011 15:42:06 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-768] Renaming a NOT NULL column without a default value fails in MySQL migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-768</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to rename a column that is NOT NULL and has no default value, Doctrine generates this SQL:&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;ALTER TABLE `article` CHANGE `typeid` `listid` INT DEFAULT NULL NOT NULL&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which fails. It should be:&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;ALTER TABLE `article` CHANGE `typeid` `listid` INT NOT NULL&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11555">DC-768</key>
            <summary>Renaming a NOT NULL column without a default value fails in MySQL migrations</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jacksleight">Jack Sleight</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Jun 2010 15:26:49 +0000</created>
                <updated>Fri, 28 Jan 2011 10:29:50 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15125" author="mhughes" created="Tue, 11 Jan 2011 14:39:20 +0000"  >&lt;p&gt;can confirm this behaviour on mysql w/ 1.2.4&lt;/p&gt;</comment>
                    <comment id="15196" author="mhughes" created="Fri, 28 Jan 2011 10:29:50 +0000"  >&lt;p&gt;Attached is a patch that solves the issue.&lt;br/&gt;
It&apos;s not the most elegan solution.&lt;br/&gt;
But works and all tests pass.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10922" name="DC-768.patch" size="1602" author="mhughes" created="Fri, 28 Jan 2011 10:29:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-560] Object1-&gt;Unlink(Relation, Id2) doesn&apos;t work, if primary key order in table of m2m reference isnt 1:Object 2: Id to unlink, when relation set to EQUAL= TRUE</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-560</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Object1-&amp;gt;Unlink(Relation, Id2) doesn&apos;t work, if primary key order in table of m2m reference isnt 1:Object 2: Id to unlink, when relation set to EQUAL= TRUE&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;User:
  actAs: 
    Timestampable: ~
  columns:    
    name:         { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
    last_name:    { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
    picture:      { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
    birthday:     { type: timestamp, notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
    gender:       { type: string(255) }
    rating:       { type: integer, &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:0} 
    num_comments: { type: integer, &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:0} 
    num_groups:   { type: integer, &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:0} 
  inheritance:
    &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;: Member
    type: column_aggregation
    keyField: type
    keyValue: 1                    
  relations:
    Friends:    { onDelete: CASCADE, class: User, foreignAlias: Friends, refClass: FriendReference, local: user1, foreign: user2, equal: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    Request:    { onDelete: CASCADE, class: User, foreignAlias: Pending, refClass: PendingReference, local: user1, foreign: user2 }
    Blocker:    { onDelete: CASCADE, class: User, foreignAlias: Blocked, refClass: BlockedReference, local: user1, foreign: user2 }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;(isset($refToRemove))
			{
				&lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; ($refToRemove)
				{
					&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;FriendReference&apos;: $references = $currentUser-&amp;gt;Friends; $relation = &apos;Friends&apos;;	&lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
					&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;PendingReference&apos;: $references = $currentUser-&amp;gt;Pending; $relation = &apos;Pending&apos;; &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
					&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;BlockerReference&apos;: $references = $currentUser-&amp;gt;Blocker; $relation = &apos;Blocker&apos;; &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
					&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;RequestReference&apos;: $references = $currentUser-&amp;gt;Request; $relation = &apos;Request&apos;; &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
				}
				 
				foreach($references as $reference)
				{

					&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($reference-&amp;gt;id == $user2-&amp;gt;id)
                        $currentUser-&amp;gt;unlink($relation, array($user2-&amp;gt;id), $now = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
				}
                
			}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;when you count relations from one side and the other it show that when set to EQUAL = TRUE relations are reciprocal, but unlink still minds primary keys order in order to function&lt;/p&gt;</description>
                <environment>Windows XP, Apache 2.2, PHP 5, Doctrine 1.2 on Symfony 1.4</environment>
            <key id="11021">DC-560</key>
            <summary>Object1-&gt;Unlink(Relation, Id2) doesn&apos;t work, if primary key order in table of m2m reference isnt 1:Object 2: Id to unlink, when relation set to EQUAL= TRUE</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="marciano">Mariano Ramon</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Mar 2010 12:11:56 +0000</created>
                <updated>Thu, 27 Jan 2011 13:26:33 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12227" author="jwage" created="Mon, 15 Mar 2010 16:04:44 +0000"  >&lt;p&gt;I am unable to reproduce the issue. When I test everything works as expected. We really need some more information and a test case in order to be sure of any issue.&lt;/p&gt;</comment>
                    <comment id="12522" author="slickrick" created="Tue, 30 Mar 2010 17:11:04 +0000"  >&lt;p&gt;I was able to reproduce this issue in Doctrine 1.2. The issue is a two part scenerio, which makes it kind of hard to debug.   But here is how to reproduce it.&lt;/p&gt;

&lt;p&gt;1.) Lets assume you have a Product model with ID 14.  &lt;br/&gt;
2.) Lets assume you have an &quot;equal&quot; M:M table that links to itself, (product_product_group). &quot;product_id_1&quot; and &quot;product_id_2&quot; are a compound primary key which link back to the Product model.&lt;br/&gt;
3.) Lets assume you that Product 14 is currently linked to products with IDs 2, 5, and 13.&lt;br/&gt;
4.) Assuming $object is an instance of Product id 14, call $object-&amp;gt;unlink(array(2));&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;SQL QUERY LOG for Step 4.)&lt;br/&gt;
482 Query       START TRANSACTION&lt;br/&gt;
482 Query       DELETE FROM product_product_group WHERE (product_id_1 = &apos;14&apos; AND product_id_2 IN (&apos;2&apos;))&lt;br/&gt;
482 Query       UPDATE product_product_group SET product_id_1 = &apos;5&apos; WHERE product_id_1 = &apos;14&apos; AND product_id_2 = &apos;5&apos;&lt;br/&gt;
482 Query       UPDATE product_product_group SET product_id_1 = &apos;13&apos; WHERE product_id_1 = &apos;14&apos; AND product_id_2 = &apos;13&apos;&lt;br/&gt;
482 Query       DELETE FROM product_product_group WHERE product_id_2 = &apos;2&apos; AND product_id_1 = &apos;14&apos;&lt;br/&gt;
482 Query       COMMIT&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The result is as follows:&lt;br/&gt;
  a.) Doctrine properly unlinks ID 2&lt;br/&gt;
  b.) Doctrine updates the M:M table and sets the remaining two IDs (5 and 13) and links them to themselves (it shouldn&apos;t run these updates).  Now, all we have in our database are two links (5-5 and 13-13).&lt;/p&gt;

&lt;p&gt;5.) Now, Product ID 14 has no links anymore in the M:M table.  So we call $object-&amp;gt;link(array(2, 5, 13));  &lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;SQL QUERY LOG for Step 5.)&lt;br/&gt;
512 Query       START TRANSACTION&lt;br/&gt;
512 Query       SELECT ... FROM to_product_id t WHERE (t.id IN (&apos;13&apos;, &apos;2&apos;, &apos;5&apos;))&lt;br/&gt;
512 Query       INSERT INTO to_product_id_to_product_id_group (product_id_2, product_id_1) VALUES (&apos;2&apos;, &apos;14&apos;)&lt;br/&gt;
512 Query       INSERT INTO to_product_id_to_product_id_group (product_id_2, product_id_1) VALUES (&apos;5&apos;, &apos;14&apos;)&lt;br/&gt;
512 Query       INSERT INTO to_product_id_to_product_id_group (product_id_2, product_id_1) VALUES (&apos;13&apos;, &apos;14&apos;)&lt;br/&gt;
512 Query       COMMIT&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This works as expected.&lt;/p&gt;

&lt;p&gt;6.) Now, in our database, Product ID 14 properly links to Ids 2, 5, and 13. BUT IDs 5 and 13 also have a link to themselves as a byproduct of the UPDATE queries called in step 4.).&lt;br/&gt;
7.) Now, we call $object-&amp;gt;unlink(array(2)) again.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;SQL QUERY LOG for Step 7.)&lt;br/&gt;
432 Query       START TRANSACTION&lt;br/&gt;
432 Query       DELETE FROM product_product_group WHERE (product_id_1 = &apos;14&apos; AND product_id_2 IN (&apos;2&apos;))&lt;br/&gt;
432 Query       UPDATE product_product_group SET product_id_1 = &apos;5&apos; WHERE product_id_1 = &apos;2&apos; AND product_id_2 = &apos;5&apos;&lt;br/&gt;
432 Query       UPDATE product_product_group SET product_id_1 = &apos;5&apos; WHERE product_id_1 = &apos;14&apos; AND product_id_2 = &apos;5&apos;&lt;br/&gt;
432 Query       ROLLBACK&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The following error occurs:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Mar 30 20:40:41 symfony &lt;span class=&quot;error&quot;&gt;&amp;#91;err&amp;#93;&lt;/span&gt; exception &apos;Doctrine_Connection_Mysql_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;5-5&apos; for key 1&apos; in /path/to/symfony/1.4/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php:1082&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So basically, it repeated the same queries from step 4.), however this time around, when attempting to set ID 5 to itself, it fails because there is already an entry this pair in the database.  Since we have a compound primary key, this non-unique combination is not allowed.  I don&apos;t know why its trying to run these UPDATE queries, but its definitely something to do with thre relationship being &quot;equal&quot;.&lt;/p&gt;</comment>
                    <comment id="13189" author="jwage" created="Tue, 8 Jun 2010 14:37:14 +0000"  >&lt;p&gt;It is hard to decipher the problem. It is best and most clear to provide a test case.&lt;/p&gt;</comment>
                    <comment id="15195" author="slickrick" created="Thu, 27 Jan 2011 13:26:33 +0000"  >&lt;p&gt;I know this is old, and is likely to never be resolved, but the problem does still exist.&lt;/p&gt;

&lt;p&gt;Basically, &quot;unlinking&quot; an equal relation only unlinks one side of the relationship:&lt;/p&gt;

&lt;p&gt;DELETE FROM user_user_group WHERE (user_id_1 = &apos;20&apos; AND user_id_2 IN (&apos;9&apos;))&lt;/p&gt;

&lt;p&gt;However, if the relationship was created from the other side (i.e. user_id_1 = 9 and user_id_2 = 20), then it doesn&apos;t properly get rid of the relationship.  Again, this only applies when a relationship is marked as &quot;equal&quot;.&lt;/p&gt;

&lt;p&gt;Here is another post about the same issue, with their work-around:&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/1385281/how-do-i-remove-a-self-referencing-nn-relation-in-doctrine&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/1385281/how-do-i-remove-a-self-referencing-nn-relation-in-doctrine&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-753] doctrine generate-migrations-diff throws &quot;No php or yml files found at path&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-753</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am trying to generate migrations from the CLI but I get the error mentioned in the title. I did some searching and this seems to &lt;b&gt;have been&lt;/b&gt; a known problem and was fixed, however, I&apos;m getting it and the path is correct, and there is even a schema.yml file I just generated, also through CLI.&lt;/p&gt;

&lt;p&gt;Here is the error:&lt;/p&gt;

&lt;p&gt;D:\wamp\www\project\src\administrator\components\com_project\doctrine&amp;gt;php doctrine generate-migrations-diff&lt;br/&gt;
No php or yml files found at path: &quot;D:\wamp\www\project\src\administrator\components\com_project\doctrine\schema&quot;&lt;/p&gt;

&lt;p&gt;And here is what I have in my CLI file:&lt;/p&gt;

&lt;p&gt;	require_once(&apos;../../../../libraries/doctrine/lib/Doctrine.php&apos;);&lt;/p&gt;

&lt;p&gt;	spl_autoload_register(array(&apos;Doctrine&apos;,&apos;autoload&apos;));&lt;/p&gt;

&lt;p&gt;	Doctrine_Manager::connection(&apos;mysql://root@localhost/project&apos;,&apos;default&apos;);&lt;/p&gt;

&lt;p&gt;	//Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine::ATTR_TBLNAME_FORMAT, &apos;jos_project_%s&apos;);&lt;br/&gt;
	Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);&lt;br/&gt;
	Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER, true);&lt;br/&gt;
	Doctrine::loadModels(&apos;models/generated&apos;);&lt;br/&gt;
	Doctrine::loadModels(&apos;models&apos;);&lt;/p&gt;

&lt;p&gt;	$cli = new Doctrine_Cli(array(&lt;br/&gt;
		&apos;data_fixtures_path&apos;  =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;fixtures&apos;,&lt;br/&gt;
		&apos;models_path&apos;         =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;models&apos;,&lt;br/&gt;
		&apos;migrations_path&apos;     =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;migrations&apos;,&lt;br/&gt;
		&apos;sql_path&apos;            =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;sql&apos;,&lt;br/&gt;
		&apos;yaml_schema_path&apos;    =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;schema&apos;&lt;br/&gt;
	));&lt;/p&gt;

&lt;p&gt;	$cli-&amp;gt;run($_SERVER&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;argv&amp;#39;&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;I find this very weird because earlier today I was able to make a migration the same way but with Symfony&apos;s CLI, however, that is another project.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;David&lt;/p&gt;</description>
                <environment>WIndows 7 x64, WAMP, PHP 5.2.11 &amp;amp; 5.3</environment>
            <key id="11524">DC-753</key>
            <summary>doctrine generate-migrations-diff throws &quot;No php or yml files found at path&quot;</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dukeofgaming">David Vega</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jun 2010 05:12:50 +0000</created>
                <updated>Thu, 27 Jan 2011 13:07:37 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15194" author="saldanha" created="Thu, 27 Jan 2011 13:07:37 +0000"  >&lt;p&gt;I have the same problem, using symfony 1.4 latest sources. After reading about 20 (long) pages about similar issues, I&apos;ve come up with a solution.&lt;/p&gt;

&lt;p&gt;The problem appears when the project still don&apos;t have any Models defined. Im my case, they were all new projects in the plugin activation stage. Curiously, the behaviour were random, as in some projects I could activate my Contacts plugin (the first), and in others I couldn&apos;t.&lt;/p&gt;

&lt;p&gt;After much consideration, the problem was that the var $extension in /doctrine/Doctrine/Migration/Diff.php was empty, and that was because the algorithm only considered the first entry of the directory. If it was a file, its extension was used. If not, the algorithm descended until it found a file as the first entry. BUT it never considered second (and following) entries, so as my first entry was the &apos;base&apos; directory, and it was empty, no extension was ever found. This probably will not happen if the project have some models defined.&lt;/p&gt;

&lt;p&gt;And so, I came up with a solution. In doctrine/Doctrine/Migration/Diff.php, enclose this code in the _getItemExtension method (near line 350, in my copy) with a loop, such as:&lt;br/&gt;
      $idx = 0;&lt;br/&gt;
      while (strlen($extension) == 0) {&lt;br/&gt;
          if (isset($files&lt;span class=&quot;error&quot;&gt;&amp;#91;$idx&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
              if (is_dir($files&lt;span class=&quot;error&quot;&gt;&amp;#91;$idx&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                  $extension = $this-&amp;gt;_getItemExtension($files[$idx]);
              }
&lt;p&gt; else &lt;/p&gt;
{
                  $pathInfo = pathinfo($files[$idx]);
                  $extension = $pathInfo[&apos;extension&apos;];
              }
&lt;p&gt;              $idx++;&lt;br/&gt;
          }&lt;br/&gt;
          else break; // no more entries to seek&lt;br/&gt;
      }&lt;/p&gt;

&lt;p&gt;Now it keep looking in every folder until it finds a file WITH an extension, and stops when all the tree is searched.&lt;/p&gt;

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

&lt;p&gt;best regards.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-958] updating Models with Intra-Table Relations cascades strangely</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-958</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sorry for the lengthy explanation, couldn&apos;t make it more straight forward:&lt;/p&gt;

&lt;p&gt;I have a model which is similiar to a nestet set but the tree structure needs to overlap:&lt;/p&gt;

&lt;p&gt;For Model A, every Object A1 can have multiple descendant objects A2 and in turn can be a descendant of multiple objects A0.&lt;/p&gt;

&lt;p&gt;Since I saw no way to do this with Nested-Set Relations (or Equal-Nested-Sets) I have set up my Model like this:&lt;/p&gt;

&lt;p&gt;modules:&lt;br/&gt;
  columns: ..&amp;lt;do not matter&amp;gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Children:&lt;br/&gt;
      class: modules&lt;br/&gt;
      refClass: modules_required&lt;br/&gt;
    Parents:&lt;br/&gt;
      class: modules&lt;br/&gt;
      refClass: modules_required&lt;/p&gt;

&lt;p&gt;modules_required:&lt;br/&gt;
  columns: &amp;lt;do not matter here, just 2 foreign key columns&amp;gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Children:&lt;br/&gt;
    Parents:&lt;/p&gt;

&lt;p&gt;I needed to specify the Relations on both tables, to use onDelete/onUpdate CASCADE rules. Generated Models look fine, just as intended.&lt;br/&gt;
(Every Class has many Children and has many Parents...)&lt;/p&gt;

&lt;p&gt;Now the strange part:&lt;br/&gt;
    When I update an object of modules (say id=18), Doctrine issues the following queries:&lt;br/&gt;
DELETE FROM modules_required WHERE (required_id = ? AND module_id IN (?, ?, ?, ?, ?)) - (18, 25, 26, 32, 34, 35) &lt;br/&gt;
// where 25 to 35 are CHILDREN of 18&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (25, 25, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (26, 26, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (32, 32, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (34, 34, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (35, 35, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (25, 25, 12)&lt;br/&gt;
//where 10 and 12 are PARENTS of 18&lt;br/&gt;
and somewhen, Doctrine encounters an MySQL ERROR because of the previous update marathon:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;25-25&apos; for key &apos;PRIMARY&apos; &lt;/p&gt;

&lt;p&gt;The point is: &lt;br/&gt;
1. why is Doctrine trying to create self-referencing relations, and &lt;br/&gt;
2. why is it touching the relation at all, when i only did change some text fields in the object?&lt;/p&gt;

&lt;p&gt;Is there a better way to solve my problem?&lt;/p&gt;</description>
                <environment>PHP 5.3 / symfony 1.4.9</environment>
            <key id="12323">DC-958</key>
            <summary>updating Models with Intra-Table Relations cascades strangely</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12278">DC-952</parent>
                        <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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Jan 2011 11:42:09 +0000</created>
                <updated>Thu, 27 Jan 2011 04:21:44 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Nested Set</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15182" author="bigbadbassman" created="Tue, 25 Jan 2011 04:37:46 +0000"  >&lt;p&gt;forgot to add something: I have done a debug run, to see why these queries are created, when there was no data modified that related to these tables:&lt;/p&gt;

&lt;p&gt;Doctrine seems to handle my structure internally as a Nested-Set, although I have not specified an actAs: NestedSet or relations: equal: true statement in the model definition.&lt;br/&gt;
Is there a way to prevent symfony from misinterpreting this?&lt;/p&gt;

&lt;p&gt;This is not a nested set, as each object can have virtually any other object either as parent or as a child, and additionaly, parent relations can span multiple tree-levels:&lt;br/&gt;
Object 2 is parent of Object 3 and 6&lt;br/&gt;
Object 3 is parent of Object 4 and 5&lt;br/&gt;
Object 4 is parent of Object 6&lt;/p&gt;

&lt;p&gt;results in: Object 6 has parents 2 and 4 (where 4 has parent 3 and 3 has parent 2 in turn)&lt;/p&gt;

&lt;p&gt;This spanning relations seems to cause the guessed nested set to fail.&lt;/p&gt;

&lt;p&gt;I simply wanted to create an m:n Relation using a Reference table and the fact that both m and n are of the same class should not consider doctrine.&lt;/p&gt;</comment>
                    <comment id="15190" author="bigbadbassman" created="Wed, 26 Jan 2011 05:36:25 +0000"  >&lt;p&gt;related to #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-329&quot; title=&quot;Problem saving Self Referencing (Nest Relations)&quot;&gt;DC-329&lt;/a&gt;:&lt;br/&gt;
seems to be the same general problem as described there. Only in DC 1.2.3, doctrine tries to delete every child-relation for some unknown reason.&lt;/p&gt;

&lt;p&gt;also the h2aEqualable mentioned there does not work, because it does not prevent symfony from issueing the delete queries. It prevents only the UPDATE-Queries, and thus circumvents the MySQL-Error.&lt;/p&gt;

&lt;p&gt;Nevertheless, data is still corrupted after object save, thus not useable in production.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-960] Bug in OCI8 adapter&apos;s freeCursor function causes exception with HYDRATE_ON_DEMAND</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-960</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;oci_free_statement  should be changed to oci_cancel inside Doctrine_Adapter_Statement_Oracle::closeCursor(). Otherwise exception is thrown if HYDRATE_ON_DEMAND is used followed by foreach loop.&lt;/p&gt;

&lt;p&gt;Doctrine2 should also be affected by this bug.&lt;/p&gt;

&lt;p&gt;Change:&lt;br/&gt;
public function closeCursor()&lt;/p&gt;
    {
        $this-&amp;gt;bindParams = array();
        return oci_free_statement($this-&amp;gt;statement);
    }
&lt;p&gt;To:&lt;br/&gt;
public function closeCursor()&lt;/p&gt;
    {
        $this-&amp;gt;bindParams = array();
        return oci_cancel($this-&amp;gt;statement);
    }</description>
                <environment>doctrine, symfony, linux, hpux</environment>
            <key id="12327">DC-960</key>
            <summary>Bug in OCI8 adapter&apos;s freeCursor function causes exception with HYDRATE_ON_DEMAND</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vadik56">vadik56</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Jan 2011 10:45:34 +0000</created>
                <updated>Wed, 26 Jan 2011 10:45:34 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10918" name="closeCursor.diff" size="922" author="vadik56" created="Wed, 26 Jan 2011 10:45:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-959] DSN style problems in documentation 1.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-959</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This page:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/introduction-to-connections/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/introduction-to-connections/en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;states the DSN can either be provided as an associative array or as a string, but it&apos;s not true, specially if you&apos;re doing lazy connection, because this type of connection only accepts doctrine dsn style and it doesn&apos;t seem to know how to handle unix socket type connections (is it correct?).&lt;/p&gt;

&lt;p&gt;I would suggest the manual clarify that lazy connection will only accept string type dsn and also will &lt;b&gt;not&lt;/b&gt; accept socket connections.&lt;/p&gt;

&lt;p&gt;Related links:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/1eecb07a2f6df447/3e74857c3a076939?lnk=gst&amp;amp;q=dsn#3e74857c3a076939&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/1eecb07a2f6df447/3e74857c3a076939?lnk=gst&amp;amp;q=dsn#3e74857c3a076939&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-647&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-647&lt;/a&gt;&lt;/p&gt;</description>
                <environment>MAMP</environment>
            <key id="12326">DC-959</key>
            <summary>DSN style problems in documentation 1.2</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="duli">Luis Felipe</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Jan 2011 21:28:26 +0000</created>
                <updated>Tue, 25 Jan 2011 21:28:26 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-950] Doctrine_Record magic _set() doesn&apos;t validate field type for timestamp/datetime/etc..</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-950</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;So I ran into this recently. the magic _set() in Doctrine_Record doesn&apos;t check/validate the type of the field. The use case is when you you do something like:&lt;br/&gt;
setCreatedAt(time()); This will not work correctly with date/time or timestamp types in Doctrine, even though Propel handles this fine. Also MYSQL will not throw an error with default sql_mode and will put garbage data into the database.&lt;/p&gt;

&lt;p&gt;The only way to generate the right date/time value is to always format that string with the &quot;right&quot; format. This should be easier and can be easier if it supported either a timestamp (time() or a DateTime() object (just like Symfony plugin does for setDateTimeObject() function). This is just a few lines of code, let me know if I should attach a patch.&lt;/p&gt;

&lt;p&gt;I would love to see the Doctrine_Record implement this functionality. There&apos;s a ton of results on frustrated users trying to figure out how to set the date/time values properly using Doctrine.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12248">DC-950</key>
            <summary>Doctrine_Record magic _set() doesn&apos;t validate field type for timestamp/datetime/etc..</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="gena01">Gennady Feldman</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Dec 2010 20:38:39 +0000</created>
                <updated>Mon, 24 Jan 2011 11:36:01 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15180" author="gena01" created="Mon, 24 Jan 2011 11:34:17 +0000"  >&lt;p&gt;Symfony actually added a work around by writing another function &quot;setDateTimeObject()&quot; to set these fields in a more friendly way. Ideally I would love to see support for time() and date_create() natively in Doctrine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-916] fetchOne defect</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-916</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Query fetchOne method now retrieves and hydrates all collection, which can be time consumable. I suggest to add limit 1 in fetchOne method.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12065">DC-916</key>
            <summary>fetchOne defect</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="orlanster">Roman</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Nov 2010 04:32:05 +0000</created>
                <updated>Mon, 24 Jan 2011 11:27:24 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15155" author="gena01" created="Fri, 21 Jan 2011 17:35:47 +0000"  >&lt;p&gt;This is a defect. People assume there&apos;s an implied limit(1) in the query because of fetchOne(). Please fix this, this is pretty serious stuff.&lt;/p&gt;</comment>
                    <comment id="15156" author="gena01" created="Fri, 21 Jan 2011 19:57:54 +0000"  >&lt;p&gt;Doctrine_Table actually &quot;works around&quot; the issue but explicitly doing limit(1) before doing fetchOne():&lt;/p&gt;

&lt;p&gt;public function findOneBy($fieldName, $value, $hydrationMode = null)&lt;/p&gt;
    {
        return $this-&amp;gt;createQuery(&apos;dctrn_find&apos;)
            -&amp;gt;where($this-&amp;gt;buildFindByWhere($fieldName), (array) $value)
            -&amp;gt;limit(1)
            -&amp;gt;fetchOne(array(), $hydrationMode);
    }</comment>
                    <comment id="15171" author="jwage" created="Sun, 23 Jan 2011 14:17:13 +0000"  >&lt;p&gt;Was this always like this or did it change recently?&lt;/p&gt;</comment>
                    <comment id="15179" author="gena01" created="Mon, 24 Jan 2011 11:27:24 +0000"  >&lt;p&gt;Frankly I have no idea. &lt;/p&gt;

&lt;p&gt;Also adding a limit(1) shouldn&apos;t break anything and is straight forward. We would also want to fix findOneBy not to do limit(1) since fetchOne() should take care of this after the fix is in place.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-615] New sequence generation for PostgreSQL SQL code results in errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-615</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With 1.2.2 we get errors for our generated PostgreSQL code: &quot;sequence &amp;lt;sequence name&amp;gt; already exists&quot;. I tracked down the issue to the following:&lt;/p&gt;

&lt;p&gt;Doctrine_Export_Pgsql::createTableSql() has the following new code:&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; (isset($options[&apos;sequenceName&apos;])) {
            $sql[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createSequenceSql($options[&apos;sequenceName&apos;]);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is fine, but this CREATE SEQUENCE code is now added after the CREATE TABLE code. This does not work okay for PostgreSQL, since PostgreSQL will automatically create the index for you if it does not yet exist. If CREATE SEQUENCE is required for some reason, then it should ge before the CREATE TABLE to be useful (it could for example be useful if different increment intervals or starting numbers should be set for the sequence).&lt;/p&gt;

&lt;p&gt;I tried moving the new code up, but that did not yet give me the desired results. The issue is that Doctrine_Export::exportClassesSql() collects all the SQL in an array and finally does:&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;rsort($sql);
&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $sql;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This can break any statement set in there that should be run in a specific order. For the PostgreSQL code, this will put all the CREATE TABLE calls in font of the CREATE SEQUENCE calls, resulting in the errors that we see.&lt;/p&gt;

&lt;p&gt;Suggested fix options:&lt;/p&gt;

&lt;p&gt;1) Do not sort the SQL queries, but accept them as generated by the db specific Export class (but I&apos;m only suggesting this, because I am not aware of the reason to do an rsort() in the first place).&lt;/p&gt;

&lt;p&gt;2) Change the PostgreSQL export code to make it immune to the sorting.&lt;/p&gt;

&lt;p&gt;We did the latter in our code. The CREATE SEQUENCE and CREATE TABLE are concatenated into one statement string (&quot;&amp;lt;squence&amp;gt;;&amp;lt;table&amp;gt;&quot;) that is added to the list of SQL queries. This provides us a work-around for the problem. The first solution is more clean IMO, but I lack knowledge to tell if the rsort() is here for technical or aesthetic reasons. &lt;/p&gt;</description>
                <environment></environment>
            <key id="11168">DC-615</key>
            <summary>New sequence generation for PostgreSQL SQL code results in errors</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Apr 2010 16:53:14 +0000</created>
                <updated>Sat, 22 Jan 2011 08:41:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14251" author="mmakaay" created="Fri, 3 Sep 2010 06:10:48 +0000"  >&lt;p&gt;An additional issue for the PostgreSQL sequence handling: the Doctrine code does create a sequence field in the tables. However, the sequence system seems not to be in use at all for generating new id fields. As a result, the sequences remain at their initial value of 1.&lt;/p&gt;

&lt;p&gt;We noticed this when we tried to manually insert a record in the database. Five records were already available. The manual INSERT failed, because of a duplicate index error on the id field. After a few attempts, it did work. That was because the PostgreSQL sequence had reached a value of 6, which was a non-existing id for the table at that point.&lt;/p&gt;

&lt;p&gt;I think that a choice has to be made here: either use sequences or don&apos;t:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;When id&apos;s are always generated without using the sequence features of PostgreSQL, then do not create the id fields as sequences, but make them standard primary key integer fields instead, so no unused sequence objects will be created in the database.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;When id generation makes use of sequence features, then it&apos;s okay to use sequences for id fields. When doing this, loading a new dataset into the database might require some additional attention for the sequences. After import, the sequences should be updated to represent the first free id value for the table that it is providing id values for. When data import makes use of the sequences directly for generating id&apos;s, then this would not be necessary of course.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I hope this helps in improving Doctrine.&lt;/p&gt;</comment>
                    <comment id="15158" author="mmakaay" created="Sat, 22 Jan 2011 08:41:30 +0000"  >&lt;p&gt;The issue with the duplicate id&apos;s is fixed on our system.&lt;/p&gt;

&lt;p&gt;When defining &quot;sequence: &amp;lt;something&amp;gt;&quot; in a YAML file for a field, Doctrine will generate two sequences: one as specified in the YAML data and one as autogenerated by PostgreSQL. Doctrine inserts will use one, direct inserts via SQL will use the other. By specifying an field as primary and autoincrement, a correct and single sequence will be generated.&lt;/p&gt;

&lt;p&gt;This work-around works for us. The Doctrine team will have to decide on what the expected behavior for &quot;sequence&quot; is. The current workings seem a bit off IMO.&lt;/p&gt;

&lt;p&gt;I hope this helps. Thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10541" name="PostreSQL.createTableSql.sequence.fix.diff" size="1685" author="mmakaay" created="Fri, 2 Apr 2010 16:53:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-746] Sluggable canUpdate overridden after subsequent updates</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-746</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When allowing the user to manually change a slug using &apos;canUpdate&apos; the slug  reverts back to it&apos;s default generated value upon subsequent saves. Pre-Update on the Sluggable Listener Template seems to incorrectly decide to regenerate the default value.&lt;/p&gt;

&lt;p&gt;Example:&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;this&lt;/span&gt;-&amp;gt;actAs(&apos;Sluggable&apos;, array(&apos;unique&apos;=&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;fields&apos;=&amp;gt;array(&apos;title&apos;), &apos;canUpdate&apos;=&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;save();

echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;example-title&quot;&lt;/span&gt; (Correct)
&lt;/span&gt;
$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;slug = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt;;
$record-&amp;gt;save();

echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt; (Correct - First Save)
&lt;/span&gt;
$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;slug = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt;;
$record-&amp;gt;save();
echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;example-title&quot;&lt;/span&gt; (Incorrect - Subsequent Save. Has regenerated it&apos;s &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; slug and lost the user defined one - even though we have passed the users custom one to the object prior to saving it.).&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>WAMP stack - PHP 5.3</environment>
            <key id="11511">DC-746</key>
            <summary>Sluggable canUpdate overridden after subsequent updates</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="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="ppanther">Adam Benson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 01:09:26 +0000</created>
                <updated>Fri, 21 Jan 2011 11:41:17 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14530" author="caponica" created="Tue, 5 Oct 2010 11:09:20 +0000"  >&lt;p&gt;As far as I can see this is a problem with the logic in Sluggable::preUpdate() , I recently posted a comment about this here:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/d40c6ac733738d4a&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/d40c6ac733738d4a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In short, I think that the code should be changed from:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&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 preUpdate(Doctrine_Event $event)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;unique&apos;]) {
            $record = $event-&amp;gt;getInvoker();
            $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name || (
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                ! array_key_exists($name, $record-&amp;gt;getModified())
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($record-&amp;gt;$name) &amp;amp;&amp;amp;
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                array_key_exists($name, $record-&amp;gt;getModified()
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To this (i.e. remove the canUpdate conditions from the first inner if):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php (modified)&lt;/b&gt;&lt;/div&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 preUpdate(Doctrine_Event $event)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;unique&apos;]) {
            $record = $event-&amp;gt;getInvoker();
            $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) { &lt;span class=&quot;code-comment&quot;&gt;// i.e. remove the other conditions - you should only build the slug from other fields &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it&apos;s empty
&lt;/span&gt;                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
            &lt;span class=&quot;code-comment&quot;&gt;// possibly add an &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; !canUpdate then make sure the old value is preserved&quot;&lt;/span&gt; here
&lt;/span&gt;            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($record-&amp;gt;$name) &amp;amp;&amp;amp;
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                array_key_exists($name, $record-&amp;gt;getModified()
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have modified my local version of the Doctrine code to use this modification and it seems to (a) not have the problem you reported above and (b) generally work ok. However, I have not run the test suite against it.&lt;/p&gt;

&lt;p&gt;C&lt;/p&gt;</comment>
                    <comment id="14786" author="ppanther" created="Fri, 19 Nov 2010 02:11:29 +0000"  >&lt;p&gt;Updated affected versions&lt;/p&gt;</comment>
                    <comment id="14787" author="ppanther" created="Fri, 19 Nov 2010 02:13:54 +0000"  >&lt;p&gt;Thanks for the update Christian, perhaps you could share your fix as a patch?&lt;/p&gt;</comment>
                    <comment id="15154" author="jessovr" created="Fri, 21 Jan 2011 11:41:17 +0000"  >&lt;p&gt;Hi, I&apos;m working on a multilingue web portal with Symfony 1.4 and Doctrine 1.2.3, and man, your fix saves my life &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
I use Sluggable slaved by i18n and without your fix Sluggable simply does not do the job, instead it messes up all slugs when updating, eventually you can&apos;t retrieve object anymore based on it. I would not set it as only minor bug ?&lt;br/&gt;
thanks, anyway.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-957] MSSQL doctrine inner join group by problem</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-957</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#group-by,-having-clauses&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#group-by,-having-clauses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
    -&amp;gt;select(&apos;u.username&apos;)&lt;br/&gt;
    -&amp;gt;addSelect(&apos;COUNT(p.id) as num_phonenumbers&apos;)&lt;br/&gt;
    -&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
    -&amp;gt;leftJoin(&apos;u.Phonenumbers p&apos;)&lt;br/&gt;
    -&amp;gt;groupBy(&apos;u.id&apos;);&lt;/p&gt;

&lt;p&gt;SELECT &lt;br/&gt;
u.id AS u__id, &lt;br/&gt;
u.username AS u__username, &lt;br/&gt;
COUNT(p.id) AS p__0 &lt;br/&gt;
FROM user u &lt;br/&gt;
LEFT JOIN phonenumber p ON u.id = p.user_id &lt;br/&gt;
GROUP BY u.id&lt;/p&gt;

&lt;p&gt;i should create&lt;/p&gt;

&lt;p&gt;SELECT &lt;br/&gt;
COUNT(p.id) AS p__0 &lt;br/&gt;
FROM user u &lt;br/&gt;
LEFT JOIN phonenumber p ON u.id = p.user_id &lt;br/&gt;
GROUP BY u.id&lt;/p&gt;


&lt;p&gt;MSSQL doesnt support this use of group by sql. Id have to be in aggregrate function or  group by.  I do not need id but doctrine creates it in sql.&lt;/p&gt;

&lt;p&gt;&quot;invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.&quot;&lt;/p&gt;</description>
                <environment>mssql, doctrine 1.2.3 , symfony</environment>
            <key id="12313">DC-957</key>
            <summary>MSSQL doctrine inner join group by problem</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mehmetuysal">Mehmet Uysal</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Jan 2011 16:28:24 +0000</created>
                <updated>Thu, 20 Jan 2011 16:28:24 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-956] Validation error (unique) when inserting an object with Searchable behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-956</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;As soon as one enables the Searchable behavior like the following it is not possible anymore to create or update an entity.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;    public function setTableDefinition()&lt;/p&gt;
    &lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {        $this-&amp;gt;setTableName(&amp;#39;seartest_article&amp;#39;);
        $this-&amp;gt;hasColumn(&amp;#39;articleid&amp;#39;, &amp;#39;integer&amp;#39;, 11, array(                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;integer&amp;#39;,                &amp;#39;primary&amp;#39; =&amp;gt; true,                &amp;#39;autoincrement&amp;#39; =&amp;gt; true,                &amp;#39;unsigned&amp;#39; =&amp;gt; true,                &amp;#39;notnull&amp;#39; =&amp;gt; false,                &amp;#39;unique&amp;#39; =&amp;gt; true,                &amp;#39;length&amp;#39; =&amp;gt; 11            )        );        $this-&amp;gt;hasColumn(&amp;#39;title&amp;#39;, &amp;#39;string&amp;#39;, 255, array(                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;string&amp;#39;,                &amp;#39;notnull&amp;#39; =&amp;gt; false,                &amp;#39;length&amp;#39; =&amp;gt; 255            )        );        $this-&amp;gt;hasColumn(&amp;#39;description&amp;#39;, &amp;#39;string&amp;#39;, null, array(                &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;string&amp;#39;,                &amp;#39;notnull&amp;#39; =&amp;gt; false,                &amp;#39;length&amp;#39; =&amp;gt; null            )        );
        $this-&amp;gt;option(&amp;#39;type&amp;#39;, &amp;#39;INNODB&amp;#39;);        $this-&amp;gt;option(&amp;#39;collate&amp;#39;, &amp;#39;utf8_unicode_ci&amp;#39;);        $this-&amp;gt;option(&amp;#39;charset&amp;#39;, &amp;#39;utf8&amp;#39;);    }&lt;/span&gt; &lt;/div&gt;

&lt;p&gt;    public function setUp()&lt;/p&gt;
    &lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {        // Search support        $search = new Doctrine_Template_Searchable(array(                &amp;#39;fields&amp;#39; =&amp;gt; array(&amp;#39;title&amp;#39;, &amp;#39;description&amp;#39;),                &amp;#39;batchUpdate&amp;#39; =&amp;gt; false            )        );
        $this-&amp;gt;actAs($search);
        $this-&amp;gt;addListener(new SearchableTest_Model_ArticleListener());    }&lt;/span&gt; &lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;After trying to create a new item the following error message appears (note the record class is called SearchableTest_Model_Article and the primary id column is named articleid):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Validation failed in class SearchableTest_Model_ArticleIndex 1 field had validation error: * 1 validator failed on articleid (unique) &lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment>Ubuntu Linux with Apache 2 and PHP 5.3.</environment>
            <key id="12312">DC-956</key>
            <summary>Validation error (unique) when inserting an object with Searchable behavior</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="guite">Axel Guckelsberger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Jan 2011 13:19:48 +0000</created>
                <updated>Thu, 20 Jan 2011 13:21:13 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-489] Doctrine_Record seems to have a bug with default values when updating</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-489</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;So lets see the table:&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  tableName: users&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(1)&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    username:&lt;br/&gt;
      type: string(32)&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      primary: false&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: false&lt;br/&gt;
    password:&lt;br/&gt;
      type: string(48)&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      primary: false&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: false&lt;br/&gt;
    role:&lt;br/&gt;
      type: enum&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      values:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;admin&lt;/li&gt;
	&lt;li&gt;support&lt;br/&gt;
      default: support                 &amp;lt;----- &lt;span class=&quot;error&quot;&gt;Unable to render embedded object: File (ROOT OF EVIL) not found.&lt;/span&gt;&lt;br/&gt;
      primary: false&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: false&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So lets say we have a user with `role` = &apos;support&apos; and want to set em&lt;br/&gt;
&apos;admin&apos; we wrote&lt;/p&gt;

&lt;p&gt;$user = new App_Model_User();&lt;br/&gt;
$user-&amp;gt;assignIdentifier(1);&lt;br/&gt;
$user-&amp;gt;role = &apos;admin&apos;;&lt;br/&gt;
$user-&amp;gt;save();&lt;br/&gt;
var_dump($user-&amp;gt;toArray());&lt;/p&gt;

&lt;p&gt;in debugger we see SQL query been made:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0.55 ms&amp;#93;&lt;/span&gt; UPDATE users SET role = ? WHERE id = ?&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
	&lt;li&gt;bindings: admin&lt;/li&gt;
	&lt;li&gt;1&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;array(6) &lt;/p&gt;
{ [&quot;id&quot;]=&amp;gt;  int(1) [&quot;display_name&quot;]=&amp;gt;  string(13)
&quot;Administrator&quot; [&quot;username&quot;]=&amp;gt;  string(4) &quot;root&quot; [&quot;password&quot;]=&amp;gt;
string(40) &quot;45bb0f589525a2f0f2a48620bb59b1b8baef0c1d&quot; [&quot;role&quot;]=&amp;gt;
string(5) &quot;admin&quot; [&quot;is_active&quot;]=&amp;gt;  bool(true) }

&lt;p&gt;Superb! Works as it should! So lets now set role of this user back to&lt;br/&gt;
&apos;support&apos;:&lt;/p&gt;

&lt;p&gt;$user = new App_Model_User();&lt;br/&gt;
$user-&amp;gt;assignIdentifier(1);&lt;br/&gt;
$user-&amp;gt;role = &apos;support&apos;; // This value defined as default in scheme,&lt;br/&gt;
thats why have problems&lt;br/&gt;
$user-&amp;gt;save();&lt;br/&gt;
var_dump($user-&amp;gt;toArray());&lt;/p&gt;

&lt;p&gt;in debugger we didnot see any UPDATE queries! However object is been&lt;br/&gt;
changed, results just has not been flushed to database.&lt;/p&gt;

&lt;p&gt;array(6) &lt;/p&gt;
{ [&quot;id&quot;]=&amp;gt;  int(1) [&quot;display_name&quot;]=&amp;gt;  string(13)
&quot;Administrator&quot; [&quot;username&quot;]=&amp;gt;  string(4) &quot;root&quot; [&quot;password&quot;]=&amp;gt;
string(40) &quot;45bb0f589525a2f0f2a48620bb59b1b8baef0c1d&quot; [&quot;role&quot;]=&amp;gt;
string(7) &quot;support&quot; [&quot;is_active&quot;]=&amp;gt;  bool(true) }

&lt;p&gt;I cant overcome this problem right now, unfortunatelly (well I can&lt;br/&gt;
just remove all default values from table definitions or use&lt;br/&gt;
Doctrine_Query for updating staff.. but I&apos;d like to use models &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &lt;/p&gt;

&lt;p&gt;However if I use Doctrine_Query of even&lt;/p&gt;

&lt;p&gt;$user = Doctrine_Core::getTable(&apos;App_Model_User&apos;)-&amp;gt;find(1);&lt;/p&gt;

&lt;p&gt;instead of&lt;/p&gt;

&lt;p&gt;$user = new App_Model_User();&lt;br/&gt;
$user-&amp;gt;assignIdentifier(1);&lt;/p&gt;

&lt;p&gt;updates works well...&lt;/p&gt;</description>
                <environment>PHP 5.2.11</environment>
            <key id="10858">DC-489</key>
            <summary>Doctrine_Record seems to have a bug with default values when updating</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="silverstorm">Silver</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Feb 2010 15:15:34 +0000</created>
                <updated>Thu, 20 Jan 2011 08:53:02 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15153" author="elijen" created="Thu, 20 Jan 2011 08:52:31 +0000"  >&lt;p&gt;I second this.&lt;/p&gt;

&lt;p&gt;When you UPDATE row with save() method of Record after setting identifier by assignIdentifier() doctrine removes columns updates from SQL which are set to default values same as it would do with INSERT. Other columns are updated correctly. This is sure a bug.&lt;/p&gt;

&lt;p&gt;You can workaround this by setting the value as NULL instead of the actual default value. (Which I wouldn&apos;t recommend).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-648] Behavior geographical generates latitude DOUBLE(18, 2), longitude DOUBLE(18, 2) - it&apos;s not exact</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-648</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem was already described by another person at &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-385&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-385&lt;/a&gt;&lt;br/&gt;
and was fixed but now is broken again.&lt;/p&gt;

&lt;p&gt;When using the Geographical behaviour in a YML schema the latitude is stored in Mysql as a Double(18,2) instead of a Double as it was in the previous versions. It appears that all doubles in yml are defaulting to (18,2).&lt;/p&gt;</description>
                <environment>Doctrine 1.2.2</environment>
            <key id="11265">DC-648</key>
            <summary>Behavior geographical generates latitude DOUBLE(18, 2), longitude DOUBLE(18, 2) - it&apos;s not exact</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="indiekiduk">Malcolm Hall</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Apr 2010 13:20:03 +0000</created>
                <updated>Wed, 19 Jan 2011 05:26:19 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12744" author="indiekiduk" created="Sat, 24 Apr 2010 13:39:55 +0000"  >&lt;p&gt;The problem lies in DataDict/Mysql.php&lt;/p&gt;

&lt;p&gt;Previously it was:&lt;/p&gt;

&lt;p&gt;case &apos;double&apos;:&lt;br/&gt;
return &apos;DOUBLE&apos;;&lt;/p&gt;

&lt;p&gt;now it&apos;s:&lt;/p&gt;

&lt;p&gt;case &apos;double&apos;:&lt;br/&gt;
                $length = !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;) ? $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt; : 18;&lt;br/&gt;
                $scale = !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt;) ? $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt; : $this-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);&lt;br/&gt;
                return &apos;DOUBLE(&apos;.$length.&apos;, &apos;.$scale.&apos;)&apos;;&lt;/p&gt;

&lt;p&gt;Perhaps this could be improved so that if there is no length specified it returns just double with no length or scale instead of defaulting to 18, ATTR_DECIMAL_PLACES? I expect that most people that use the double type in yaml wouldn&apos;t want only 2 decimals.&lt;/p&gt;</comment>
                    <comment id="13181" author="jwage" created="Tue, 8 Jun 2010 13:53:29 +0000"  >&lt;p&gt;Can you provide a patch that fixes the situation for you? we&apos;ll see if that has any breakage of current tests.&lt;/p&gt;</comment>
                    <comment id="13706" author="spike008t" created="Mon, 26 Jul 2010 13:56:18 +0000"  >&lt;p&gt;I have the same trouble, and I fix it by specified directly the precision of the double into Doctrine_Template_Geographical class.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&apos;type&apos;     =&amp;gt;  &apos;double(18,8)&apos;,&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    <comment id="14681" author="janusz.slota" created="Mon, 8 Nov 2010 08:54:54 +0000"  >&lt;p&gt;You can fix it with:&lt;br/&gt;
Geographical:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;latitude:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type: float(18,8)&lt;br/&gt;
&amp;nbsp;&amp;nbsp;longitude:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type: float(18,8)&lt;/p&gt;

&lt;p&gt;instead of:&lt;br/&gt;
Geographical: ~&lt;/p&gt;</comment>
                    <comment id="15149" author="spike008t" created="Wed, 19 Jan 2011 05:26:19 +0000"  >&lt;p&gt;diff on Template/Geographical.php&lt;/p&gt;

&lt;p&gt;Hope that could help&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10913" name="patch.diff" size="1091" author="spike008t" created="Wed, 19 Jan 2011 05:26:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-955] Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-955</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sample schema:&lt;/p&gt;

&lt;p&gt;Blog:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;Versionable, Searchable&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
   id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;   name: string&lt;br/&gt;
   text: text&lt;/p&gt;

&lt;p&gt;When dumping data of a schema with Versionable and/or Searchable Behaviour, the dump.yml will contain all data, including the *_version and *_index tables.&lt;/p&gt;

&lt;p&gt;Trying to load the same .yml file results in Duplicate-Key constraint violations, as long as the data for the *_version and *_index tables is present.&lt;br/&gt;
The import is only successfull, when the data for these tables is discarded.&lt;br/&gt;
This leads to the issue, that one can only do a dump-load cycle, when the complete version history of a Model is discarded. Which makes dump-load for such models rather useless.&lt;/p&gt;</description>
                <environment>PHP 5.3.3 / symfony 1.4.9-dev / MySQL 5.0</environment>
            <key id="12301">DC-955</key>
            <summary>Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2011 04:38:57 +0000</created>
                <updated>Fri, 14 Jan 2011 04:42:12 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Data Fixtures</component>
                <component>Import/Export</component>
                <component>Searchable</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-864] Generating YAML schema from model should pick up also charset, collate and other options</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-864</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I did change Doctrine/Export/Schema.php to pick up some options from model, then they get exported into YAML schema by current code.&lt;/p&gt;

&lt;p&gt;Adding the patch. (sorry, can&apos;t run the tests, so I&apos;m not sure whether it does break something, really shouldn&apos;t)&lt;/p&gt;

&lt;p&gt;In my project it works just as expected (did need it for the way I do migrations).&lt;/p&gt;

&lt;p&gt;TODO for Doctrine devs:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;run tests with my patch and let me know if there&apos;s a problem&lt;/li&gt;
	&lt;li&gt;consider other option names, which are worth of export, so far I did need &quot;charset&quot; and &quot;collate&quot;, and I added &quot;queryParts&quot; as well.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I hope my additions make sense and will help you to improve Doctrine project. (and that you will include it, so I don&apos;t have custom modified Doctrine &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11904">DC-864</key>
            <summary>Generating YAML schema from model should pick up also charset, collate and other options</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="ped">Peter Helcmanovsky</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 06:15:08 +0000</created>
                <updated>Mon, 10 Jan 2011 09:51:03 +0000</updated>
                                                                    <component>Import/Export</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15118" author="ped" created="Mon, 10 Jan 2011 09:51:03 +0000"  >&lt;p&gt;By hunting down an eluding bug I figured out (i.e. by hard way) that the indexes are dropped as well during YAML generation.&lt;/p&gt;

&lt;p&gt;I will do another pull request on github including another 3 lines to fix that...&lt;/p&gt;

&lt;p&gt;I see this issue is ignored anyway by core devs.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10784" name="Export_Schema.patch" size="863" author="ped" created="Fri, 10 Sep 2010 06:15:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-954] tinyint(1) with default value in schema.yml generates blank default value, gives SQLSTATE[42000]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-954</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;doing a &lt;br/&gt;
doctrine:build --all --and-load&lt;br/&gt;
with a schema.yml of&lt;/p&gt;

&lt;p&gt;Foo:&lt;br/&gt;
  tableName: foo&lt;br/&gt;
  options:&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    bar:&lt;br/&gt;
      type: tinyint(1)&lt;br/&gt;
      default: 0&lt;/p&gt;

&lt;p&gt;results in a blank value generated for the default keyword, and the following error:&lt;/p&gt;

&lt;p&gt;  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos; PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB&apos; at line 1. Failing Query: &quot;CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB&quot;. Failing Query: CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB &lt;/p&gt;

&lt;p&gt;I&apos;ve also tried combinations of tinyint, tinyint(4), single-quoting the default value, and different default values.&lt;/p&gt;

&lt;p&gt;Changing the type to int makes the issue disappear&lt;/p&gt;</description>
                <environment>Win7 64-bit&lt;br/&gt;
Netbeans 6.9.1&lt;br/&gt;
Symfony 1.4.8</environment>
            <key id="12288">DC-954</key>
            <summary>tinyint(1) with default value in schema.yml generates blank default value, gives SQLSTATE[42000]</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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bluescrubbie">Colin Stuart</reporter>
                        <labels>
                    </labels>
                <created>Sun, 9 Jan 2011 13:41:36 +0000</created>
                <updated>Sun, 9 Jan 2011 15:13:04 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-953] Doctrine fails when using link() on OneToMany because of failing save</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-953</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have continually run into a very particular bug when using OneToMany relationships between Doctrine tables. When attempting to call &quot;link()&quot; to generate a relationship between records in related tables, Doctrine attempts to set the ID of the &quot;one&quot; portion of the record to 0, then save it.&lt;/p&gt;

&lt;p&gt;This is best demonstrated by the sample YML and PHP that I have attached. It establishes a OneToMany relationship where the &quot;one&quot; table has another foreign key constraint. This causes the DB to trigger a foreign key constraint error when Doctrine tries to set the ID to 0, making the error easier to see.&lt;/p&gt;

&lt;p&gt;From looking into the relevant sections of the codebase, the following appears to be happening:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Calling &quot;link&quot; properly adds the relationship to the &quot;many&quot; record.&lt;/li&gt;
	&lt;li&gt;Calling &quot;save&quot; triggers the saving of the &quot;many&quot; record and all associated records.&lt;/li&gt;
	&lt;li&gt;With the &quot;one&quot; record now listed as an associated record, its own &quot;save&quot; function is called as a result.&lt;/li&gt;
	&lt;li&gt;Its &quot;save&quot; function works properly, except that for some reason, the ID key is not present in the $_data internal array (but oddly is present in the $_id array, allowing it to be returned in other places).&lt;/li&gt;
	&lt;li&gt;Seeing a difference, Doctrine attempts to execute an &quot;UPDATE&quot; query setting the ID to 0.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;ve made it this far in looking into it, but for the life of me I can&apos;t figure out what is triggering the identifier being reset in this case. I should note, however, that it happens consistently in every such situation on every server I&apos;ve tested it on.&lt;/p&gt;</description>
                <environment>PHP 5.2.10, MySQL database connection</environment>
            <key id="12279">DC-953</key>
            <summary>Doctrine fails when using link() on OneToMany because of failing save</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="slvreagle23">Buster Neece</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Jan 2011 20:47:27 +0000</created>
                <updated>Tue, 4 Jan 2011 21:43:39 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15107" author="slvreagle23" created="Tue, 4 Jan 2011 21:43:39 +0000"  >&lt;p&gt;Further research into the issue has revealed the exact area where the problem is being caused:&lt;/p&gt;

&lt;p&gt;Doctrine_Collection (272): Function &quot;setReference&quot;, called from Doctrine_Relation_ForeignKey (80).&lt;/p&gt;

&lt;p&gt;For each of the elements in the collection (in this case, the related items), that function is setting the &quot;reference field&quot; value to the record being related to. Apparently, it&apos;s getting the field names confused, because it&apos;s overwriting &quot;id&quot; with a reference to the entire related object, which has a different ID.&lt;/p&gt;

&lt;p&gt;I can&apos;t tell if this is only an issue when both the relation tables use the same identifier (&quot;id&quot;), but this is surely common enough to warrant a fix.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10903" name="test.php" size="408" author="slvreagle23" created="Tue, 4 Jan 2011 20:47:27 +0000" />
                    <attachment id="10904" name="test.yml" size="1162" author="slvreagle23" created="Tue, 4 Jan 2011 20:47:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-856] Doctrine_Core::getPath() not working when inside phar, due to a bug in php</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-856</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It seems that there is a bug in php, and realpath doesn&apos;t work when path is inside of phar archive.&lt;br/&gt;
function Doctrine_Core::getPath()&lt;br/&gt;
        if ( ! self::$_path) &lt;/p&gt;
{
          self::$_path = realpath(dirname(__FILE__) . &apos;/..&apos;);
        }

&lt;p&gt;can be easily changed to &lt;br/&gt;
        if ( ! self::$_path) &lt;/p&gt;
{
          self::$_path = dirname(dirname(__FILE__));
        }</description>
                <environment></environment>
            <key id="11877">DC-856</key>
            <summary>Doctrine_Core::getPath() not working when inside phar, due to a bug in php</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Sep 2010 06:36:39 +0000</created>
                <updated>Tue, 4 Jan 2011 06:19:21 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15105" author="ishtanzar" created="Tue, 4 Jan 2011 06:19:21 +0000"  >&lt;p&gt;&lt;a href=&quot;http://bugs.php.net/bug.php?id=52769&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/bug.php?id=52769&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-610] Chaining innerjoins can only be made uni-directional; order matters</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-610</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The following code fails&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This doesn&apos;t work&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Query::create()
	-&amp;gt;select(&apos;Table t1&apos;)
	-&amp;gt;innerJoin(&apos;f1.Foreign2 f2 WITH f1.field = 2&apos;)
	-&amp;gt;innerJoin(&apos;t1.Foreign1 f1&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Doctrine seems only to be happy when we change the order of the inner joins&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;This works&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Query::create()
	-&amp;gt;select(&apos;Table t1&apos;)
	-&amp;gt;innerJoin(&apos;t1.Foreign1 f1&apos;)
	-&amp;gt;innerJoin(&apos;f1.Foreign2 f2 WITH f1.field = 2&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>I&amp;#39;ve witnessed the problem in Doctrine 1.2.2 and 1.2.1</environment>
            <key id="11155">DC-610</key>
            <summary>Chaining innerjoins can only be made uni-directional; order matters</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="exceptione">Exception e</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Mar 2010 17:07:53 +0000</created>
                <updated>Fri, 31 Dec 2010 17:18:07 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12521" author="exceptione" created="Tue, 30 Mar 2010 17:09:16 +0000"  >&lt;p&gt;fixed typo&lt;/p&gt;</comment>
                    <comment id="15078" author="dquintard" created="Fri, 31 Dec 2010 17:17:05 +0000"  >&lt;p&gt;What about this issue.&lt;br/&gt;
I&apos;ve got the same:&lt;/p&gt;

&lt;p&gt;$q2 = Doctrine_Query::create()&lt;br/&gt;
			-&amp;gt;select(&apos;*&apos;)&lt;br/&gt;
			-&amp;gt;from(&apos;Model_TForfaitType ft&apos;)&lt;br/&gt;
			-&amp;gt;innerJoin(&apos;ft.TServiceForfait sf&apos;);&lt;br/&gt;
		echo $q2-&amp;gt;getSqlQuery();&lt;br/&gt;
		$results = $q2-&amp;gt;fetchArray();&lt;br/&gt;
		echo &quot;results:&quot;.count($results).&quot;&amp;lt;br&amp;gt;&quot;; =&amp;gt; 3 results&lt;/p&gt;

&lt;p&gt;		$q3 = Doctrine_Query::create()&lt;br/&gt;
			-&amp;gt;select(&apos;*&apos;)&lt;br/&gt;
			-&amp;gt;from(&apos;Model_TServiceForfait sf&apos;)&lt;br/&gt;
			-&amp;gt;innerJoin(&apos;sf.TForfaitType ft&apos;);&lt;br/&gt;
		echo $q3-&amp;gt;getSqlQuery();		&lt;br/&gt;
		$results = $q3-&amp;gt;fetchArray();&lt;br/&gt;
		echo &quot;results:&quot;.count($results).&quot;&amp;lt;br&amp;gt;&quot;; =&amp;gt; 16 results&lt;/p&gt;

&lt;p&gt;		$q4 = Doctrine_Query::create()&lt;br/&gt;
			-&amp;gt;select(&apos;*&apos;)&lt;br/&gt;
			-&amp;gt;from(&apos;Model_TServiceForfait,Model_TForfaitType&apos;);&lt;br/&gt;
		echo $q4-&amp;gt;getSqlQuery();		&lt;br/&gt;
		$results = $q4-&amp;gt;fetchArray();&lt;br/&gt;
		echo &quot;results:&quot;.count($results).&quot;&amp;lt;br&amp;gt;&quot;; =&amp;gt; 16 results&lt;/p&gt;

&lt;p&gt;Moreover i tried with Doctrine 1.3 and this problem is not resolved.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-951] Error in generating the field size and error in the generation of the date fields  for postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-951</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;collaboration of vtamara@pasosdejesus.org    and  jeronimo0000@gmail.com           &lt;/p&gt;


&lt;p&gt;While we developed a tool with symfony 1.4 and postgresql database we found errors in the generated schema.yml which I describe below&lt;/p&gt;

&lt;p&gt;1 - Error in generating of field size of varchars&lt;br/&gt;
2 - Error in the generation of date fields&lt;/p&gt;

&lt;p&gt;We found the following solution&lt;/p&gt;


&lt;p&gt;&amp;#8212; Doctrine/Import/Pgsql.php.orig      2010-12-23 17:48:00.160271000 -0500&lt;br/&gt;
+++ Doctrine/Import/Pgsql.php   2010-12-23 18:01:59.252271002 -0500&lt;br/&gt;
@@ -168,11 +168,14 @@&lt;br/&gt;
         $columns     = array();&lt;br/&gt;
         foreach ($result as $key =&amp;gt; $val) {&lt;br/&gt;
             $val = array_change_key_case($val, CASE_LOWER);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if (strtolower($val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt;) === &apos;character varying&apos;) {&lt;br/&gt;
+            if (strtolower($val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt;) === &apos;varchar&apos;) 
{
                 // get length from varchar definition
                 $length = preg_replace(&apos;~.*\(([0-9]*)\).*~&apos;, &apos;$1&apos;, $val[&apos;complete_type&apos;]);
                 $val[&apos;length&apos;] = $length;
             }
&lt;p&gt;+           if ($val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt; == &apos;date&apos;) &lt;/p&gt;
{
+               $val[&apos;type&apos;] = $val[&apos;complete_type&apos;] = &apos;timestamp&apos;; 
+            }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;             $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val);&lt;/p&gt;





</description>
                <environment>apacha2, linux, Symfony 1.4</environment>
            <key id="12252">DC-951</key>
            <summary>Error in generating the field size and error in the generation of the date fields  for postgres</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Dec 2010 12:16:23 +0000</created>
                <updated>Fri, 24 Dec 2010 12:16:23 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-939] Patch for Doctrine .....  to identify in some cases autoincremented fields in oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-939</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Patch for Doctrine .....  to identify in some cases autoincremented&lt;br/&gt;
fields.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Solution found thanks to Vladimir Tamara - vtamara AT pasosdejesus DOT org&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Doctrine/Import/Oracle.php&lt;/p&gt;

&lt;p&gt;   // Heuristic to check autoincremented fields.&lt;br/&gt;
        // We check if there is a trigger on the field.&lt;br/&gt;
           // We could also check if there is a sequence on the field.&lt;br/&gt;
           // Side effect: slower generation of scheme&lt;br/&gt;
           $q = &quot;SELECT * FROM all_trigger_cols WHERE&lt;br/&gt;
           table_name=&apos;$table&apos; AND column_name=&apos;&quot; . $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;            $res2 = $this-&amp;gt;conn-&amp;gt;fetchColumn($q);&lt;br/&gt;
           if (count($res2) &amp;gt; 0) &lt;/p&gt;
{
               $descr[$val[&apos;column_name&apos;]][&apos;autoincrement&apos;] = true;
           }

&lt;p&gt;        }&lt;/p&gt;

&lt;p&gt;        return $descr;&lt;/p&gt;</description>
                <environment>PHP Version 5.2.4-2ubuntu5.10 &lt;br/&gt;
Copyright (c) 1997-2007 The PHP Group&lt;br/&gt;
Oracle database 10gR2&lt;br/&gt;
Symfony 1.4.4</environment>
            <key id="12164">DC-939</key>
            <summary>Patch for Doctrine .....  to identify in some cases autoincremented fields in oracle</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="alexander">Edwin Alexander Herrera Saavedra</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 17:30:22 +0000</created>
                <updated>Fri, 24 Dec 2010 12:06:55 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15015" author="alexander" created="Fri, 24 Dec 2010 12:06:55 +0000"  >&lt;p&gt;when new tables are created, the auto-increment is shown in all fields of the table in the schema, to avoid this problem has generated the following improvements to a validation of the auto-increment column is only when the primary key&lt;/p&gt;

&lt;p&gt;Solution found thanks to&lt;br/&gt;
Vladimir Tamara - vtamara AT pasosdejesus DOT org&lt;br/&gt;
and Alexander Herrera&lt;/p&gt;

&lt;p&gt;            if($descr[$val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;==1){&lt;br/&gt;
            // Heuristic to check autoincremented fields.&lt;br/&gt;
	    // We check if there is a trigger on the field.&lt;br/&gt;
	    // We could also check if there is a sequence on the field.&lt;br/&gt;
	    // Side effect: slower generation of scheme&lt;br/&gt;
            //SELECT * FROM ALL_CONS_COLUMNS WHERE CONSTRAINT_NAME LIKE &apos;%TS_DIS_REG_PK%&apos;  AND COLUMN_NAME=&apos;FECHA_PROC&apos;;&lt;br/&gt;
            $q=&quot;SELECT * FROM ALL_CONS_COLUMNS WHERE CONSTRAINT_NAME LIKE &apos;%&quot;.$table.&quot;_PK%&apos; AND COLUMN_NAME=&apos;&quot;.$val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;.&quot;&apos;&lt;/p&gt;

&lt;p&gt;                    &quot;;&lt;br/&gt;
           // echo $descr[$val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;.&quot;\n&quot;;&lt;br/&gt;
	    $s = &quot;SELECT * FROM all_trigger_cols WHERE table_name=&apos;$table&apos; AND column_name=&apos;&quot; . $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt; . &quot;&apos;&quot;;&lt;br/&gt;
           //echo $q.&quot;\n&quot;;&lt;br/&gt;
            $res2 = $this-&amp;gt;conn-&amp;gt;fetchColumn($q);&lt;br/&gt;
            $res3 = $this-&amp;gt;conn-&amp;gt;fetchColumn($s);&lt;br/&gt;
	    if (count($res2) &amp;gt; 0 &amp;amp;&amp;amp; count($res3)&amp;gt;0) &lt;/p&gt;
{
                $descr[$val[&apos;column_name&apos;]][&apos;autoincrement&apos;] = true;
	    }
&lt;p&gt;            }&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-371] Lazy loading - doctrine makes extra queries into db</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-371</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Just downloaded symfony 1.4&lt;/p&gt;

&lt;p&gt;First of all I have a query:&lt;/p&gt;

&lt;p&gt;                $q = \Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&apos;u.&lt;b&gt;, ur.&lt;/b&gt;&apos;)&lt;br/&gt;
                    -&amp;gt;from(&apos;UserDb u&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.RealUserDetailsDb ur&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.MockUserDetailsDb um&apos;)&lt;br/&gt;
                    -&amp;gt;where(&apos;u.id = :user_id&apos;)&lt;br/&gt;
                ;&lt;br/&gt;
                $user = $q-&amp;gt;fetchOne(array(&apos;:user_id&apos; =&amp;gt; $uid));&lt;/p&gt;

&lt;p&gt;After that I&apos;m accessing the fields of this object:&lt;/p&gt;

&lt;p&gt;                $userArray = array(&lt;br/&gt;
                    &apos;id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getId(),&lt;br/&gt;
                    &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId(),&lt;br/&gt;
                    &apos;mock_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getMockUserDetailsId(),&lt;br/&gt;
                    &apos;real_user_details&apos; =&amp;gt; array(),&lt;br/&gt;
                    &apos;mock_user_details&apos; =&amp;gt; array()&lt;br/&gt;
                );&lt;/p&gt;

&lt;p&gt;This is the actual queries into DB:&lt;/p&gt;

&lt;p&gt;NR1:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;&lt;em&gt;user_mock_id, u2.id AS u2&lt;/em&gt;&lt;em&gt;id, u2.nickname AS u2&lt;/em&gt;&lt;em&gt;nickname, u2.email AS u2&lt;/em&gt;_email FROM user u LEFT JOIN user_real u2 ON u.user_real_id = u2.id LEFT JOIN user_mock u3 ON u.user_mock_id = u3.id WHERE (u.id = :user_id)&lt;/p&gt;

&lt;p&gt;NR2:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;_user_mock_id FROM user u WHERE (u.id = &apos;1&apos;) LIMIT 1&lt;/p&gt;

&lt;p&gt;As you can see there are TWO queries however there should be only one query. The problem is that u.user_real_id is NULL in database and when I do  &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId() doctrine does not have enough intelligence to understand that these fields have been already requested in NR1. If I comment this field, everything works well. &lt;/p&gt;

&lt;p&gt;SURPRISE! &lt;br/&gt;
And now a surprise... if I modify a little bit my first query: &quot;&lt;del&gt;&amp;gt;select(&apos;u.&lt;b&gt;&apos;)&quot; instead of , &quot;&lt;/del&gt;&amp;gt;select(&apos;u.&lt;/b&gt;,  ur.*&apos;)&quot; it WON&apos;T make TWO queries. It will make ONLY ONE!&lt;/p&gt;

&lt;p&gt;As you understand this a very critical bug and of course our system won&apos;t go to production with this bug. &lt;/p&gt;

&lt;p&gt;P.S. Is it possible to turn off the lazy loading in doctrine?&lt;/p&gt;</description>
                <environment>Symfony 1.4, Doctrine Version: 1.2.0-BETA3</environment>
            <key id="10636">DC-371</key>
            <summary>Lazy loading - doctrine makes extra queries into db</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="drapeko">Roman Drapeko</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Dec 2009 22:53:48 +0000</created>
                <updated>Thu, 23 Dec 2010 20:22:10 +0000</updated>
                                    <version>1.2.0-BETA3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11405" author="drapeko" created="Sun, 17 Jan 2010 16:56:01 +0000"  >&lt;p&gt;Any comments? Will it be fixed??&lt;/p&gt;</comment>
                    <comment id="11893" author="jwage" created="Mon, 1 Mar 2010 15:52:49 +0000"  >&lt;p&gt;Hi, I&apos;d like to take a look but can you make a failing test case that I can run so that I can see if I can come up with a patch that fixes your case and doesn&apos;t break anything else.&lt;/p&gt;</comment>
                    <comment id="13087" author="lukis" created="Tue, 1 Jun 2010 13:11:16 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I had similar problem but after several hours i did work it out&lt;/p&gt;

&lt;p&gt;Try to make get method in your model for getting field which has NULL value in database&lt;/p&gt;

&lt;p&gt;public function getUserRealId() &lt;/p&gt;
{

  return $this-&amp;gt;_get(&quot;user_real_id&quot;, false);

}

&lt;p&gt;by making second argument false u force doctrine not to lazy load value and extra sql query is not created&lt;/p&gt;

&lt;p&gt;regards&lt;/p&gt;</comment>
                    <comment id="13207" author="jwage" created="Tue, 8 Jun 2010 16:31:53 +0000"  >&lt;p&gt;Has anyone been able to reproduce this in a test case? I am not having much luck so far.&lt;/p&gt;</comment>
                    <comment id="15001" author="gena01" created="Thu, 23 Dec 2010 20:22:10 +0000"  >&lt;p&gt;I&apos;ve seen this a ton of times. Basically when it loads related records through the Hydrator using leftJoin() and gets NULLs back. BUT it doesn&apos;t save the fact that the related records are NULL. So when you actually do call to getRelated objects it sees that it doesn&apos;t have the value cached and runs the query again.&lt;/p&gt;

&lt;p&gt;Let me know if I should show you the problem in the Doctrine code base.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-874] Allow parameters to be passed to Doctrine_Query::select()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-874</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While I believe it&apos;s not so extraordinary to have parameters in a SELECT clause, Doctrine_Query::select() does not allow to pass parameters, next to the SELECT clause. You can still pass any parameters to execute(), but I do believe it would be nice to be able to pass the parameter values right away to select() as you can with where() etc.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Doctrine_Query::create()&lt;del&gt;&amp;gt;select(&apos;f.*, (f.id = ?) AS selected&apos;))&lt;/del&gt;&amp;gt;from(&apos;Foo f&apos;)-&amp;gt;execute(array($selected_id));&lt;/p&gt;

&lt;p&gt;This principle would apply to any select-field that has a calculated value that comes from a parameter.&lt;/p&gt;</description>
                <environment>Any</environment>
            <key id="11964">DC-874</key>
            <summary>Allow parameters to be passed to Doctrine_Query::select()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="gerryvdm">Gerry Vandermaesen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 06:04:19 +0000</created>
                <updated>Thu, 23 Dec 2010 05:49:10 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14999" author="leszczu" created="Thu, 23 Dec 2010 05:49:10 +0000"  >&lt;p&gt;I believe this should be major improvement for Doctrine. Without this feature, some queries can&apos;t be created.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-936] json schema import broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-936</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With a valid Json file :&lt;br/&gt;
PHP Warning:  explode() expects parameter 2 to be string, object given in Doctrine/Doctrine/Import/Schema.php on line 381&lt;br/&gt;
PHP Catchable fatal error:  Object of class stdClass could not be converted to string in Doctrine/Doctrine/Import/Schema.php on line 391&lt;/p&gt;

&lt;p&gt;It&apos;s due to this line, line, in Doctrine/Parser/Json.php (#65) :&lt;br/&gt;
$json = json_decode($contents);&lt;/p&gt;

&lt;p&gt;It should be:&lt;br/&gt;
$json = json_decode($contents, true);&lt;/p&gt;

&lt;p&gt;Because casting the result as array will only affect the top-level element. You must use the second parameter of json_decode() to force every objects (including sub-objects) to be converted to indexed arrays.&lt;/p&gt;</description>
                <environment>PHP 5.3.3-1ubuntu9.1</environment>
            <key id="12135">DC-936</key>
            <summary>json schema import broken</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="arcanis">Mael Nison</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Nov 2010 09:18:25 +0000</created>
                <updated>Wed, 22 Dec 2010 11:49:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>File Parser</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14801" author="arcanis" created="Mon, 22 Nov 2010 09:23:21 +0000"  >&lt;p&gt;A try to import this file should fail.&lt;/p&gt;</comment>
                    <comment id="14995" author="fentie" created="Wed, 22 Dec 2010 11:49:56 +0000"  >&lt;p&gt;I&apos;ve submitted a pull request w/patch and unit test for this issue using the fix above. I had the same problem in my code on OS X 10.6.4, PHP 5.3.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10876" name="foobar.schema.json" size="345" author="arcanis" created="Mon, 22 Nov 2010 09:23:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-949] (patch)allow Native floats and double precision field types for MySQL, Oracle, Pgsql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-949</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This creates a new attribute constant Doctrine_Core::ATTR_USE_NATIVE_FLOAT and Doctrine_Core::ATTR_USE_NATIVE_DOUBLE.  This will allow the setting of attributes of use_native_float = true and use_native_double = true.  With these set to true in MySQL  of the generated sql will no longer Make FLOAT(18,2) and will make it just FLOAT that is a true floating point the same thing with DOUBLE except it is now a true double precision floating point. &lt;/p&gt;

&lt;p&gt;Proper adjustments are also made to MySQL, Oracle and Postgresql to use native floating point declarations to define both single and double precision floating point data types. &lt;/p&gt;

&lt;p&gt;I have attached a patch to fix the floating point field types. &lt;/p&gt;</description>
                <environment>Os Independent, MySQL, Oracle, Postgresql</environment>
            <key id="12214">DC-949</key>
            <summary>(patch)allow Native floats and double precision field types for MySQL, Oracle, Pgsql</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mblackmer">Max Blackmer</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Dec 2010 18:11:08 +0000</created>
                <updated>Thu, 9 Dec 2010 18:53:19 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Attributes</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14940" author="mblackmer" created="Thu, 9 Dec 2010 18:34:58 +0000"  >&lt;p&gt;Quote from MySQL Manual &quot;For maximum portability, code requiring storage of approximate numeric data values should use FLOAT or DOUBLE PRECISION with no specification of precision or number of digits&quot;  &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10890" name="doctrine-1.2-native-float.patch" size="4643" author="mblackmer" created="Thu, 9 Dec 2010 18:11:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-948] 3 underscores in my yaml file lead to error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-948</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I had this yaml:&lt;/p&gt;

&lt;p&gt;OldAppellations:&lt;/p&gt;

&lt;p&gt;  connection: doctrine&lt;/p&gt;

&lt;p&gt;  tableName: old_appellations&lt;/p&gt;

&lt;p&gt;  columns:&lt;/p&gt;

&lt;p&gt;    appellations___sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationsapcode_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationsappellation_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationscolor_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationscountry_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationsregion_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationsregion_for_link_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationssubt_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationstaster_appel_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationstotal_r_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    appellationstype_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;    export_record_id_sql: &lt;/p&gt;
{ type: text }


&lt;p&gt;I got this error:&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: o__appellations in /home/lkrubner/dev/tastingnotes/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 302&lt;br/&gt;
Notice: Undefined index: in /home/lkrubner/dev/tastingnotes/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 303&lt;br/&gt;
Fatal error: Call to a member function getFieldName() on a non-object in /home/lkrubner/dev/tastingnotes/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 304&lt;/p&gt;


&lt;p&gt;Then I changed the 3 underscores to 1:&lt;/p&gt;

&lt;p&gt;    appellations_sql: &lt;/p&gt;
{ type: text }

&lt;p&gt;I rebuilt the model and the error was gone. &lt;/p&gt;

&lt;p&gt;More details and screenshots are here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.symfonyexperts.com/question/show/id/178&quot; class=&quot;external-link&quot;&gt;http://www.symfonyexperts.com/question/show/id/178&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Linux 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009&lt;br/&gt;
&lt;br/&gt;
Symfony 1.4</environment>
            <key id="12211">DC-948</key>
            <summary>3 underscores in my yaml file lead to error</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="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="lkrubner">Lawrence Krubner</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Dec 2010 11:44:39 +0000</created>
                <updated>Thu, 9 Dec 2010 11:44:39 +0000</updated>
                                                                    <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-947] getRandom() method for Doctrine_Table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-947</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Consider adding this method into Doctrine_Table&lt;/p&gt;

&lt;p&gt;public static function getRandom()&lt;br/&gt;
{&lt;br/&gt;
    return&lt;br/&gt;
    self::getInstance()-&amp;gt;createQuery()			&lt;br/&gt;
        -&amp;gt;select(&apos;*, RANDOM() as rand&apos;)&lt;br/&gt;
        -&amp;gt;limit(1)&lt;br/&gt;
        -&amp;gt;orderBy(&apos;rand&apos;)&lt;br/&gt;
        -&amp;gt;fetchOne();&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;It is portable and very useful.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12205">DC-947</key>
            <summary>getRandom() method for Doctrine_Table</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="maxtsepkov">ddead profile</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 05:42:23 +0000</created>
                <updated>Wed, 8 Dec 2010 05:42:23 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-937] Cross Schema stored procedures are not recognized</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-937</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you call a stored procedure from a schema other than that of the current connection: &lt;span class=&quot;error&quot;&gt;&amp;#91;schema_name&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;stored_procedure_name&amp;#93;&lt;/span&gt;(&lt;span class=&quot;error&quot;&gt;&amp;#91;stored_procedure_arguments&amp;#93;&lt;/span&gt;) doctrine miss understands the string and throws  a &quot;Couldn&apos;t get short alias for&quot; exception.&lt;/p&gt;

&lt;p&gt;I fixed this by adding some more regex to the getExpressionOwner method of the Query Class.&lt;/p&gt;

&lt;p&gt;I will post the patch shortly.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12141">DC-937</key>
            <summary>Cross Schema stored procedures are not recognized</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>Mon, 22 Nov 2010 22:07:08 +0000</created>
                <updated>Wed, 8 Dec 2010 00:10:22 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14931" author="willf1976" created="Wed, 8 Dec 2010 00:10:21 +0000"  >&lt;p&gt;Fixed an issue where the code wouldn&apos;t work with calls to stored procedure that were nestted in groups in selects.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10888" name="DC_937_fix.patch" size="2848" author="willf1976" created="Wed, 8 Dec 2010 00:10:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-421] Doctrine_Table::createQuery() can use wrong connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-421</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;tt&gt;r6799&lt;/tt&gt; introduced 3 changes to the &lt;tt&gt;Doctrine_Table&lt;/tt&gt;: in &lt;tt&gt;findByDql()&lt;/tt&gt;, &lt;tt&gt;getQueryObject()&lt;/tt&gt;, and &lt;tt&gt;createQuery()&lt;/tt&gt; methods.&lt;br/&gt;
The first two are pretty obvious, but the last one is a mistake in my opinion:&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;--- lib/Doctrine/Table.php	(revision 6798)
+++ lib/Doctrine/Table.php	(revision 6799)
@@ -1033,7 +1033,7 @@
 
         $class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_QUERY_CLASS);
 
-        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Query::create($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn, $class)
+        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Query::create(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $class)
             -&amp;gt;from($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getComponentName() . $alias);
     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;An instance of &lt;tt&gt;Doctrine_Table&lt;/tt&gt; always has a reference to a particular &lt;tt&gt;Doctrine_Connection&lt;/tt&gt;, so why &lt;tt&gt;createQuery()&lt;/tt&gt; method, intended to &quot;create a query on this table&quot; should use different (i.e. default one) connection instead of already specified one?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10716">DC-421</key>
            <summary>Doctrine_Table::createQuery() can use wrong connection</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="esycat">Eugene Janusov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jan 2010 04:50:27 +0000</created>
                <updated>Tue, 7 Dec 2010 22:34:44 +0000</updated>
                    <resolved>Tue, 7 Dec 2010 22:34:44 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11430" author="esycat" created="Wed, 20 Jan 2010 00:26:20 +0000"  >&lt;p&gt;Attached test case.&lt;/p&gt;</comment>
                    <comment id="11431" author="esycat" created="Wed, 20 Jan 2010 00:38:59 +0000"  >&lt;p&gt;While preparing the test case, I looked more closely to the sources. It turns out that if you do something like this:&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;Doctrine::getTable(&apos;ComponentName&apos;)-&amp;gt;createQuery()-&amp;gt;execute()&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;then eventually the preferred connection will be used.&lt;/p&gt;

&lt;p&gt;But &lt;tt&gt;createQuery()&lt;/tt&gt; method creates a new &lt;tt&gt;Doctrine_Query&lt;/tt&gt; and doesn&apos;t pass a connection, thus &lt;tt&gt;Doctrine_Query_Abstract&lt;/tt&gt;&apos;s constructor tries to get a default connection, which is unacceptable if you&apos;d like to work without a default connection.&lt;/p&gt;

&lt;p&gt;&lt;del&gt;A possible solution that I see is to not set &lt;tt&gt;$this&lt;/del&gt;&amp;gt;_conn&lt;/tt&gt; inside &lt;tt&gt;Doctrine_Query&lt;/tt&gt; as long as it will not be really required.-&lt;/p&gt;</comment>
                    <comment id="11432" author="esycat" created="Wed, 20 Jan 2010 01:03:48 +0000"  >&lt;p&gt;I found another solution. As I said above, the problem is really relevant only if you don&apos;t use a default connection. But in this case you must bind all your components to a particular connection(s). So, we can just check for &lt;tt&gt;hasConnectionForComponent()&lt;/tt&gt; inside &lt;tt&gt;Doctrine_Table::createQuery()&lt;/tt&gt;.&lt;/p&gt;</comment>
                    <comment id="13199" author="jwage" created="Tue, 8 Jun 2010 15:17:12 +0000"  >&lt;p&gt;Can you provide the fix you found as a patch so I can clearly see it and test it? Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="13594" author="paulkamer" created="Sat, 17 Jul 2010 08:27:23 +0000"  >&lt;p&gt;Jonathan, I can confirm that this patch solves this issue. &lt;br/&gt;
It also fixes this ticked in Symfony 1.X: &lt;a href=&quot;http://trac.symfony-project.org/ticket/7689&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7689&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13825" author="jocl" created="Sat, 7 Aug 2010 07:57:45 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-421&quot; title=&quot;Doctrine_Table::createQuery() can use wrong connection&quot;&gt;&lt;del&gt;DC-421&lt;/del&gt;&lt;/a&gt;.patch works for me too.&lt;/p&gt;</comment>
                    <comment id="14930" author="jwage" created="Tue, 7 Dec 2010 22:33:36 +0000"  >&lt;p&gt;I&apos;ve reverted that one change and everything seems better now: &lt;a href=&quot;https://github.com/doctrine/doctrine1/commit/b4dc8e66a89a7e17cd195c489b18005e19ca9ea5&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/commit/b4dc8e66a89a7e17cd195c489b18005e19ca9ea5&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10303" name="DC-421.patch" size="779" author="esycat" created="Wed, 20 Jan 2010 01:04:06 +0000" />
                    <attachment id="10305" name="DC421TestCase.php" size="3116" author="esycat" created="Wed, 20 Jan 2010 01:22:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-945] Doctrine_Query::create()-&gt;where(&apos;table.field =&apos;) unexpectedly returns a result</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-945</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While firing the following query with Doctrine, I did not expect Doctrine to return me a record, however, even though there is a syntax error (in my opinion) it gave me the first record of the table.&lt;/p&gt;

&lt;p&gt;$q = \Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;u.Id =&apos;, $userId);&lt;/p&gt;

&lt;p&gt;$r = $q-&amp;gt;fetchOne();&lt;/p&gt;

&lt;p&gt;Note that the question mark in the where method is ommitted. This will return a User model with an Id of 1.&lt;/p&gt;

&lt;p&gt;I would expect this to generate an invalid SQL statement (or even fail to pass the DQL validation). &lt;/p&gt;

&lt;p&gt;Giving the first record doesn&apos;t seem to be appropriate in my opinion.&lt;/p&gt;</description>
                <environment>PHP 5.3.0</environment>
            <key id="12198">DC-945</key>
            <summary>Doctrine_Query::create()-&gt;where(&apos;table.field =&apos;) unexpectedly returns a result</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="johnhuijbers">John Huijbers</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Dec 2010 09:06:07 +0000</created>
                <updated>Tue, 7 Dec 2010 03:16:02 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-422] Using the ON_DEMAND hydrator a warning a thrown on the last iterator of a foreach</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-422</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Used in a symfony project code similar to the following throws a warning on the last iteration of the foreach&lt;/p&gt;

&lt;p&gt;    $currentQuery = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;from(&apos;article a&apos;);&lt;/p&gt;

&lt;p&gt;    $result = $currentQuery-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ON_DEMAND);&lt;/p&gt;

&lt;p&gt;    foreach ($result as $article) &lt;/p&gt;
{
      echo $article-&amp;gt;getId();
    }


&lt;p&gt;The warnings are  located in the connection profiler.&lt;/p&gt;

&lt;p&gt;symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineConnectionProfiler.class.php on line 196&lt;/p&gt;

&lt;p&gt;Warning: join(): Invalid arguments passed in symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineConnectionProfiler.class.php on line 141&lt;/p&gt;

&lt;p&gt;I&apos;m unsure how best to fix it. As far as I can tell there is an issue regarding the call to the iterator rewind at the end of the foreach. &lt;/p&gt;

&lt;p&gt;Doctrine_Connection_Statement-&amp;gt;execute(???) symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Collection/OnDemand.php:71&lt;/p&gt;</description>
                <environment>os x 10.6, php 5.3.1</environment>
            <key id="10720">DC-422</key>
            <summary>Using the ON_DEMAND hydrator a warning a thrown on the last iterator of a foreach</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="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="arnaud">Arnaud Limbourg</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jan 2010 13:04:33 +0000</created>
                <updated>Sun, 5 Dec 2010 07:50:19 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11916" author="jwage" created="Mon, 1 Mar 2010 18:23:40 +0000"  >&lt;p&gt;Sorry, we&apos;re gonna need some more information to be able to do anything for this ticket.&lt;/p&gt;</comment>
                    <comment id="13201" author="jwage" created="Tue, 8 Jun 2010 15:20:55 +0000"  >&lt;p&gt;Is this issue a symfony one and not a Doctrine problem? It is hard to tell.&lt;/p&gt;</comment>
                    <comment id="14909" author="snpy" created="Sun, 5 Dec 2010 07:44:58 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;It&apos;s partially both - symfony doesn&apos;t protect itself from NULL params (default value), however when use Doctrine_Core::PORTABILITY_EMPTY_TO_NULL then Doctrine will also generate the same warning.&lt;/p&gt;

&lt;p&gt;Btw - symfony does throw this issue only when logging is enabled.&lt;/p&gt;

&lt;p&gt;This is a trace tail when when using OnDemand hydrator with foreach.&lt;/p&gt;

&lt;p&gt;21	1.1271	26883400	LessonTable-&amp;gt;copyTeacherData( )	../actions.class.php:54&lt;br/&gt;
22	1.1604	27817624	Doctrine_Collection_OnDemand-&amp;gt;rewind( )	../OnDemand.php:0&lt;br/&gt;
23	1.1604	27784376	Doctrine_Connection_Statement-&amp;gt;execute( )	../OnDemand.php:71&lt;br/&gt;
24	1.1605	27785616	Doctrine_EventListener_Chain-&amp;gt;preStmtExecute( )	../Statement.php:231&lt;br/&gt;
25	1.1605	27785616	sfDoctrineConnectionProfiler-&amp;gt;preStmtExecute( )	../Chain.php:494&lt;br/&gt;
26	1.1606	27788152	sfDoctrineConnectionProfiler::fixParams( )	../sfDoctrineConnectionProfiler.class.php:146&lt;/p&gt;

&lt;p&gt;Suggested patch attached.&lt;br/&gt;
We&apos;re always expecting $params parameter to be an array, hence array() as default value.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10886" name="Doctrine_Connection_Statement.patch" size="856" author="snpy" created="Sun, 5 Dec 2010 07:50:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-943] Memory leaks in find* magic methods owing to failure to free queries</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-943</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The following methods on Doctrine_Table create Doctrine_Query objects that are never free()d:&lt;br/&gt;
  findAll()&lt;br/&gt;
  findBySql()&lt;br/&gt;
  findByDql()&lt;br/&gt;
  findBy()&lt;br/&gt;
  findOneBy() &lt;/p&gt;</description>
                <environment></environment>
            <key id="12188">DC-943</key>
            <summary>Memory leaks in find* magic methods owing to failure to free queries</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="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="garpini">Garpini</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Dec 2010 08:39:53 +0000</created>
                <updated>Fri, 3 Dec 2010 10:30:42 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14896" author="garpini" created="Fri, 3 Dec 2010 10:30:42 +0000"  >&lt;p&gt;The attachment contains a patch that addresses the memory leak by free()ing the query objects generated before returning the results of the query.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10882" name="doctrine_query_patch.patch" size="1568" author="garpini" created="Fri, 3 Dec 2010 10:30:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-942] fromArray makes unnessesary cals to database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-942</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I do toArray(true) on record with realtions and later fromArray($array, true) on with same data unnessesary calls to database are made.&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;
$message = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Message();
$message-&amp;gt;Sender = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; i leave out &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; line sender will first get loaded from database and then overwritten with provided data
&lt;/span&gt;$message-&amp;gt;Receiver = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();   &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; i leave out &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; line receiver will first get loaded from database and then overwritten with provided data
&lt;/span&gt;$message-&amp;gt;fromArray($data);

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In Doctrine_Record::fromArray()&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; ($deep &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;hasRelation($key)) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$key) {                                           --&amp;gt; data gets loaded from db here, refreshRelated is not even executed.
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;refreshRelated($key);
    }
...
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this desired behavour? Wouldnt it be smarter to create empty object automaticly instead of loading it from db?&lt;br/&gt;
Also have look at &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1434&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1434&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12187">DC-942</key>
            <summary>fromArray makes unnessesary cals to database</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ihff">Ivo V&#245;sa</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Dec 2010 05:16:41 +0000</created>
                <updated>Fri, 3 Dec 2010 05:16:41 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-904] Doctrine_Query (execute / fetchOne) memory leak</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-904</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve created new symfony 1.4.8 project:&lt;/p&gt;

&lt;p&gt;$ ./symfony -V&lt;br/&gt;
symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib)&lt;/p&gt;

&lt;p&gt;$ php -v&lt;br/&gt;
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies&lt;br/&gt;
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans&lt;/p&gt;

&lt;p&gt;and set the database schema as follows:&lt;/p&gt;

&lt;p&gt;$ cat config/doctrine/schema.yml &lt;br/&gt;
Example:&lt;br/&gt;
  columns:&lt;br/&gt;
    col1: string(255)&lt;br/&gt;
    col2: string(255)&lt;br/&gt;
    col3: string(255)&lt;br/&gt;
    col4: string(255)&lt;br/&gt;
    col5: string(255)&lt;br/&gt;
    col6: string(255)&lt;/p&gt;

&lt;p&gt;I created a task that contains a Doctrine_query call &lt;/p&gt;

&lt;p&gt;(...)&lt;br/&gt;
protected function execute($arguments = array(), $options = array())&lt;br/&gt;
{&lt;br/&gt;
  // initialize the database connection&lt;br/&gt;
  $databaseManager = new sfDatabaseManager($this-&amp;gt;configuration);&lt;br/&gt;
  $connection = $databaseManager-&amp;gt;getDatabase($options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;connection&amp;#39;&amp;#93;&lt;/span&gt;)-&amp;gt;getConnection();&lt;/p&gt;

&lt;p&gt;  while(1)&lt;br/&gt;
  {&lt;br/&gt;
    $m = xdebug_memory_usage();&lt;br/&gt;
    $q = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;from(&apos;Example&apos;);&lt;br/&gt;
    $o = $q-&amp;gt;fetchOne();&lt;/p&gt;

&lt;p&gt;    if (false !== $o))&lt;/p&gt;
    {
      $o-&amp;gt;free(true);
    }
&lt;p&gt;    unset($q, $o);&lt;/p&gt;

&lt;p&gt;    printf(&quot;Delta: %s Value: %s\n&quot;, &lt;br/&gt;
        xdebug_memory_usage()-$m,&lt;br/&gt;
        xdebug_memory_usage()&lt;br/&gt;
    );&lt;br/&gt;
  }&lt;br/&gt;
}&lt;br/&gt;
(...)&lt;/p&gt;

&lt;p&gt;Unfortunately, memory usage is increasing:&lt;br/&gt;
./symfony leak&lt;br/&gt;
Delta: 3285264 Value: 10651596&lt;br/&gt;
Delta: 12944 Value: 10664448&lt;br/&gt;
Delta: 12952 Value: 10677308&lt;br/&gt;
Delta: 12932 Value: 10690148&lt;br/&gt;
Delta: 12932 Value: 10702988&lt;br/&gt;
Delta: 12932 Value: 10715828&lt;br/&gt;
Delta: 12932 Value: 10728668&lt;br/&gt;
Delta: 12932 Value: 10741508&lt;br/&gt;
Delta: 12932 Value: 10754348&lt;br/&gt;
Delta: 12932 Value: 10767188&lt;/p&gt;

&lt;p&gt;Tested with and without data in database - result is the same.&lt;/p&gt;</description>
                <environment>$ ./symfony -V&lt;br/&gt;
symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib)&lt;br/&gt;
&lt;br/&gt;
$ php -v&lt;br/&gt;
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans&lt;br/&gt;
&lt;br/&gt;
Ubuntu Server (lucid)</environment>
            <key id="12042">DC-904</key>
            <summary>Doctrine_Query (execute / fetchOne) memory leak</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drymek">Marcin Dryka</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Oct 2010 09:24:05 +0000</created>
                <updated>Fri, 3 Dec 2010 02:51:53 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14892" author="stc6895" created="Fri, 3 Dec 2010 01:18:50 +0000"  >&lt;p&gt;i found this bug too.&lt;/p&gt;

&lt;p&gt;$rcs = $query-&amp;gt;execute(array(),\Doctrine_Core::HYDRATE_ON_DEMAND);&lt;br/&gt;
		$query-&amp;gt;free();&lt;br/&gt;
		//write to new table&lt;br/&gt;
		foreach ($rcs as $rc)&lt;/p&gt;
{
			$new = $table-&amp;gt;create($rc-&amp;gt;toArray());
			$new-&amp;gt;save();
			$new-&amp;gt;free(true); //free memory
			$rc-&amp;gt;free(true);
		}

&lt;p&gt;hydrate not cause memory leak&lt;/p&gt;

&lt;p&gt;bug hydrate record will cause leak&lt;/p&gt;

&lt;p&gt;so iterate Doctrine_collection will cause memory leak&lt;/p&gt;
</comment>
                    <comment id="14893" author="drymek" created="Fri, 3 Dec 2010 02:51:53 +0000"  >&lt;p&gt;Changing hydration doesn&apos;t work for me. Same result for:&lt;br/&gt;
HYDRATE_ON_DEMAND&lt;br/&gt;
HYDRATE_RECORD&lt;br/&gt;
HYDRATE_ARRAY&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-863] Connection.UnitOfWork::buildFlushTree when loading data from yml file, Incorrect ordering of tables by their relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-863</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I don&apos;t know where exactly to start, I&apos;m new here, and i&apos;m not even sure this is a bug. BUT&lt;/p&gt;

&lt;p&gt;We have a database structure with most important tables&apos; PK&apos;s as string fields, which function as FK on other tables the basic structure is:&lt;/p&gt;

&lt;p&gt;Artist&lt;br/&gt;
   -Album&lt;br/&gt;
     -Song&lt;br/&gt;
       -Comments&lt;/p&gt;

&lt;p&gt;each artist has multiple songs&lt;br/&gt;
each artist has multiple albums&lt;br/&gt;
each album has multiple songs that belong to the same artist as the album belongs to&lt;br/&gt;
each song has multiple comments&lt;/p&gt;

&lt;p&gt;thus, the UnitOfWork - builtFlushTree should generate&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt;Artist&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt;Album&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;=&amp;gt;Song&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;=&amp;gt;Comments&lt;/p&gt;

&lt;p&gt;but instead i get:&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; Album&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; =&amp;gt; Artist&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt; =&amp;gt; Song&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt; =&amp;gt; Lyrics&lt;/p&gt;

&lt;p&gt;which in turn generates:&lt;/p&gt;

&lt;p&gt;QLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`lyrics`.`album`, CONSTRAINT `album_artist_fk_stripped_name_artist_stripped_name` FOREIGN KEY (`artist_fk_stripped_name`) REFERENCES `artist` (`stripped_name`) ON DELETE CASCADE ON UPDATE CASC)  &lt;br/&gt;
obviously.&lt;/p&gt;

&lt;p&gt;I&apos;ve been going through symfony/doctrine code for a whole day trying to figure out why I can&apos;t load-data. in the end i get to this buildFlushTree function.&lt;br/&gt;
probably have to go deeper. but so far this is it&lt;/p&gt;

&lt;p&gt;PS. It&apos;s my decision to use string fields as PK&apos;s and FK even though it&apos;s a bad practice, but just because it is a bad practice I shouldn&apos;t be unable to work with it.&lt;/p&gt;</description>
                <environment>symfony 1.4.6, windows 7, apache2.2, php5.3.3, mySQL 5.1.49-community</environment>
            <key id="11902">DC-863</key>
            <summary>Connection.UnitOfWork::buildFlushTree when loading data from yml file, Incorrect ordering of tables by their relations</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fuximus">Ochoo</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 04:36:44 +0000</created>
                <updated>Wed, 1 Dec 2010 20:31:14 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                <component>Data Fixtures</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14328" author="fuximus" created="Fri, 10 Sep 2010 20:15:39 +0000"  >&lt;p&gt;found a tiny BUG, submitting the fix.&lt;/p&gt;


&lt;p&gt;EDIT: scratch  the rest from here.&lt;/p&gt;

&lt;p&gt;&amp;lt;!-----------&lt;br/&gt;
still, fixing the bug does not resolve the issue&lt;br/&gt;
BECAUSE:&lt;br/&gt;
   the whole logic of ordering the tables is flawed! it can be proved, don&apos;t have time to do so. but trying to come up with a fix myself&lt;/p&gt;

&lt;p&gt;   instead of looping through the tables and then through each tables&apos; related tables, either have a recursive function OR implement user defined array sort function, latter of which seems like the proper and correct way to go&lt;br/&gt;
--&amp;gt;&lt;/p&gt;

</comment>
                    <comment id="14329" author="fuximus" created="Fri, 10 Sep 2010 20:18:26 +0000"  >&lt;p&gt;unfortunately i&apos;m unable to commit any changes i have made. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; just me being a newbie, any help is appreciated&lt;/p&gt;</comment>
                    <comment id="14331" author="fuximus" created="Fri, 10 Sep 2010 20:32:35 +0000"  >&lt;p&gt;on UnitOfWork.php of Doctrine ORM 1.2.3 &lt;br/&gt;
Revision 7684&lt;br/&gt;
right after the line 752:&lt;br/&gt;
          array_splice($flushList, $index, 0, $relatedClassName);&lt;br/&gt;
there should be:&lt;br/&gt;
          $index++;&lt;/p&gt;</comment>
                    <comment id="14863" author="atali" created="Mon, 29 Nov 2010 00:07:38 +0000"  >&lt;p&gt;@Ochoo: Even with your bugfix, it doesn&apos;t seem to work.&lt;/p&gt;</comment>
                    <comment id="14881" author="fuximus" created="Wed, 1 Dec 2010 20:31:14 +0000"  >&lt;p&gt;thanks atali, i haven&apos;t checked it on 1.2.3, just did and you&apos;re right. the &quot;bug fix&quot; worked on 1.2.0 but not on 1.2.3. I&apos;m gonna look into it, at least i&apos;ll try. but this is a bug right?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10782" name="schema.yml" size="6100" author="fuximus" created="Fri, 10 Sep 2010 04:36:44 +0000" />
                    <attachment id="10783" name="test.yml" size="1363" author="fuximus" created="Fri, 10 Sep 2010 04:36:44 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-941] Spatial index type for mysql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-941</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using doctrine and some of mysql&apos;s spatial functions. I need to specify spatial index for my tables.&lt;br/&gt;
My declaration looks like:&lt;/p&gt;

&lt;p&gt;Geometry:&lt;br/&gt;
  tableName: geometry&lt;br/&gt;
  options:&lt;br/&gt;
    type:    MyISAM&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    id: &lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    geometry:&lt;br/&gt;
      type: geometry&lt;br/&gt;
      notnull: true&lt;br/&gt;
   indexes:&lt;br/&gt;
    geometry:&lt;br/&gt;
      fields:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;geometry&lt;br/&gt;
      type: spatial&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Exporting this definitions throws an exception: Unknown type spatial for index geometry_idx&lt;/p&gt;

</description>
                <environment></environment>
            <key id="12178">DC-941</key>
            <summary>Spatial index type for mysql</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mishal">Mishal</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Nov 2010 14:43:57 +0000</created>
                <updated>Mon, 29 Nov 2010 14:43:57 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10880" name="patch.patch" size="736" author="mishal" created="Mon, 29 Nov 2010 14:43:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-940] Doctrine - loading a YAML fixture with French characters, replaces the accents with junk</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-940</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;My Doctrine 1.2 is integrated inside CodeIgniter as a hook and I know that my char-set is utf8 with collation utf8_unicode_ci.&lt;/p&gt;

&lt;p&gt;I have two YAML files, one for creating the DB and its tables and one to load some test data. My data can contain French accents (&#231;&#233;&#239;&#235;...). In my schama.yml I have correctly specified the collation and char-set:&lt;/p&gt;

&lt;p&gt;options:&lt;br/&gt;
  type: INNODB&lt;br/&gt;
  charset: utf8&lt;br/&gt;
  collate: utf8_unicode_ci&lt;/p&gt;

&lt;p&gt;I double checked the settings in phpMyAdmin, everything is correct.&lt;/p&gt;

&lt;p&gt;When I run my doctrine script from commandline to load my fixture to populate one of tables, all the French accents are replaced by junk!&lt;/p&gt;

&lt;p&gt;Am I missing a setting or configuration or is there a bug in Doctrine?&lt;/p&gt;

&lt;p&gt;I appreciate any help. Cheers.&lt;/p&gt;

&lt;p&gt;P.S. Everything else works like a charm&lt;/p&gt;</description>
                <environment>MAC OS X (10.6.5)&lt;br/&gt;
MAMP 1.9.4&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="12166">DC-940</key>
            <summary>Doctrine - loading a YAML fixture with French characters, replaces the accents with junk</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="raminoacid">Ramin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Nov 2010 13:14:09 +0000</created>
                <updated>Fri, 26 Nov 2010 13:14:09 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-938] Impossible to use other formats than YAML in data import</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-938</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;File Doctrine/Data/Import.php, line #80&lt;br/&gt;
if (end($e) == &apos;yml&apos;)&lt;/p&gt;

&lt;p&gt;So, if the file is a .json (for exemple), it will be impossible to load it, even if we have specified &quot;json&quot; as format parameter.&lt;br/&gt;
And it sucks.&lt;/p&gt;

&lt;p&gt;The fix would just be to change the line to :&lt;br/&gt;
if (end($e) == $this-&amp;gt;getFormat())&lt;/p&gt;</description>
                <environment></environment>
            <key id="12159">DC-938</key>
            <summary>Impossible to use other formats than YAML in data import</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="arcanis">Mael Nison</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 09:58:18 +0000</created>
                <updated>Thu, 25 Nov 2010 09:58:18 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-935] Doctrine_Task_BuildAllReload does not call generate-models-from-yaml</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-935</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Task_BuildAllReload never calls generate models-from-yaml. This does not coincide with the logic of Doctrine_Task_BuildAll and Doctrine_Task_BuildAllLoad.&lt;/p&gt;

&lt;p&gt;BuildAllReload suggests that it will be building all (everything) and then reloading the database.&lt;br/&gt;
But instead it only rebuilds the database and loads data&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine 1.2.3 - BuildAllReload.php&lt;/b&gt;&lt;/div&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 __construct($dispatcher = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        parent::__construct($dispatcher);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_RebuildDb($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_LoadData($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;requiredArguments);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;optionalArguments);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function execute()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;execute();
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;execute();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Instead, I think it would be more efficient and understanding to follow the same logic as build-all and build-all-load by calling drop-db and build-all-load.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Proposed - BuildAllReload.php&lt;/b&gt;&lt;/div&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 __construct($dispatcher = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        parent::__construct($dispatcher);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_DropDb($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_BuildAllLoad($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;requiredArguments);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;optionalArguments);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function execute()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;execute();
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;execute();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I attached a patch with the above changes... I got a little lost in the test area for Doctrine_CLI, so that is not included = )&lt;/p&gt;</description>
                <environment>Windows Vista 32bit, Apache 2.2.14, PHP 5.3.1</environment>
            <key id="12133">DC-935</key>
            <summary>Doctrine_Task_BuildAllReload does not call generate-models-from-yaml</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="brandonevans">Brandon Evans</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Nov 2010 20:56:31 +0000</created>
                <updated>Sun, 21 Nov 2010 21:35:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14797" author="brandonevans" created="Sun, 21 Nov 2010 21:31:14 +0000"  >&lt;p&gt;Added the proper proposed code this time and also attached patch with better naming.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10874" name="DC-935.patch" size="2461" author="brandonevans" created="Sun, 21 Nov 2010 21:31:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<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>

<item>
            <title>[DC-931] Newly generated Migration Classes failing to load due to method used to determine class name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-931</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The loadMigrationClassesFromDirectory() method in Doctrine_Migration uses array_diff on get_declared_classes() between including each classes script.&lt;/p&gt;

&lt;p&gt;When a new migration class is generated by Doctrine_Core::generateMigrationsFromDiff it&apos;s class is loaded, which means loadMigrationClassesFromDirectory silently fails to load the newly generated migration on the same request. This means that scripts that first generate migrations and then apply them must be executed twice - first to generate then to apply.&lt;/p&gt;

&lt;p&gt;The following example code is used to check if the database has been modifed, generate migrations between the base version and the latest models, and then migrate the database if needed:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;automigrate.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Core::generateYamlFromModels(ROOT_PATH.&apos;tmp/yaml/&apos;, ROOT_PATH.&apos;models/&apos;);
$result = Doctrine_Core::generateMigrationsFromDiff(ROOT_PATH.&apos;tmp/migrations/&apos;, ROOT_PATH.&apos;data/yaml/&apos;, ROOT_PATH.&apos;tmp/yaml/&apos;);

unlink(ROOT_PATH.&apos;data/yaml/schema.yml&apos;);
rename(ROOT_PATH.&apos;tmp/yaml/schema.yml&apos;, ROOT_PATH.&apos;data/yaml/schema.yml&apos;);

$migration = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Migration(ROOT_PATH.&apos;tmp/migrations&apos;);

$currentVersion = $migration-&amp;gt;getCurrentVersion();
$latestVersion = $migration-&amp;gt;getLatestVersion();
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($currentVersion &amp;lt; $latestVersion) {
	$migration-&amp;gt;migrate();
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;app-&amp;gt;addMessage(&lt;span class=&quot;code-quote&quot;&gt;&quot;Database migration completed (from version $currentVersion to version $latestVersion)&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;success&quot;&lt;/span&gt;);
} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;app-&amp;gt;addMessage(&lt;span class=&quot;code-quote&quot;&gt;&quot;Database is up to date and doesn&apos;t require migration (at version $currentVersion)&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;success&quot;&lt;/span&gt;);
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>LAMP</environment>
            <key id="12124">DC-931</key>
            <summary>Newly generated Migration Classes failing to load due to method used to determine class name</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ppanther">Adam Benson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2010 02:04:00 +0000</created>
                <updated>Fri, 19 Nov 2010 02:04:00 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-754] When using a dot inside a string doctrine throws an exception because it believes what comes before the dot is a class name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-754</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi Jon&lt;/p&gt;

&lt;p&gt;I ran into and patched another bug in Doctrine 1.2.2 (The menu in jija shows 1.2.3 as released but I am not seeing it in SVN or on the web site so I can&apos;t test the bug in that version).&lt;/p&gt;

&lt;p&gt;When you include a dot in a string in your select statement the function getExpressionOwner in Doctrine_Query fires and considers that the text appearing before the dot in the string is the name of a class. There for it attempts to extract a short alias out of it.&lt;/p&gt;

&lt;p&gt;I made a test case to illustrate this:&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 testQuoteEncapedDots()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;select(&lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;testing.dots.inquotes&apos; as string, u.name&quot;&lt;/span&gt;)-&amp;gt;from(&apos;User u&apos;);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT e.id AS e__id, e.name AS e__name, &apos;testing.dots.inquotes&apos; AS e__0 FROM entity e WHERE (e.type = 0)&quot;&lt;/span&gt;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;It throws the following exception.&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;Unexpected Doctrine_Query_Exception thrown in [Doctrine_Query_ShortAliases_TestC
ase] with message [Couldn&apos;t get &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt; alias &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; testing] in C:\htdocs\php_librar
y\Doctrine_1.2_SVN\lib\Doctrine\Query\Abstract.php on line 679

Trace
-------------
#0 C:\htdocs\php_library\Doctrine_1.2_SVN\lib\Doctrine\Query.php(641): Doctrine_
Query_Abstract-&amp;gt;getSqlTableAlias(&apos;testing&apos;)
#1 C:\htdocs\php_library\Doctrine_1.2_SVN\lib\Doctrine\Query\Select.php(37): Doc
trine_Query-&amp;gt;parseSelect(&apos;&apos;testing.dots.i...&apos;)
#2 C:\htdocs\php_library\Doctrine_1.2_SVN\lib\Doctrine\Query\Abstract.php(2083):
 Doctrine_Query_Select-&amp;gt;parse(&apos;&apos;testing.dots.i...&apos;)
#3 C:\htdocs\php_library\Doctrine_1.2_SVN\lib\Doctrine\Query.php(1168): Doctrine
_Query_Abstract-&amp;gt;_processDqlQueryPart(&apos;select&apos;, Array)
#4 C:\htdocs\php_library\Doctrine_1.2_SVN\lib\Doctrine\Query.php(1134): Doctrine
_Query-&amp;gt;buildSqlQuery(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
#5 C:\htdocs\php_library\Doctrine_1.2_SVN\tests\Query\ShortAliasesTestCase.php(3
0): Doctrine_Query-&amp;gt;getSqlQuery()
#6 C:\htdocs\php_library\Doctrine_1.2_SVN\tests\DoctrineTest\UnitTestCase.php(15
8): Doctrine_Query_ShortAliases_TestCase-&amp;gt;testQuoteEncapedDots()
#7 C:\htdocs\php_library\Doctrine_1.2_SVN\tests\DoctrineTest\GroupTest.php(75):
UnitTestCase-&amp;gt;run()
#8 C:\htdocs\php_library\Doctrine_1.2_SVN\tests\DoctrineTest.php(183): GroupTest
-&amp;gt;run(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;(DoctrineTest_Reporter_Cli), Array)
#9 C:\htdocs\php_library\Doctrine_1.2_SVN\tests\run.php(320): DoctrineTest-&amp;gt;run(
)
#10 {main}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I patched the bug by doing a preg_replace where all quote encaped strings are removed before looking for the short alias. The getExpressionOwner  function now reads as follows in my code:&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 getExpressionOwner($expr)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strtoupper(substr(trim($expr, &apos;( &apos;), 0, 6)) !== &apos;SELECT&apos;) {
			$expr = preg_replace(&apos;/([\\]*[\&apos;\&quot;])[^\1]*\1/&apos;, &apos;&apos;, $expr);
            preg_match_all(&lt;span class=&quot;code-quote&quot;&gt;&quot;/[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_]*[\.[a-z0-9]+]*/i&quot;&lt;/span&gt;, $expr, $matches);

            $match = current($matches);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($match[0])) {
                $terms = explode(&apos;.&apos;, $match[0]);

                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $terms[0];
            }
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRootAlias();

    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am including the patch with this post but I think my version of the code base is starting diverge as I also have a few other things added to mine (as discussed in: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-701&quot; title=&quot;Aggregates functions do not return proper values when using many relationships and limits&quot;&gt;DC-701&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Hope you are well.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="11526">DC-754</key>
            <summary>When using a dot inside a string doctrine throws an exception because it believes what comes before the dot is a class name</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Jun 2010 04:01:09 +0000</created>
                <updated>Thu, 18 Nov 2010 18:26:32 +0000</updated>
                    <resolved>Wed, 1 Sep 2010 14:08:57 +0000</resolved>
                            <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13397" author="willf1976" created="Mon, 21 Jun 2010 18:39:07 +0000"  >&lt;p&gt;Improved patch to have a more rigorous test case, refined the regex added, and put in a comment referencing this bug.&lt;/p&gt;</comment>
                    <comment id="13456" author="pgmateos" created="Tue, 29 Jun 2010 11:11:26 +0000"  >&lt;p&gt;Hi, we&apos;re having an issue which is related to this post and I&apos;d like to share it with you so maybe it&apos;s posible to solve both.&lt;/p&gt;

&lt;p&gt;The situation appears when you need to look for some data that includes a &quot;.&quot; inside a string SQL comparison with LIKE operator, here you have an example:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;pager = new sfDoctrinePager(&apos;Recurso&apos;, sfConfig::get(&apos;app_res_pag&apos;));&lt;br/&gt;
 $this-&amp;gt;pager-&amp;gt;getQuery()&lt;br/&gt;
            -&amp;gt;select(&apos;r.*,&lt;br/&gt;
                      c.alias as cliente_alias,&lt;br/&gt;
                      c.nombre as cliente_nombre,&lt;br/&gt;
                      o.alias as origen_alias,&lt;br/&gt;
                      o.nombre as origen_nombre,&lt;br/&gt;
                      GROUP_CONCAT(DISTINCT CONCAT_WS(&quot;,&quot;, cat.id, e.nombre) ORDER BY cat.id ASC) as elemento_nombre, &lt;br/&gt;
                      cv.hash as cv_hash&apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;Recurso r&apos;)&lt;br/&gt;
            -&amp;gt;innerJoin(&apos;r.Cliente c&apos;)&lt;br/&gt;
            -&amp;gt;innerJoin(&apos;r.Origen o&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;r.RecursoCategoriaItem rci&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;rci.CategoriaItem ci&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;ci.Categoria cat&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;ci.Elemento e&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;ci.Nivel n&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;r.RecursoCv rcv&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;rcv.Cv cv&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;cv.Idioma i&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;r.RecursoComentario rc&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;rc.Comentario comm&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;r.apellido LIKE &quot;%.net%&quot; OR r.nombre LIKE &quot;%.net%&quot; OR r.numero_doc LIKE &quot;%.net%&quot; OR r.mail LIKE &quot;%.net%&quot; OR o.nombre LIKE &quot;%.net%&quot; OR cat.nombre LIKE &quot;%.net%&quot; OR e.nombre LIKE &quot;%.net%&quot; OR n.nombre LIKE &quot;%.net%&quot; OR c.nombre LIKE &quot;%.net%&quot; OR c.alias LIKE &quot;%.net%&quot; OR r.contenido LIKE &quot;%.net%&quot;&apos;)&lt;br/&gt;
            -&amp;gt;groupBy(&apos;r.id&apos;)&lt;br/&gt;
            &lt;del&gt;&amp;gt;orderBy(&apos;r.&apos; . $orderBy . &apos; &apos; . $this&lt;/del&gt;&amp;gt;order);&lt;br/&gt;
$this-&amp;gt;pager-&amp;gt;setPage($page);&lt;br/&gt;
$this-&amp;gt;pager-&amp;gt;init();&lt;/p&gt;


&lt;p&gt;Look at the &quot;WHERE&quot; line, there is a LIKE &quot;.net&quot;.&lt;/p&gt;

&lt;p&gt;So when we execute this code, Doctrine tries to parse the &quot;.&quot; in the &quot;.net&quot; like an SQL alias and of course it fails:&lt;/p&gt;

&lt;p&gt;ERROR:&lt;/p&gt;

&lt;p&gt;500 | Internal Server Error | Doctrine_Exception&lt;br/&gt;
Couldn&apos;t find class &quot;%&lt;/p&gt;

&lt;p&gt;Do you know some other why to solve this situation ?. In case you need further information about this, just ask me.&lt;/p&gt;

&lt;p&gt;Thank you in advance.&lt;/p&gt;

&lt;p&gt;Pablo Mateos.&lt;/p&gt;
</comment>
                    <comment id="13460" author="willf1976" created="Tue, 29 Jun 2010 19:28:17 +0000"  >&lt;p&gt;Hi Pablo&lt;/p&gt;

&lt;p&gt;I think I found a work around for you &amp;#8211; I tested this bug out to see if I could recreate and patch it and found that my own system didn&apos;t generate the bug. Turns out the difference is my code encapes the strings that go in the query with single quotes and this seems to solve the problem.&lt;/p&gt;

&lt;p&gt;Try the same query you posted above but replace the &quot;%.net%&quot; with &apos;%.net%&apos;.&lt;/p&gt;

&lt;p&gt;I think that should solve it.&lt;/p&gt;

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

&lt;p&gt;Will&lt;/p&gt;</comment>
                    <comment id="13465" author="pgmateos" created="Wed, 30 Jun 2010 09:45:52 +0000"  >&lt;p&gt;Hi Will, I tried what you said and it worked !!!!!! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;. It&apos;s great to have so easy solutions for debugging, isn&apos;t ?.&lt;/p&gt;

&lt;p&gt;So, anyway do you think this issue should be considered as a bug ?.&lt;/p&gt;

&lt;p&gt;I really appreciate  your help.&lt;/p&gt;

&lt;p&gt;Pablo.&lt;/p&gt;</comment>
                    <comment id="13475" author="willf1976" created="Wed, 30 Jun 2010 19:49:11 +0000"  >&lt;p&gt;Hi Pablo&lt;/p&gt;

&lt;p&gt;I am glad that worked &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.&lt;/p&gt;

&lt;p&gt;I do think this is still a bug &amp;#8211; I there are some problems with double quotes in dql in general I believe. Then again there may be something in the docs about this being a restriction that I overlooked (not sure).&lt;/p&gt;

&lt;p&gt;But since its solvable with using single quotes I would recommend putting it as a low priority bug &amp;#8211; which may mean it won&apos;t actually get fixed any time soon. Whether it gets fixed or not though its good to have these kinds of bugs in the system so that there is a record of everything that needs fixing and so other users can find work arounds to there problems by looking through the archive.&lt;/p&gt;

&lt;p&gt;Hope you are well.&lt;/p&gt;

&lt;p&gt;Will&lt;/p&gt;</comment>
                    <comment id="14220" author="jwage" created="Wed, 1 Sep 2010 14:08:57 +0000"  >&lt;p&gt;Thanks for the issue and patches!&lt;/p&gt;

&lt;p&gt;Fixed here &lt;a href=&quot;http://github.com/doctrine/doctrine1/commit/2ad78e62e360133efc04bf6897bf679c7f3d833b&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/commit/2ad78e62e360133efc04bf6897bf679c7f3d833b&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14227" author="willf1976" created="Wed, 1 Sep 2010 19:23:20 +0000"  >&lt;p&gt;individual patch for this issue with out other features included&lt;/p&gt;</comment>
                    <comment id="14782" author="smashcompany" created="Thu, 18 Nov 2010 15:38:55 +0000"  >&lt;p&gt;I&apos;m curious if this could be the same issue that causes doctrine:build-schema to give either the &apos;Missing class name&apos; or &apos;Couldn&apos;t find class Content &apos; error? I am going a little crazy trying to figure out why doctrine:build-schema doesn&apos;t work for me. Details here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.symfonyexperts.com/question/show/id/156&quot; class=&quot;external-link&quot;&gt;http://www.symfonyexperts.com/question/show/id/156&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14783" author="willf1976" created="Thu, 18 Nov 2010 18:26:32 +0000"  >&lt;p&gt;Hi Smash&lt;/p&gt;

&lt;p&gt;I did a quick glance at your issue. I have never encountered this error my self and I don&apos;t think it is related to my issue.&lt;/p&gt;

&lt;p&gt;When I have a bug like that the first place I start looking is where the exception is being thrown.&lt;/p&gt;

&lt;p&gt;For you its in the Doctrine_Import_Builder class on either line 949 or 995&lt;/p&gt;

&lt;p&gt;You could start by putting some debugging to see what the $definition var is. That may offer some insights. Then if that doesn&apos;t clarify whats wrong with your schema you could start back tracking out of the method to see where else things could be screwing up &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.&lt;/p&gt;

&lt;p&gt;Hope that helps at least alil bit.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10673" name="2010-06-21_Doctrine_1.2_SVN.patch" size="10740" author="willf1976" created="Mon, 21 Jun 2010 18:39:07 +0000" />
                    <attachment id="10765" name="DC_754_fix.patch" size="1474" author="willf1976" created="Wed, 1 Sep 2010 19:23:20 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-72] DQL Auto generated column aliases cause &quot;ORA-00972: identifier is too long&quot; on Oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-72</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have an existing Oracle DB that has some tables with column names that have 28-30 characters (30 characters is the maximum identifier&lt;br/&gt;
length with Oracle).&lt;/p&gt;

&lt;p&gt;I have created a YAML schema for the tables I want to query via DQL in this database and generated the models.&lt;/p&gt;

&lt;p&gt;When I run a DQL that selects some of the columns whose names are 28-30 characters in length, I receive an &quot;ORA-00972: identifier is too long&quot; error from Oracle.&lt;/p&gt;

&lt;p&gt;After some investigation, I found that Doctrine_Query is auto generating aliases for these columns that are more than 30 characters in length. In a nutshell, it appears that Doctrine_Query generates the alias by taking a single character for the table alias, plus two underscores, plus the column name (for example, t__alongerthanusualtablecolumnx).&lt;/p&gt;

&lt;p&gt;If the original column name was 28-30 characters in length, then the additional 3 characters exceed the 30 character identifier limit. If more tables are joined in the query, you can end up with longer table aliases (t0, t1, ... t10, etc) and the problem will affect tables with column names less than 28 characters in length as well.&lt;/p&gt;

&lt;p&gt;I worked around this problem by patching Doctrine_Query and Doctrine_Hydrator to use the numerical column indexes from the table definition instead of the column name when auto generating aliases.&lt;/p&gt;

&lt;p&gt;Attached is a patch for my workaround.  I doubt it&apos;s the best way to fix this, but it should help to exemplify what is happening.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Jamie&lt;/p&gt;</description>
                <environment>Doctrine 1.1.4, Oracle 10.2.0.4, PHP 5.2.10</environment>
            <key id="10125">DC-72</key>
            <summary>DQL Auto generated column aliases cause &quot;ORA-00972: identifier is too long&quot; on Oracle</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="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="jaugust">James Augustine</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Sep 2009 12:31:17 +0000</created>
                <updated>Thu, 18 Nov 2010 10:38:02 +0000</updated>
                    <resolved>Mon, 16 Nov 2009 19:07:04 +0000</resolved>
                            <version>1.1.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10680" author="jwage" created="Mon, 16 Nov 2009 19:07:04 +0000"  >&lt;p&gt;This issue has been fixed in D2.&lt;/p&gt;</comment>
                    <comment id="14779" author="ogurbuz" created="Thu, 18 Nov 2010 10:36:55 +0000"  >&lt;p&gt;After patching, i can observer an unexpected behaviour of doctrine.&lt;/p&gt;

&lt;p&gt;    $q = Doctrine_Query::create()&lt;br/&gt;
			-&amp;gt;select(&apos;locale AS l&apos;) // Giving an Alias&lt;br/&gt;
			-&amp;gt;distinct()&lt;br/&gt;
			-&amp;gt;from(&apos;Translation&apos;)&lt;/p&gt;

&lt;p&gt;Before Patching:&lt;br/&gt;
string(70) &quot;SELECT DISTINCT t.locale AS t__0 FROM TRANSLATION t WHERE t.cotrid = ?&quot; &lt;br/&gt;
array(2) { &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;l&quot;]=&amp;gt; string(5) &quot;de_DE&quot; }
&lt;p&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;l&quot;]=&amp;gt; string(5) &quot;en_GB&quot; }
&lt;p&gt; } &lt;/p&gt;

&lt;p&gt;After Patching:&lt;br/&gt;
string(70) &quot;SELECT DISTINCT t.locale AS t__0 FROM TRANSLATION t WHERE t.cotrid = ?&quot; &lt;br/&gt;
array(2) { &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;trasId&quot;]=&amp;gt; string(5) &quot;de_DE&quot; }
&lt;p&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;trasId&quot;]=&amp;gt; string(5) &quot;en_GB&quot; }
&lt;p&gt; } &lt;/p&gt;

&lt;p&gt;After Patching its not possible to access the value by my alias &quot;l&quot;.&lt;/p&gt;

&lt;p&gt;How can we fix this!?&lt;/p&gt;
</comment>
                    <comment id="14780" author="ogurbuz" created="Thu, 18 Nov 2010 10:38:02 +0000"  >&lt;p&gt;We have to use Doctrine 1.1.4 or 1.1.5. I think in the above fix it making no difference using 1.1.4 or 1.1.5&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10046" name="doctrine_fix.diff" size="5261" author="jaugust" created="Wed, 30 Sep 2009 12:31:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-921] The ability to add WITH ROLLUP to a group by in a query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-921</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I figured it would be handy to have a WITH ROLLUP be add able to the group by clause.&lt;/p&gt;

&lt;p&gt;I added this feature but I can&apos;t post the patch because my patches are starting to run together - the syntax with in the generated patch would also contain parts of other patches I have posted to jira but have not yet been included in the doctrine svn.&lt;/p&gt;

&lt;p&gt;I still wanted to make this post because it will give me a ticket number to base my test cases around.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP XAMP</environment>
            <key id="12084">DC-921</key>
            <summary>The ability to add WITH ROLLUP to a group by in a query</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Nov 2010 04:04:29 +0000</created>
                <updated>Thu, 18 Nov 2010 03:19:47 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14699" author="willf1976" created="Tue, 9 Nov 2010 22:29:28 +0000"  >&lt;p&gt;In order to illustrate what this patch fixes I am posting my test case for the patch below&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;&amp;lt;?php
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;AS IS&quot;&lt;/span&gt; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * &amp;lt;http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org&amp;gt;.
&lt;/span&gt; */

/**
 * Doctrine_Ticket_DC921_TestCase
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
 * @author      Will Ferrer
 * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt; * @category    &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; Relational Mapping
 * @link        www.doctrine-project.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Ticket_DC921_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase 
{
  
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testAggregateValueMappingSupportsLeftJoinsWithRollUp()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();

        $q-&amp;gt;select(&apos;MAX(u.name), u.*, p.*&apos;)-&amp;gt;from(&apos;User u&apos;)-&amp;gt;leftJoin(&apos;u.Phonenumber p&apos;)-&amp;gt;groupby(&apos;u.id&apos;);
		$q-&amp;gt;setWithRollUp(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
        $&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, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP&apos;);
    }

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14773" author="willf1976" created="Thu, 18 Nov 2010 03:19:47 +0000"  >&lt;p&gt;I have updated my implemenation of this feature. Here is the new 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;&amp;lt;?php
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;AS IS&quot;&lt;/span&gt; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * &amp;lt;http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org&amp;gt;.
&lt;/span&gt; */

/**
 * Doctrine_Ticket_DC921_TestCase
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
 * @author      Will Ferrer
 * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt; * @category    &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; Relational Mapping
 * @link        www.doctrine-project.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Ticket_DC921_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase 
{
  
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testAggregateValueMappingSupportsLeftJoinsWithRollUp()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();

        $q-&amp;gt;select(&apos;MAX(u.name), u.*, p.*&apos;)-&amp;gt;from(&apos;User u&apos;)-&amp;gt;leftJoin(&apos;u.Phonenumber p&apos;)-&amp;gt;groupby(&apos;u.id&apos;);
		$q-&amp;gt;withRollUp();
        $&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, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &apos;SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP&apos;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testAggregateValueMappingSupportsLeftJoinsWithRollUpDql()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;parseDqlQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP&quot;&lt;/span&gt;);
        $&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, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &apos;SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP&apos;);
    }
	
	


}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-536] Duplicate CREATE TABLE entries in schema.sql when using column_inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-536</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When creating a model involving column_inheritance the CREATE TABLE statement gets duplicated.&lt;/p&gt;

&lt;p&gt;The second CREATE TABLE include an index for the keyField.&lt;/p&gt;

&lt;p&gt;Test doctrine generated models and generated schema.sql attached.&lt;/p&gt;</description>
                <environment>MySQL 5 / PHP 5.3.1 / Symfony 1.4.3 (branch) / Doctrine 1.2.1 / Mac OSX</environment>
            <key id="10981">DC-536</key>
            <summary>Duplicate CREATE TABLE entries in schema.sql when using column_inheritance</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="webpragmatist">webPragmatist</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Mar 2010 12:38:25 +0000</created>
                <updated>Thu, 18 Nov 2010 01:44:16 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Inheritance</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="11973" author="webpragmatist" created="Tue, 2 Mar 2010 13:05:19 +0000"  >&lt;p&gt;It seems this issue is related to using array_unique() and databases which doctrine creates index along with the CREATE TABLE statement.&lt;/p&gt;

&lt;p&gt;This does not occur on sqlite as shown above in the console-log.txt (this db uses the CREATE INDEX statement).&lt;/p&gt;</comment>
                    <comment id="11975" author="sacho" created="Tue, 2 Mar 2010 13:25:36 +0000"  >&lt;p&gt;Yes, it seems SQL CREATE TABLE statements are generated for each of the children as well, but with sqlite, array_unique() filters out the ones that are &quot;extra&quot;.&lt;br/&gt;
But the MySQL statements all differ(due to indexes, I don&apos;t know if other things can cause them to differ as well), and as such all are left.&lt;/p&gt;</comment>
                    <comment id="12867" author="boutell" created="Fri, 7 May 2010 12:22:40 +0000"  >&lt;p&gt;We&apos;re seeing this issue too. doctrine:build --all --and-load works fine, but doctrine:build-sql generates duplicate CREATE TABLE statements. Our in-house workflow is the former, so the latter came as a surprise. Is there any sign of progress on this one?&lt;/p&gt;</comment>
                    <comment id="13533" author="bascht" created="Wed, 7 Jul 2010 09:14:06 +0000"  >&lt;p&gt;This looks like a Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-123&quot; class=&quot;external-link&quot;&gt;DC-123&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="14772" author="kerdany" created="Thu, 18 Nov 2010 01:43:39 +0000"  >&lt;p&gt;A little addition to the symptoms of this problem.&lt;/p&gt;

&lt;p&gt;If the one of the child classes has a foreign key to another entity, another Third Create table SQL will be created, which contains the an index on the foreign key column.&lt;/p&gt;

&lt;p&gt;In other words, it seems that an additional create table statement is created for each automatically created index.&lt;/p&gt;

&lt;p&gt;An illustration is in the attached yml and sql schema:&lt;br/&gt;
kerdany_10-11-18-08-30.yml&lt;br/&gt;
kerdany_10-11-18-08-30.sql&lt;/p&gt;

&lt;p&gt;Tom Boutell: doctrine:build --all generates the problem with me!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10413" name="BaseInherited.class.php" size="429" author="webpragmatist" created="Tue, 2 Mar 2010 12:38:25 +0000" />
                    <attachment id="10412" name="BaseInheriter.class.php" size="1525" author="webpragmatist" created="Tue, 2 Mar 2010 12:38:25 +0000" />
                    <attachment id="10871" name="kerdany_10-11-18-08-30.sql" size="633" author="kerdany" created="Thu, 18 Nov 2010 01:42:16 +0000" />
                    <attachment id="10870" name="kerdany_10-11-18-08-30.yml" size="407" author="kerdany" created="Thu, 18 Nov 2010 01:42:16 +0000" />
                    <attachment id="10414" name="sandbox-console.txt" size="1465" author="webpragmatist" created="Tue, 2 Mar 2010 13:05:19 +0000" />
                    <attachment id="10411" name="schema.sql" size="416" author="webpragmatist" created="Tue, 2 Mar 2010 12:38:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-551] Doctrine_Query :: count() and result sql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-551</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;1) take latest 1.2 sandbox&lt;br/&gt;
2) change DSN to mysql&lt;br/&gt;
3) schema.yml - &lt;a href=&quot;http://pastebin.org/105193&quot; class=&quot;external-link&quot;&gt;http://pastebin.org/105193&lt;/a&gt;&lt;br/&gt;
4) add to index.php&lt;/p&gt;

&lt;p&gt;$query = Doctrine_Query::create()-&amp;gt;&lt;br/&gt;
      select(&apos;d.data, c.name&apos;)-&amp;gt;&lt;br/&gt;
      from(&apos;CategoryData d&apos;)-&amp;gt;&lt;br/&gt;
      leftJoin(&apos;d.Category c&apos;);&lt;/p&gt;

&lt;p&gt;$result = $query-&amp;gt;count();&lt;/p&gt;

&lt;p&gt;5) Result query;&lt;br/&gt;
  SELECT COUNT&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; AS num_results FROM (SELECT c.id FROM category_data c LEFT JOIN category c2 ON c.category_id = c2.id GROUP BY c.id) dctrn_count_query&lt;/p&gt;

&lt;p&gt;6) Question:&lt;br/&gt;
 what for group by statement there ? I defined in schema, that data has only one category, no more. We don&apos;t need to group anything. We even don&apos;t need to do this left join, as we don&apos;t filter result.&lt;/p&gt;

&lt;p&gt;7) sfDoctrinePager really sux .. How can i set my count query, for example? No way. I need to extend this pager with my own class and overwrite getCountQuery method .. If my base query will have 10 LEFT JOINS, result count query will make those joins too, and even group by them. Sounds really nice, huh?&lt;/p&gt;</description>
                <environment>nvm</environment>
            <key id="11004">DC-551</key>
            <summary>Doctrine_Query :: count() and result sql</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="4">Incomplete</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="discozohan">Oleg</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Mar 2010 08:15:43 +0000</created>
                <updated>Tue, 16 Nov 2010 16:53:45 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 16:16:48 +0000</resolved>
                            <version>1.2.1</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12232" author="jwage" created="Mon, 15 Mar 2010 16:16:48 +0000"  >&lt;p&gt;Hi, this ticket is not a valid issue. I understand you may have some problem but this is not the place to ask questions. Only for reproducible issues with patches and test cases.&lt;/p&gt;</comment>
                    <comment id="14764" author="zhukaster" created="Tue, 16 Nov 2010 16:53:45 +0000"  >&lt;p&gt;Here is some sort of patch: you can use this class for custom count queries, or include this fixes into pager,&lt;br/&gt;
but as I see they accept only patch with tests, etc, so if someone can form a patch - please do it.&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Description of slogerPager&lt;br/&gt;
 *&lt;br/&gt;
 */&lt;br/&gt;
class customDoctrinePager extends sfDoctrinePager&lt;br/&gt;
{&lt;br/&gt;
    protected $countQuery = null;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    public function  setCountQuery(Doctrine_Query $q = null)&lt;/p&gt;
    {
        $this-&amp;gt;countQuery = $q;
    }

&lt;p&gt;    public function getCountQuery()&lt;/p&gt;
    {
        if (!is_null($this-&amp;gt;countQuery))
            return $this-&amp;gt;countQuery;

        return parent::getCountQuery();
    }
&lt;p&gt;}&lt;br/&gt;
?&amp;gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-928] [Migrations] Drop not null is not working in Postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-928</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When removing the not null from a column the migration does not change anything in the database. This is due to the following check on line 162 of lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Pgsql.php&lt;br/&gt;
if ( ! empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;))&lt;/p&gt;

&lt;p&gt;So if notnull is not there or set to false or &apos;0&apos; or 0 the code does not enter into that if statement and therefore no changes are done to the not null value of the column.&lt;/p&gt;</description>
                <environment>Postgresql 8.4, Symfony 1.4, Doctrine 1.2</environment>
            <key id="12110">DC-928</key>
            <summary>[Migrations] Drop not null is not working in Postgres</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lea">Lea Haensenberger</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 07:56:22 +0000</created>
                <updated>Tue, 16 Nov 2010 11:44:46 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14755" author="lsmith" created="Tue, 16 Nov 2010 08:05:03 +0000"  >&lt;p&gt;@Lea: can you write up a patch for this? would also be nice if you could check if the same issue affects other drivers.&lt;/p&gt;</comment>
                    <comment id="14756" author="lea" created="Tue, 16 Nov 2010 11:44:21 +0000"  >&lt;p&gt;Here is a patch (attachment). The generate-migrations-diff Task in Symfony sets &apos;notnull&apos; to an empty string if it&apos;s false in the schema.yml, therefore the check for empty string.&lt;/p&gt;

&lt;p&gt;I had a quick look at the classes for other DBs, but that seems to be a postgres only issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10861" name="dropNotNullPatch.patch" size="1119" author="lea" created="Tue, 16 Nov 2010 11:44:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-930] Complex query with DISTINCT and LIMIT on pgsql causes a SQLSTATE exception - problem in doctrine_subquery_alias</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-930</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There is a problem in the following code in Doctrine/Query.php (lines 1257-1279) inside the buildSqlQuery() method:&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;            $subquery = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getLimitSubquery();

            &lt;span class=&quot;code-comment&quot;&gt;// what about composite keys?
&lt;/span&gt;            $idColumnName = $table-&amp;gt;getColumnName($table-&amp;gt;getIdentifier());

            &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; (strtolower($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;getDriverName())) {
                &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;mysql&apos;:
[...]
                &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;pgsql&apos;:
                    $subqueryAlias = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteIdentifier(&apos;doctrine_subquery_alias&apos;);

                    &lt;span class=&quot;code-comment&quot;&gt;// pgsql needs special nested LIMIT subquery
&lt;/span&gt;                    $subquery = &apos;SELECT &apos; . $subqueryAlias . &apos;.&apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteIdentifier($idColumnName)
                            . &apos; FROM (&apos; . $subquery . &apos;) AS &apos; . $subqueryAlias;

                    &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above code is executed when a query consist of DISTINCT and LIMIT clauses. The most common situation is using pager. &lt;br/&gt;
The problem is in the subquery variable. The $idColumnName variable often has value &quot;id&quot;. In such a situation in case of  $subquery consist of some JOINs and some tables have column named &quot;id&quot;, we have:&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-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; doctrine_subquery_alias.id &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; ((&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; DISTINCT d1.id, d2.id &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; ...)) AS doctrine_subquery_alias
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It, of course, causes the &quot;ambiguous column name&quot; pgsql exception.&lt;/p&gt;</description>
                <environment>pgsql</environment>
            <key id="12112">DC-930</key>
            <summary>Complex query with DISTINCT and LIMIT on pgsql causes a SQLSTATE exception - problem in doctrine_subquery_alias</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="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 09:54:02 +0000</created>
                <updated>Tue, 16 Nov 2010 09:54:02 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-740] issue with multiple connection handling</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-740</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve found an issue where doctrine will use the wrong connection for tables under certain conditions.&lt;/p&gt;

&lt;p&gt;In a template, I&apos;m doing a $sf_user-&amp;gt;hasCredential() - which is causing this to be run in sfGuardSecurityUser,&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;this&lt;/span&gt;-&amp;gt;user = Doctrine::getTable(&apos;sfGuardUser&apos;)-&amp;gt;find($id);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When this execute, the calls find themselves to Doctrine_Manager::getConnectionForComponent($componentName)&lt;/p&gt;

&lt;p&gt;This method calls Doctrine_Core::modelsAutoload($componentName);,  which fails to load the class, and returns false (no checking is done to see if it should return true).&lt;/p&gt;

&lt;p&gt;As this fails to include the sfGuardUser classes wher the component binding goes on, the getTAble call will use the default connection, then create the table fails to use the correct connection&lt;/p&gt;

&lt;p&gt;Doctrine_Core::getTable()&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;return&lt;/span&gt; Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($componentName)-&amp;gt;getTable($componentName);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the binding is done &lt;b&gt;after&lt;/b&gt; the call to getConectionForComponent, as it&apos;s getTable that will ultimately cause the autoloader to pull in the table classes.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11502">DC-740</key>
            <summary>issue with multiple connection handling</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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pookey">Ian P. Christian</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 07:14:23 +0000</created>
                <updated>Tue, 16 Nov 2010 03:08:32 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="13336" author="jwage" created="Wed, 16 Jun 2010 08:03:16 +0000"  >&lt;p&gt;Hmm, why is the autoloading of sfGuardUser failing? I don&apos;t understand that part. If it is failing do you get a cannot load class error?&lt;/p&gt;</comment>
                    <comment id="13339" author="pookey" created="Wed, 16 Jun 2010 08:46:34 +0000"  >&lt;p&gt;The reason no autoload error is throw, is because symfony&apos;s autoloader loads the class for you, but it does it at the getTable() call, which as seen below from Doctrine_Core::getTable(), it&apos;s proxied though the connection - which is created &lt;b&gt;before&lt;/b&gt; the gable is instanced, which of when the file is actaully loaded.&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;return&lt;/span&gt; Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($componentName)-&amp;gt;getTable($componentName);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13342" author="pookey" created="Wed, 16 Jun 2010 10:00:05 +0000"  >&lt;p&gt;Just to expand on this...&lt;/p&gt;

&lt;p&gt;This obviously gets called when a call to getTable is made:&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 getConnectionForComponent($componentName)
    {
        Doctrine_Core::modelsAutoload($componentName);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_bound[$componentName])) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getConnection($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_bound[$componentName]);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getCurrentConnection();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The autoload fails, as you can see from the code...&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; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function modelsAutoload($className)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (class_exists($className, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) || interface_exists($className, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! self::$_modelsDirectory) {
            $loadedModels = self::$_loadedModelFiles;

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($loadedModels[$className]) &amp;amp;&amp;amp; file_exists($loadedModels[$className])) {
                require $loadedModels[$className];

                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            $class = self::$_modelsDirectory . DIRECTORY_SEPARATOR . str_replace(&apos;_&apos;, DIRECTORY_SEPARATOR, $className) . &apos;.php&apos;;

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (file_exists($class)) {
                require $class;

                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
            }
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$_modelsDirectory is never set, and $_loadedModelFiles is an empty array.   The $_modelsDirectory, even if set, wouldn&apos;t handle loading for plugins, which put their models in places like lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUser.class.php.&lt;/p&gt;</comment>
                    <comment id="13346" author="pookey" created="Wed, 16 Jun 2010 11:34:48 +0000"  >&lt;p&gt;This was not a problem before r7668 (at least, not for most use cases)....&lt;/p&gt;

&lt;p&gt;It used to be that null was passed as the first arg in the D_Query::create() method call, causing the query to figure out itself which connection to use, which was done after the component was bound, so that&apos;s fine!&lt;/p&gt;

&lt;p&gt;However, the code below is how it is in the current head&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 createQuery($alias = &apos;&apos;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($alias)) {
            $alias = &apos; &apos; . trim($alias);
        }

        $class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_QUERY_CLASS);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Query::create($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn, $class)
            -&amp;gt;from($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getComponentName() . $alias);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here , the connection of the table (as explained above is previously set incorerctly) is passed to the query.&lt;/p&gt;</comment>
                    <comment id="13347" author="pookey" created="Wed, 16 Jun 2010 12:43:49 +0000"  >&lt;p&gt;I&apos;ve found a work around to this, not sure if it&apos;s a desirable fix though...&lt;/p&gt;

&lt;p&gt;In the project configuration class, I&apos;ve added this to the setup()&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;this&lt;/span&gt;-&amp;gt;dispatcher-&amp;gt;connect(&apos;doctrine.configure&apos;, array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;, &apos;doctrineBinder&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;and the following method is also added, were I&apos;m manually doing my bindings...&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 doctrineBinder(sfEvent $event)
  {
    $manager = Doctrine_Manager::getInstance();
    $manager-&amp;gt;bindComponent(&apos;sfGuardUser&apos;, &apos;nosp&apos;);
    $manager-&amp;gt;bindComponent(&apos;Incident&apos;, &apos;nosp&apos;);
    $manager-&amp;gt;bindComponent(&apos;ServiceIp&apos;, &apos;ip&apos;);

  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The overhead here isn&apos;t really that high (it just sets an element in the array)  - I&apos;d also wonder if a bindComponents($array); should be added to simplify this call, but that&apos;s another method.&lt;/p&gt;</comment>
                    <comment id="13523" author="pluk77" created="Tue, 6 Jul 2010 10:41:36 +0000"  >&lt;p&gt;After a long and hard look at the sfDoctrinePlugin and Doctrine code I can to the same conclusion. The Doctrine autoload is not working in sfDoctrinePlugin. I think this is more a &lt;a href=&quot;http://trac.symfony-project.org/ticket/7689&quot; class=&quot;external-link&quot;&gt;sfDoctrinePlugin bug&lt;/a&gt; than a Doctrine bug.&lt;/p&gt;

&lt;p&gt;Instead of manual binding, a better way is the actually make sure the intended flow of the code is working like it should be.&lt;/p&gt;

&lt;p&gt;To be able to use sfDoctrineGuard with multiple connections you need to ensure that the connection name is added to the Schema of sfDoctrineGuard. Once this is done, rebuilding the model will put a bindComponent in the class files.&lt;/p&gt;

&lt;p&gt;This works fine if the autoload is working like it should.&lt;/p&gt;

&lt;p&gt;To get the autoload to work, you can extend the autoload function of Doctrine_Core in Doctrine:&lt;/p&gt;

&lt;p&gt;The Doctrine.php file is empty by default, so its easy to add your code to it (until the problem is fixed without having to edit Doctrine code)&lt;/p&gt;

&lt;p&gt;lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine.php:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
class Doctrine extends Doctrine_Core
{
  public static function modelsAutoload($className)
  {
    sfAutoload::getInstance()-&amp;gt;autoload($className);

    parent::modelsAutoload($className);
  }
  
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="13525" author="pluk77" created="Tue, 6 Jul 2010 11:17:54 +0000"  >&lt;p&gt;Sorry... the above does not work.&lt;/p&gt;

&lt;p&gt;Doctrine_Core-&amp;gt;autoload() is called and not Doctrine-&amp;gt;autoload().&lt;/p&gt;

&lt;p&gt;sfAutoload::getInstance()-&amp;gt;autoload($className);&lt;/p&gt;

&lt;p&gt;can be added to Doctrine_Core line 1133&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;public static function modelsAutoload($className)
    {
        if (class_exists($className, false) || interface_exists($className, false)) {
            return false;
        }

        sfAutoload::getInstance()-&amp;gt;autoload($className);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13526" author="pluk77" created="Tue, 6 Jul 2010 11:26:04 +0000"  >&lt;p&gt;Oh, and to make sfDoctrineGuard work properly, you might have to ensure the sfBasicSecurityUser is bound to the correct model.&lt;/p&gt;

&lt;p&gt;You can do this in plugins\sfDoctrineGuardPlugin\lib\user\sfGuardSecurityUser.class.php or in apps\xxxxx\lib\myUser.class.php&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;sfGuardUser&apos;, &apos;connectionName&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="13532" author="pluk77" created="Wed, 7 Jul 2010 06:05:39 +0000"  >&lt;p&gt;The patch to Doctrine_Core&lt;/p&gt;

&lt;p&gt;This is a hack that only works when used in sfDoctrinePlugin / Symfony&lt;/p&gt;

&lt;p&gt;Not intended as the final patch to fix this bug but as a work around to make multiple connections usable.&lt;/p&gt;</comment>
                    <comment id="13542" author="pookey" created="Thu, 8 Jul 2010 05:57:47 +0000"  >&lt;p&gt;This effects migrations too it seems:&lt;/p&gt;

&lt;p&gt;Even doing this:&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;
    $manager = Doctrine_Manager::getInstance();                                                          
    $manager-&amp;gt;bindComponent(&apos;ChangeRequest&apos;, &apos;nosp&apos;);                                                    
    $manager-&amp;gt;bindComponent(&apos;change_request&apos;, &apos;nosp&apos;);                                                   
class Addstatetochangerequest &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Migration_Base                                            
{                                                                                                        
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()                                                                                   
  {                                                                                                      
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addColumn(&apos;change_request&apos;, &apos;change_state&apos;, &apos;&lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt;&apos;, array(&apos;values&apos; =&amp;gt; array(&apos;draft&apos;, &apos;submitted&apos;, &apos;approved&apos;, &apos;rejected&apos;, &apos;closed&apos;)));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This results in:&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;
# ./symfony doctrine:migrate
&amp;gt;&amp;gt; doctrine  Migrating from version 0 to 1
                                                                                                                                                                                    
  The following errors occurred:                                                                                                                                                    
                                                                                                                                                                                    
   - SQLSTATE[42S02]: Base table or view not found: 1146 Table &apos;nosp_test_radius2.change_request&apos; doesn&apos;t exist. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;ALTER TABLE change_request ADD change_state TEXT&quot;&lt;/span&gt;  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The database attempted to be used there is not the correct one.&lt;/p&gt;
</comment>
                    <comment id="14465" author="pluk77" created="Mon, 27 Sep 2010 03:03:15 +0000"  >&lt;p&gt;second required patch to make Symfony work with 2 concurrent databases&lt;/p&gt;</comment>
                    <comment id="14592" author="zhekanax" created="Thu, 21 Oct 2010 14:30:47 +0000"  >&lt;h5&gt;&lt;a name=&quot;Anotherbadwaytogetitworkinginsymfony%3A&quot;&gt;&lt;/a&gt;Another bad way to get it working in symfony:&lt;/h5&gt;
&lt;p&gt;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;ProjectConfiguration.class.php&lt;/b&gt;&lt;/div&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 configureDoctrine(Doctrine_Manager $manager)
  {
    $files = sfFinder::type(&apos;file&apos;)
      -&amp;gt;maxdepth(0)
      -&amp;gt;not_name(&apos;*Table.class.php&apos;)
      -&amp;gt;name(&apos;*.class.php&apos;)
      -&amp;gt;in(sfConfig::get(&apos;sf_lib_dir&apos;) . &apos;/model/doctrine&apos;);

    foreach ($files as $file) {
      $class_name = str_replace(&apos;.class.php&apos;, &apos;&apos;, basename($file));
      Doctrine_Core::loadModel($class_name, $file);
    }
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14744" author="ddebree" created="Tue, 16 Nov 2010 03:08:32 +0000"  >&lt;p&gt;I found that if I changed the getTable function inside the Core.php file it seemed to work. Basically it forces the autoloader to load the object file, and when it does this it runs the bound connection statement to bind a table to a connection. &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Core.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
     * Get the Doctrine_Table object &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the passed model
     *
     * @param string $componentName
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Table
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function getTable($componentName)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!class_exists($componentName)) {
            &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $componentName();
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($componentName)-&amp;gt;getTable($componentName);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10689" name="doctrine_core.patch" size="758" author="pluk77" created="Wed, 7 Jul 2010 06:05:39 +0000" />
                    <attachment id="10814" name="doctrine_manager.patch" size="1560" author="pluk77" created="Mon, 27 Sep 2010 03:03:15 +0000" />
                </attachments>
            <subtasks>
            <subtask id="11178">DC-618</subtask>
        </subtasks>
        </item>

<item>
            <title>[DC-926] Doctrine ignored PORTABILITY_FIX_CASE and ATTR_FIELD_CASE settings when building query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-926</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Setting:&lt;br/&gt;
$conn-&amp;gt;setAttribute(Doctrine_Core::ATTR_PORTABILITY, Doctrine_Core::PORTABILITY_FIX_CASE)&lt;br/&gt;
$conn-&amp;gt;setAttribute(Doctrine_Core::ATTR_FIELD_CASE, CASE_UPPER)&lt;/p&gt;

&lt;p&gt;I expect column names in built queries to be uppercase, but they remain to be lowercase.&lt;/p&gt;</description>
                <environment>Tested on CentOS 5, Ubuntu 10.4, MYSQL and MSSQL databases</environment>
            <key id="12101">DC-926</key>
            <summary>Doctrine ignored PORTABILITY_FIX_CASE and ATTR_FIELD_CASE settings when building query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</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="dziamid">Dziamid Zayankouski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Nov 2010 17:27:10 +0000</created>
                <updated>Fri, 12 Nov 2010 17:29:13 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-925] missing hasOne() method-call in many-to-many relation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-925</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Here&apos;s my YAML-file for the model: &lt;a href=&quot;http://pastie.org/1290649&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1290649&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m using the following command to build the whole model: symfony doctrine:build --all --and-load&lt;br/&gt;
By this command symfony will create the model using Doctrine.&lt;/p&gt;

&lt;p&gt;Please have a closer look at the class BaseTicketHasHardware: &lt;a href=&quot;http://pastie.org/1290737&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1290737&lt;/a&gt;&lt;br/&gt;
If I compare it to the class BaseTicketHasNote I expect a class like this: &lt;a href=&quot;http://pastie.org/1290765&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1290765&lt;/a&gt;&lt;br/&gt;
But Doctrine has created this class: &lt;a href=&quot;http://pastie.org/1290766&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1290766&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Debian Lenny&lt;br/&gt;
Apache 2.0&lt;br/&gt;
PHP 5.3.3-0.dotdeb.1&lt;br/&gt;
Symfony 1.4.8 - using Doctrine 1.2.x</environment>
            <key id="12097">DC-925</key>
            <summary>missing hasOne() method-call in many-to-many relation</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="simonsimcity">Simon Schick</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Nov 2010 16:49:56 +0000</created>
                <updated>Thu, 11 Nov 2010 16:49:56 +0000</updated>
                                                                    <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-924] type mismatch for keyfield in column aggregation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-924</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is the doc exemple on column aggregation inheritance :&lt;/p&gt;

&lt;p&gt;Entity:&lt;br/&gt;
  columns:&lt;br/&gt;
    username: string(20)&lt;br/&gt;
    password: string(16)&lt;br/&gt;
    created_at: timestamp&lt;br/&gt;
    updated_at: timestamp&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 1&lt;/p&gt;

&lt;p&gt;Group:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 2&lt;/p&gt;

&lt;p&gt;But the keyField (type) is created as VARCHAR(255) so PostgreSQL return an error on applying inheritance condition :&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42883&amp;#93;&lt;/span&gt;: Undefined function: 7 ERROR:  operator does not exist: character varying = integer         &lt;br/&gt;
  LINE 1: ...D s.application = &apos;frontend&apos; AND s.lft = 1) AND (s.type = 2)                                     &lt;br/&gt;
                                                                     ^                                        &lt;br/&gt;
  HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.&lt;/p&gt;

&lt;p&gt;I found this with symfony sfFilebasePlugin on sfFilebase:create-root task.&lt;/p&gt;</description>
                <environment>PostgreSQL</environment>
            <key id="12095">DC-924</key>
            <summary>type mismatch for keyfield in column aggregation</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="romanb">Roman S. Borschel</assignee>
                                <reporter username="nono">Arnaud Morvan</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Nov 2010 12:02:12 +0000</created>
                <updated>Thu, 11 Nov 2010 12:02:12 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-923] Documentation 1.2 #working-with-models error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-923</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In documentation&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/working-with-models/en#many-to-many-relations:creating-a-new-link&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/working-with-models/en#many-to-many-relations:creating-a-new-link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There&apos;s an error in example code:&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-comment&quot;&gt;// test.php
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;username = &apos;Some User&apos;;
$user-&amp;gt;Groups[0]-&amp;gt;username = &apos;Some Group&apos;;
$user-&amp;gt;Groups[1]-&amp;gt;username = &apos;Some Other Group&apos;;
$user-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The error is on lines:&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;$user-&amp;gt;Groups[0]-&amp;gt;username = 
$user-&amp;gt;Groups[1]-&amp;gt;username = 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;they shoud be:&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;$user-&amp;gt;Groups[0]-&amp;gt;name = 
$user-&amp;gt;Groups[1]-&amp;gt;name = 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;as there&apos;s no username column in schema.yml definition of Group object.&lt;/p&gt;</description>
                <environment>Ubuntu 10.4, LAMP</environment>
            <key id="12089">DC-923</key>
            <summary>Documentation 1.2 #working-with-models error</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</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="martin">Martin Babic</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 06:17:30 +0000</created>
                <updated>Wed, 10 Nov 2010 06:27:30 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-922] master-slave replication with i18n behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-922</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to use sfDoctrineMasterSlavePlugin for database replication with Symfony  1.4 and PHP 5.3. But facing problem while selecting I18n records and receiving &quot;Unknown relation alias Translation&quot; error.&lt;/p&gt;

&lt;p&gt;I&apos;ve also tried same with implementation solution given in master-slave chapter of doctrine cookbook but no success. &lt;/p&gt;

&lt;p&gt;Is anyone facing same problem with sfDoctrineMasterSlavePlugin and i18n behavio? Is there any solution of the problem?&lt;/p&gt;</description>
                <environment>php 5.3, doctrine 1.2, Symfony 1.4, mysql</environment>
            <key id="12088">DC-922</key>
            <summary>master-slave replication with i18n behavior</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="husen">husen mankada</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 02:34:37 +0000</created>
                <updated>Wed, 10 Nov 2010 02:34:37 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-897] Pager ignores default model hasMany ORDER BY statements, caused by getLimitSubquery ignoring same</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-897</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Our model configuration includes several hasMany statements, for example:&lt;/p&gt;

&lt;p&gt;        $this-&amp;gt;hasMany(&apos;Subcategory as Subcategories&apos;, array(&lt;br/&gt;
            &apos;refClass&apos; =&amp;gt; &apos;SubcategoryTone&apos;,&lt;br/&gt;
            &apos;local&apos; =&amp;gt; &apos;tone_id&apos;,&lt;br/&gt;
            &apos;foreign&apos; =&amp;gt; &apos;subcategory_id&apos;,&lt;br/&gt;
            &apos;cascade&apos; =&amp;gt; array(&apos;delete&apos;),&lt;br/&gt;
            &apos;orderBy&apos; =&amp;gt; &apos;order_id&apos;,&lt;br/&gt;
        ));&lt;/p&gt;

&lt;p&gt;We noticed that the ORDER BY directive worked just fine with a normal query, but the order by was being ignored when we fed it into the Pager.&lt;/p&gt;

&lt;p&gt;For example:&lt;br/&gt;
            $aa = $t-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;br/&gt;
            var_dump($aa&lt;span class=&quot;error&quot;&gt;&amp;#91;4&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;            $pager = new Doctrine_Pager($t, $currentPage, $resultsPerPage);&lt;br/&gt;
            $bb = $pager-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;            var_dump($bb&lt;span class=&quot;error&quot;&gt;&amp;#91;4&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;These two var_dumps would give different results because the ORDER BY is ignored by the limit subquery in the pager.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12025">DC-897</key>
            <summary>Pager ignores default model hasMany ORDER BY statements, caused by getLimitSubquery ignoring same</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="angrygreenfrogs">Andrew Eross</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 02:50:21 +0000</created>
                <updated>Wed, 10 Nov 2010 01:41:21 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14593" author="angrygreenfrogs" created="Fri, 22 Oct 2010 03:05:23 +0000"  >&lt;p&gt;I&apos;ve also found a fix for the issue (thanks to George over here for finding the location of the problem) ... we found that simply moving the ORDER BY generation code inside of buildSqlQuery() to be ABOVE the if block containing getLimitSubquery() resolves the issue.&lt;/p&gt;

&lt;p&gt;We&apos;re not super familiar with the Doctrine code-base, so everything looks to work fine after moving the code block, and it fixes the issue, but would love to hear if this is a real fix.&lt;/p&gt;

&lt;p&gt;diff from 1.2.3 via our SVN:&lt;/p&gt;

&lt;p&gt;Index: Query.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; Query.php   (revision 1120)&lt;br/&gt;
+++ Query.php   (working copy)&lt;br/&gt;
@@ -1256,7 +1256,46 @@&lt;br/&gt;
                 $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;where&amp;#39;&amp;#93;&lt;/span&gt;[] = &apos;(&apos; . $string . &apos;)&apos;;&lt;br/&gt;
             }&lt;br/&gt;
         }&lt;br/&gt;
+        &lt;br/&gt;
+    // Fix the orderbys so we only have one orderby per value&lt;br/&gt;
+        foreach ($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt; as $k =&amp;gt; $orderBy) {&lt;br/&gt;
+            $e = explode(&apos;, &apos;, $orderBy);&lt;br/&gt;
+            unset($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$k&amp;#93;&lt;/span&gt;);&lt;br/&gt;
+            foreach ($e as $v) &lt;/p&gt;
{
+                $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
+            }
&lt;p&gt;+        }&lt;/p&gt;

&lt;p&gt;+        // Add the default orderBy statements defined in the relationships and table classes&lt;br/&gt;
+        // Only do this for SELECT queries&lt;br/&gt;
+        if ($this-&amp;gt;_type === self::SELECT) {&lt;br/&gt;
+            foreach ($this-&amp;gt;_queryComponents as $alias =&amp;gt; $map) {&lt;br/&gt;
+                $sqlAlias = $this-&amp;gt;getSqlTableAlias($alias);&lt;br/&gt;
+                if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
+                    $orderBy = $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getOrderByStatement($sqlAlias, true);&lt;br/&gt;
+                    if ($orderBy == $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderBy&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;br/&gt;
+                        if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ref&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
+                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], true);
+                        }
&lt;p&gt; else &lt;/p&gt;
{
+                            $orderBy = null;
+                        }
&lt;p&gt;+                    }&lt;br/&gt;
+                } else &lt;/p&gt;
{
+                    $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, true);
+                }
&lt;p&gt;+&lt;br/&gt;
+                if ($orderBy) {&lt;br/&gt;
+                    $e = explode(&apos;,&apos;, $orderBy);&lt;br/&gt;
+                    $e = array_map(&apos;trim&apos;, $e);&lt;br/&gt;
+                    foreach ($e as $v) {&lt;br/&gt;
+                        if ( ! in_array($v, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
+                            $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
+                        }
&lt;p&gt;+                    }&lt;br/&gt;
+                }&lt;br/&gt;
+            }&lt;br/&gt;
+        }&lt;br/&gt;
+&lt;br/&gt;
         $modifyLimit = true;&lt;br/&gt;
         $limitSubquerySql = &apos;&apos;;&lt;/p&gt;

&lt;p&gt;@@ -1307,47 +1346,8 @@&lt;/p&gt;

&lt;p&gt;             $q .= &apos; WHERE &apos; . $limitSubquerySql . $where;&lt;br/&gt;
             //   .  (($limitSubquerySql == &apos;&apos; &amp;amp;&amp;amp; count($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;where&amp;#39;&amp;#93;&lt;/span&gt;) == 1) ? substr($where, 1, -1) : $where);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;}&lt;br/&gt;
+        }        &lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;// Fix the orderbys so we only have one orderby per value&lt;/li&gt;
	&lt;li&gt;foreach ($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt; as $k =&amp;gt; $orderBy) {&lt;/li&gt;
	&lt;li&gt;$e = explode(&apos;, &apos;, $orderBy);&lt;/li&gt;
	&lt;li&gt;unset($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$k&amp;#93;&lt;/span&gt;);&lt;/li&gt;
	&lt;li&gt;foreach ($e as $v) 
{
-                $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
-            }&lt;/li&gt;
	&lt;li&gt;}&lt;br/&gt;
-&lt;/li&gt;
	&lt;li&gt;// Add the default orderBy statements defined in the relationships and table classes&lt;/li&gt;
	&lt;li&gt;// Only do this for SELECT queries&lt;/li&gt;
	&lt;li&gt;if ($this-&amp;gt;_type === self::SELECT) {&lt;/li&gt;
	&lt;li&gt;foreach ($this-&amp;gt;_queryComponents as $alias =&amp;gt; $map) {&lt;/li&gt;
	&lt;li&gt;$sqlAlias = $this-&amp;gt;getSqlTableAlias($alias);&lt;/li&gt;
	&lt;li&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;/li&gt;
	&lt;li&gt;$orderBy = $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getOrderByStatement($sqlAlias, true);&lt;/li&gt;
	&lt;li&gt;if ($orderBy == $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderBy&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;/li&gt;
	&lt;li&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ref&amp;#39;&amp;#93;&lt;/span&gt;)) 
{
-                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], true);
-                        }
&lt;p&gt; else &lt;/p&gt;
{
-                            $orderBy = null;
-                        }&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;} else 
{
-                    $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, true);
-                }
&lt;p&gt;-&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;if ($orderBy) {&lt;/li&gt;
	&lt;li&gt;$e = explode(&apos;,&apos;, $orderBy);&lt;/li&gt;
	&lt;li&gt;$e = array_map(&apos;trim&apos;, $e);&lt;/li&gt;
	&lt;li&gt;foreach ($e as $v) {&lt;/li&gt;
	&lt;li&gt;if ( ! in_array($v, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)) 
{
-                            $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
-                        }&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;}&lt;br/&gt;
-&lt;br/&gt;
         $q .= ( ! empty($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;groupby&amp;#39;&amp;#93;&lt;/span&gt;)) ? &apos; GROUP BY &apos; . implode(&apos;, &apos;, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;groupby&amp;#39;&amp;#93;&lt;/span&gt;)  : &apos;&apos;;&lt;br/&gt;
         $q .= ( ! empty($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;having&amp;#39;&amp;#93;&lt;/span&gt;)) ?  &apos; HAVING &apos;   . implode(&apos; AND &apos;, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;having&amp;#39;&amp;#93;&lt;/span&gt;): &apos;&apos;;&lt;br/&gt;
         $q .= ( ! empty($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)) ? &apos; ORDER BY &apos; . implode(&apos;, &apos;, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)  : &apos;&apos;;&lt;br/&gt;
@@ -1396,7 +1396,7 @@&lt;br/&gt;
             $subquery = &apos;SELECT DISTINCT &apos;;&lt;br/&gt;
         }&lt;br/&gt;
         $subquery .= $this-&amp;gt;_conn-&amp;gt;quoteIdentifier($primaryKey);&lt;br/&gt;
-&lt;br/&gt;
+        &lt;br/&gt;
         // pgsql &amp;amp; oracle need the order by fields to be preserved in select clause&lt;br/&gt;
         if ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {&lt;br/&gt;
             foreach ($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt; as $part) 
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {@@ -1420,7 +1420,7 @@                         // don&amp;#39;t add primarykey column (its already in the select clause)                         if ($part !== $primaryKey) {
                             $subquery .= &apos;, &apos; . $partOriginal;
-                        }+                        }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt; &lt;br/&gt;
                     }&lt;br/&gt;
                 }&lt;br/&gt;
             }&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Property changes on: Query.php&lt;br/&gt;
___________________________________________________________________&lt;br/&gt;
Deleted: svn:keywords&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Id Revision&lt;br/&gt;
Deleted: svn:eol-style&lt;/li&gt;
	&lt;li&gt;LF&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="14594" author="angrygreenfrogs" created="Fri, 22 Oct 2010 03:05:58 +0000"  >&lt;p&gt;Diff file&lt;/p&gt;</comment>
                    <comment id="14700" author="angrygreenfrogs" created="Wed, 10 Nov 2010 01:41:14 +0000"  >&lt;p&gt;patch -p0 ./libs/doctrine/Doctrine/Query.php ./Doctrine_Query.php.ORDERBY.patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10856" name="Doctrine_Query.php.ORDERBY.patch" size="5166" author="angrygreenfrogs" created="Wed, 10 Nov 2010 01:41:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-920] The ability to add sql in the query between the first word and body of the query (allowing &quot;SELECT STRAIGHT_JOIN&quot; etc)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-920</link>
                <project id="10031" key="DC">Doctrine 1</project>
