<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 04:33:30 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+AND+resolution+%3D+Unresolved+AND+priority+%3D+Major+ORDER+BY+key+DESC&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+AND+resolution+%3D+Unresolved+AND+priority+%3D+Major+ORDER+BY+key+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="325" total="325"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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>
                        <description>&lt;p&gt;I recently discovered that I could greatly optimize some of the queries that were being run through our system by adding a STRAIGHT_JOIN keyword to the front of the select&lt;/p&gt;

&lt;p&gt;I added a feature to doctrine which allows me to inject sql into the query in the right place to enable features such as &quot;STRAIGHT_JOIN&quot; but I can&apos;t post the patch because my patches are starting to run together &amp;#8211; 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="12082">DC-920</key>
            <summary>The ability to add sql in the query between the first word and body of the query (allowing &quot;SELECT STRAIGHT_JOIN&quot; etc)</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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Nov 2010 02:30:49 +0000</created>
                <updated>Tue, 9 Nov 2010 22:25:55 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14698" author="willf1976" created="Tue, 9 Nov 2010 22:25:35 +0000"  >&lt;p&gt;In order to show what this patch fixes I am including 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_DC920_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_DC920_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 testBeforeBodySelect()
    {
        $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 DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = &apos;123 123&apos;&quot;&lt;/span&gt;);
		$&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 DISTINCT STRAIGHT_JOIN e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON (p.phonenumber = &apos;123 123&apos;) WHERE (e.type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = &apos;123 123&apos;&quot;&lt;/span&gt;);
    }

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodySelectNoneDQL() 
    {
        $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;DISTINCT STRAIGHT_JOIN u.name, p.id&quot;&lt;/span&gt;);
		$q-&amp;gt;from(&apos;User u&apos;);
		$q-&amp;gt;leftJoin(&lt;span class=&quot;code-quote&quot;&gt;&quot;u.Phonenumber p ON (p.phonenumber = &apos;123 123&apos;)&quot;&lt;/span&gt;);
        $&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 DISTINCT STRAIGHT_JOIN e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON (p.phonenumber = &apos;123 123&apos;) WHERE (e.type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON (p.phonenumber = &apos;123 123&apos;)&quot;&lt;/span&gt;);
	}
	
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyDelete() 
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();

        $q-&amp;gt;parseDqlQuery(&apos;DELETE IGNORE FROM User&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;DELETE IGNORE FROM entity WHERE (type = 0)&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;DELETE IGNORE FROM User&quot;&lt;/span&gt;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyDeleteNoneDQL() 
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;delete(&apos;IGNORE&apos;);
		$q-&amp;gt;from(&apos;User&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;DELETE IGNORE FROM entity WHERE (type = 0)&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;DELETE IGNORE FROM User&quot;&lt;/span&gt;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyUpdate() 
    {
        $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;UPDATE IGNORE User u SET u.name = &apos;someone&apos;&quot;&lt;/span&gt;);
        $&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;UPDATE IGNORE entity SET name = &apos;someone&apos; WHERE (type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE User u SET u.name = &apos;someone&apos;&quot;&lt;/span&gt;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyUpdateNonDql() 
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;update(&apos;IGNORE&apos;);
		$q-&amp;gt;from(&apos;User u&apos;);
		$q-&amp;gt;set(&apos;name&apos;, &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;someone&apos;&quot;&lt;/span&gt;);
        $&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;UPDATE IGNORE entity SET name = &apos;someone&apos; WHERE (type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE User u SET name = &apos;someone&apos;&quot;&lt;/span&gt;);
    }

}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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-917] Doctrine take wrong connction</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-917</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have problems with different connection&lt;br/&gt;
i am using doctrine with symfony, and i work with 2 connections&lt;br/&gt;
in base class i have bind to my connection&lt;/p&gt;

&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;Datasource&apos;, &apos;doctrine&apos;);&lt;/p&gt;

&lt;p&gt;symfony generate me &lt;/p&gt;

&lt;p&gt;$this-&amp;gt;datasources = Doctrine_Core::getTable(&apos;datasource&apos;)&lt;br/&gt;
                -&amp;gt;createQuery(&apos;a&apos;)&lt;br/&gt;
                -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;and when i execute it show me error error that can find this table but it take wrong connection&lt;/p&gt;

&lt;p&gt;by test i tried to add bind component as datasource (first is lower character and it works pretty cool)&lt;/p&gt;

&lt;p&gt;then i change getTable(&apos;datasource&apos;) =&amp;gt; getTable(&apos;Datasource&apos;) but it doesn&apos;t work&lt;br/&gt;
then i have added &lt;br/&gt;
test function to my datasource table &lt;/p&gt;

&lt;p&gt;public static function test()&lt;/p&gt;
{
        return Doctrine_Query::create()-&amp;gt;from(&quot;Datasource&quot;)-&amp;gt;execute();
    }

&lt;p&gt;and it works.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12066">DC-917</key>
            <summary>Doctrine take wrong connction</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="vovikdrg">Volodymyr</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Nov 2010 04:45:12 +0000</created>
                <updated>Fri, 5 Nov 2010 04:45:12 +0000</updated>
                                                                    <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <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-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-912] A method that can run in a model when the model is autoloaded</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-912</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For my project I needed to be able to reassign connections to models when they are autoloaded &amp;#8211; this had to be able to happen during a conservative model loading process before the models had been instantiated. My solution was to build in a hook to a &quot;autoloadSetUp&quot; method which can be attached to any model (or class that is the base for a model).&lt;/p&gt;

&lt;p&gt;I will post my patch after I make a test case for it.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12055">DC-912</key>
            <summary>A method that can run in a model when the model is autoloaded</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>Mon, 1 Nov 2010 20:32:14 +0000</created>
                <updated>Tue, 9 Nov 2010 19:20:06 +0000</updated>
                                                                    <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14661" author="willf1976" created="Tue, 2 Nov 2010 20:27:31 +0000"  >&lt;p&gt;made test case use a static method&lt;/p&gt;</comment>
                    <comment id="14697" author="willf1976" created="Tue, 9 Nov 2010 19:20:06 +0000"  >&lt;p&gt;fixed some compatibility issues with the test case and other test cases&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10855" name="DC_912_fix.patch" size="4403" author="willf1976" created="Tue, 9 Nov 2010 19:20:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-911] A way of checking if a model has been loaded via the loaded loadModels method</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-911</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I needed a way to check if a model has been loaded &amp;#8212; checking to see if the model was included in the _loadedModelFiles property of core.&lt;/p&gt;

&lt;p&gt;I put in a simple function that allows me to test for this.&lt;/p&gt;

&lt;p&gt;I will post the patch after building a test case for this ticket.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12054">DC-911</key>
            <summary>A way of checking if a model has been loaded via the loaded loadModels method</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>Mon, 1 Nov 2010 20:17:39 +0000</created>
                <updated>Tue, 2 Nov 2010 20:23:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14660" author="willf1976" created="Tue, 2 Nov 2010 20:18:33 +0000"  >&lt;p&gt;Changed the name of the method to modelLoaded (seemed more appropriate)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10844" name="DC_911_fix.patch" size="2676" author="willf1976" created="Tue, 2 Nov 2010 20:23:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-910] Sub queries do not work properly in the on clause of a join</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-910</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When subqueries are used in the on part of a join clause the Doctrine_Query_JoinCondition class does not always create the proper sql. For instance when there are 2 subqueries used in a between doctrine tries to parse the statement as 1 subquery rather 2 subqueries with an &quot;and&quot;. &lt;/p&gt;

&lt;p&gt;I will post my patch that fixes this issue after I make some test cases for it. I also fixed an issue where &quot;(SQL:&quot; syntax was breaking the join as well.&lt;/p&gt;

&lt;p&gt;Will&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12053">DC-910</key>
            <summary>Sub queries do not work properly in the on clause of a 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="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, 1 Nov 2010 18:54:39 +0000</created>
                <updated>Tue, 2 Nov 2010 00:06:00 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14658" author="willf1976" created="Tue, 2 Nov 2010 00:06:00 +0000"  >&lt;p&gt;took out some commented code chunks&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10841" name="DC_910_fix.patch" size="11377" author="willf1976" created="Tue, 2 Nov 2010 00:06:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-908] Can&apos;t save Doctrine Expression AES_ENCRYPT into a utf8_general_ci field</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-908</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$membre = new Model_TMembre();&lt;br/&gt;
$membre-&amp;gt;password = new Doctrine_Expression(&quot;AES_ENCRYPT(\&quot;&quot;.htmlspecialchars($password,ENT_QUOTES).&quot;\&quot;,\&quot;&quot;._MYSQL_CRYPT.&quot;\&quot;)&quot;);&lt;br/&gt;
$membre-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;Doesn&apos;t works id password field is encoded into utf8_general_ci .&lt;/p&gt;

&lt;p&gt;Works fine id password field is encoded into latin1 .&lt;/p&gt;</description>
                <environment>Win XP</environment>
            <key id="12047">DC-908</key>
            <summary>Can&apos;t save Doctrine Expression AES_ENCRYPT into a utf8_general_ci 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dquintard">dquintard</reporter>
                        <labels>
                    </labels>
                <created>Sun, 31 Oct 2010 08:36:36 +0000</created>
                <updated>Sun, 31 Oct 2010 08:36:36 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-907] when I delete fields from a table in oracle 10g and I execute build schema keeps bringing me those same fields that no longer exist.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-907</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a table in oracle that i was using but I had to change it so i remove some fields and add others when i run the task buils schema it generates the file schema.yml it  created the new fields added but  continued to bringing those field who had been eliminated and no longer existed in the database, it generates an  error because the file schema.yml are those field  but the database does not ...&lt;/p&gt;</description>
                <environment></environment>
            <key id="11688">DC-907</key>
            <summary>when I delete fields from a table in oracle 10g and I execute build schema keeps bringing me those same fields that no longer exist.</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="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 10:06:04 +0000</created>
                <updated>Sun, 31 Oct 2010 07:13:05 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14396" author="beberlei" created="Wed, 15 Sep 2010 16:36:13 +0000"  >&lt;p&gt;Is this a Doctrine 1 or 2 bug? Is this a caching issue maybe?&lt;/p&gt;</comment>
                </comments>
                    <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-903] Make Doctrine_Record_UnknownPropertyException error more descriptive</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-903</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I have a Doctrine object and I try something like $book-&amp;gt;getNonexistantThing(), I always get an error like this:&lt;br/&gt;
PHP Fatal error:  Class &apos;Doctrine_Record_UnknownPropertyException&apos; not found in /home/jason/projects/mcif/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record/Filter/Standard.php on line 55&lt;/p&gt;

&lt;p&gt;It makes it hard to track down the source of the error. Why not have the error include the offending method call?&lt;/p&gt;</description>
                <environment>Ubuntu 10.10</environment>
            <key id="12040">DC-903</key>
            <summary>Make Doctrine_Record_UnknownPropertyException error more descriptive</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="jasonswett">Jason Swett</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Oct 2010 14:46:49 +0000</created>
                <updated>Thu, 28 Oct 2010 14:46:49 +0000</updated>
                                                                    <component>Attributes</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-902] Xcache Cache Driver is not documented</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-902</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Xcache Cache Driver is not documented at all. Is it working? Is it stable? Can we use it?&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12035">DC-902</key>
            <summary>Xcache Cache Driver is not documented</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="leszczu">Piotr Leszczy&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Oct 2010 14:38:59 +0000</created>
                <updated>Tue, 26 Oct 2010 14:38:59 +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>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-899] Expose hardDelete method on node object when SoftDelete behavior is used</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-899</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When combining SoftDelete and NestedSet behavior, there&apos;s no way of calling hardDelete method on node object. According to documentation, to peform a delete on a nested set, delete should be called in node object, which will call delete method on the object itself.&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="12027">DC-899</key>
            <summary>Expose hardDelete method on node object when SoftDelete behavior is used</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="fvaresi">Fernando Varesi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 10:55:52 +0000</created>
                <updated>Fri, 22 Oct 2010 10:55:52 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-898] (PATCH) Migration fails when addColumn with type &apos;boolean&apos; used with default value, resulting in incorrect &apos;ALTER TABLE&apos; query in MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-898</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I use MySQL. In my up() method in migration class, I have:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn($table, &apos;is_master&apos;, &apos;boolean&apos;, null, array(&apos;notnull&apos; =&amp;gt; true, &apos;default&apos; =&amp;gt; false));&lt;/p&gt;

&lt;p&gt;Running &apos;migrate&apos; results in a following exception:&lt;br/&gt;
 Error #1 - SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1067 Invalid default value for &apos;is_master&apos;. Failing Query: &quot;ALTER TABLE books_authors ADD is_master TINYINT(1) DEFAULT &apos;&apos; NOT NULL&quot;&lt;br/&gt;
#0 /usr/local/zend/share/pear/Doctrine/Connection.php(1025): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql), &apos;ALTER TABLE boo...&apos;)&lt;br/&gt;
#1 /usr/local/zend/share/pear/Doctrine/Export.php(621): Doctrine_Connection-&amp;gt;execute(&apos;ALTER TABLE boo...&apos;)&lt;br/&gt;
#2 /usr/local/zend/share/pear/Doctrine/Migration/Process.php(89): Doctrine_Export-&amp;gt;alterTable(&apos;books_authors&apos;, Array)&lt;br/&gt;
#3 /usr/local/zend/share/pear/Doctrine/Migration.php(522): Doctrine_Migration_Process-&amp;gt;processCreatedColumn(Array)&lt;br/&gt;
#4 /usr/local/zend/share/pear/Doctrine/Migration.php(479): Doctrine_Migration-&amp;gt;_doMigrateStep(&apos;up&apos;, 1)&lt;br/&gt;
#5 /usr/local/zend/share/pear/Doctrine/Migration.php(328): Doctrine_Migration-&amp;gt;_doMigrate(1)&lt;br/&gt;
#6 /usr/local/zend/share/pear/Doctrine/Core.php(1016): Doctrine_Migration-&amp;gt;migrate(NULL)&lt;br/&gt;
#7 /usr/local/zend/share/pear/Doctrine/Task/Migrate.php(41): Doctrine_Core::migrate(&apos;/Users/argasek/...&apos;, NULL)&lt;br/&gt;
#8 /usr/local/zend/share/pear/Doctrine/Cli.php(516): Doctrine_Task_Migrate-&amp;gt;execute()&lt;br/&gt;
#9 /usr/local/zend/share/pear/Doctrine/Cli.php(498): Doctrine_Cli-&amp;gt;executeTask(Object(Doctrine_Task_Migrate), Array)&lt;br/&gt;
#10 /usr/local/zend/share/pear/Doctrine/Cli.php(452): Doctrine_Cli-&amp;gt;_run(Array)&lt;br/&gt;
#11 /Users/argasek/Sites/blipoteka/scripts/doctrine-cli.php(28): Doctrine_Cli-&amp;gt;run(Array)&lt;br/&gt;
#12 &lt;/p&gt;
{main}

&lt;p&gt;However, I would expect ALTER query to look like this:&lt;/p&gt;

&lt;p&gt;ALTER TABLE books_authors ADD is_master TINYINT(1) DEFAULT 0 NOT NULL&lt;/p&gt;

&lt;p&gt;I guess there&apos;s a problem with getDefaultFieldDeclaration() in Doctrine_Export_Mysql, it lacks convertBooleans() call being present at Doctrine_Export.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6 Snow Leopard / Zend Server CE 5.0.3 (irrelevant)</environment>
            <key id="12026">DC-898</key>
            <summary>(PATCH) Migration fails when addColumn with type &apos;boolean&apos; used with default value, resulting in incorrect &apos;ALTER TABLE&apos; query in MySQL</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="argasek">Jakub Argasi&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 08:02:33 +0000</created>
                <updated>Fri, 22 Oct 2010 08:02:33 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10830" name="fix_boolean_default_mysql_column_migration.patch" size="525" author="argasek" created="Fri, 22 Oct 2010 08:02:33 +0000" />
                </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-893] Using default value for bigint fields generates an error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-893</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;A field defined as:&lt;br/&gt;
&apos;user_id&apos; =&amp;gt; array(&lt;br/&gt;
 &#160; &#160;&apos;type&apos; =&amp;gt; &apos;bigint&apos;,&lt;br/&gt;
 &#160; &#160;&apos;length&apos; =&amp;gt; 22,&lt;br/&gt;
 &#160; &#160;&apos;default&apos; =&amp;gt; 0,&lt;br/&gt;
),&lt;/p&gt;

&lt;p&gt;Generates an error when create-tables is used:&lt;br/&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; &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt; user_id bigint(22) DEFAULT , INDEX schedule_prize_id_idx (schedule_prize_id)&lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The default value is not accounted for.&lt;/p&gt;</description>
                <environment>Replicated on *nix using MySQL DB.</environment>
            <key id="12016">DC-893</key>
            <summary>Using default value for bigint fields generates an error</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="dosipov">Dan Osipov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 10:56:49 +0000</created>
                <updated>Mon, 25 Oct 2010 16:27:06 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14600" author="paulovitin" created="Mon, 25 Oct 2010 16:27:06 +0000"  >&lt;p&gt;20 is the length of the mysql bigint..&lt;/p&gt;</comment>
                </comments>
                    <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-889] Using RANDOM() AS rand as last field WITHOUT a comma between them works, but not randomly</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-889</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The difference between the two code samples below is that there is a comma after &apos;lo.postal&apos;_code in the second example:&lt;/p&gt;

&lt;p&gt;This code DOES NOT RANDOMIZE But also DOES NOT PRODUCE A PARSER ERROR&lt;br/&gt;
$q = Doctrine_Query::create()&lt;br/&gt;
                            -&amp;gt;select(&quot;li.id,&lt;br/&gt;
                                      ap.name, &lt;br/&gt;
                                      act.title, act.title_short, act.family_friendly, &lt;br/&gt;
                                      o.unix_ts_begin, o.unix_ts_end, &lt;br/&gt;
                                      act.description, &lt;br/&gt;
                                      act.cost_min, act.tags, act.cost_min, act.cost_notes, act.organization, &lt;br/&gt;
                                      lo.thoroughfare, lo.address_extra, lo.locality, lo.administrative_area, lo.country_name_code, lo.postal_code&lt;br/&gt;
                                      RANDOM() AS rand&quot;)&lt;br/&gt;
                             -&amp;gt;from(blah, blah)&lt;br/&gt;
                             -&amp;gt;where(primary key equality statements for joining)&lt;br/&gt;
                             -&amp;gt;orderBy(&apos;rand&apos;);&lt;/p&gt;

&lt;p&gt;This DOES&lt;br/&gt;
$q = Doctrine_Query::create()&lt;br/&gt;
                            -&amp;gt;select(&quot;li.id,&lt;br/&gt;
                                      ap.name, &lt;br/&gt;
                                      act.title, act.title_short, act.family_friendly, &lt;br/&gt;
                                      o.unix_ts_begin, o.unix_ts_end, &lt;br/&gt;
                                      act.description, &lt;br/&gt;
                                      act.cost_min, act.tags, act.cost_min, act.cost_notes, act.organization, &lt;br/&gt;
                                      lo.thoroughfare, lo.address_extra, lo.locality, lo.administrative_area, lo.country_name_code, lo.postal_code,&lt;br/&gt;
                                      RANDOM() AS rand&quot;)&lt;br/&gt;
                             -&amp;gt;from(blah, blah)&lt;br/&gt;
                             -&amp;gt;where(primary key equality statements for joining)&lt;br/&gt;
                             -&amp;gt;orderBy(&apos;rand&apos;);&lt;/p&gt;

</description>
                <environment>ubuntu 64 bit, using a task in symfony</environment>
            <key id="12007">DC-889</key>
            <summary>Using RANDOM() AS rand as last field WITHOUT a comma between them works, but not randomly</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="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Oct 2010 00:22:30 +0000</created>
                <updated>Thu, 14 Oct 2010 00:22:30 +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-888] Foreign key id columns do not respect ATTR_DEFAULT_IDENTIFIER_OPTIONS</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-888</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Some time ago Jon Wage suggested that one can override the 8-byte default integer type for IDs by setting Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS in configureDoctrine (in a Symfony project), like this:&lt;/p&gt;

&lt;p&gt;  public function configureDoctrine(Doctrine_Manager $manager)&lt;/p&gt;
  {
    // Use 4-byte IDs for backwards compatibility with databases built on
    // Apostrophe 1.4, sfDoctrineGuard pre-5.0, etc. You don&apos;t need this for
    // a brand new site
    $options = $manager-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS);
    $options[&apos;length&apos;] = 4;
    $manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS, $options);
  }

&lt;p&gt;This works for primary key id columns. However it is not respected by foreign key id columns, which do not consult ATTR_DEFAULT_IDENTIFIER_OPTIONS.&lt;/p&gt;

&lt;p&gt;I looked at working around this using ATTR_DEFAULT_COLUMN_OPTIONS, however it is not type-specific. So if you set a length of 4 with that option, it applies not just to all integers but also to dates, datetimes, booleans and many other things that definitely should not be 4 bytes. &lt;/p&gt;

&lt;p&gt;The correct fix seems to be for foreign key id columns to respect ATTR_DEFAULT_IDENTIFIER_OPTIONS. &lt;/p&gt;

&lt;p&gt;Also, ATTR_DEFAULT_COLUMN_OPTIONS should probably let you specify different defaults for each column type as the length option is basically not usable in its current form. But that would not be a particularly clean solution to the foreign key id problem since limiting non-ID integers to 4 bytes should not be necessary.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;* *&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The motivation for this bug report:&lt;/p&gt;

&lt;p&gt;The new stable release of sfDoctrineGuardPlugin (for Symfony) does not specify an integer size as it formerly did, so the size of integers now defaults to 8 bytes. This breaks backwards compatibility with existing code that adds foreign key relationships to sfGuard objects like sfGuardUser, etc. Creating migrations to deal with changing this across all tables involved is quite difficult (all foreign key indexes must be dropped and recreated - doctrine:migrations-diff is unable to figure it out, understandably). &lt;/p&gt;</description>
                <environment>Any</environment>
            <key id="12006">DC-888</key>
            <summary>Foreign key id columns do not respect ATTR_DEFAULT_IDENTIFIER_OPTIONS</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="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Oct 2010 12:52:51 +0000</created>
                <updated>Wed, 13 Oct 2010 13:03:15 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                <component>Relations</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-887] disabling deep option with toArray() drops relations in result</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-887</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the toArray() on a Doctrine_Record object with the deep option set to true (default) correctly converts the whole object to an array including the relations.&lt;br/&gt;
But when the deep option is disabled the relations are not converted to array&apos;s (as expected) but they are lost, I would expect them to still be there in their original form (objects).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a fix. Another solution would be to add a flag that disables deep array conversion but enables relation persistence.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12004">DC-887</key>
            <summary>disabling deep option with toArray() drops relations in result</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="lex">Lex Brugman</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Oct 2010 11:06:39 +0000</created>
                <updated>Wed, 13 Oct 2010 11:06:39 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10825" name="doctrine_toarray-deep_fix.patch" size="742" author="lex" created="Wed, 13 Oct 2010 11:06:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-886] Doctrine should support mysql native float/double</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-886</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine does not support native mysql float/double. It always specifies float(18,2) which reduces precission to 2 decimals.&lt;br/&gt;
Although it is possible via&lt;br/&gt;
type: float(18), scale: 6&lt;br/&gt;
to enhance precission, I experience the side-effect, that for example 76.86 is now stored as 76.860001&lt;br/&gt;
This ugly formatted number shows up in every form, unless I make an effort to round every field accordingly.&lt;/p&gt;

&lt;p&gt;I think doctrine should support mysql native float/double!&lt;/p&gt;</description>
                <environment>symfony 1.4.8 / mysql</environment>
            <key id="12003">DC-886</key>
            <summary>Doctrine should support mysql native float/double</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="zevero">Severin Puschkarski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Oct 2010 10:55:24 +0000</created>
                <updated>Wed, 13 Oct 2010 11:19:54 +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-885] Building schema doesn&apos;t work when tables have cross database foreign keys (MySQL).</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-885</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When building schema using the doctrine:build-schena task from multiple databases used in our project, the import process end up with a &quot;missing classname&quot; error without building the schema.yml file.&lt;/p&gt;

&lt;p&gt;This seems to be caused by the fact that the tables contained in the databases contain foreign keys referencing the other databases tables pks.&lt;/p&gt;

&lt;p&gt;As an example we have :&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;A main database (call it portal) that contains user&apos;s informations, and many other things.&lt;/li&gt;
	&lt;li&gt;a second database that contains business informations with some tables refererecing users informations contained in the main database.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When generating the schema, and specifically on the second database step, there are no informations found for the primary keys contained main database.&lt;/p&gt;

&lt;p&gt;Digging in the import process, it seems that the issue comes from the fact that the Doctrine_Import.importSchema function creates a new definition array instance for every database encountered in the databases.yml.&lt;/p&gt;

&lt;p&gt;The correction found for this was to take the array() creation one level up before the connections traversing.&lt;/p&gt;

&lt;p&gt;original code :&lt;br/&gt;
    public function importSchema($directory, array $connections = array(), array $options = array())&lt;br/&gt;
    {&lt;br/&gt;
        $classes = array();&lt;/p&gt;

&lt;p&gt;        $manager = Doctrine_Manager::getInstance();&lt;br/&gt;
        foreach ($manager as $name =&amp;gt; $connection) {&lt;br/&gt;
          // Limit the databases to the ones specified by $connections.&lt;br/&gt;
          // Check only happens if array is not empty&lt;br/&gt;
          if ( ! empty($connections) &amp;amp;&amp;amp; ! in_array($name, $connections)) &lt;/p&gt;
{
            continue;
          }&lt;br/&gt;
&lt;br/&gt;
          $builder = new Doctrine_Import_Builder();&lt;br/&gt;
          $builder-&amp;gt;setTargetPath($directory);&lt;br/&gt;
          $builder-&amp;gt;setOptions($options);&lt;br/&gt;
&lt;br/&gt;
          $definitions = array(); // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; STAYING THERE CAUSES THE &quot;MISSING CLASSNAME&quot; ERROR&lt;br/&gt;
&lt;br/&gt;
          foreach ($connection-&amp;gt;import-&amp;gt;listTables() as $table) {&lt;br/&gt;
......&lt;br/&gt;
&lt;br/&gt;
modified code :&lt;br/&gt;
&lt;br/&gt;
    public function importSchema($directory, array $connections = array(), array $options = array())&lt;br/&gt;
    {&lt;br/&gt;
        $classes = array();&lt;br/&gt;
&lt;br/&gt;
        $manager = Doctrine_Manager::getInstance();&lt;br/&gt;
        $definitions = array(); // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;PUT HERE&lt;br/&gt;
&lt;br/&gt;
        foreach ($manager as $name =&amp;gt; $connection) {&lt;br/&gt;
          // Limit the databases to the ones specified by $connections.&lt;br/&gt;
          // Check only happens if array is not empty&lt;br/&gt;
          if ( ! empty($connections) &amp;amp;&amp;amp; ! in_array($name, $connections)) {            continue;          }

&lt;p&gt;          $builder = new Doctrine_Import_Builder();&lt;br/&gt;
          $builder-&amp;gt;setTargetPath($directory);&lt;br/&gt;
          $builder-&amp;gt;setOptions($options);&lt;/p&gt;

&lt;p&gt;          foreach ($connection-&amp;gt;import-&amp;gt;listTables() as $table) {&lt;br/&gt;
.......&lt;/p&gt;</description>
                <environment>Windows XP SP3, Apache 2, PHP 5.3, MySQL 5.1.36, Symfony 1.4.8.</environment>
            <key id="11998">DC-885</key>
            <summary>Building schema doesn&apos;t work when tables have cross database foreign keys (MySQL).</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="fabrice.agnello">Fabrice Agnello</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Oct 2010 04:52:04 +0000</created>
                <updated>Tue, 12 Oct 2010 04:52:04 +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-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-882] Doctrine Collection FromArray doesn&apos;t adhere to KeyColumn</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-882</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the following in the base class:&lt;/p&gt;

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

&lt;p&gt;Then executing a query to array the indexes of the entity are not that of the class field:&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;array(
 0 =&amp;gt; ..
 1 =&amp;gt; ...
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;fix:&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;/**
     * Populate a Doctrine_Collection from an array of data
     *
     * @param string $array 
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function fromArray($array, $deep = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
    {
        $data = array();
        foreach ($array as $rowKey =&amp;gt; $row) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;[$rowKey]-&amp;gt;fromArray($row, $deep);
        }
    }
&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;/**
     * Populate a Doctrine_Collection from an array of data
     *
     * @param string $array 
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function fromArray($array, $deep = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
    {
        $data = array();
        $keyColumn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;keyColumn;
        foreach ($array as $rowKey =&amp;gt; $row) {
            $rowKey = $keyColumn AND isset($row[$keyColumn]) ? $row[$keyColumn] : $rowKey;
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;[$rowKey]-&amp;gt;fromArray($row, $deep);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11992">DC-882</key>
            <summary>Doctrine Collection FromArray doesn&apos;t adhere to KeyColumn</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>Sat, 9 Oct 2010 11:47:46 +0000</created>
                <updated>Sat, 9 Oct 2010 11:48:38 +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-881] Doctrine_Manager::parsePdoDsn() doesn&apos;t work properly [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-881</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Manager::parsePdoDsn(&apos;dblib:host=127.0.0.1:1433;dbname=foo&apos;) does not return proper results.&lt;/p&gt;

&lt;p&gt;patch and test case @ github&lt;/p&gt;</description>
                <environment></environment>
            <key id="11989">DC-881</key>
            <summary>Doctrine_Manager::parsePdoDsn() doesn&apos;t work properly [+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="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Oct 2010 12:46:04 +0000</created>
                <updated>Fri, 8 Oct 2010 12:46:04 +0000</updated>
                                    <version>1.2.3</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-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-878] cannot access the version models using object-&gt;CLASSNAMEVersion in v1.2.3</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-878</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Doctrine 1.1 if I said&lt;/p&gt;

&lt;p&gt;$vAaaaa = Doctrine::getTable(&apos;Aaaaa&apos;)-&amp;gt;find(1);&lt;br/&gt;
print_r( $vAaaaa-&amp;gt;AaaaaVersion ); // print_r( $vAaaaa-&amp;gt;AaaaaVersion&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;toArray() );&lt;/p&gt;

&lt;p&gt;then I got the corresponding version model/array. Our application is using this nice behaviour at several places. But then the project got upgraded to Doctrine 1.2.3, and since then it dies saying&lt;/p&gt;

&lt;p&gt;Unknown record property / related component &quot;UserVersion&quot; on &quot;User&quot; on line 55 of file /home/roland/www/cabcall/library/Doctrine/Doctrine/Record/Filter/Standard.php&lt;br/&gt;
#0 /home/roland/www/cabcall/library/Doctrine/Doctrine/Record.php(1395): Doctrine_Record_Filter_Standard-&amp;gt;filterGet(Object(User), &apos;UserVersion&apos;)&lt;br/&gt;
#1 /home/roland/www/cabcall/library/Doctrine/Doctrine/Record.php(1350): Doctrine_Record-&amp;gt;_get(&apos;UserVersion&apos;, true)&lt;br/&gt;
#2 /home/roland/www/cabcall/library/Doctrine/Doctrine/Access.php(72): Doctrine_Record-&amp;gt;get(&apos;UserVersion&apos;)&lt;br/&gt;
#3 /home/roland/www/cabcall/application/controllers/TestController.php(12): Doctrine_Access-&amp;gt;__get(&apos;UserVersion&apos;)&lt;br/&gt;
#4 /home/roland/www/cabcall/library/Zend/Controller/Action.php(513): TestController-&amp;gt;indexAction()&lt;br/&gt;
#5 /home/roland/www/cabcall/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action-&amp;gt;dispatch(&apos;indexAction&apos;)&lt;br/&gt;
#6 /home/roland/www/cabcall/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))&lt;br/&gt;
#7 /home/roland/www/cabcall/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&amp;gt;dispatch()&lt;br/&gt;
#8 /home/roland/www/cabcall/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()&lt;br/&gt;
#9 /home/roland/www/cabcall/public/index.php(64): Zend_Application-&amp;gt;run()&lt;br/&gt;
#10 &lt;/p&gt;
{main}

&lt;p&gt;Here is the exact example I tried before posting:&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;
Aaaaa:
    tableName: aaaaa
    columns:
        something:
            type: integer(8)
            unsigned: false
            notnull: true
            default: 0
    actAs:
        Versionable:
            versionColumn: version
            className: %CLASS%Version
            auditLog: true
            deleteVersions: true


class AaaaaTable extends Doctrine_Table
{
    /**
     * Returns an instance of this class.
     *
     * @return object AaaaaTable
     */
    public static function getInstance()
    {
        return Doctrine_Core::getTable(&apos;Aaaaa&apos;);
    }
}


abstract class BaseAaaaa extends Doctrine_Record
{

    public function setTableDefinition()
    {
        $this-&amp;gt;setTableName(&apos;aaaaa&apos;);
        $this-&amp;gt;hasColumn(&apos;something&apos;, &apos;integer&apos;, 8, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; true,
             &apos;default&apos; =&amp;gt; 0,
             &apos;length&apos; =&amp;gt; &apos;8&apos;,
             ));

        $this-&amp;gt;option(&apos;type&apos;, &apos;INNODB&apos;);
        $this-&amp;gt;option(&apos;collate&apos;, &apos;utf8_general_ci&apos;);
        $this-&amp;gt;option(&apos;charset&apos;, &apos;utf8&apos;);
    }

    public function setUp()
    {
        parent::setUp();
        $versionable0 = new Doctrine_Template_Versionable(array(
             &apos;versionColumn&apos; =&amp;gt; &apos;version&apos;,
             &apos;className&apos; =&amp;gt; &apos;%CLASS%Version&apos;,
             &apos;auditLog&apos; =&amp;gt; true,
             &apos;deleteVersions&apos; =&amp;gt; true
             ));

        $this-&amp;gt;actAs($versionable0);
    }

}


class Aaaaa extends BaseAaaaa
{

}


/*
$vAaaaa = New Aaaaa;
$vAaaaa-&amp;gt;something = 1;
$vAaaaa-&amp;gt;save();
*/

$vAaaaa = Doctrine::getTable(&apos;Aaaaa&apos;)-&amp;gt;find(1);

print_r( $vAaaaa-&amp;gt;AaaaaVersion );

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP Version 5.2.10-2ubuntu6.5 ; Suhosin Patch 0.9.7 ; Ubuntu 9.10 2.6.31-22-generic x86_64 ; Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.5 with Suhosin-Patch  ; Doctrine 1.2.3</environment>
            <key id="11969">DC-878</key>
            <summary>cannot access the version models using object-&gt;CLASSNAMEVersion in v1.2.3</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="hroland">Roland Huszti</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 11:21:45 +0000</created>
                <updated>Thu, 7 Oct 2010 06:14:53 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14508" author="hroland" created="Fri, 1 Oct 2010 05:18:41 +0000"  >&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 OSS_Resource_Doctrine extends Zend_Application_Resource_ResourceAbstract
{
    /**
     * Holds the Doctrine instance
     *
     * @var
     */
    protected $_doctrine;


    public function init()
    {
        // Return Doctrine so bootstrap will store it in the registry
        return $this-&amp;gt;getDoctrine();
    }


    public function getDoctrine()
    {
        if ( null === $this-&amp;gt;_doctrine )
        {
            // Get Doctrine configuration options from the application.ini file
            $doctrineConfig = $this-&amp;gt;getOptions();

            require_once &apos;Doctrine.php&apos;;

            $loader = Zend_Loader_Autoloader::getInstance();
            $loader-&amp;gt;pushAutoloader( array( &apos;Doctrine&apos;, &apos;autoload&apos; ) );
            $loader-&amp;gt;pushAutoloader( array( &apos;Doctrine&apos;, &apos;modelsAutoload&apos; ) );

            $manager = Doctrine_Manager::getInstance();

            $manager-&amp;gt;setAttribute( Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE );
            $manager-&amp;gt;setAttribute( Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true );
            $manager-&amp;gt;setAttribute( Doctrine::ATTR_USE_DQL_CALLBACKS, true );

            $manager-&amp;gt;setCollate( &apos;utf8_unicode_ci&apos; );
            $manager-&amp;gt;setCharset( &apos;utf8&apos; );

            Doctrine::loadModels( $doctrineConfig[&apos;models_path&apos;] );

            $db_profiler = new Doctrine_Connection_Profiler();

            $manager-&amp;gt;openConnection( $doctrineConfig[&apos;connection_string&apos;] );
            $manager-&amp;gt;connection()-&amp;gt;setListener( $db_profiler );

            $manager-&amp;gt;connection()-&amp;gt;setCollate(&apos;utf8_unicode_ci&apos;);
            $manager-&amp;gt;connection()-&amp;gt;setCharset(&apos;utf8&apos;);

            Zend_Registry::set( &apos;db_profiler&apos;, $db_profiler );

            $this-&amp;gt;_doctrine = $manager;
        }

        return $this-&amp;gt;_doctrine;
    }

    /**
     * Set the classes $_doctrine member
     *
     * @param $doctrine The object to set
     */
    public function setDoctrine( $doctrine )
    {
        $this-&amp;gt;_doctrine = $doctrine;
    }

}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14543" author="hroland" created="Thu, 7 Oct 2010 06:14:53 +0000"  >&lt;p&gt;To have this very nice and useful feature, I had to add these lines by hand to my audited table&apos;s models. Not to the base models, those are overwritten every time you migrate to a new version! Also, in the YAML file you can set the classname to whatever you want, so you need to use the same name in the model, too!&lt;/p&gt;

&lt;p&gt;MODEL&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 XYZ extends BaseXYZ

{


    public function setUp()

    {

        parent::setUp();

        $this-&amp;gt;hasMany(&apos;XYZVersion&apos;, array( &apos;local&apos; =&amp;gt; &apos;id&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        // you may get the classname from the model, so then you only need to copy-paste the exact same piece of setUp() code into every model you want to
    }


    . . .
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;YAML&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:
        Versionable:
            versionColumn: version
            className: %CLASS%Version    # this is the default, User -&amp;gt; UserVersion , Address -&amp;gt; AddressVersion, etc.
            auditLog: true
            deleteVersions: true
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-877] Hydrator fatal error: Found non-unique key mapping named &apos;lang&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-877</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;You could find the ticket&apos;s test case in the attachments.&lt;/p&gt;</description>
                <environment>PHP 5.2.13</environment>
            <key id="11967">DC-877</key>
            <summary>Hydrator fatal error: 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="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="fruit">Ilya Sabelnikov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 10:08:55 +0000</created>
                <updated>Fri, 22 Oct 2010 06:04:32 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10829" name="Ticket_DC877_TestCase.php" size="4859" author="fruit" created="Fri, 22 Oct 2010 06:04:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-876] Basic Request return one element.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-876</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;h4&gt;&lt;a name=&quot;itrytogetallpreferenceswithanIdUserspecified.&quot;&gt;&lt;/a&gt;i try to get all preferences with an IdUser specified.&lt;/h4&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;UserHasPreference:
  connection: hopscore
  actAs:
    I18n:
      fields: [value]
    Timestampable:
      created:
        name: created_at
        type: timestamp
        format: Y-m-d H:i:s
  columns:
    idUserHasPreference:
      name: idUserHasPreference as id
      type: integer(4)
      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;
    UsersIdUser:
      name: UsersIdUser as idUser
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    PreferencesIdPreference:
      name: PreferencesIdPreference as idPreference
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    MatchLinksMatchLinkId:
      name: MatchLinksMatchLinkId as MatchLinkId
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    value:
      type: string(100)
  relations:
    Users:
      class: User
      local: idUser
      foreign: id
      type: one
    Preferences:
      class: Preference
      local: idPreference
      foreign: id
      type: one
    MatchLinks:
      class: MatchLink
      local: MatchLinkId
      foreign: id
      type: one
  options:
    collate: utf8_unicode_ci
    charset: utf8
&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;Doctrine Request&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$preferences = Doctrine_Query::create()
		-&amp;gt;select(&apos;uhp.idPreference as idPref&apos;)
		-&amp;gt;addSelect(&apos;uhpt.value as value&apos;)
		-&amp;gt;addSelect(&apos;uhp.MatchLinkId as idItem&apos;)
		-&amp;gt;from(&apos;UserHasPreference uhp&apos;)
		-&amp;gt;innerJoin(&apos;uhp.Translation uhpt&apos;)
		-&amp;gt;where(&apos;uhp.idUser = ?&apos;, intval($idUser))
		-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);
	    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $preferences;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With $preferences-&amp;gt;getSqlQuery(); and getParams(); and report this SQL query in phpmydadmin.&lt;br/&gt;
With SQL i have 13 elements. But in my object &lt;b&gt;$preference&lt;/b&gt; i have one element (Doctrine::HYDRATE_ARRAY)&lt;br/&gt;
With &quot;Doctrine::HYDRATE_NONE&quot;,  i have 13 elements as SQL query.&lt;/p&gt;</description>
                <environment>Windows XP Pro. Service Pack 3, Eclipe PDT, Doctrine 1.2.3,  Php 5.2.11</environment>
            <key id="11966">DC-876</key>
            <summary>Basic Request return one element.</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="rudy.bruneau">rudybruneau</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 08:47:10 +0000</created>
                <updated>Tue, 5 Oct 2010 08:08:38 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14529" author="eirikhm" created="Tue, 5 Oct 2010 08:08:38 +0000"  >&lt;p&gt;I have the same problem, and I think this is related to the select statement. It seems that a select statement where all fields are aliased will cause this behavior. A simple work-around is to select one field without aliasing it. &lt;/p&gt;


&lt;p&gt;Code for reproducing / work-around:&lt;/p&gt;

&lt;p&gt;$query = Doctrine_Query::create();        &lt;br/&gt;
$query-&amp;gt;from(&apos;Results r&apos;);&lt;br/&gt;
$query-&amp;gt;select(&apos;p.id as myid, r.value as foo&apos;);&lt;br/&gt;
$query-&amp;gt;innerJoin(&apos;r.Profil p on (r.pid=123)&apos;);&lt;br/&gt;
$results = $query-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;count($results) = 1&lt;/p&gt;


&lt;p&gt;$query = Doctrine_Query::create();        &lt;br/&gt;
$query-&amp;gt;from(&apos;Results r&apos;);&lt;br/&gt;
$query-&amp;gt;select(&apos;p.id as myid, r.value&apos;);&lt;br/&gt;
$query-&amp;gt;innerJoin(&apos;r.Profil p on (r.pid=123)&apos;);&lt;br/&gt;
$results = $query-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;count($results) = 250&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10817" name="image.jpg" size="27934" author="rudy.bruneau" created="Thu, 30 Sep 2010 08:47:10 +0000" />
                </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-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-873] Update Execute Params do not persist </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-873</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have been trying to update numerous records with the one doctrine_query object (which could be my problem) and passing the query execute params to persist to the dbase. eg&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;update(&apos;TdPackageType pt&apos;)&lt;br/&gt;
            -&amp;gt;set(&apos;pt.name&apos;, &apos;?&apos;)&lt;br/&gt;
            -&amp;gt;set(&apos;pt.group_type_id&apos;, &apos;?&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;pt.id = ?&apos;)&lt;br/&gt;
            ;&lt;/p&gt;

&lt;p&gt;Then iterating over an array of values, passing the required values to the execute method eg&lt;br/&gt;
foreach($foobars as $foobar) {&lt;br/&gt;
   $q-&amp;gt;execute(array($foobar&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;, $foobar&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, $foobar&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;));&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;I thought this the best way by creating only the one query instance and then assigning the vars as required. Trouble being, the data did not persist? I had no errors returned from Doctrine - eg I had the correct number of matched params - but the update would not update. To move on I ended up instantiating a new query object each time I iterated over my array of data values. eg&lt;/p&gt;

&lt;p&gt;foreach($foobars as $foobar) {&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;update(&apos;TdPackageType pt&apos;)&lt;br/&gt;
            -&amp;gt;set(&apos;pt.name&apos;, &apos;?&apos;, $foo&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;)&lt;br/&gt;
            -&amp;gt;set(&apos;pt.group_type_id&apos;, &apos;?&apos;, $foo&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;)&lt;br/&gt;
            -&amp;gt;where(&apos;pt.id = ?&apos;, $foo&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;)&lt;br/&gt;
            ;&lt;/p&gt;

&lt;p&gt;            $q-&amp;gt;execute();&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;The values did then persist correctly to the dbase? Am I missing something really fundamental here? eg I would have thought the first code struct was a much better design to re-use the one query object. Or is it as silly as me not adding a hydration method to the execute method?&lt;/p&gt;

&lt;p&gt;Any all help appreciated.&lt;br/&gt;
Thanks&lt;br/&gt;
Kyle&lt;/p&gt;</description>
                <environment>LAMP php5.2.6 Symfony 1.4 </environment>
            <key id="11957">DC-873</key>
            <summary>Update Execute Params do not persist </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="kylerclarke">Kyle Clarke</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Sep 2010 20:57:19 +0000</created>
                <updated>Sun, 26 Sep 2010 20:57:19 +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-871] When importing fixtures some times the fixtures will be loaded in the wrong order causing broken foreign key relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-871</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I recently encountered a problem when importing fixtures. I was ending up with invalid foreign key constraints due to the fact that the fixtures were importing in the wrong order. I tracked down the problem and figured out that the method Doctrine_Connection_UnitOfWork::buildFlushTree, while a truly impressive piece of sorting logic still some times still gets the order of the classes wrong in its end result.&lt;/p&gt;

&lt;p&gt;I realized that all it needed though was a second shot at reordering the list &amp;#8211; in other words it needed to exhaustively try to order the list until it found that everything was in the right order.&lt;/p&gt;

&lt;p&gt;I put in a for loop in this method that will keep running until no order changes occurred or until a max number of attempts have been reached. The max number of attempts I added as a property of Doctrine_Connection called: maxBuildFlushTreeOrderAttempts.&lt;/p&gt;

&lt;p&gt;This has solved my problem. I wouldn&apos;t be surprised if this was a common issue.&lt;/p&gt;

&lt;p&gt;I will post my patch into this thread.&lt;/p&gt;

&lt;p&gt;Hope all is well.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="11935">DC-871</key>
            <summary>When importing fixtures some times the fixtures will be loaded in the wrong order causing broken foreign key 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="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 22:26:01 +0000</created>
                <updated>Mon, 20 Sep 2010 22:34:45 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14426" author="willf1976" created="Mon, 20 Sep 2010 22:34:45 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10805" name="DC_871_fix.patch" size="10326" author="willf1976" created="Mon, 20 Sep 2010 22:34:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-870] NestedSet not moving children of child nodes correctly</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-870</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The best way I can explain the issue is with code. Please see the below:&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

$root = new Test();
$root-&amp;gt;name = &apos;1&apos;;
$root-&amp;gt;save();

// Create root node
$tree = Doctrine::getTable(&apos;Test&apos;)-&amp;gt;getTree();
$tree-&amp;gt;createRoot($root);

// Create child node
$child1 = new Test();
$child1-&amp;gt;name = &apos;2&apos;;
$child1-&amp;gt;save();

// Add child
$child1-&amp;gt;getNode()-&amp;gt;moveAsLastChildOf($root);

// Create child node
$child2 = new Test();
$child2-&amp;gt;name = &apos;3&apos;;
$child2-&amp;gt;save();

// Add child2 as node of child1
$child2-&amp;gt;getNode()-&amp;gt;moveAsLastChildOf($child1);

// Create child node
$child3 = new Test();
$child3-&amp;gt;name = &apos;4&apos;;
$child3-&amp;gt;save();

// Add child3 as node of child2
$child3-&amp;gt;getNode()-&amp;gt;moveAsLastChildOf($child2);

// Add another root just to be nice
$root2 = new Test();
$root2-&amp;gt;name = &apos;5&apos;;
$root2-&amp;gt;save();

// Create root node
$tree-&amp;gt;createRoot($root2);

/**
 * Now we have the following tree (Each &apos;-&apos; indicates 1 level):
 * 1
 * - 2
 * - - 3
 * - - - 4
 * 5
 */

/**
 * Lets say I want to move node &apos;3&apos; to be a root.
 * With this I assume that all of the current nodes
 * children will be moved with it:
 */
$tree-&amp;gt;createRoot(child2);

/**
 * Now the (implied) tree should look like this:
 * 1
 * - 2
 * 3
 * - 4
 * 5
 * 
 * Instead, the tree actually looks like this:
 * 1
 * - 2
 * - - - 4
 * 3
 * 5
 */

/**
 * I will now demostrate incorrect moving back of child nodes.
 */
$child2-&amp;gt;getNode()-&amp;gt;moveAsLastChildOf($child1);
/**
 * Now the tree should go back to looking like this:
 * 1
 * - 2
 * - - 3
 * - - - 4
 * 5
 * 
 * But the tree now looks like this:
 * 1
 * - 2
 * - - - 4
 * - - 3
 * 5
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 10.04 x64&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11933">DC-870</key>
            <summary>NestedSet not moving children of child nodes correctly</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="theashman">Ashley Broadley</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 11:25:54 +0000</created>
                <updated>Mon, 20 Sep 2010 11:53:27 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14420" author="theashman" created="Mon, 20 Sep 2010 11:28:02 +0000"  >&lt;p&gt;Fixing code spacing&lt;/p&gt;</comment>
                    <comment id="14421" author="theashman" created="Mon, 20 Sep 2010 11:49:04 +0000"  >&lt;p&gt;I have also noticed that moving a root node back into its original position as a child also corrupts the tree. I have added an example to the original post&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-869] calling getLastModified() after saving the object without any modifications returns the last modified fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-869</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;_resetModified() function in Record.php fails to reset $this-&amp;gt;_lastModified the second time the object is saved. &lt;/p&gt;
</description>
                <environment>symfony-1.4.6</environment>
            <key id="11930">DC-869</key>
            <summary>calling getLastModified() after saving the object without any modifications returns the last modified fields</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>Fri, 17 Sep 2010 09:02:08 +0000</created>
                <updated>Fri, 17 Sep 2010 09:02:08 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </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-866] Bug In Debian &quot;Can&apos;t parse dsn..&quot;!</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-866</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;config dsn: sqlite:///root/db3.db&lt;/p&gt;

&lt;p&gt;i find parse_url will cause the problem&lt;/p&gt;

&lt;p&gt;------------------&lt;br/&gt;
 $dsn = str_replace(&quot;////&quot;, &quot;/&quot;, $dsn);&lt;br/&gt;
 $dsn = str_replace(&quot;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&quot;, &quot;/&quot;, $dsn);&lt;br/&gt;
$dsn = preg_replace(&quot;/\/\/\/(.*):\//&quot;, &quot;//$1:/&quot;, $dsn);&lt;/p&gt;

&lt;p&gt;this fix will be correct in windows ,because dsn is sqlite://C:/aa/wafdb.db3&lt;/p&gt;

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

&lt;p&gt;but in debian it will be fail.&lt;/p&gt;</description>
                <environment>Debian4  PHP 5.3.1</environment>
            <key id="11915">DC-866</key>
            <summary>Bug In Debian &quot;Can&apos;t parse dsn..&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="stc6895">sonic wang</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Sep 2010 07:44:46 +0000</created>
                <updated>Wed, 15 Sep 2010 09:10:03 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-865] Models that extend a baseclass other than Doctrine_Record treat that baseclass as if it were a model</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-865</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We recently made an extended version of Docrtine_Record which has some functionality that is specific to our project and we switched all our models to use this baseclass by setting the cli option: generate_models_options:baseClassName&lt;/p&gt;

&lt;p&gt;We found that when we rebuilt our db this base class was being treated as it were a model (even though its an abstract class). This was causing some errors during our build and a table based on the name of the baseclass was being created.&lt;/p&gt;

&lt;p&gt;I tracked the problem down to line 310 of Doctrine_Table where the do loop was only breaking for a class named &quot;Doctrine_Record&quot;.&lt;/p&gt;

&lt;p&gt;It seemed to make more sense to me to have this loop break for any abstract class, so I copied the technique used to check for abstract classes from Doctrine_Core Line 798. This broke a lot of tests however so due to time constraints I went with a simpler fix &amp;#8211; instead I just changed the code that checks if the class is named &quot;Doctrine_Record&quot; to be a regular expression that checks to see if the class name starts with &quot;Doctrine_Record&quot; optionally followed by an underscore + more text in the class name.&lt;/p&gt;

&lt;p&gt;This has fixed my issue and should let people make extensions of doctrine record which they can use as a baseclass provided that their class names indicate that they are extending Doctrine_Record.&lt;/p&gt;

&lt;p&gt;The only problem I can see arising from this if some users have made models that they have named starting with &quot;Doctrine_Record&quot;, but that seems like it would be an odd thing to do so this probably it won&apos;t be an issue.&lt;/p&gt;

&lt;p&gt;I could however look more closely into detecting abstract classes if this would make my changes significantly more useful.&lt;/p&gt;

&lt;p&gt;Please see attached patch.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Windows</environment>
            <key id="11912">DC-865</key>
            <summary>Models that extend a baseclass other than Doctrine_Record treat that baseclass as if it were a model</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="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Sat, 11 Sep 2010 19:42:56 +0000</created>
                <updated>Sat, 11 Sep 2010 19:47:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14345" author="willf1976" created="Sat, 11 Sep 2010 19:47:56 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10791" name="DC_865_fix.patch" size="531" author="willf1976" created="Sat, 11 Sep 2010 19:47:56 +0000" />
                </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-862] INNER JOIN example is same as previous LEFT JOIN example</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-862</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I was reading the &quot;JOIN syntax&quot; section of the documentation. The docs first talk about how the default join type is LEFT JOIN and an example is presented. Next, INNER JOINS are discussed, but the example is the same left join example used previously. Am I misunderstanding the flow of the document?&lt;/p&gt;</description>
                <environment>&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#join-syntax&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#join-syntax&lt;/a&gt;</environment>
            <key id="11896">DC-862</key>
            <summary>INNER JOIN example is same as previous LEFT JOIN example</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="robertom@sas.upenn.edu">Roberto Mansfield</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Sep 2010 15:55:21 +0000</created>
                <updated>Wed, 8 Sep 2010 15:55:21 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-859] Diff generator doesn&apos;t load models from specified paths</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-859</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Adding simple testcase, I have two version of PHP model, they differ in primary key.&lt;br/&gt;
version 0 has: stateid = Integer (classic id number)&lt;br/&gt;
version 1 has: stateid = char(2) (fixed length)&lt;/p&gt;

&lt;p&gt;After I run Doctrine_Core::generateMigrationsFromDiff, doctrine will load only the integer model and compare it, so no difference is detected and no migration script created.&lt;/p&gt;

&lt;p&gt;I&apos;m attaching simple project where it doesn&apos;t work (adjust please LIBS_DIR definition for your setup).&lt;/p&gt;

&lt;p&gt;From current codepath I would say when YAML is used, the from/to classes get prefixes.&lt;br/&gt;
When php model directories are used, the classes don&apos;t have have prefixes and their names are identical.&lt;br/&gt;
I think this may be one part of problem.&lt;/p&gt;

&lt;p&gt;&lt;del&gt;Trying to generate YAML files instead from php models lead to migration script dropping all tables. (looks like it&apos;s already reported as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-755&quot; title=&quot;CLONE [DC-558] incorrect handling of MODEL_CLASS_PREFIX causes Doctrine_Migration_Diff to drop the whole database when working from YAML (Regression)&quot;&gt;DC-755&lt;/a&gt;)&lt;/del&gt;&lt;br/&gt;
&lt;em&gt;I did call both yaml generation and diff tool in the same script, which doesn&apos;t work. When I generate schema in other script and call diff tool on schemas later, it works.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Please, I&apos;m willing to work on fix, but give me some ideas what should I try. (I thought about adding prefixes into php model files after they are copied into temp directory (to simulate YAML behavior), or bend the loading of models later, but I&apos;m not sure the rest of code would cope with such fix, or there&apos;s more to do.&lt;/p&gt;</description>
                <environment>WinXP, PHP 5.3.3</environment>
            <key id="11887">DC-859</key>
            <summary>Diff generator doesn&apos;t load models from specified paths</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="ped">Peter Helcmanovsky</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Sep 2010 10:50:54 +0000</created>
                <updated>Wed, 8 Sep 2010 07:21:42 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14284" author="ped" created="Mon, 6 Sep 2010 10:53:16 +0000"  >&lt;p&gt;Another potentional fix is to not copy model files into temp dir, but generate YAML from them, and then generate prefixed models trough YAML code path.&lt;br/&gt;
Doesn&apos;t sound effective, but as long as YAML path will be fixed, it may work?&lt;/p&gt;</comment>
                    <comment id="14306" author="ped" created="Wed, 8 Sep 2010 07:21:28 +0000"  >&lt;p&gt;One more idea for how it can be done ( ? ):&lt;br/&gt;
to create temporary php script in temp dir together with &lt;em&gt;from&lt;/em&gt; model files, run it, let it generate $fromInfo data, serialize them on disk, do the same with &lt;em&gt;to&lt;/em&gt; models and get another serialized data, then load those files into $fromInfo and $toInfo and do the actual diffing.&lt;/p&gt;

&lt;p&gt;The point is that by running the small temporary script in new process it would be able to load model files from disk as classes without prefixing/changing them, create the $info data, and exit, so the newer classes with same name can be loaded again in the another new thread. The diff then has to live with serialized $info data only without loading model classes.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10775" name="Doc1_migration_model_loading_bug.zip" size="2700" author="ped" created="Mon, 6 Sep 2010 10:50:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-858] Custom Behaviors/Templates cause autoloader errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-858</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When emitting Behaviors from schema files (YAML in our case),&lt;br/&gt;
Doctrine expects a shortened class name of the behavior (e.g. &apos;Timestampable&apos;) instead of the full class name:&lt;br/&gt;
The string &apos;Doctrine_Template_&apos; is automatically prepended and a check (class_exists()) is made.&lt;/p&gt;

&lt;p&gt;This is leading to possible autoloader errors (in our case: Zend autoloader does not find our custom behavior):&lt;/p&gt;


&lt;p&gt;YAML:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
Person:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;SoftDelete, My_Doctrine_Template_CustomBehavior&amp;#93;&lt;/span&gt;&lt;br/&gt;
  ...&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;&apos;SoftDelete&apos; is the short class name of &apos;Doctrine_Template_SoftDelete&apos;.&lt;br/&gt;
&apos;My_Doctrine_Template_CustomBehavior&apos; is the full class name and shall not be prefixed with &apos;Doctrine_Template_&apos;.&lt;/p&gt;


&lt;p&gt;The corresponding section responsible for this bug:&lt;/p&gt;

&lt;p&gt;File: Doctrine/Import/Builder.php&lt;br/&gt;
Lines: 702-704, function emitAssign()&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
if (class_exists(&quot;Doctrine_Template_$name&quot;, true)) &lt;/p&gt;
{
    $classname = &quot;Doctrine_Template_$name&quot;;
}
}}&lt;br/&gt;
&lt;br/&gt;
There is no test whether a full class name is given as $name, so there is no way to add custom behaviors to records without the autoloader checking for a non-existing class and spilling errors/notices.&lt;br/&gt;
With the above YAML schema file it would test for class_exists(&apos;Doctrine_Template_My_Doctrine_Template_CustomBehavior&apos;), which is obviously not existing.&lt;br/&gt;
&lt;br/&gt;
a quick fix could look like this:&lt;br/&gt;
&lt;br/&gt;
{{&lt;br/&gt;
if (strpos($name, &apos;_&apos;) === false // is this a shortened name of an original Doctrine behaviour class?&lt;br/&gt;
            &amp;amp;&amp;amp; class_exists(&quot;Doctrine_Template_$name&quot;, true)) {    $classname = &quot;Doctrine_Template_$name&quot;;}}}

&lt;p&gt;Another alternative (but breaking compatability with existing schema files) would be to &lt;em&gt;always&lt;/em&gt; use full class names instead of fancy short names.&lt;/p&gt;


&lt;p&gt;Interestingly enough, this error is only occuring with Zend autoloader on Windows systems, but can be easily avoided with the fix like suggested above.&lt;/p&gt;</description>
                <environment>Windows Vista/7&lt;br/&gt;
PHP 5.3.1 - 5.3.3&lt;br/&gt;
Zend autoloader&lt;br/&gt;
not occuring under Ubuntu 10.05 / MacOSX</environment>
            <key id="11883">DC-858</key>
            <summary>Custom Behaviors/Templates cause autoloader 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="apric">apric</reporter>
                        <labels>
                    </labels>
                <created>Sat, 4 Sep 2010 11:38:30 +0000</created>
                <updated>Sat, 4 Sep 2010 19:09:33 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14277" author="jwage" created="Sat, 4 Sep 2010 19:09:33 +0000"  >&lt;p&gt;I believe this is because the Zend autoloader does not fail silently by default. I think it can be configured to check if the file exists and not throw any errors.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </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-854] having not work as expected and described</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-854</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;    $this-&amp;gt;q1 = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;select(&apos;m.questionaire&apos;)&lt;br/&gt;
      -&amp;gt;addSelect(&apos;m.aszero&apos;)&lt;br/&gt;
      -&amp;gt;addSelect(&apos;COUNT(f.id) as bref&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;machine m&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;m.relations r ON r.machine_id=m.id&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;r.ref f ON f.id=r.ref_id AND f.part_number LIKE &quot;B%&quot;&apos;)&lt;br/&gt;
      -&amp;gt;groupBy(&apos;m.questionaire&apos;)&lt;br/&gt;
      -&amp;gt;having(&apos;bref=0&apos;)&lt;br/&gt;
    ;&lt;br/&gt;
is producing &lt;/p&gt;

&lt;p&gt;&quot;SELECT m.id AS m_&lt;em&gt;id, m.questionaire AS m&lt;/em&gt;&lt;em&gt;questionaire, m.aszero AS m&lt;/em&gt;&lt;em&gt;aszero, COUNT(r2.id) AS r2&lt;/em&gt;_0 FROM machine m LEFT JOIN relation r ON (r.machine_id = m.id) LEFT JOIN ref r2 ON ((r2.id = r.ref_id AND r2.part_number LIKE &quot;B%&quot;)) GROUP BY m.questionaire HAVING bref=0 &quot;&lt;/p&gt;


&lt;p&gt;but it should be &lt;/p&gt;

&lt;p&gt;&quot;SELECT m.id AS m_&lt;em&gt;id, m.questionaire AS m&lt;/em&gt;&lt;em&gt;questionaire, m.aszero AS m&lt;/em&gt;&lt;em&gt;aszero, COUNT(r2.id) AS r2&lt;/em&gt;&lt;em&gt;0 FROM machine m LEFT JOIN relation r ON (r.machine_id = m.id) LEFT JOIN ref r2 ON ((r2.id = r.ref_id AND r2.part_number LIKE &quot;B%&quot;)) GROUP BY m.questionaire HAVING r2&lt;/em&gt;_0=0 &quot;&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;http://www.doctrine-project.org/docu&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docu&lt;/a&gt; mentation/manual/1_1/en/dql-doctrine-query-language%3Agroup-by,-having-clauses&lt;/p&gt;

&lt;p&gt;With kind regards&lt;/p&gt;

&lt;p&gt;Petronel&lt;/p&gt;

&lt;p&gt;I use symfony 1.4 and not sure if doctrine is 1...&lt;/p&gt;</description>
                <environment></environment>
            <key id="11871">DC-854</key>
            <summary>having not work as expected and described</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="malutanpetronel">Petronel MALUTAN</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Sep 2010 06:48:13 +0000</created>
                <updated>Thu, 2 Sep 2010 06:48:13 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-853] I am using symfony 1.4</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-853</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;   $q1 = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;select(&apos;m.questionaire, COUNT(f.id) AS bref&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;machine m&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;m.relations r ON r.machine_id=m.id&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;r.ref f ON r.ref_id=f.id AND f.part_number LIKE &quot;B%&quot;&apos;)&lt;br/&gt;
      -&amp;gt;groupBy(&apos;m.questionaire&apos;)&lt;br/&gt;
    ;&lt;br/&gt;
    $r1 =  $q1-&amp;gt;execute();&lt;br/&gt;
    $q1q = $q1-&amp;gt;getSqlQuery();&lt;/p&gt;

&lt;p&gt;    $q2 = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;select(&apos;m.questionaire, COUNT(f.id) AS nonbref&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;machine m&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;m.relations r ON r.machine_id=m.id&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;r.ref f ON r.ref_id=f.id AND f.part_number NOT LIKE &quot;B%&quot;&apos;)&lt;br/&gt;
      -&amp;gt;groupBy(&apos;m.questionaire&apos;)&lt;br/&gt;
    ;&lt;br/&gt;
    $r2 =  $q2-&amp;gt;execute();&lt;br/&gt;
    $q2q = $q2-&amp;gt;getSqlQuery();&lt;/p&gt;

&lt;p&gt;    $this-&amp;gt;reports-&amp;gt;setQuery(Doctrine_Query::create()&lt;br/&gt;
    -&amp;gt;select(&apos;&apos;)&lt;br/&gt;
    -&amp;gt;from(&apos;(SQL:&apos;.$q1q.&apos;} q1&apos;)&lt;br/&gt;
    -&amp;gt;leftJoin(&apos;(SQL:&apos;.$q2q.&apos;) q2 ON q1.questionaire=q2questionaire&apos;)&lt;br/&gt;
    );&lt;br/&gt;
    echo $this-&amp;gt;reports-&amp;gt;getQuery()-&amp;gt;getSqlQuery(); die;&lt;/p&gt;


&lt;p&gt;This outputs Couldn&apos;t find class (SQL&lt;/p&gt;

&lt;p&gt;How to use in such a case ?&lt;/p&gt;</description>
                <environment>Symfony 1.4 </environment>
            <key id="11865">DC-853</key>
            <summary>I am using symfony 1.4</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="malutanpetronel">Petronel MALUTAN</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Sep 2010 11:27:20 +0000</created>
                <updated>Thu, 2 Sep 2010 14:58:05 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14226" author="jwage" created="Wed, 1 Sep 2010 14:48:22 +0000"  >&lt;p&gt;What is the SQL: syntax you are using here? That is definitely not something that is &quot;supported&quot;&lt;/p&gt;</comment>
                    <comment id="14230" author="malutanpetronel" created="Thu, 2 Sep 2010 03:39:50 +0000"  >&lt;p&gt;Dear Jonathan&lt;/p&gt;

&lt;p&gt;The example I&apos;ve tried is based on the :&lt;br/&gt;
&lt;a href=&quot;http://www.symfony-project.org/cookbook/1_2/en/retrieving_data_with_doctrine&quot; class=&quot;external-link&quot;&gt;http://www.symfony-project.org/cookbook/1_2/en/retrieving_data_with_doctrine&lt;/a&gt;&lt;br/&gt;
Please find Sub-Queries in this article and see what I mean.&lt;/p&gt;

&lt;p&gt;My problem started from a SQL query created in phpmyadmin, I&apos;ve tried to convert to doctrine. Following is the mysql query which nicely work:&lt;/p&gt;

&lt;p&gt;    select * from (select m1.questionaire, COUNT(f1.id) AS n1_refs&lt;br/&gt;
    from machine AS m1&lt;br/&gt;
    left join relation AS r1 on m1.id=r1.machine_id&lt;br/&gt;
    left join ref AS f1 on f1.id=r1.ref_id and f1.part_number LIKE &apos;B%&apos;&lt;br/&gt;
    group by m1.questionaire) as a1&lt;/p&gt;

&lt;p&gt;    left join&lt;/p&gt;

&lt;p&gt;    (select m2.questionaire, COUNT(f2.id) AS n2_refs&lt;br/&gt;
    from machine AS m2&lt;br/&gt;
    left join relation AS r2 on m2.id=r2.machine_id&lt;br/&gt;
    left join ref AS f2 on f2.id=r2.ref_id and f2.part_number not LIKE &apos;B%&apos;&lt;br/&gt;
    group by m2.questionaire) as a2&lt;br/&gt;
    on a1.questionaire=a2.questionaire&lt;/p&gt;

&lt;p&gt;and my trying was to create 2 easier DQL queries and than join them:&lt;/p&gt;

&lt;p&gt;     $this-&amp;gt;q = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;select(&apos;&apos;)&lt;br/&gt;
      ;&lt;/p&gt;

&lt;p&gt;    $this-&amp;gt;q1 = $this-&amp;gt;q-&amp;gt;createSubquery()&lt;br/&gt;
      -&amp;gt;select(&apos;m.questionaire, m.aszero, COUNT(f.id) AS bref&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;machine m&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;m.relations r ON r.machine_id=m.id&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;r.ref f ON f.id=r.ref_id AND f.part_number LIKE &quot;B%&quot;&apos;)&lt;br/&gt;
      -&amp;gt;groupBy(&apos;m.questionaire&apos;)&lt;br/&gt;
    ;&lt;br/&gt;
    //$r1 = $q1-&amp;gt;fetchArray();&lt;br/&gt;
    //$this-&amp;gt;r1=$this-&amp;gt;q1-&amp;gt;execute(array(),Doctrine_Core::HYDRATE_RECORD);&lt;/p&gt;

&lt;p&gt;    $this-&amp;gt;q2 = $this-&amp;gt;q-&amp;gt;createSubquery()&lt;br/&gt;
      -&amp;gt;select(&apos;m.questionaire, m.aszero, COUNT(f.id) AS nonbref&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;machine m&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;m.relations r ON r.machine_id=m.id&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;r.ref f ON f.id=r.ref_id AND f.part_number NOT LIKE &quot;B%&quot;&apos;)&lt;br/&gt;
      -&amp;gt;groupBy(&apos;m.questionaire&apos;)&lt;br/&gt;
    ;&lt;br/&gt;
    //$this-&amp;gt;r2=$this-&amp;gt;q2-&amp;gt;execute(array(),Doctrine_Core::HYDRATE_RECORD);&lt;/p&gt;


&lt;p&gt;    $this-&amp;gt;q-&amp;gt;from($this-&amp;gt;q1-&amp;gt;getDql() . &apos; q1)&apos;)&lt;br/&gt;
    &lt;del&gt;&amp;gt;leftJoin($this&lt;/del&gt;&amp;gt;q2-&amp;gt;getDql() . &apos; q2 ON q1.questionaire=q2questionaire&apos;);&lt;/p&gt;

&lt;p&gt;    echo $this-&amp;gt;q-&amp;gt;getSqlQuery(); die;&lt;/p&gt;

&lt;p&gt;This is outputting :&lt;/p&gt;

&lt;p&gt;500 | Internal Server Error | Doctrine_Exception&lt;br/&gt;
Couldn&apos;t find class SELECT&lt;/p&gt;

&lt;p&gt;so please tell me is it now more clear and make some sense ?&lt;br/&gt;
How to make it work ?&lt;/p&gt;

&lt;p&gt;With kind regards&lt;/p&gt;

&lt;p&gt;Petronel&lt;/p&gt;</comment>
                    <comment id="14242" author="jwage" created="Thu, 2 Sep 2010 14:58:05 +0000"  >&lt;p&gt;Can you make a test case that I can run on my machine to see the problem?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-850] Error  in Doctrine method execute() </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-850</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the execute method when doctrine runs a sql query, the process is&lt;br/&gt;
interrupted. The review found that the process is interrupted in the fetch method in class Doctrine::Hidrator::Graph.php&lt;/p&gt;

&lt;p&gt;In the line $stmt-&amp;gt;fetch(Doctrine_Core::FETCH_ASSOC);&lt;/p&gt;

&lt;p&gt;I appreciate the partnership that I can provide.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
                <environment></environment>
            <key id="11859">DC-850</key>
            <summary>Error  in Doctrine method execute() </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="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 18:38:10 +0000</created>
                <updated>Tue, 31 Aug 2010 18:41:31 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14205" author="jwage" created="Tue, 31 Aug 2010 18:41:31 +0000"  >&lt;p&gt;Can you provide some more information?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-849] Error Generate Schema.yml Database Oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-849</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Some deleted records are genereated by the Oracle driver, the following patch solves the problem, found with .... alexia.velasquez@hotmail.es, vtamara@pasosdeJesus.org, jeronimo0000@gmail.com&lt;/p&gt;

&lt;p&gt;&amp;#8212; Doctrine/Import/Oracle.php.orig     2010-08-31 11:01:10.934142453 -0500&lt;br/&gt;
+++ Doctrine/Import/Oracle.php  2010-08-31 11:01:35.778661707 -0500&lt;br/&gt;
@@ -118,7 +118,7 @@&lt;br/&gt;
 SELECT tc.column_name, data_type,&lt;br/&gt;
 CASE WHEN data_type = &apos;NUMBER&apos; THEN data_precision ELSE data_length END AS data_length,&lt;br/&gt;
 nullable, data_default, data_scale, data_precision, pk.primary&lt;br/&gt;
-FROM all_tab_columns tc&lt;br/&gt;
+FROM user_tab_columns tc&lt;br/&gt;
 LEFT JOIN (&lt;br/&gt;
  select &apos;primary&apos; primary, cc.table_name, cc.column_name from all_constraints cons&lt;br/&gt;
  join all_cons_columns cc on cons.constraint_name = cc.constraint_name&lt;br/&gt;
@@ -252,4 +252,4 @@&lt;br/&gt;
         $query = &apos;SELECT view_name FROM sys.user_views&apos;;&lt;br/&gt;
         return $this-&amp;gt;conn-&amp;gt;fetchColumn($query);&lt;br/&gt;
     }&lt;br/&gt;
-}&lt;br/&gt;
\ No hay ning&#250;n car&#225;cter de nueva l&#237;nea al final del fichero&lt;br/&gt;
+}&lt;/p&gt;</description>
                <environment>Ubuntu 10.4, Oracle</environment>
            <key id="11858">DC-849</key>
            <summary>Error Generate Schema.yml Database 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="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 18:24:01 +0000</created>
                <updated>Tue, 31 Aug 2010 18:40:58 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14204" author="jwage" created="Tue, 31 Aug 2010 18:40:58 +0000"  >&lt;p&gt;Hi, the formatting is a bit unreadable. Can you fork &lt;a href=&quot;http://github.com/doctrine/doctrine1&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1&lt;/a&gt; and send a pull request?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-847] Can not set a default value of &apos;CURRENT_TIMESTAMP&apos; in a  table definition for mysql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-847</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I recently I discovered that I needed o put a default value of &apos;CURRENT_TIMESTAMP&apos; on some of my fields. This was breaking the build of my mysql base for 2 different reasons &amp;#8211; for one columns with a type of timestamp were being switched instead to have a type of datetime, and for two the words: CURRENT_TIMESTAMP were being quote encapsulated in the create table statement.&lt;/p&gt;

&lt;p&gt;I looked around a bit and couldn&apos;t find a solution so I made a patch to fix the issue. This patch however broke some test cases that were expecting datetimes to be returned instead of timestamps (so i fixed the tests).&lt;/p&gt;

&lt;p&gt;I may be breaking something that I am not aware of by doing this, or perhaps there was another solution to the problem that I could not find &amp;#8211; if any one has any input on this I would appreciate it.&lt;/p&gt;

&lt;p&gt;I will post my patch in this thread but it is worth mention that it contains several bug fixes and a few new features which I have posted in other threads several months ago but never heard back regarding (most notably, beyond bug fixes it introduces a new hydration type and allows the disabling of the some times useful some times problematic limit subquery feature of doctrine).&lt;/p&gt;

&lt;p&gt;Thanks to all who have any input.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XAMP Windows</environment>
            <key id="11853">DC-847</key>
            <summary>Can not set a default value of &apos;CURRENT_TIMESTAMP&apos; in a  table definition for mysql</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="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 04:03:46 +0000</created>
                <updated>Sat, 25 Sep 2010 04:38:14 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14191" author="willf1976" created="Tue, 31 Aug 2010 05:44:58 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                    <comment id="14211" author="willf1976" created="Wed, 1 Sep 2010 05:30:50 +0000"  >&lt;p&gt;Found a small error in my last patch (some debug code I hadn&apos;t removed) and added some more comments (links to jira above each change) to clarify the fixes and new features the patch has in it.&lt;/p&gt;</comment>
                    <comment id="14229" author="willf1976" created="Wed, 1 Sep 2010 19:24:44 +0000"  >&lt;p&gt;individual patch for this issue with out other features included&lt;/p&gt;</comment>
                    <comment id="14240" author="jwage" created="Thu, 2 Sep 2010 14:43:53 +0000"  >&lt;p&gt;Hi, this one breaks the tests and backwards compatibility. Previously if you have a timestamp field in Doctrine, it would create a datetime column in mysql. Now it is creating a timestamp column. I don&apos;t think we can make this change in a stable version.&lt;/p&gt;</comment>
                    <comment id="14241" author="jwage" created="Thu, 2 Sep 2010 14:44:38 +0000"  >&lt;p&gt;At any rate, it is breaking the tests still. If we do decide to make the change, can you run all the tests and fix any of the other failures?&lt;/p&gt;</comment>
                    <comment id="14249" author="willf1976" created="Thu, 2 Sep 2010 19:16:32 +0000"  >&lt;p&gt;Hi Jon&lt;/p&gt;

&lt;p&gt;I added more test case fixes to the patch. I can see how this would still cause backwards compatibility issues though &amp;#8211; any one who built their db using the none patched version of doctrine would end up with different field types if they rebuilt using the patched version and this could affect the functionality of their existing code.&lt;/p&gt;

&lt;p&gt;Thanks for the help &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 you are well.&lt;/p&gt;

&lt;p&gt;Will&lt;/p&gt;</comment>
                    <comment id="14258" author="jwage" created="Fri, 3 Sep 2010 11:53:07 +0000"  >&lt;p&gt;Can you think of anyway it could be tweaked so that it is BC?&lt;/p&gt;</comment>
                    <comment id="14269" author="willf1976" created="Fri, 3 Sep 2010 20:32:34 +0000"  >&lt;p&gt;Good question... &lt;/p&gt;

&lt;p&gt;Here is an idea &amp;#8211; how about I put a flag in the options for the field that changes the behavior. So if some one wants to use real timestamps instead of datetime fields they could set an option of: &quot;useRealTimestamps : true&quot; on the field.&lt;/p&gt;

&lt;p&gt;I think that would be a good solution because by default everything would work as does is now (providing BC) but users could switch it over if they required the additional functionality that timestamps provide.&lt;/p&gt;

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

&lt;p&gt;Will&lt;/p&gt;</comment>
                    <comment id="14342" author="willf1976" created="Sat, 11 Sep 2010 19:12:48 +0000"  >&lt;p&gt;Hi Jon&lt;/p&gt;

&lt;p&gt;Here is a backwards compatible patch using the method I proposed in my last comment.&lt;/p&gt;

&lt;p&gt;To make a timestamp field use a type of timestamp (instead of datatime) include an option of: userealtimestamp=&amp;gt;true&lt;/p&gt;

&lt;p&gt;Let me know if you think this method will work out.&lt;/p&gt;

&lt;p&gt;Hope you are well.&lt;/p&gt;

&lt;p&gt;Will&lt;/p&gt;</comment>
                    <comment id="14462" author="willf1976" created="Sat, 25 Sep 2010 04:38:00 +0000"  >&lt;p&gt;I found some issues with this patch when I moved it off my local machine our production server &amp;#8211; there was a case sensitivity issue that I have since resolved. Here is the fixed version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10769" name="DC_847_fix.patch" size="5141" author="willf1976" created="Thu, 2 Sep 2010 19:16:32 +0000" />
                    <attachment id="10790" name="DC_847_fix_BC.patch" size="4744" author="willf1976" created="Sat, 11 Sep 2010 19:12:48 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-845] One of our Foreign Keys is not being inserted/passed</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-845</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We are working on a symfony/doctrine project and have come to a near halt on development.&lt;/p&gt;

&lt;p&gt;We feel that now, it may be a bug/feature in doctrine, regarding foreign keys&lt;/p&gt;

&lt;p&gt;Part of our model includes a join table that references three different table. Below is a diagram of what the model looks like, and the relevant portion of our schema.yml is at the bottom.&lt;/p&gt;

&lt;p&gt;Image of our schema: &lt;a href=&quot;http://imgur.com/dfFYI.png&quot; class=&quot;external-link&quot;&gt;http://imgur.com/dfFYI.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have a form that contains a set of embedded forms that attempt to create a new Person entry and add rows to the join table, adding items to the PersonName table as needed.&lt;/p&gt;

&lt;p&gt;The form attempts to do this by creating and saving PersonName objects with NameType parameters, but are running into the problem of Doctrine not including that column when trying to do an insert into the join table.&lt;/p&gt;

&lt;p&gt;Part of the problem seems to be caused by the Doctrine_Connection_UnitOfWork::saveAssociations method:&lt;/p&gt;

&lt;p&gt;                foreach ($v-&amp;gt;getInsertDiff() as $r) &lt;/p&gt;
{
                    $assocRecord = $assocTable-&amp;gt;create();
                    $assocRecord-&amp;gt;set($assocTable-&amp;gt;getFieldName($rel-&amp;gt;getForeign()), $r);
                    $assocRecord-&amp;gt;set($assocTable-&amp;gt;getFieldName($rel-&amp;gt;getLocal()), $record);
                    $this-&amp;gt;saveGraph($assocRecord);
                }

&lt;p&gt;Are we correct in understanding that this means that Doctrine 1.2 does not support tables with multiple foreign keys in this scenario?&lt;/p&gt;


&lt;p&gt;Here is the relevant portion of schema.yml:&lt;/p&gt;

&lt;p&gt;agPerson: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
  relations: &lt;br/&gt;
    agPersonName: &lt;br/&gt;
      class: agPersonName &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_id &lt;br/&gt;
      foreign: person_name_id &lt;br/&gt;
    agPersonNameType: &lt;br/&gt;
      class: agPersonNameType &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_id &lt;br/&gt;
      foreign: person_name_type_id &lt;br/&gt;
agPersonNameType: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(2) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
    person_name_type: &lt;br/&gt;
      unique: true &lt;br/&gt;
      type: string(30) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    app_display: &lt;br/&gt;
      default: 1 &lt;br/&gt;
      type: boolean &lt;br/&gt;
      notnull: true &lt;br/&gt;
  relations: &lt;br/&gt;
    agPerson: &lt;br/&gt;
      class: agPerson &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_type_id &lt;br/&gt;
      foreign: person_id &lt;br/&gt;
    agPersonName: &lt;br/&gt;
      class: agPersonName &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_type_id &lt;br/&gt;
      foreign: person_name_id &lt;br/&gt;
agPersonName: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
    person_name: &lt;br/&gt;
      unique: true &lt;br/&gt;
      type: string(64) &lt;br/&gt;
      notnull: true &lt;br/&gt;
  relations: &lt;br/&gt;
    agPerson: &lt;br/&gt;
      class: agPerson &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_id &lt;br/&gt;
      foreign: person_id &lt;br/&gt;
    agPersonNameType: &lt;br/&gt;
      class: agPersonNameType &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_id &lt;br/&gt;
      foreign: person_name_type_id &lt;br/&gt;
agPersonMjAgPersonName: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
    person_id: &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    person_name_id: &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    person_name_type_id: &lt;br/&gt;
      type: integer(2) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    is_primary: &lt;br/&gt;
      type: boolean &lt;br/&gt;
      notnull: true &lt;br/&gt;
  indexes: &lt;br/&gt;
    UX_ag_person_mj_ag_person_name: &lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;person_name_id, person_name_type_id, person_id&amp;#93;&lt;/span&gt; &lt;br/&gt;
      type: unique &lt;br/&gt;
  relations: &lt;br/&gt;
    agPerson: &lt;br/&gt;
      local: person_id &lt;br/&gt;
      foreign: id &lt;br/&gt;
    agPersonName: &lt;br/&gt;
      local: person_name_id &lt;br/&gt;
      foreign: id &lt;br/&gt;
    agPersonNameType: &lt;br/&gt;
      local: person_name_type_id &lt;br/&gt;
      foreign: id &lt;br/&gt;
actAs: &lt;br/&gt;
  Timestampable: &lt;/p&gt;



&lt;p&gt;As a caveat: we&apos;ve noticed that sfdoctrineguard group table, has such a relationship:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; describe sf_guard_user_group;&lt;br/&gt;
&lt;ins&gt;-----------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;--------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---&lt;del&gt;&lt;ins&gt;&lt;/del&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; Field      &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Type     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Null &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Key &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Default &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Extra &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;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---&lt;del&gt;&lt;ins&gt;&lt;/del&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; user_id    &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; int(11)  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; PRI &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0       &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; group_id   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; int(11)  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; PRI &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0       &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; created_at &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; datetime &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL    &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; updated_at &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; datetime &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL    &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;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---&lt;del&gt;&lt;ins&gt;&lt;/del&gt;-------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;


&lt;p&gt;i.e. IT has two foreign keys taken into account&lt;/p&gt;</description>
                <environment>Linux ubuntu 2.6.31-22-generic #63-Ubuntu SMP Thu Aug 19 00:23:50 UTC 2010 x86_64 GNU/Linux&lt;br/&gt;
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan  6 2010 22:56:44) &lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) using  EditLine wrapper</environment>
            <key id="11840">DC-845</key>
            <summary>One of our Foreign Keys is not being inserted/passed</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="zelaz">charles wisniewski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2010 12:06:42 +0000</created>
                <updated>Fri, 27 Aug 2010 12:06:42 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Record</component>
                <component>Relations</component>
                <component>Transactions</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-844] DataDict for MySQL excludes the possibility to have an actual floating point column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-844</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Extracted from Doctrine/DataDict/Mysql.php:&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;Mysql.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;case&lt;/span&gt; &apos;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&apos;:
                $length = !empty($field[&apos;length&apos;]) ? $field[&apos;length&apos;] : 18;
                $scale = !empty($field[&apos;scale&apos;]) ? $field[&apos;scale&apos;] : $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;FLOAT(&apos;.$length.&apos;, &apos;.$scale.&apos;)&apos;;
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;&lt;span class=&quot;code-object&quot;&gt;double&lt;/span&gt;&apos;:
                $length = !empty($field[&apos;length&apos;]) ? $field[&apos;length&apos;] : 18;
                $scale = !empty($field[&apos;scale&apos;]) ? $field[&apos;scale&apos;] : $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;If the user does not specify length and decimal places, MySQL creates a floating point number. However Doctrine behavior forces FLOATs and DOUBLEs to be fixed-width.&lt;/p&gt;</description>
                <environment>Not environment dependent</environment>
            <key id="11835">DC-844</key>
            <summary>DataDict for MySQL excludes the possibility to have an actual floating point column</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="rgonzalez">Roberto Gonz&#225;lez</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2010 05:46:47 +0000</created>
                <updated>Fri, 27 Aug 2010 05:46:47 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-842] Alias linking wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-842</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you create this kind of query:&lt;br/&gt;
$q = Doctrine_Query::create()&lt;br/&gt;
					-&amp;gt;select( &apos;p.name, a.key, count( a.key ) as amount&apos; )&lt;br/&gt;
					-&amp;gt;from( &apos;Actions a, ActionPage p&apos; )&lt;br/&gt;
					-&amp;gt;where( &apos;a.key = p.id&apos; )&lt;br/&gt;
					-&amp;gt;andWhere( &apos;a.type = 1&apos; )&lt;br/&gt;
					-&amp;gt;andWhere( &apos;p.type = 2&apos; )&lt;br/&gt;
					-&amp;gt;andWhere( &apos;a.date &amp;gt;= 0&apos; )&lt;br/&gt;
					-&amp;gt;andWhere( &apos;p.name not like \&apos;%&amp;amp;ru=%\&apos;&apos; )&lt;br/&gt;
					-&amp;gt;groupBy( &apos;a.key&apos; )&lt;br/&gt;
					-&amp;gt;orderBy( &apos;amount&apos; )&lt;br/&gt;
					-&amp;gt;execute( array(), Doctrine::HYDRATE_ARRAY );&lt;/p&gt;

&lt;p&gt;You get the folowing error:&lt;br/&gt;
Fatal error: Uncaught exception &apos;Doctrine_Hydrator_Exception&apos; with message &apos;&quot;ActionPage&quot; with an alias of &quot;p&quot; in your query does not reference the parent component it is related to.&lt;/p&gt;

&lt;p&gt;There is no relation between those 2 tables. You can solve it by creating a default SQL query. But my guess is that this shouldn&apos;t be the right way.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11828">DC-842</key>
            <summary>Alias linking wrong</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="sjaakmans">Sjaakmans</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 03:06:21 +0000</created>
                <updated>Thu, 26 Aug 2010 03:06:21 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <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-838] &quot;Primary columns are implied to be notnull in Doctrine&quot; but are not</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-838</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine says : &quot;Primary columns are implied to be notnull in Doctrine&quot; (line 563 in lib/Doctrine/Import/Builder.php)&lt;/p&gt;

&lt;p&gt;But when generating (My)SQL statements, primary fields are not set to &quot;NOT NULL&quot; even if it is specified in the YAML and/or Model file.&lt;/p&gt;

&lt;p&gt;If doctrine unsets the &apos;notnull&apos; option on line 565 in lib/Doctrine/Import/Builder.php (as it does), it should make sure to add the &quot;NOT NULL&quot; to the SQL when appropriate :&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;in getNotNullFieldDeclaration() method (line 798) in lib/Doctrine/Export.php&lt;br/&gt;
AND&lt;/li&gt;
	&lt;li&gt;in getDeclaration() method (line 272) in lib/Doctrine/Export/Mysql.php&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Solution #1: In both places, check if field is primary, and if so, add &quot;NOT NULL&quot; to SQL, since &quot;Primary columns are implied to be notnull in Doctrine&quot;.&lt;/p&gt;

&lt;p&gt;Solution #2: Change Doctrine as to not enforce this behaviour (eg. remove the check in lib/Doctrine/Import/Builder.php on line 565)&lt;/p&gt;


&lt;p&gt;Thx for this great ORM.&lt;/p&gt;

&lt;p&gt;~ Jonathan&lt;/p&gt;</description>
                <environment>Latest doctrine git commit: bfa24eb68640c412ff6115103ba044bbe1b4333b&lt;br/&gt;
Ubuntu 10.4 x64&lt;br/&gt;
MySQL server 5.1.41-3ubuntu12.6&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11818">DC-838</key>
            <summary>&quot;Primary columns are implied to be notnull in Doctrine&quot; but are not</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="jonathan.dh">Jonathan Melnick (Doghouse Media)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Aug 2010 06:09:43 +0000</created>
                <updated>Tue, 24 Aug 2010 21:15:23 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-837] Add support for AFTER in migration addColumn function</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-837</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It&apos;s imperative that the migration utility support specifying where the column is created and not just created at the end of the table, otherwise the migration utility is pretty much useless. I want to keep my database schema clean and tidy.&lt;/p&gt;

&lt;p&gt;I would say the default use case of this method is to specify where the new column is created.&lt;/p&gt;

&lt;p&gt;Please add the ability to specify where the new column goes to this function:&lt;br/&gt;
Doctrine_Migration::addColumn(). &lt;/p&gt;</description>
                <environment></environment>
            <key id="11815">DC-837</key>
            <summary>Add support for AFTER in migration addColumn function</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="exien">Exien</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Aug 2010 14:44:31 +0000</created>
                <updated>Mon, 23 Aug 2010 15:18:39 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14035" author="jwage" created="Mon, 23 Aug 2010 15:18:39 +0000"  >&lt;p&gt;I understand your desire to want to control where a column is added but to use words like &quot;imperative&quot; and &quot;useless&quot; is crazy! Where the column goes is in no way a blocker or major problem. If someone wants this bad enough and provides a patch we can consider including it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-835] Inconsistent record validation on a notnull foreign key when the local relation is set</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-835</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Validator_ForeignKeys_TestCase#testForeignKeyIsValidIfLocalRelationIsSet()&lt;/p&gt;

&lt;p&gt;This test passes fine as is. But it fails if I make the following 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-none&quot;&gt;public function testForeignKeyIsValidIfLocalRelationIsSet()
{
    //$person = new TestPerson();
    $address = new TestAddress();
        
    //$address-&amp;gt;Person = $person;    
    $address-&amp;gt;Person-&amp;gt;first_name = &quot;John&quot;;
        
    $table = $address-&amp;gt;getTable();
    $errors = $table-&amp;gt;validateField(&apos;person_id&apos;, $address-&amp;gt;person_id, $address);
        
    $this-&amp;gt;assertEqual(0, $errors-&amp;gt;count());
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The only difference is that instead of explicitly assigning $address-&amp;gt;Person, I&apos;m letting it happen automatically when assigning the first name. What is it about the property chaining when creating the related record that screws up doctrine&apos;s internal reference tracking?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11806">DC-835</key>
            <summary>Inconsistent record validation on a notnull foreign key when the local relation is 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="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="adamthehutt">Adam Huttler</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 22:33:14 +0000</created>
                <updated>Tue, 24 Aug 2010 22:14:20 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                <component>Relations</component>
                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14019" author="adamthehutt" created="Thu, 19 Aug 2010 23:20:35 +0000"  >&lt;p&gt;This is an existing test case for which I&apos;ve added two tests. The first one fails, while the second passes. The first one captures the issue I&apos;m experiencing.&lt;/p&gt;</comment>
                    <comment id="14062" author="adamthehutt" created="Tue, 24 Aug 2010 22:14:20 +0000"  >&lt;p&gt;This patch augments the test file with the new test and also makes a change to Doctrine_Related_LocalKey that causes the test to pass.&lt;/p&gt;

&lt;p&gt;Unfortunately, it causes another test to fail: 1072.&lt;/p&gt;

&lt;p&gt;I don&apos;t fully understand test 1072, but it appears to be testing closely related behavior (i.e. relation chaining).&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10748" name="dc-835-patch.txt" size="1601" author="adamthehutt" created="Tue, 24 Aug 2010 22:14:20 +0000" />
                    <attachment id="10746" name="ForeignKeysTestCase.php" size="2549" author="adamthehutt" created="Thu, 19 Aug 2010 23:20:35 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-834] When altering an existing column PGSQL can&apos;t convert to SERIAL for autoincrement</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-834</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you have an existing column Postgresql won&apos;t allow you to use the type SERIAL for altering the column.&lt;/p&gt;

&lt;p&gt;First create a column cat_id on category of integer type. Then run the following migration:&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;migration.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 up()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;changeColumn(&apos;category&apos;, &apos;cat_id&apos;, &apos;integer&apos;, &apos;4&apos;, array(
             &apos;unsigned&apos; =&amp;gt; &apos;&apos;,
             &apos;primary&apos; =&amp;gt; &apos;1&apos;,
             &apos;autoincrement&apos; =&amp;gt; &apos;1&apos;,
             ));
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Instead of using type SERIAL doctrine would have to simply alter the column then add a sequence on it&apos;s own.&lt;/b&gt;&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4</environment>
            <key id="11796">DC-834</key>
            <summary>When altering an existing column PGSQL can&apos;t convert to SERIAL for autoincrement</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>Wed, 18 Aug 2010 12:36:45 +0000</created>
                <updated>Wed, 18 Aug 2010 12:36:45 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Attributes</component>
                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-833] Data type in YAML schema spacing issue</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-833</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When creating a column in a table in a YAML schema file, the following two scenarios produce different results:&lt;/p&gt;

&lt;p&gt;Model:&lt;br/&gt;
  columns:&lt;br/&gt;
    ...&lt;br/&gt;
    some_numeric:&lt;br/&gt;
      type: integer(3)&lt;br/&gt;
      ....&lt;br/&gt;
__________________________&lt;br/&gt;
Model:&lt;br/&gt;
  columns:&lt;br/&gt;
    ...&lt;br/&gt;
    some_numeric:&lt;br/&gt;
      type: integer (3)&lt;br/&gt;
      ....&lt;/p&gt;

&lt;p&gt;Please note the spacing in the second example before the (3) in the type definition. The first example will generate a mediumint in MySQL with a length other than 3, while the second example works as expected.&lt;/p&gt;</description>
                <environment>Windows 7, Apache 2.2.11, PHP 5.2.9, MySQL 5.1.36</environment>
            <key id="11795">DC-833</key>
            <summary>Data type in YAML schema spacing issue</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="dannykopping">Danny Kopping</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Aug 2010 08:16:04 +0000</created>
                <updated>Wed, 18 Aug 2010 08:21:04 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13998" author="dannykopping" created="Wed, 18 Aug 2010 08:21:04 +0000"  >&lt;p&gt;The formatting for the YAML didn&apos;t come out right through JIRA, I apologize for that&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-831] Importing fixtures fails when GoogleI18n used with &quot;Couldn&apos;t create collection index. Record field &apos;lang&apos; was null.&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-831</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There&apos;s a problem with Doctrine_Data_Import. When trying to load a fixture record with translations, and GoogleI18n (or similar) instead of I18n is used (via actAs()), the following crash happens:&lt;br/&gt;
Couldn&apos;t create collection index. Record field &apos;lang&apos; was null.&lt;/p&gt;

&lt;p&gt;#0 /Users/argasek/Sites/fwm/library/doctrine/Doctrine/Access.php(131): Doctrine_Collection-&amp;gt;add(Object(Fwm_Shop_Catalog_CategoryTranslation))&lt;br/&gt;
#1 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data/Import.php(241): Doctrine_Access-&amp;gt;offsetSet(NULL, Object(Test_Shop_Catalog_CategoryTranslation))&lt;br/&gt;
#2 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data/Import.php(335): Doctrine_Data_Import-&amp;gt;_processRow(&apos;(catalog_catego...&apos;, Array)&lt;br/&gt;
#3 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data/Import.php(118): Doctrine_Data_Import-&amp;gt;_loadData(Array)&lt;br/&gt;
#4 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data.php(222): Doctrine_Data_Import-&amp;gt;doImport(false)&lt;br/&gt;
#5 /Users/argasek/Sites/test/library/doctrine/Doctrine/Core.php(1011): Doctrine_Data-&amp;gt;importData(&apos;/Users/argasek/...&apos;, &apos;yml&apos;, Array, false)&lt;br/&gt;
#6 /Users/argasek/Sites/test/library/doctrine/Doctrine/Task/LoadData.php(43): Doctrine_Core::loadData(&apos;/Users/argasek/...&apos;, false)&lt;br/&gt;
#7 /Users/argasek/Sites/test/library/doctrine/Doctrine/Cli.php(516): Doctrine_Task_LoadData-&amp;gt;execute()&lt;br/&gt;
#8 /Users/argasek/Sites/test/library/doctrine/Doctrine/Cli.php(498): Doctrine_Cli-&amp;gt;executeTask(Object(Doctrine_Task_LoadData), Array)&lt;br/&gt;
#9 /Users/argasek/Sites/test/library/doctrine/Doctrine/Cli.php(452): Doctrine_Cli-&amp;gt;_run(Array)&lt;br/&gt;
#10 /Users/argasek/Sites/test/scripts/doctrine-cli.php(29): Doctrine_Cli-&amp;gt;run(Array)&lt;br/&gt;
#11 &lt;/p&gt;
{main}

&lt;p&gt;I have narrowed down the problem to the line 135 of Doctrine/Data/Import.php, ie.&lt;/p&gt;

&lt;p&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 case of GoogleI18n, $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;) returns false.&lt;/p&gt;

&lt;p&gt;I have no idea how to patch this in a sane way. Adding another condition (&amp;amp;&amp;amp; ! $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_GoogleI18n&apos;) serves well as a workaround, but such condition would be required for any class similar to Doctrine_Template_GoogleI18n. I guess the condition should check if it&apos;s a Doctrine_Template_I18n template or any template iherited from this class?...&lt;/p&gt;</description>
                <environment>Mac OS X 10.6.4, Zend Server CE 5.0.2 (irrelevant, I guess)</environment>
            <key id="11784">DC-831</key>
            <summary>Importing fixtures fails when GoogleI18n used with &quot;Couldn&apos;t create collection index. Record field &apos;lang&apos; was null.&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="argasek">Jakub Argasi&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Aug 2010 06:55:40 +0000</created>
                <updated>Wed, 13 Oct 2010 08:02:30 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Data Fixtures</component>
                <component>I18n</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13975" author="argasek" created="Tue, 17 Aug 2010 07:40:42 +0000"  >&lt;p&gt;I have provided a quick workaround patch for this problem, with an approach described in my report, ie. checking whether table has a template being an instance of or a child of Doctrine_Template_I18n.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10743" name="fix_google18n_and_similiar_import_problem.patch" size="1387" author="argasek" created="Tue, 17 Aug 2010 07:40:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-830] Migration for up() not adding suffix for index</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-830</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am still getting the same issue as previously closed a while ago on trac &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1964&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1964&lt;/a&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;migration.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class Add_Category_Slug_Index &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;addIndex(&apos;category&apos;, &apos;category_sluggable&apos;, array(
             &apos;fields&apos; =&amp;gt; 
             array(
              0 =&amp;gt; &apos;slug&apos;,
             ),
             &apos;type&apos; =&amp;gt; &apos;unique&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;removeIndex(&apos;category&apos;, &apos;category_sluggable&apos;, array(
             &apos;fields&apos; =&amp;gt; 
             array(
              0 =&amp;gt; &apos;slug&apos;,
             ),
             &apos;type&apos; =&amp;gt; &apos;unique&apos;,
             ));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above migration generates an index named &lt;b&gt;category_sluggable&lt;/b&gt; instead of  &lt;b&gt;category_sluggable_idx&lt;/b&gt;&lt;/p&gt;</description>
                <environment>Postgresql 8.4 / Symfony 1.4.6</environment>
            <key id="11780">DC-830</key>
            <summary>Migration for up() not adding suffix for index</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>Mon, 16 Aug 2010 17:05:06 +0000</created>
                <updated>Sat, 21 Aug 2010 07:06:10 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13968" author="webpragmatist" created="Mon, 16 Aug 2010 17:57:53 +0000"  >&lt;p&gt;If I change the name in the up() to &lt;b&gt;category_sluggable_idx&lt;/b&gt; both up and down work properly.&lt;/p&gt;</comment>
                    <comment id="14023" author="argasek" created="Sat, 21 Aug 2010 07:06:10 +0000"  >&lt;p&gt;Confirming. I had the same problem last week and as a workaround I had to change suffix from &quot;%s_idx&quot; to &quot;%s&quot;. Even if the bug is not reproducible in a test case, it indeed happens in live environment on PostgreSQL (in my case, Symphony is not used).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-829] Hydrator/RecordDriver/setLastElement And APC useResultCache</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-829</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;1) I have a Query with APC useResultCache  with leftJoin between User and Avatar. (With no avatar for this User).&lt;br/&gt;
2) I have au Query without APC useResultCache  with leftJoin between Gallery, User and Avatar (Same user than 1))&lt;/p&gt;

&lt;p&gt;On the first show of my page =&amp;gt; OK&lt;br/&gt;
On second show of my page (With APC Cache) error when i call user-&amp;gt;getGalleries() :&lt;/p&gt;

&lt;p&gt;In Hydrator/RecordDriver.php setLastElement()&lt;/p&gt;

&lt;p&gt;$coll is instanceOf Doctrine_Null and count($coll) return 1, so =&amp;gt; Crash because -&amp;gt;getLast doesn&apos;t exist in Doctrine_Null class&lt;/p&gt;

&lt;p&gt;If you add in setLastElement() (Before if (count($coll) &amp;gt; 0) ....&lt;/p&gt;

&lt;p&gt;if ($coll instanceOf Doctrine_Null) &lt;/p&gt;
{
        	return;
        }

&lt;p&gt;It&apos;s works.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11779">DC-829</key>
            <summary>Hydrator/RecordDriver/setLastElement And APC useResultCache</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="zaor">PIERRONT Julien</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Aug 2010 17:02:25 +0000</created>
                <updated>Mon, 16 Aug 2010 17:02:25 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-828] MSSQL - ORDER BY on text columns throws mssql error 306 [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-828</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;ul&gt;
	&lt;li&gt;Table: foo (id:integer, title:text)&lt;/li&gt;
	&lt;li&gt;Created Query: SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;title&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;foo&amp;#93;&lt;/span&gt; ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;title&amp;#93;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Throws:&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;Server: Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE &lt;span class=&quot;code-keyword&quot;&gt;operator&lt;/span&gt;.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Solution:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Created Query: SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;title&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;foo&amp;#93;&lt;/span&gt; ORDER BY CAST(&lt;span class=&quot;error&quot;&gt;&amp;#91;title&amp;#93;&lt;/span&gt; AS VARCHAR(8000))&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa276838(v=SQL.80).aspx&quot; class=&quot;external-link&quot;&gt;http://msdn.microsoft.com/en-us/library/aa276838(v=SQL.80).aspx&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/cc645611.aspx&quot; class=&quot;external-link&quot;&gt;http://msdn.microsoft.com/en-us/library/cc645611.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Patch will be supplied soon ...&lt;/p&gt;</description>
                <environment></environment>
            <key id="11774">DC-828</key>
            <summary>MSSQL - ORDER BY on text columns throws mssql error 306 [+patch]</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="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Aug 2010 07:36:30 +0000</created>
                <updated>Thu, 2 Sep 2010 08:02:33 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14021" author="enrico" created="Fri, 20 Aug 2010 14:44:03 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/estahn/doctrine1/compare/DC-828&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/DC-828&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-828&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-828&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I guess we need more TestCases for the SubQuery stuff.&lt;/p&gt;</comment>
                    <comment id="14234" author="enrico" created="Thu, 2 Sep 2010 08:02:33 +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-828-2&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-828-2&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-827] Custom Doctrine_Query UPDATE statement inside migration scope not working</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-827</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I found strange problem in Doctrine migration. I tried to execute custom DQL in migration. Custom query with SELECT statement  succeed, but UPDATE query not changed any data in DB and do not returned back any error message.  After I tried execute same code in CLI task. Worked well and data in database was updated as I expected.  So looks like Doctrine_Query do not works well inside migration scope with UPDATE statement.&lt;/p&gt;

&lt;p&gt;... or maybe  I do something wrong? If did something maybe you have to put in manual how to use custom DQL in migrations correctly. I hope migrations are not only to change structure of tables, but also can be used to change data structure too. &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 function up() {

$conn = Doctrine_Manager::connection();  	  	
  	
$brands = Doctrine_Query::create ($conn)
  		-&amp;gt;select(&apos;b.id, b.name&apos;)
  		-&amp;gt;from(&apos;Brand b&apos;)
  		-&amp;gt;fetchArray();  // this query worked for me well. I have data
  		 	  	  	 	  	
foreach ($brands as $brand) {
  Doctrine_Query::create ($conn)
   	-&amp;gt;update(&apos;Brand&apos;)
  	-&amp;gt;set(&apos;safe_name&apos;, &apos;?&apos;, &apos;some_safe_name&apos;)
  	-&amp;gt;where(&apos;id = ?&apos;, $brand[&apos;id&apos;])
  	-&amp;gt;execute(); // this query was executed but not had any effect on data in DB
 }
//........
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Symfony Framework 1.3&lt;br/&gt;
Zend Server CE 5.0.2  (PHP 5.3.2)&lt;br/&gt;
Apache 2.2&lt;br/&gt;
MySQL 5.1.47&lt;br/&gt;
Windows XP </environment>
            <key id="11772">DC-827</key>
            <summary>Custom Doctrine_Query UPDATE statement inside migration scope not working</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="arnlukas">Arnoldas Lukasevicius</reporter>
                        <labels>
                    </labels>
                <created>Sat, 14 Aug 2010 13:48:18 +0000</created>
                <updated>Tue, 2 Nov 2010 06:28:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-825] Versionable does not work with column alias on primary keys [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-825</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the Versionable behavior on a model which has a column with an alias and which is also primary causes the generation of a wrong version of the versionable table.&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; 
ModelFoo:
  model_id as id
  username
  password
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Generates tables:&lt;br/&gt;
model_foo (model_id, username, password, version)&lt;br/&gt;
model_foo_version (id, model_id, userrname, password, version)&lt;/p&gt;

&lt;p&gt;It should be:&lt;br/&gt;
model_foo (model_id, username, password, version)&lt;br/&gt;
model_foo_version (model_id, userrname, password, version)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11768">DC-825</key>
            <summary>Versionable does not work with column alias on primary keys [+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="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Aug 2010 07:42:28 +0000</created>
                <updated>Wed, 25 Aug 2010 11:26:56 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13942" author="enrico" created="Fri, 13 Aug 2010 08:52:55 +0000"  >&lt;p&gt;TestCase and Fix&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-825&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-825&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13996" author="enrico" created="Wed, 18 Aug 2010 06:55:47 +0000"  >&lt;p&gt;The supplied patches are not up-to-date. Pls use &lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-825&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-825&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10738" name="0001-TestCase-for-issue-DC-825.patch" size="3855" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                    <attachment id="10739" name="0002-DC-825-fix-generation-of-the-versionable-table.patch" size="8407" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                    <attachment id="10740" name="0003-DC-825-fix-generation-of-model-classes-with-column-a.patch" size="1356" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-817] Nested aggregate fields do not hydrate to the right object</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-817</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to run a query that gets a forum, its threads and the number of replies for each thread. The following query works as per the documentation:&lt;/p&gt;

&lt;p&gt;    $threads = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;select(&apos;p.*, COUNT(c.id) as num_replies)&lt;br/&gt;
            -&amp;gt;from(&apos;Posts p&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;p.Children c&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;p.parent_id IS NULL&apos;)&lt;br/&gt;
            -&amp;gt;groupBy(&apos;p.id&apos;)&lt;br/&gt;
            -&amp;gt;fetchArray(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;As expected, I can access $threads&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;num_replies&amp;#39;&amp;#93;&lt;/span&gt; and I get the COUNT() of the number of children for the thread.&lt;/p&gt;

&lt;p&gt;However, when I run this query:&lt;/p&gt;

&lt;p&gt;    $forum = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;select(&apos;f.&lt;b&gt;, p.&lt;/b&gt;, COUNT(c.id) as num_replies)&lt;br/&gt;
            -&amp;gt;from(&apos;Forum f&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;f.Posts p WITH p.parent_id IS NULL&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;p.Children c&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;f.slug = ?&apos;, $params&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;)&lt;br/&gt;
            -&amp;gt;groupBy(&apos;p.id&apos;)&lt;br/&gt;
            -&amp;gt;fetchOne(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;Instead of num_replies being assigned to each Posts[] object, it is only being assigned once to the Forum object, rendering it totally useless.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11760">DC-817</key>
            <summary>Nested aggregate fields do not hydrate to the right object</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="patcomwiz">Patrick Nagurny</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Aug 2010 23:07:55 +0000</created>
                <updated>Thu, 12 Aug 2010 23:07:55 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-814] protected method _isValueModified returns wrong result</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-814</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&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; function _isValueModified($type, $old, $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Expression) {
            &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;if&lt;/span&gt; ($type == &apos;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&apos; &amp;amp;&amp;amp; (is_bool($old) || is_numeric($old)) &amp;amp;&amp;amp; (is_bool($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;) || is_numeric($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)) &amp;amp;&amp;amp; $old == $&lt;span class=&quot;code-keyword&quot;&gt;new&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;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array($type, array(&apos;decimal&apos;, &apos;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old * 100 != $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; * 100;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array($type, array(&apos;integer&apos;, &apos;&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)) {
            &lt;span class=&quot;code-comment&quot;&gt;// getType($old) in many cases is always &apos;string&apos; so using &lt;span class=&quot;code-keyword&quot;&gt;operator&lt;/span&gt; &apos;!==&apos;  is make no sense 
&lt;/span&gt;            &lt;span class=&quot;code-comment&quot;&gt;// the only needed condition is already checked: i mean &apos;is_numeric&apos;
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old !== $&lt;span class=&quot;code-keyword&quot;&gt;new&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; ($type == &apos;timestamp&apos; || $type == &apos;date&apos;) {
            $oldStrToTime = strtotime($old);
            $newStrToTime = strtotime($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($oldStrToTime &amp;amp;&amp;amp; $newStrToTime) {
                &lt;span class=&quot;code-comment&quot;&gt;// the same here: it&apos;s make no sense to using &apos;!==&apos; - first and second variable are the same type 
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $oldStrToTime !== $newStrToTime;
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old !== $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;;
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old !== $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Apache/2.2.15 (Win64) PHP/5.3.2 </environment>
            <key id="11747">DC-814</key>
            <summary>protected method _isValueModified returns wrong result</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="mstrzele">Micha&#322; Strzelecki</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Aug 2010 06:36:32 +0000</created>
                <updated>Tue, 10 Aug 2010 06:58:58 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13891" author="mstrzele" created="Tue, 10 Aug 2010 06:40:00 +0000"  >&lt;p&gt;Using operator &apos;!==&apos; is make no sense. The result is wrong after that comparition.&lt;br/&gt;
The implication of that is wrong state of the record if it is id of relation hydrate after joins.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-812] Postgresql and query cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-812</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After enabling:&lt;/p&gt;

&lt;p&gt;$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver);&lt;br/&gt;
(both Memcache and APC)&lt;/p&gt;

&lt;p&gt;I get:&lt;/p&gt;

&lt;p&gt;Doctrine_Connection_Pgsql_Exception: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;08P01&amp;#93;&lt;/span&gt;: &amp;lt;&amp;gt;: 7 ERROR: bind message supplies 8 parameters, but prepared statement &quot;pdo_stmt_00000008&quot; requires 16 in /home/taat/www/library/Doctrine/1.2.2/lib/Doctrine/Connection.php on line 1082&lt;/p&gt;

&lt;p&gt;Without the cache everything works OK.&lt;br/&gt;
RESULT_CACHE works OK too.&lt;/p&gt;

&lt;p&gt;Maybe this may help somehow:&lt;br/&gt;
&lt;a href=&quot;http://bugs.php.net/33886&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/33886&lt;/a&gt;&lt;/p&gt;
</description>
                <environment>Postgresql 8.4, Ubuntu 10.04, PHP 5.3, latest APC and Memcache, Memcached</environment>
            <key id="11735">DC-812</key>
            <summary>Postgresql and query cache</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="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Aug 2010 17:13:54 +0000</created>
                <updated>Fri, 6 Aug 2010 17:14:47 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-810] Doctrine relations: Doctrine_Record::fromArray() does not update local field when new linked record is created</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-810</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record::fromArray() does not update local field when new linked record is created.&lt;/p&gt;

&lt;p&gt;Case:&lt;/p&gt;

&lt;p&gt;1. I have a model1 with a hasOne relation to model2.&lt;/p&gt;

&lt;p&gt;2. I have a record in model1 with no model2 related&lt;/p&gt;

&lt;p&gt;3. Then i try to update model1 adding a new related model2 record using Doctrine_Record::fromArray(), model2 is created (Doctrine_Record::toArray() shows me the new row in model2, created and linked to model1)&lt;/p&gt;

&lt;p&gt;4. When I save and refresh model1, relation disappear (local field on model1 who links to model2 is empty).&lt;/p&gt;

&lt;p&gt;So it seems that Doctrine_Record::fromArray() doesn&apos;t recognize the change on model1 if I link it to a new foreign record. In fact if I modify some other field in model1, create and link a new model2 record, all works good!&lt;/p&gt;

&lt;p&gt;Digging in Record.php I found a trick, Doctrine_Record::fromArray() doesn&apos;t update the state of the model when relations are touched, so I force record state to Doctrine_Record::STATE_DIRTY.&lt;/p&gt;

&lt;p&gt;Diff file is attached, but it&apos;s still a workaround.&lt;/p&gt;</description>
                <environment>$uname -a&lt;br/&gt;
Linux debianVM 2.6.30-2-686 #1 SMP Sat Sep 26 01:16:22 UTC 2009 i686 GNU/Linux&lt;br/&gt;
&lt;br/&gt;
$php -v&lt;br/&gt;
PHP 5.2.11-1 with Suhosin-Patch 0.9.7 (cli) (built: Sep 20 2009 12:28:20)&lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
</environment>
            <key id="11729">DC-810</key>
            <summary>Doctrine relations: Doctrine_Record::fromArray() does not update local field when new linked record is created</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="agopaul">Paolo Agostinetto</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Aug 2010 06:00:47 +0000</created>
                <updated>Fri, 6 Aug 2010 06:00:47 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10722" name="doctrine1_bug.diff" size="495" author="agopaul" created="Fri, 6 Aug 2010 06:00:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-809] Doctrine_Query_Abstract::set() Does not handle boolean values correctly.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-809</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When passing booleans to the set() function on an update DQL query object, the value false is not handled correctly and end up in a corrupted query.&lt;/p&gt;

&lt;p&gt;Test 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;Test:
  columns:
    bool:
      type: &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: &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;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Steps to reproduce:&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;code.php&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;update(&apos;Test&apos;)
                        -&amp;gt;set(&apos;bool&apos;, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
                        -&amp;gt;execute()
                        -&amp;gt;getSqlQuery();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result Query:&lt;br/&gt;
&lt;em&gt;&apos;UPDATE test SET bool = &apos;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Expected Query:&lt;br/&gt;
&lt;em&gt;&apos;UPDATE test SET bool = false&apos;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;See attached patch file for a &lt;b&gt;possible&lt;/b&gt; solution. (I don&apos;t have deep know of Doctrine internals...)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11727">DC-809</key>
            <summary>Doctrine_Query_Abstract::set() Does not handle boolean values correctly.</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="mars105">Alexandre Ravey</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Aug 2010 08:18:42 +0000</created>
                <updated>Thu, 5 Aug 2010 08:18:42 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10721" name="Abstract.patch" size="437" author="mars105" created="Thu, 5 Aug 2010 08:18:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-807] Equal nest relation uses incorrect SQL and returns incorrect data</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-807</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The equal nest relation works incorrectly twice. The SQL it produces is wrong. And even if correct the SQL it still returns wrong data.&lt;br/&gt;
In my example below $profile-&amp;gt;getFriends() returns incorrect data and even tries to write these wrong data when I do $profile-&amp;gt;setEmail(&quot;...&quot;); $profile-&amp;gt;save()&lt;br/&gt;
I&apos;m certain that SQL query in Nest.php is wrong, but not only SQL. Even after fixing SQL the data is still incorrect. I digged through the code and suspect that the problem is in Doctrine_Collection which seems to works with only one referenceField, while in an &quot;equal relationship&quot; this field varies row to row.&lt;/p&gt;

&lt;p&gt;Here goes steps to reproduce.&lt;/p&gt;

&lt;p&gt;Schema.yml&lt;br/&gt;
==========&lt;/p&gt;

&lt;p&gt;Profile:&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    email:&lt;br/&gt;
      type: varchar(255)&lt;br/&gt;
      notnull: true&lt;br/&gt;
  relations:&lt;br/&gt;
    Friends: &lt;/p&gt;
{ class: Profile, refClass: UserFriend, local: requestor_user_id, foreign: receiver_user_id, equal: true }


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

&lt;p&gt;Profile:&lt;br/&gt;
  -&lt;br/&gt;
    id: 1&lt;br/&gt;
    email: one@example.org&lt;br/&gt;
  -&lt;br/&gt;
    id: 2&lt;br/&gt;
    email: two@example.org&lt;br/&gt;
  -&lt;br/&gt;
    id: 3&lt;br/&gt;
    email: three@example.org&lt;br/&gt;
  -&lt;br/&gt;
    id: 4&lt;br/&gt;
    email: four@example.org&lt;/p&gt;

&lt;p&gt;UserFriend:&lt;br/&gt;
  -&lt;br/&gt;
    requestor_user_id: 1&lt;br/&gt;
    receiver_user_id:  2&lt;br/&gt;
  -&lt;br/&gt;
    requestor_user_id: 4&lt;br/&gt;
    receiver_user_id:  1&lt;br/&gt;
  -&lt;br/&gt;
    requestor_user_id: 2&lt;br/&gt;
    receiver_user_id:  3&lt;/p&gt;


&lt;p&gt;PHP test&lt;br/&gt;
=======&lt;br/&gt;
$user = Doctrine_Core::getTable(&apos;Profile&apos;)-&amp;gt;find(1);&lt;br/&gt;
var_dump($user-&amp;gt;getFriends()-&amp;gt;toArray());&lt;/p&gt;


&lt;p&gt;Output&lt;br/&gt;
======&lt;br/&gt;
array(2) {&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  array(3) {&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;id&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
    string(1) &quot;2&quot;&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;email&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
    string(15) &quot;two@example.org&quot;&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;UserFriend&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
    array(2) {&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
      array(3) &lt;/p&gt;
{
        [&quot;requestor_user_id&quot;]=&amp;gt;
        string(1) &quot;1&quot;
        [&quot;receiver_user_id&quot;]=&amp;gt;
        string(1) &quot;2&quot;
        [&quot;Receiver&quot;]=&amp;gt;
        bool(false)
      }
&lt;p&gt;      &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
      array(3) &lt;/p&gt;
{
        [&quot;requestor_user_id&quot;]=&amp;gt;
        string(1) &quot;2&quot;
        [&quot;receiver_user_id&quot;]=&amp;gt;
        string(1) &quot;2&quot;
        [&quot;Receiver&quot;]=&amp;gt;
        bool(false)
      }
&lt;p&gt;    }&lt;br/&gt;
  }&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  array(3) {&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;id&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
    string(1) &quot;4&quot;&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;email&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
    string(16) &quot;four@example.org&quot;&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;UserFriend&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
    array(1) {&lt;br/&gt;
      &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
      array(3) &lt;/p&gt;
{
        [&quot;requestor_user_id&quot;]=&amp;gt;
        string(1) &quot;4&quot;
        [&quot;receiver_user_id&quot;]=&amp;gt;
        string(1) &quot;4&quot;
        [&quot;Receiver&quot;]=&amp;gt;
        bool(false)
      }
&lt;p&gt;    }&lt;br/&gt;
  }&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;As it can be seen from output, the relation &quot;UserFriend&quot; shows insane data:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;sometime there are two records in &quot;UserFriend&quot; - and that&apos;s wrong&lt;/li&gt;
	&lt;li&gt;user 4 has friendship with 4 - that&apos;s also wrong, not in the fixtures.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Debian</environment>
            <key id="11710">DC-807</key>
            <summary>Equal nest relation uses incorrect SQL and returns incorrect 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="romanb">Roman S. Borschel</assignee>
                                <reporter username="denis.chmel">Denis Chmel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Aug 2010 10:40:59 +0000</created>
                <updated>Tue, 3 Aug 2010 10:42:24 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13769" author="denis.chmel" created="Tue, 3 Aug 2010 10:42:24 +0000"  >&lt;p&gt;If this will be useful. here&apos;s the SQL it produces:&lt;/p&gt;

&lt;p&gt;SELECT&lt;br/&gt;
  profile.id      AS profile__id,&lt;br/&gt;
  profile.email   AS profile__email,&lt;br/&gt;
  user_friend.requestor_user_id AS user_friend__requestor_user_id,&lt;br/&gt;
  user_friend.receiver_user_id  AS user_friend__receiver_user_id&lt;br/&gt;
FROM profile&lt;br/&gt;
INNER JOIN user_friend ON profile.id = user_friend.receiver_user_id OR profile.id = user_friend.requestor_user_id&lt;br/&gt;
WHERE&lt;br/&gt;
profile.id IN(SELECT  receiver_user_id FROM user_friend WHERE requestor_user_id = 1)&lt;br/&gt;
OR profile.id IN (SELECT requestor_user_id FROM user_friend WHERE receiver_user_id = 1)&lt;br/&gt;
ORDER BY profile.id ASC&lt;/p&gt;

&lt;p&gt;It&apos;s very clear that an OR in the inner join and another OR in where are not connected, while they must be. Here&apos;s the correct part (in my opinion)&lt;/p&gt;

&lt;p&gt;...&lt;br/&gt;
WHERE&lt;br/&gt;
profile.id IN(SELECT  receiver_user_id FROM user_friend WHERE requestor_user_id = 1) AND user_friend.receiver_user_id=1&lt;br/&gt;
OR profile.id IN (SELECT requestor_user_id FROM user_friend WHERE receiver_user_id = 1) AND user_friend.receiver_user_id=1&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;But this only fixes the problem with 2 records in &quot;UserFriends&quot;, but not the second (&quot;user 4 has friendship with 4 - that&apos;s also wrong, not in the fixtures.&quot;).&lt;br/&gt;
That another issue is somewhere inside Collection and how it works with the referenceField.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-806] i8n behavior </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-806</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;hi everyone &lt;/p&gt;

&lt;p&gt;I&apos;m trying to use the Doctrine i18n behavior but ... something wrong happen! &lt;/p&gt;

&lt;p&gt;I have this Doctrine_Connection_Mysql_Exception :&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;p.label&apos; in &apos;field list&apos; ( ie : linked screenshot )&lt;/p&gt;

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

&lt;hr /&gt;
&lt;p&gt;Doctrine_Query::create()-&amp;gt;from(&apos;OrderProduct o&apos;)&lt;br/&gt;
                  -&amp;gt;leftJoin(&apos;o.Product p&apos;)&lt;br/&gt;
                  -&amp;gt;addWhere(&apos;o.order_id = ?&apos;, $currentOrderId)&lt;br/&gt;
                  -&amp;gt;orderBy(&apos;o.created_at ASC&apos;)&lt;br/&gt;
                  -&amp;gt;execute();&lt;br/&gt;
&amp;#8212;&lt;/p&gt;



&lt;p&gt;I don&apos;t understand why doctrine try to get the label field from &quot;Product&quot;, this field is in the Translation table :s &lt;/p&gt;

&lt;p&gt;Here an extract from my schema.yml :&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
Product:&lt;br/&gt;
  tableName:                   product&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields:                  &lt;span class=&quot;error&quot;&gt;&amp;#91;label, label_2&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
    code:                      &lt;/p&gt;
{type: string(64), notnull: true, primary: true}
&lt;p&gt;    label:                     &lt;/p&gt;
{type: string(64)}
&lt;p&gt;    label_2:                   &lt;/p&gt;
{type: string(64)}
&lt;p&gt;&amp;#8212;&lt;/p&gt;

&lt;p&gt;i don&apos;t know if my problem is in my code ( i don&apos;t think ), in Doctrine or in Symfony implementation of doctrine and thats why i post this message.&lt;/p&gt;

&lt;p&gt;If you want more details ask me &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; I have one working copy &quot;freezed&quot; just for this bug ( and for my work i use a system without i18n behavior :s )&lt;/p&gt;

&lt;p&gt;thx in advance&lt;/p&gt;</description>
                <environment>Symfony 1.4.0, PHP 5.2.6 &amp;amp; 5.3.1</environment>
            <key id="11703">DC-806</key>
            <summary>i8n 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="fmeynard">Fabien MEYNARD</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Jul 2010 13:51:36 +0000</created>
                <updated>Sat, 31 Jul 2010 13:51:36 +0000</updated>
                                                                    <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10714" name="Capture d&#8217;&#233;cran 2010-07-30 &#224; 12.43.50.png" size="208155" author="fmeynard" created="Sat, 31 Jul 2010 13:51:36 +0000" />
                </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-799] Doctrine_Query::parseFunctionExpression() produces unexpected results if the expression contains a function</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-799</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When &lt;em&gt;Doctrine_Query::parseFunctionExpression()&lt;/em&gt; is called with the following parameter and &lt;em&gt;$this-&amp;gt;_conn-&amp;gt;expression&lt;/em&gt; is of type &lt;em&gt;Doctrine_Expression_MySql&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$expr = &quot;DATE_FORMAT(datefield,&apos;%Y-%m-%d&apos;),someotherfield&quot;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;The expected result from Doctrine_Query::parseFunctionExpressoin() would be&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;DATE_FORMAT(l.datefield,&apos;%Y-%m-%d&apos;),l.someotherfield&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;However, the actual result is&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;DATE_FORMAT(l.datefield,&apos;%Y-%m-%d&apos;),someotherfiel&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Note the missing leading &quot;l.&quot; and the last character (&quot;d&quot;) on &quot;someotherfield&quot;.&lt;br/&gt;
Obviously this leads to fatal errors.&lt;/p&gt;

&lt;p&gt;This example is a result of calling addGroupby(&quot;DATE_FORMAT(datefield,&apos;%Y-%m-%d&apos;),someotherfield&quot;) on a Doctrine_Query object.&lt;/p&gt;</description>
                <environment>Mac OS X, LINUX</environment>
            <key id="11686">DC-799</key>
            <summary>Doctrine_Query::parseFunctionExpression() produces unexpected results if the expression contains a function</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="hglattergotz">Henning Glatter-Gotz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Jul 2010 16:42:17 +0000</created>
                <updated>Tue, 27 Jul 2010 16:42:17 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-798] Change column Postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-798</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Migration_Base::changeColumn doesn&apos;t change the DB column when using Postgres. &lt;/p&gt;

&lt;p&gt;In Doctrine_Export_Pgsql::alterTableSql it checks for an index &apos;type&apos; in the $field array, but the &apos;type&apos; index is in $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;, so we never enter there. Furthermore it then tries to get the type declaration with $this-&amp;gt;conn-&amp;gt;datatype-&amp;gt;getTypeDeclaration($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;) but there is no datatype property on the collection.&lt;br/&gt;
The attached patch should fix these problems.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6, doctrine 1.2, symfony 1.4, postgres 8.4</environment>
            <key id="11684">DC-798</key>
            <summary>Change column 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, 27 Jul 2010 08:33:25 +0000</created>
                <updated>Thu, 19 Aug 2010 10:10:07 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13712" author="lsmith" created="Tue, 27 Jul 2010 10:31:56 +0000"  >&lt;p&gt;hmm .. seems like a refactoring issue with the old MDB2 code. same issue could be in other places too.&lt;/p&gt;</comment>
                    <comment id="13999" author="lsmith" created="Wed, 18 Aug 2010 08:30:05 +0000"  >&lt;p&gt;may i commit the patch?&lt;/p&gt;</comment>
                    <comment id="14000" author="jwage" created="Wed, 18 Aug 2010 11:30:43 +0000"  >&lt;p&gt;Do the other drivers reference the &apos;definition&apos; too?&lt;/p&gt;</comment>
                    <comment id="14001" author="jwage" created="Wed, 18 Aug 2010 11:33:46 +0000"  >&lt;p&gt;The other classes don&apos;t seem to reference the &apos;definition&apos;. It looks like the information is right in the root of the array, why is it different in this case?&lt;/p&gt;</comment>
                    <comment id="14016" author="lsmith" created="Thu, 19 Aug 2010 10:10:07 +0000"  >&lt;p&gt;ok the patch has been committed.&lt;/p&gt;

&lt;p&gt;the others do also reference &apos;definition&apos;, its just that for mysql and sqlite the code is simpler because there you can just give a new definition, in postgresql you need to explicitly pass what you want to change and therefore the code needs to work differently.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10710" name="doctrine.patch" size="2227" author="lea" created="Tue, 27 Jul 2010 08:33:25 +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-795] Can&apos;t mix Soft and Hard deletes. Fix with patch provided.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-795</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I reported this bug on the symfony site, but after investigation i have found that it is actually a doctrine SoftDelete issue. &lt;a href=&quot;http://trac.symfony-project.org/ticket/8898&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8898&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have a sandbox replicating the problem here:&lt;br/&gt;
&lt;a href=&quot;http://dl.dropbox.com/u/8354765/sf_sandbox.zip&quot; class=&quot;external-link&quot;&gt;http://dl.dropbox.com/u/8354765/sf_sandbox.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the test:&lt;br/&gt;
./symfony test:unit Contact &lt;/p&gt;

&lt;p&gt;The issue is I want to hard delete my M-M link table and soft delete the parents. This fails. I believe it is to do with the fact that the relations to the parent are marked as Doctrine_Record::STATE_TCLEAN which when the SoftDelete calls save on the parent object this flag trys to reinsert the relations that it has deleted. Things go very wrong at this point and the connection is rolled back.&lt;/p&gt;

&lt;p&gt;The fix I have is the following, not sure what this would do to other things or not as I am not overly familiar with Doctrine internals...&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;Index: Doctrine/Template/Listener/SoftDelete.php
===================================================================
--- Doctrine/Template/Listener/SoftDelete.php	(revision 12962)
+++ Doctrine/Template/Listener/SoftDelete.php	(working copy)
@@ -95,6 +95,7 @@
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function postDelete(Doctrine_Event $event)
     {
         &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;_options[&apos;hardDelete&apos;]) {
+            $event-&amp;gt;getInvoker()-&amp;gt;clearRelated();
             $event-&amp;gt;getInvoker()-&amp;gt;save();
         }
     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This works even if the relations have been marked as SoftDelete.&lt;/p&gt;</description>
                <environment>Mac</environment>
            <key id="11661">DC-795</key>
            <summary>Can&apos;t mix Soft and Hard deletes. Fix with patch provided.</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="johnwards">John Wards</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 08:45:26 +0000</created>
                <updated>Wed, 21 Jul 2010 14:47:10 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13636" author="johnwards" created="Wed, 21 Jul 2010 08:50:28 +0000"  >&lt;p&gt;Formatting&lt;/p&gt;</comment>
                    <comment id="13642" author="jwage" created="Wed, 21 Jul 2010 13:46:26 +0000"  >&lt;p&gt;Does this patch pass the test suite?&lt;/p&gt;</comment>
                    <comment id="13643" author="johnwards" created="Wed, 21 Jul 2010 14:32:02 +0000"  >&lt;p&gt;I have run the test suite and got the same 8 failures with and without the patch. &lt;/p&gt;

&lt;p&gt;These are the failing tests:&lt;br/&gt;
Doctrine_Cache_Apc_TestCase&lt;br/&gt;
Doctrine_Cache_Abstract_TestCase&lt;br/&gt;
Doctrine_Ticket_1783_TestCase&lt;/p&gt;

&lt;p&gt;Anything obvious I need to do to get these working, other than enabling apc...&lt;/p&gt;</comment>
                    <comment id="13644" author="johnwards" created="Wed, 21 Jul 2010 14:47:10 +0000"  >&lt;p&gt;It seems to be passing all the tests that have SoftDelete in them however, so I would say that it is working as expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-793] import-&gt;listTableColumns / export-&gt;alterTableSql issues</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-793</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am not sure where to lay the blame for the following issue.  I am using import-&amp;gt;listTableColumns() to get the metadata of existing tables.  I am then changing the name of the the columns in the tables retrieved using export-&amp;gt;alterTable()... in general this seems to be working perfectly ok except for MYSQL LONGTEXT type fields.  listTableColumns is returning the following schema:&lt;/p&gt;

&lt;p&gt;  &apos;pn_value&apos; =&amp;gt; &lt;br/&gt;
    array&lt;br/&gt;
      &apos;name&apos; =&amp;gt; string &apos;pn_value&apos; (length=8)&lt;br/&gt;
      &apos;type&apos; =&amp;gt; string &apos;string&apos; (length=6)&lt;br/&gt;
      &apos;alltypes&apos; =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          0 =&amp;gt; string &apos;string&apos; (length=6)&lt;br/&gt;
          1 =&amp;gt; string &apos;clob&apos; (length=4)&lt;br/&gt;
      &apos;ntype&apos; =&amp;gt; string &apos;longtext&apos; (length=8)&lt;br/&gt;
      &apos;length&apos; =&amp;gt; null&lt;br/&gt;
      &apos;fixed&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;unsigned&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;values&apos; =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          empty&lt;br/&gt;
      &apos;primary&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;default&apos; =&amp;gt; null&lt;br/&gt;
      &apos;notnull&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;autoincrement&apos; =&amp;gt; boolean false&lt;/p&gt;

&lt;p&gt;And when I send this to export-&amp;gt;alterTable() it&apos;s generating the following SQL&lt;br/&gt;
ALTER TABLE z_module_vars CHANGE pn_value z_value VARCHAR(255)&lt;/p&gt;

&lt;p&gt;So you can see it&apos;s truncating the field.  The schema returned from the import of column definitions seems strange since there are two alltypes - and I wonder if that is why alterTables just assumes a string of 255 characters?&lt;/p&gt;

&lt;p&gt;So I&apos;m not sure which is to blame, if the import is returning invalid data, or that alterTableSql ultimately misinterprets it, but, the end result is an incorrect ALTER command.&lt;/p&gt;
</description>
                <environment>MySQL 5.1, PHP 5.3.1, Doctrine 1.2 branch latest.</environment>
            <key id="11636">DC-793</key>
            <summary>import-&gt;listTableColumns / export-&gt;alterTableSql issues</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="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Jul 2010 18:03:18 +0000</created>
                <updated>Sat, 17 Jul 2010 18:03:18 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-792] Doctrine query with the Oracle SOUNDEX function</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-792</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi all,&lt;br/&gt;
We create a doctrine query with the Oracle SOUNDEX function.&lt;br/&gt;
The Dql generated work fine when we run it on Oracle&lt;br/&gt;
 on the development envirenment an error is thrown  (Unknown function soundex)&lt;br/&gt;
this is the Dql generated:&lt;br/&gt;
SELECT * FROM ACTOR A WHERE A.bocompanyid = 32 AND soundex(actor_fname || &apos; &apos; || actor_name) = soundex(&apos;EEEE&apos;)&lt;/p&gt;

&lt;p&gt;related to :&lt;br/&gt;
$q = $this-&amp;gt;createQuery(&apos;A&apos;)-&amp;gt;select(&apos;*&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;A.bocompanyid = ?&apos;, $companyId)&lt;br/&gt;
-&amp;gt;andWhere(&quot;soundex(actor_fname || &apos; &apos; || actor_name) = soundex (&apos;&quot; .$actorName.&quot;&apos;)&quot;);&lt;/p&gt;</description>
                <environment>Ubuntu, oracle 11g, symfony 1.4.3</environment>
            <key id="11634">DC-792</key>
            <summary>Doctrine query with the Oracle SOUNDEX function</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="ghaliano">Ahmed GHALI</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Jul 2010 10:52:57 +0000</created>
                <updated>Fri, 16 Jul 2010 10:52:57 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-790] Doctrine_Inflector::unaccent() Problem with array keys for Norwegian characters</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-790</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Inflector.php, on line 221, there are missing keys (or values) for values &apos;&#229;&apos; and &apos;aa&apos; in $chars.&lt;br/&gt;
This generates a bug with $string which contains &quot;0&quot; or &quot;1&quot;.&lt;/p&gt;

&lt;p&gt;l221&lt;br/&gt;
// Norwegian characters&lt;br/&gt;
          &apos;&#197;&apos;=&amp;gt;&apos;Aa&apos;,&apos;&#198;&apos;=&amp;gt;&apos;Ae&apos;,&apos;&#216;&apos;=&amp;gt;&apos;O&apos;,&apos;&#230;&apos;=&amp;gt;&apos;a&apos;,&apos;&#248;&apos;=&amp;gt;&apos;o&apos;,&apos;&#229;&apos;,&apos;aa&apos;&lt;br/&gt;
          );&lt;/p&gt;</description>
                <environment></environment>
            <key id="11632">DC-790</key>
            <summary>Doctrine_Inflector::unaccent() Problem with array keys for Norwegian characters</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="bat">bat</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Jul 2010 04:58:52 +0000</created>
                <updated>Fri, 16 Jul 2010 05:04:04 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-789] Better documentation for the generated getInstance method in generated *Table.class.php files</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-789</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;As stated in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-518&quot; class=&quot;external-link&quot;&gt;DC-518&lt;/a&gt; the getInstance method is added in table classes generated by Doctrine 1.2.2. The problem is, that the word order is wrong for the parameter keyword to support auto completion in IDEs. At least the NetBeans IDE is not able to use this information properly.&lt;/p&gt;

&lt;p&gt;As it is common to expect phpDocumentor comment syntax, the first word after the @param keyword specifies the type, which is in the current version &lt;cite&gt;object&lt;/cite&gt;. It would be really helpful if the current form could be changed from&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;Doctrine/Import/Builder.php:1077&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;return&lt;/span&gt; object %s
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Doctrine/Import/Builder.php:1077&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;return&lt;/span&gt; %s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;as it was propossed in the above mentioned issue.&lt;/p&gt;</description>
                <environment>Symfony 1.4.6 with Doctrine 1.2.2 on Debian Linux 5.0</environment>
            <key id="11631">DC-789</key>
            <summary>Better documentation for the generated getInstance method in generated *Table.class.php files</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="cberg">Christoph Berg</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Jul 2010 03:02:11 +0000</created>
                <updated>Fri, 16 Jul 2010 03:02:11 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-788] Reopen DC-125. Searchable: batchUpdateIndex has a memory leak</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-788</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;batchUpdateIndex leaks memory when indexing a table&lt;/p&gt;</description>
                <environment>php5.3.2, mysql 5.1, centos 5</environment>
            <key id="11630">DC-788</key>
            <summary>Reopen DC-125. Searchable: batchUpdateIndex has a 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="fredl">Fred Luhamaa</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Jul 2010 14:08:33 +0000</created>
                <updated>Thu, 15 Jul 2010 14:31:18 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Searchable</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13589" author="fredl" created="Thu, 15 Jul 2010 14:13:57 +0000"  >&lt;p&gt;I&apos;m using Doctrine 1.2.2 with Symfony 1.4.7-dev ( both latest from Symfony svn).&lt;/p&gt;

&lt;p&gt;I have table with approx ~300 000 rows.&lt;/p&gt;

&lt;p&gt;Doctrine::getTable(&apos;sfVideo&apos;)-&amp;gt;batchUpdateIndex(); running this command will end after ~10 seconds.&lt;br/&gt;
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 71 bytes) in /usr/share/symfony/1.4/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 800&lt;/p&gt;

&lt;p&gt;Memory is leaking constantly even if using offset and limit.&lt;/p&gt;

&lt;p&gt;Doctrine::getTable(&apos;sfVideo&apos;)-&amp;gt;batchUpdateIndex(10000, 25000);&lt;/p&gt;

</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-787] Join &amp; On override</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-787</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Users &amp;amp; Books are linked by CompoUsersBooks. So, It&apos;s a m:m relationship.&lt;/p&gt;

&lt;p&gt;Here, a crazy DQL query to fetch users &amp;amp; specifics books.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt;&lt;br/&gt;
$query	= Doctrine_Query::create ()&lt;br/&gt;
	-&amp;gt;select (&quot;users.&lt;b&gt;, books.&lt;/b&gt;&quot;)&lt;br/&gt;
	-&amp;gt;from (&quot;Users users&quot;)&lt;br/&gt;
	-&amp;gt;leftJoin (&quot;users.alternateBooks alternateBooks&quot;)&lt;br/&gt;
	-&amp;gt;leftJoin (&quot;users.books books ON books.id_book = alternateBooks.id_book&quot;);&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;/code&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The SQL query&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt;&lt;br/&gt;
SELECT `s`.`id_show`            AS `s__id_show`&lt;br/&gt;
FROM   `users` `u`&lt;br/&gt;
       LEFT JOIN `compo_users_books` `c1`&lt;br/&gt;
         ON ( `u`.`id_user` = `c2`.`id_user` )&lt;br/&gt;
       LEFT JOIN `books` `b1`&lt;br/&gt;
         ON `c1`.`id_book` = `b1`.`id_book`&lt;br/&gt;
       LEFT JOIN `compo_users_books` `c2`&lt;br/&gt;
         ON `u`.`id_user` = `c2`.`id_user`&lt;br/&gt;
       LEFT JOIN `books` `b2`&lt;br/&gt;
         ON `b1`.`id_book` = `b2`.`id_book`&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;/code&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;As you can see, &lt;br/&gt;
The SQL query is correctly build.&lt;br/&gt;
But, this SQL Query isn&apos;t optimized at all.&lt;br/&gt;
Because the following part of code isn&apos;t use :&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt;&lt;br/&gt;
       LEFT JOIN `compo_users_books` `c2`&lt;br/&gt;
         ON `u`.`id_user` = `c2`.`id_user`&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;/code&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;And also, the left join is a cartesian product ! The number of row return is really big for nothing...&lt;/p&gt;

&lt;p&gt;That really sux because It&apos;s performance killer.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11627">DC-787</key>
            <summary>Join &amp; On override</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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Jul 2010 10:12:46 +0000</created>
                <updated>Thu, 15 Jul 2010 10:12:46 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-783] Doing introspection of postgres datagbases with sequences for columns does not generate &apos;nextval(sequence_name)::regclass&apos; for default value</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-783</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After database is introspected, yaml file worked on for minor tweeks, and normal development cycle of  drop database/rebuild database &amp;amp; sql, regular sql scrips and build in fuctions expecting the sequenced primary key columns to automatically create their own id from the sequence is broken. Found that in no case does this version of Doctrine put into the YML file&lt;/p&gt;

&lt;p&gt;&apos;nextval(sequenceName_seq&apos;::regclass)&lt;/p&gt;

&lt;p&gt;for the default value of the autoincrementing columns. Doing so should not affect any operation of the Doctrine library, as Doctrine gets the value independently by that exact call, and inserts that value into the column during inserts.&lt;/p&gt;

&lt;p&gt;BUT, *&lt;b&gt;NOT&lt;/b&gt;* having that as the default value BREAKS any SQL scripts or quick and dirty tasks via PGADMIN3 or any stored procedures expecting the column to assign itself the default value.&lt;/p&gt;

&lt;p&gt;Summary, it won&apos;t hurt doctrine&apos;s operation&lt;br/&gt;
but it&apos;ll help non doctrine operations.&lt;/p&gt;

&lt;p&gt;Seems like it should be done.&lt;/p&gt;</description>
                <environment>ubuntu/apache/postgres/php (LAP2/LAPP) Symfony 1.4.4 unmodified (orignal doctrine)</environment>
            <key id="11616">DC-783</key>
            <summary>Doing introspection of postgres datagbases with sequences for columns does not generate &apos;nextval(sequence_name)::regclass&apos; for default value</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="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 13:11:44 +0000</created>
                <updated>Mon, 12 Jul 2010 13:26:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13572" author="gearond" created="Mon, 12 Jul 2010 13:26:57 +0000"  >&lt;p&gt;I tried manually adding the default value to the yml file and symfony/doctrine ignores it - it never gets set in the next newly created database. Hmmmmm.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-782] Generated SQL for indexes is faulty</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-782</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We have the following YAML:&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;Yaml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;User:
  columns:
    id:
      type: integer
      unsigned: 1
      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;
    username: 
      type: string(255)
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  indexes:
    username_index:
      fields:
        username:
          type: unique
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The resulting record-class looks like this, which is still fine:&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;Class&lt;/b&gt;&lt;/div&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;setTableName(&apos;users&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;unsigned&apos; =&amp;gt; 1,
             &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;username&apos;, &apos;string&apos;, 255, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;length&apos; =&amp;gt; &apos;255&apos;,
             ));
 

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;index(&apos;username_index&apos;, array(
             &apos;fields&apos; =&amp;gt; 
             array(
              &apos;username&apos; =&amp;gt; 
              array(
              &apos;type&apos; =&amp;gt; &apos;unique&apos;,
              ),
             ),
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        parent::setUp();
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But the resulting SQL looks like this, which is faulty because of the Array stuff at the index:&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;SQL&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt; (&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; BIGSERIAL, &lt;span class=&quot;code-quote&quot;&gt;&quot;username&quot;&lt;/span&gt; VARCHAR(255) NOT NULL, PRIMARY KEY(&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;));
CREATE INDEX &lt;span class=&quot;code-quote&quot;&gt;&quot;username_index&quot;&lt;/span&gt; ON &lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt; (&lt;span class=&quot;code-quote&quot;&gt;&quot;Array&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>LAMP, PHP 5.2.6, PostgreSQL 8.3</environment>
            <key id="11613">DC-782</key>
            <summary>Generated SQL for indexes is faulty</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="tc77">Christian Schmitz</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Jul 2010 07:53:50 +0000</created>
                <updated>Sun, 11 Jul 2010 07:53:50 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-779] sf1.4 i18n form create/update item extra insert</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-779</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;config/doctrine/schema.yml:&lt;br/&gt;
JobeetCategory:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&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;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary:  true&lt;br/&gt;
      autoincrement:  true&lt;br/&gt;
    num:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull:  true&lt;/p&gt;

&lt;p&gt;lib/form/doctrine/JobeetCategoryForm.class.php:&lt;br/&gt;
class JobeetCategoryForm extends BaseJobeetCategoryForm&lt;br/&gt;
{&lt;br/&gt;
  public function configure()&lt;/p&gt;
  {
    $this-&amp;gt;embedI18n(array(&apos;nl&apos;));
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;then running:&lt;br/&gt;
./symfony doctrine:generate-module --non-verbose-templates --with-show backend category JobeetCategory&lt;/p&gt;

&lt;p&gt;surfing to:&lt;br/&gt;
backend_dev.php/category/new&lt;/p&gt;

&lt;p&gt;everything looks fine but as soon as I post valid data i get the following error:&lt;br/&gt;
500 | Internal Server Error | Doctrine_Connection_Mysql_Exception&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;1-nl&apos; for key &apos;PRIMARY&apos;&lt;/p&gt;

&lt;p&gt;And in my sql log i see it tries to execute the following (and fails):&lt;br/&gt;
START TRANSACTION&lt;br/&gt;
INSERT INTO `jobeet_category` (`created_at`, `updated_at`) VALUES (&apos;2005-01-01 00:00:00&apos;, &apos;2005-01-01 00:01:00&apos;)&lt;br/&gt;
INSERT INTO `jobeet_category_translation` (`id`, `lang`, `name`) VALUES (&apos;1&apos;, &apos;nl&apos;, &apos;2378&apos;)&lt;br/&gt;
INSERT INTO `jobeet_category_translation` (`id`, `lang`) VALUES (&apos;1&apos;, &apos;nl_NL&apos;)&lt;br/&gt;
ROLLBACK&lt;/p&gt;

&lt;p&gt;Obviously this third insert is not ok, but why is doctrine running it?&lt;/p&gt;

&lt;p&gt;I tried the Jobeet demo locally to see if I get the same issues with editing the I18n categories in the backend, but that all runs fine..&lt;/p&gt;

&lt;p&gt;I tried a apps/backend/config/settings.yml with:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;i18n&lt;br/&gt;
    i18n:                   true&lt;br/&gt;
    default_culture:        nl&lt;br/&gt;
    standard_helpers:       &lt;span class=&quot;error&quot;&gt;&amp;#91;Partial, I18N&amp;#93;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;and I also tried it commenting it all out. Still doesn&apos;t work.&lt;/p&gt;

&lt;p&gt;I really don&apos;t know why Doctrine runs this third insert and why it is using the incorrect &quot;nl_NL&quot; instead of &quot;nl&quot;.&lt;/p&gt;</description>
                <environment>problem arises \w Symfony 1.4.6 on Mac OS X 10.6.4 with Mysql 5.1.38 and a also on Ubuntu 10.04 Lucid \w bundled Apache 2.2.14 and Mysql 5.1.41</environment>
            <key id="11600">DC-779</key>
            <summary>sf1.4 i18n form create/update item extra insert</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="kuijsten">Tim</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Jul 2010 19:53:54 +0000</created>
                <updated>Thu, 14 Oct 2010 06:29:50 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>I18n</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14565" author="jpasquier" created="Thu, 14 Oct 2010 06:29:50 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I had the same problem, and was able to solve it setting the culture of the user.&lt;/p&gt;

&lt;p&gt;In my case, I had two languages: &quot;ca&quot; and &quot;es&quot; (catalan and spanish), and my default culture defined in settings.yml was &quot;ca_ES&quot;&lt;/p&gt;

&lt;p&gt;Every time I tried to save a symfony form with embeded translation forms, I got an error similar to the following one:&lt;br/&gt;
Integrity constraint violation: 1062 Duplicate entry &apos;3-ca&apos; for key &apos;PRIMARY&apos;&lt;/p&gt;

&lt;p&gt;Basically, symfony or Doctrine, was trying to do 3 inserts: one with the &quot;ca&quot; language, one with the &quot;es&quot; language and one with the &quot;ca_ES&quot; language!&lt;/p&gt;

&lt;p&gt;Here is the symfony log:&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;Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES &apos;UTF8&apos; - ()
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : SELECT COUNT(*) AS num_results FROM client c WHERE c.id = ? - (1)
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO campanya (client_id, idiomes, created_at, updated_at) VALUES (?, ?, ?, ?) - (1, a:1:{i:0;s:2:&quot;ca&quot;;}, 2010-10-13 14:38:46, 2010-10-13 14:38:46)
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : SELECT c.id AS c__id, c.lang AS c__lang, c.slug AS c__slug FROM campanya_translation c WHERE (c.slug LIKE ? AND c.lang = ? AND c.nom = ?) - (aixo-es-una-nova-campanya-en-catala%, ca, Aix&#242; &#233;s una nova campanya, en catal&#224;)
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO campanya_translation (id, lang, nom, descripcio, slug) VALUES (?, ?, ?, ?, ?) - (3, ca, Aix&#242; &#233;s una nova campanya, en catal&#224;, Lorem ipsum dolor...
Hic et nunc!, aixo-es-una-nova-campanya-en-catala)
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : SELECT c.id AS c__id, c.lang AS c__lang, c.slug AS c__slug FROM campanya_translation c WHERE (c.slug LIKE ? AND c.lang = ? AND c.nom = ?) - (%, es, )
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO campanya_translation (id, lang, nom, descripcio, slug) VALUES (?, ?, ?, ?, ?) - (3, es, , , )
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : SELECT c.id AS c__id, c.lang AS c__lang, c.slug AS c__slug FROM campanya_translation c WHERE (c.slug LIKE ? AND c.lang = ? AND c.nom IS NULL) - (%, ca_ES)
Oct 13 14:38:46 symfony [info] {Doctrine_Connection_Statement} execute : INSERT INTO campanya_translation (id, lang, slug) VALUES (?, ?, ?) - (3, ca_ES, )
Oct 13 14:38:46 symfony [err] {Doctrine_Connection_Mysql_Exception} SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &apos;3-ca&apos; for key &apos;PRIMARY&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, I was able to solve it doing a:&lt;br/&gt;
$this-&amp;gt;getUser()-&amp;gt;setCulture(&apos;ca&apos;);&lt;br/&gt;
when users log into my application.&lt;/p&gt;

&lt;p&gt;I&apos;m using symfony 1.4.9&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-778] Aggregate column becomes NULL when using TableClass-&gt;create(array(...))</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-778</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I use aggregate column inheritance, say B extends A, and create a new record instance of B using BTable-&amp;gt;create(array(...values...)). But due to changeset &lt;span class=&quot;error&quot;&gt;&amp;#91;7618&amp;#93;&lt;/span&gt; this fails to set the aggregate column value to the value assigned for B, it becomes NULL.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11598">DC-778</key>
            <summary>Aggregate column becomes NULL when using TableClass-&gt;create(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="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Jul 2010 15:01:17 +0000</created>
                <updated>Wed, 1 Sep 2010 14:39:59 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14223" author="jwage" created="Wed, 1 Sep 2010 14:39:59 +0000"  >&lt;p&gt;Can you provide some more information and/or a test case?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-777] getConnectionForComponent and bindComponent are case sensitive </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-777</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using multiple database connections, the sfDoctrinePlugin for Symfony 1.4.x is case sensitive when looking up the connection for a model / component while the Symfony is not.&lt;/p&gt;

&lt;p&gt;This causes  code to function correct even when the model names are used in lower case. Once a second connection is configured, the model name is registered in upper case via the base-class (as per the naming convention) causing the wrong connection to be chosen when the model is referenced in lower case.&lt;/p&gt;


&lt;p&gt;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; 
$componentName = &apos;Country&apos;;

$this-&amp;gt;_bound[$componentName] = $connectionName;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Will result in no connection found for:&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; 
$componentName = &apos;country&apos;;

if (isset($this-&amp;gt;_bound[$componentName])) {
            return $this-&amp;gt;getConnection($this-&amp;gt;_bound[$componentName]);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Unless this was purposely designed to be case-sensitive, I think this should be changed to prevent confusion since in general PHP is not case sensitive when dealing with variable names.&lt;/p&gt;

&lt;p&gt;This bug is related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-740&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-740&lt;/a&gt; &lt;/p&gt;</description>
                <environment>Symfony 1.4.x&lt;br/&gt;
sfDoctrinePlugin&lt;br/&gt;
</environment>
            <key id="11593">DC-777</key>
            <summary>getConnectionForComponent and bindComponent are case sensitive </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="pluk77">Marcel Berteler</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Jul 2010 08:06:34 +0000</created>
                <updated>Wed, 7 Jul 2010 08:06:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10690" name="doctrine_manager.patch" size="1563" author="pluk77" created="Wed, 7 Jul 2010 08:06:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-774] Cannot fromArray a toArray with many to many records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-774</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When working with a many to many record, if you &lt;tt&gt;toArray&lt;/tt&gt; then &lt;tt&gt;synchronizeWithArray&lt;/tt&gt;/&lt;tt&gt;fromArray&lt;/tt&gt; the result - you get an exception. &lt;/p&gt;

&lt;p&gt;This appears to be due to the fact that &lt;tt&gt;toArray&lt;/tt&gt; returns collections of &lt;tt&gt;array(0 =&amp;gt; false)&lt;/tt&gt; (because a record is in a locked state) and &lt;tt&gt;fromArray&lt;/tt&gt; will attempt to &lt;tt&gt;link()&lt;/tt&gt; the &lt;tt&gt;refClass&lt;/tt&gt; (which has multiple identifiers).&lt;/p&gt;

&lt;p&gt;Here&apos;s a test that should show this behavior: &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 Doctrine_Ticket_DC774_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 prepareTables()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;EntityAddress&apos;;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Book&apos;;
        parent::prepareTables();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareData()
    {
        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
        $user-&amp;gt;name = &apos;TestUser&apos;;

        $address = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Address();
        $address-&amp;gt;address = &apos;TestAddress&apos;;

        $user-&amp;gt;Addresses[] = $address;
        
        $user-&amp;gt;save();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testToArraySynchronizeWithManyToMany() {
        $user = Doctrine_Core::getTable(&apos;User&apos;)-&amp;gt;findOneByName(&apos;TestUser&apos;);
        $user-&amp;gt;refreshRelated();
        $user-&amp;gt;synchronizeWithArray($user-&amp;gt;toArray());
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testToArrayFromManyToMany() {
        $user = Doctrine_Core::getTable(&apos;User&apos;)-&amp;gt;findOneByName(&apos;TestUser&apos;);
        $user-&amp;gt;refreshRelated();
        $user-&amp;gt;fromArray($user-&amp;gt;toArray());
    }
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11578">DC-774</key>
            <summary>Cannot fromArray a toArray with many to many 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="jochu">Jeff Chu</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2010 19:00:14 +0000</created>
                <updated>Thu, 1 Jul 2010 20:04:35 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13493" author="jochu" created="Thu, 1 Jul 2010 19:42:18 +0000"  >&lt;p&gt;I doubt this is the right way to fix this, but we wrote in a patch that has the link() function ignore relations that with multiple identifiers. I figured this would be alright since linking those in directly don&apos;t make too much sense anyways.&lt;/p&gt;

&lt;p&gt;It seems to pass the doctrine test suite. I&apos;ve attached the patch in case anyone is curious. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10687" name="doctrine-link.patch" size="1478" author="jochu" created="Thu, 1 Jul 2010 19:42:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-773] Connection::createQuery() can use wrong connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-773</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Similar to bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-437&quot; title=&quot;Connection::query() can use wrong connection&quot;&gt;&lt;del&gt;DC-437&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-437&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-437&lt;/a&gt;)&lt;br/&gt;
When calling Connection::createQuery() object we use the default connection instead of the connection we have when calling the createQuery() method.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11577">DC-773</key>
            <summary>Connection::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="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="lonnyk">Lonny Kapelushnik</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2010 16:37:22 +0000</created>
                <updated>Thu, 1 Jul 2010 18:13:31 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13485" author="lonnyk" created="Thu, 1 Jul 2010 18:13:31 +0000"  >&lt;p&gt;Patch and Test Case&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10686" name="DC773TestCase.php" size="4321" author="lonnyk" created="Thu, 1 Jul 2010 18:13:31 +0000" />
                    <attachment id="10685" name="DC_773.patch" size="482" author="lonnyk" created="Thu, 1 Jul 2010 18:13:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-769] Variable type different for return value from Doctrine_Record-&gt;toArray() depending on whether the object is from a select, or a save.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-769</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With a object that is created via a save(),  and the record&apos;s primary key is a INT fed by a SEQUENCE, the type of the variable is an INT.&lt;/p&gt;

&lt;p&gt;With an object that is hydrated from the database via a SELECT, the record&apos;s primary key INT will come back in &apos;toArray()&apos; as a STRING.&lt;/p&gt;

&lt;p&gt;That means that checking for type has to know what context it came from, user, INSERT, or SELECT. Not fun.&lt;/p&gt;

&lt;p&gt;This also screws up converting arrays to JSON, &apos;cause the STRINGS get quotation marks and the INTS do not.&lt;/p&gt;

&lt;p&gt;As a general rule, everything FROM the database seems to be strings. Yes, I know, everything &apos;on the wire&apos; or &apos;through a socket&apos; comes out as text. And it&apos;s a lot faster to leave it that way.&lt;/p&gt;

&lt;p&gt;But having the type be different depending on the database operation? Not sure I like that.&lt;/p&gt;</description>
                <environment>Ubuntu9.10, PHP 5.2.6, Symfony 1.4.1, Postgres8.4</environment>
            <key id="11557">DC-769</key>
            <summary>Variable type different for return value from Doctrine_Record-&gt;toArray() depending on whether the object is from a select, or a 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="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Jun 2010 00:55:48 +0000</created>
                <updated>Tue, 24 Aug 2010 12:55:48 +0000</updated>
                                    <version>1.2.1</version>
                                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14050" author="jwage" created="Tue, 24 Aug 2010 12:02:06 +0000"  >&lt;p&gt;Can you provide a test case so that we can see if we can come up with a patch?&lt;/p&gt;</comment>
                </comments>
                    <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-766] preQuery() and getConnection() - multiple connections</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-766</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When preQuery() hook is invoked, any calls to $this-&amp;gt;getConnection() in preQuery() body  is useless because it always returns the current connection instead of the connection bound with component that is being queried.&lt;/p&gt;

&lt;p&gt;I am using this hook to switch the connection to connection to master host for schema of the queried component , but cannot do this because the is no way to obtain information about which component this query uses and what would be bounded connection.&lt;br/&gt;
The connection is propely set by Doctrine but after the preQuery() hook is invoked, but when this finally happens i have no control over the execution of the query.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11553">DC-766</key>
            <summary>preQuery() and getConnection() - multiple 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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="maciek">Maciej Mazur</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Jun 2010 05:04:47 +0000</created>
                <updated>Fri, 25 Jun 2010 05:04:47 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-765] Incorrect query for inherited many-to-many relation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-765</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Column Aggregation Inheritance, Many to Many &lt;/p&gt;

&lt;p&gt;Inspired by post on symfonyexperts.com (&lt;a href=&quot;http://symfonyexperts.com/question/show/id/48&quot; class=&quot;external-link&quot;&gt;http://symfonyexperts.com/question/show/id/48&lt;/a&gt;) I tried to setup a similar scenario whith 1 &apos;Entity&apos; Model and many-to-many relations between them.&lt;br/&gt;
The different types of relations between them are implemented by inheritance.&lt;/p&gt;

&lt;p&gt;It seems that Doctrine is omitting the type of the key field in the generated queries.&lt;br/&gt;
I put up an example to reproduce it:&lt;/p&gt;


&lt;p&gt;Model (YAML)&lt;br/&gt;
---------------------------------------&lt;br/&gt;
Entity:&lt;br/&gt;
  columns:&lt;br/&gt;
    name: &lt;/p&gt;
{ type: varchar(20) }
&lt;p&gt;  relations:&lt;br/&gt;
    Owners:      &lt;/p&gt;
{ class: Entity, local: src_entity_id, foreign: dst_entity_id, refClass: EntityRelationOwner }
&lt;p&gt;    Compatibles: &lt;/p&gt;
{ class: Entity, local: src_entity_id, foreign: dst_entity_id, refClass: EntityRelationCompatible }

&lt;p&gt;EntityRelation:&lt;br/&gt;
  columns:&lt;br/&gt;
    src_entity_id: &lt;/p&gt;
{ type: integer(4), primary: true }
&lt;p&gt;    dst_entity_id: &lt;/p&gt;
{ type: integer(4), primary: true }
&lt;p&gt;    type:          &lt;/p&gt;
{ type: string(10) }


&lt;p&gt;EntityRelationOwner:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: EntityRelation&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: owner&lt;/p&gt;

&lt;p&gt;EntityRelationCompatible:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: EntityRelation&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: compatible&lt;/p&gt;

&lt;p&gt;Action:&lt;br/&gt;
---------------------------------------&lt;br/&gt;
  ..&lt;br/&gt;
  $entity = Doctrine::getTable(&apos;Entity&apos;)-&amp;gt;find(1);&lt;br/&gt;
  $entity-&amp;gt;getOwners()&lt;br/&gt;
  ..&lt;/p&gt;

&lt;p&gt;SQL:&lt;br/&gt;
---------------------------------------&lt;br/&gt;
SELECT entity.id AS entity__id,&lt;br/&gt;
       entity.name AS entity__name,&lt;br/&gt;
       entity_relation.src_entity_id AS entity_relation__src_entity_id,&lt;br/&gt;
       entity_relation.dst_entity_id AS entity_relation__dst_entity_id,&lt;br/&gt;
       entity_relation.type AS entity_relation__type&lt;br/&gt;
FROM entity&lt;br/&gt;
     INNER JOIN entity_relation ON entity.id = entity_relation.dst_entity_id&lt;br/&gt;
WHERE entity.id IN (&lt;br/&gt;
     SELECT dst_entity_id FROM entity_relation WHERE src_entity_id = &apos;1&apos;&lt;br/&gt;
)&lt;br/&gt;
ORDER BY entity.id ASC&lt;/p&gt;



&lt;p&gt;To my understanding, the inner SQL statement is missing the type restriction and should be:&lt;/p&gt;

&lt;p&gt;SELECT dst_entity_id FROM entity_relation WHERE src_entity_id = &apos;1&apos; AND type = &apos;owner&apos;&lt;/p&gt;</description>
                <environment>PHP Version 5.3.0&lt;br/&gt;
System 	Windows NT ZEUS 5.1 build 2600 (Windows XP Professional Service Pack 3) i586 &lt;br/&gt;
symfony version 1.4.6-DEV&lt;br/&gt;
sfDoctrinePlugin revision 29679</environment>
            <key id="11551">DC-765</key>
            <summary>Incorrect query for inherited 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jmiridis">Jorgo Miridis</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 22:43:32 +0000</created>
                <updated>Thu, 24 Jun 2010 22:43:32 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-761] MSSQL Server: No support for transaction savepoints </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-761</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Transaction_MSSQL doesn&apos;t provide methods for working with transaction savepoints. I&apos;ve attached a patch to address this.&lt;/p&gt;

&lt;p&gt;N.B. As far as I can see, SQL Server doesn&apos;t support the release of savepoints, so I&apos;ve just stubbed that method out.&lt;/p&gt;</description>
                <environment>Windows XP&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11542">DC-761</key>
            <summary>MSSQL Server: No support for transaction savepoints </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="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 06:06:01 +0000</created>
                <updated>Thu, 24 Jun 2010 06:06:01 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10678" name="doctrine_transaction_mssql_savepoints.patch" size="1403" author="craigmarvelley" created="Thu, 24 Jun 2010 06:06:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-760] MSSQL Server: Support for RAND() in Doctrine_Expression_MSSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-760</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Expression_MSSQL doesn&apos;t provide a method for handling SQL Server&apos;s RAND() method. I&apos;ve attached a patch to support it.&lt;/p&gt;</description>
                <environment>Windows XP&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11541">DC-760</key>
            <summary>MSSQL Server: Support for RAND() in Doctrine_Expression_MSSQL</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="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 05:40:34 +0000</created>
                <updated>Thu, 24 Jun 2010 05:40:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10677" name="doctrine_expression_mssql_rand.patch" size="485" author="craigmarvelley" created="Thu, 24 Jun 2010 05:40:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-759] MSSQL Server / ODBC: Cannot order by a column aggregate when a limit subquery is required.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-759</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It&apos;s not possible to use a column aggregate function and a limit subquery together with SQL Server; the logic that constructs the limit subquery is flawed, not recognising the presence of a function and assuming it to be a column. The resulting error occurs:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 207 &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;Invalid column name ...&lt;/p&gt;

&lt;p&gt;This can be observed when running the random sorting example from the manual against SQL Server through ODBC:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/hu/dql-doctrine-query-language:order-by-clause:using-random-order&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/hu/dql-doctrine-query-language:order-by-clause:using-random-order&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition to the syntax error, it seems SQL Server requires that all aggregate functions that appear in the order by section of the query are declared (i.e. aliased) in the select section which is not currently happening.&lt;/p&gt;

&lt;p&gt;I also noticed what I &lt;b&gt;think&lt;/b&gt; is a bug in the ordering of results within the sub-select on line 214 of Doctrine_Connection_Mssql:&lt;br/&gt;
$query .= (stripos($sorts&lt;span class=&quot;error&quot;&gt;&amp;#91;$i&amp;#93;&lt;/span&gt;, &apos;asc&apos;) !== false) ? &apos;DESC&apos; : &apos;ASC&apos;;&lt;/p&gt;

&lt;p&gt;which appears to be sorting in the opposite order as to what was intended.&lt;/p&gt;

&lt;p&gt;I&apos;ve a fix and a test case which attempts to address these issues. I noticed two other open issues surrounding this section of code (#586 and #744)  - if this patch is accepted I think these issues will also be resolved.&lt;/p&gt;</description>
                <environment>Windows XP&lt;br/&gt;
Apache 2.2&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11538">DC-759</key>
            <summary>MSSQL Server / ODBC: Cannot order by a column aggregate when a limit subquery is required.</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="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Jun 2010 12:36:25 +0000</created>
                <updated>Tue, 22 Jun 2010 12:43:27 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13400" author="craigmarvelley" created="Tue, 22 Jun 2010 12:41:22 +0000"  >&lt;p&gt;Uploaded patch and test case.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10676" name="DC759TestCase.php" size="2430" author="craigmarvelley" created="Tue, 22 Jun 2010 12:43:27 +0000" />
                    <attachment id="10674" name="doctrine_aggregate_function_order_patch.patch" size="2515" author="craigmarvelley" created="Tue, 22 Jun 2010 12:41:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-758] CascadeDelete not work properly on Versionable and on the AuditLog</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-758</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&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; 
Schema:

Personal:
  actAs:
    Versionable:
      deleteVersions: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      cascadeDelete: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When you use this configuration and try to delete one of the record linked with the versionned one, an exception about foreign key is raised because the id of the versioned record has a foreign key to the id of the record.&lt;/p&gt;

&lt;p&gt;It&apos;s necessary to could work with cascadeDelete: false... because like that it&apos;s needed to use softDelete and the deleted record&apos;s will be stored on the version table, but with the advantage that you don&apos;t have the performance problem of soft delete behaviour.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>Mac OS X Snow Leopard, LAMP and Macports</environment>
            <key id="11535">DC-758</key>
            <summary>CascadeDelete not work properly on Versionable and on the AuditLog</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>Mon, 21 Jun 2010 13:54:37 +0000</created>
                <updated>Tue, 24 Aug 2010 12:55:48 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-757] In SQL query, field name is not replaced with real column name in right part of join condition</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-757</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;br/&gt;
I&apos;m blocked on a bad issue &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;I have a schema that uses fields aliases:&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-none&quot;&gt;User:

Phonenumber:
  columns:
    theuser:
      name: colprefix_user_id as user_id   #note the column alias
      type: integer
    thenumber:
      name: colprefix_number as number
      type: string(20)
  relations:
    User:
      local: user_id
      foreign: id
      foreignAlias: Phonenumbers
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now if I make the following 2 DQL queries, the first &quot;plain&quot; and the second with redefining the ON clause, then print generated 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;$q1 = Doctrine_Query::create()
    -&amp;gt;from(&apos;User u&apos;)
    -&amp;gt;innerJoin(&apos;u.Phonenumbers p&apos;);

$q2 = Doctrine_Query::create()
    -&amp;gt;from(&apos;User u&apos;)
    -&amp;gt;innerJoin(&apos;u.Phonenumbers p ON u.id = p.user_id&apos;);

echo $q1-&amp;gt;getSqlQuery() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
echo $q2-&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;I get (lines formatted a little):&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 u.id AS u__id, p.id AS p__id, p.colprefix_user_id AS p__colprefix_user_id, p.colprefix_number AS p__colprefix_number
        FROM user u INNER JOIN phonenumber p ON u.id = p.colprefix_user_id

SELECT u.id AS u__id, p.id AS p__id, p.colprefix_user_id AS p__colprefix_user_id, p.colprefix_number AS p__colprefix_number
        FROM user u INNER JOIN phonenumber p ON (u.id = p.user_id)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note how, on the right end, p.user_id is &lt;b&gt;not&lt;/b&gt; replaced with p.colprefix_user_id in the 2nd query!&lt;br/&gt;
If I try to execute $q2 I get&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;Fatal error:  Uncaught exception &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;p.user_id&apos; in &apos;on clause&apos;&apos; in /&lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;/doctrine_test/lib/vendor/doctrine/Doctrine/Connection.php:1082&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This only happens for the &lt;em&gt;right&lt;/em&gt; member of the join condition. If i swap the fields 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;$q3 = Doctrine_Query::create()
    -&amp;gt;from(&apos;User u&apos;)
    -&amp;gt;innerJoin(&apos;u.Phonenumbers p ON p.user_id = u.id&apos;); &lt;span class=&quot;code-comment&quot;&gt;//swapped
&lt;/span&gt;
echo $q3-&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;then we can see that the &lt;em&gt;left&lt;/em&gt; member is replaced well:&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 u.id AS u__id, p.id AS p__id, p.colprefix_user_id AS p__colprefix_user_id, p.colprefix_number AS p__colprefix_number
        FROM user u INNER JOIN phonenumber p ON (p.colprefix_user_id = u.id)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(This is only an example, there&apos;s no point redefining the ON clause here, but the same is occurring in the project I work on, in a WITH clause).&lt;/p&gt;

&lt;p&gt;I think the problem is in &lt;em&gt;Doctrine_Query_JoinCondition::load()&lt;/em&gt;, in which&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the &lt;b&gt;left&lt;/b&gt; member of condition is directly parsed in a call to &lt;tt&gt;Doctrine_Query::parseClause()&lt;/tt&gt;;&lt;/li&gt;
	&lt;li&gt;whereas the &lt;b&gt;right&lt;/b&gt; member is checked if it&apos;s a subquery, and if not, is transformed into the result of &lt;tt&gt;Doctrine_Expression::getSql()&lt;/tt&gt; then passed to &lt;tt&gt;Doctrine_Query_JoinCondition::parseLiteralValue()&lt;/tt&gt; or &lt;tt&gt;Doctrine_Query::parseClause()&lt;/tt&gt; if it is an SQL function...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This can also produce weird results with SQL functions:&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;$q4 = Doctrine_Query::create()
    -&amp;gt;from(&apos;User u&apos;)
    -&amp;gt;innerJoin(&apos;u.Phonenumbers p WITH SUBSTRING(p.number,0,3) = \&apos;555\&apos;&apos;); &lt;span class=&quot;code-comment&quot;&gt;//left
&lt;/span&gt;
$q5 = Doctrine_Query::create()
    -&amp;gt;from(&apos;User u&apos;)
    -&amp;gt;innerJoin(&apos;u.Phonenumbers p WITH \&apos;555\&apos; = SUBSTRING(p.number,0,3)&apos;); &lt;span class=&quot;code-comment&quot;&gt;//right
&lt;/span&gt;
echo $q4-&amp;gt;getSqlQuery() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
echo $q5-&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;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 u.id AS u__id, p.id AS p__id, p.colprefix_user_id AS p__colprefix_user_id, p.colprefix_number AS p__colprefix_number
        FROM user u INNER JOIN phonenumber p ON u.id = p.colprefix_user_id AND (SUBSTRING(p.colprefix_number FROM 0 FOR 3) = &apos;555&apos;)

SELECT u.id AS u__id, p.id AS p__id, p.colprefix_user_id AS p__colprefix_user_id, p.colprefix_number AS p__colprefix_number
        FROM user u INNER JOIN phonenumber p ON u.id = p.colprefix_user_id AND (&apos;555&apos; = SUBSTRING(p.colprefix_number FROM 0 FOR 3 FROM ))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now, the correct column name is always used, but in the 2nd case the &quot;SUBSTRING&quot; function looks like it has been parsed twice :/&lt;/p&gt;

&lt;p&gt;I think both members (left and right) of condition should be treated equally (but I have no fix for now... :s)&lt;/p&gt;

&lt;p&gt;Thank you &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>Doctrine SVN 1.2 r7676</environment>
            <key id="11533">DC-757</key>
            <summary>In SQL query, field name is not replaced with real column name in right part of join condition</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="gx">Guilliam X</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 08:42:20 +0000</created>
                <updated>Mon, 21 Jun 2010 10:04:06 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13387" author="gx" created="Mon, 21 Jun 2010 10:04:06 +0000"  >&lt;p&gt;Waiting for better, I attach the patch I used;&lt;br/&gt;
but it&apos;s not a good one, as it only &quot;solves&quot; the field name problem but not the SUBSTRING one, and is more a patch than a fix... (sorry I don&apos;t feel to refactor Doctrine_Query_JoinCondition::load() :s)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10672" name="DC757-patch_1.txt" size="792" author="gx" created="Mon, 21 Jun 2010 10:04:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-756] Cannot use named parameters in a &apos;limit(&apos;:max&apos;) clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-756</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$modulus=5;&lt;br/&gt;
$offset=2;&lt;br/&gt;
$this-&amp;gt;Statuses&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ready&amp;#39;&amp;#93;&lt;/span&gt;=1;&lt;/p&gt;

&lt;p&gt;This works&lt;br/&gt;
---------------------------------&lt;br/&gt;
   $DetailsList=&lt;br/&gt;
     Doctrine_Query::create()-&amp;gt;from(&apos;Data s&apos;)&lt;br/&gt;
                             -&amp;gt;where(&apos;s.status_id=:status_id&apos;)&lt;br/&gt;
                             -&amp;gt;andWhere(&apos;((s.id % :modulus) - :offset)=0&apos;)&lt;br/&gt;
                             -&amp;gt;orderBy(&apos;s.id&apos;)&lt;br/&gt;
                             -&amp;gt;limit($maxDaysDetailsToProcess)&lt;br/&gt;
                             &lt;del&gt;&amp;gt;execute(array(&apos;:status_id&apos;=&amp;gt;$this&lt;/del&gt;&amp;gt;Statuses&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ready&amp;#39;&amp;#93;&lt;/span&gt;,&lt;br/&gt;
                                              &apos;:modulus&apos;=&amp;gt;$modulus,&lt;br/&gt;
                                              &apos;:offset&apos;=&amp;gt;$offset), Doctrine::HYDRATE_ARRAY);&lt;/p&gt;




&lt;p&gt;This does not, it gets the whole table&lt;br/&gt;
---------------------------------&lt;br/&gt;
   $DetailsList=&lt;br/&gt;
     Doctrine_Query::create()-&amp;gt;from(&apos;Data s&apos;)&lt;br/&gt;
                             -&amp;gt;where(&apos;s.status_id=:status_id&apos;)&lt;br/&gt;
                             -&amp;gt;andWhere(&apos;((s.id % :modulus) - :offset)=0&apos;)&lt;br/&gt;
                             -&amp;gt;orderBy(&apos;s.id&apos;)&lt;br/&gt;
                             -&amp;gt;limit(&apos;:max&apos;)&lt;br/&gt;
                             &lt;del&gt;&amp;gt;execute(array(&apos;:status_id&apos;=&amp;gt;$this&lt;/del&gt;&amp;gt;Statuses&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ready&amp;#39;&amp;#93;&lt;/span&gt;,&lt;br/&gt;
                                              &apos;:modulus&apos;=&amp;gt;$modulus,&lt;br/&gt;
                                              &apos;:offset&apos;=&amp;gt;$offset,&lt;br/&gt;
                                              &apos;:max&apos;=&amp;gt;$maxDaysDetailsToProcess), Doctrine::HYDRATE_ARRAY);&lt;/p&gt;

</description>
                <environment>ubuntu, apache, symfony version 1.4.4</environment>
            <key id="11532">DC-756</key>
            <summary>Cannot use named parameters in a &apos;limit(&apos;:max&apos;) 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 01:01:11 +0000</created>
                <updated>Tue, 7 Sep 2010 17:10:38 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13410" author="gearond" created="Thu, 24 Jun 2010 20:58:58 +0000"  >&lt;p&gt;I noticed an error in the code, which does not solve the problem, only confuse whomever works on 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;  Please add &lt;/p&gt;

&lt;p&gt;$maxDaysDetailsToProcess=3;&lt;/p&gt;

&lt;p&gt;as the fourth line in the code.&lt;/p&gt;</comment>
                    <comment id="14302" author="jagalan" created="Tue, 7 Sep 2010 17:10:20 +0000"  >&lt;p&gt;I think I found a solution but it&apos;s making some tests fail. Let me explain you what I did:&lt;/p&gt;

&lt;p&gt;First I removed any casting to int of the limit value, in order to keep the named parameter in the LIMIT part of the query. Actually this named parameters were converted to 0 due to those int castings.&lt;/p&gt;

&lt;p&gt;Then I realized that the params are bound as strings so the resulting query looks like ... LIMIT &quot;2&quot; or whatever you put in the limit value, and mysql throws and error. Then I tryed to modify the function that binds the paramters to bind them as integers when they&apos;re not strings. Everything seems to work fine and you could put named parameters in the limit clause, but some tests are failing. If you look at the tests that are failing you&apos;ll see that they&apos;re failing because of a wrong phone number, the test it&apos;s expecting a number large number like 6155139185 but the result array has a number like 1860171889. I&apos;m wondering if there&apos;s something wrong when binding numbers bigger than mysql INT as integers.&lt;/p&gt;

&lt;p&gt;I attach a diff file with the changes I did, hope it helps&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10779" name="DC-756.partial.patch" size="2068" author="jagalan" created="Tue, 7 Sep 2010 17:10:38 +0000" />
                </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-751] [PATCH] fix migration builder for remove index</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-751</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;remove the third argumnet it is not used/defined&lt;/p&gt;</description>
                <environment></environment>
            <key id="11519">DC-751</key>
            <summary>[PATCH] fix migration builder for remove index</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="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Jun 2010 03:44:21 +0000</created>
                <updated>Fri, 18 Jun 2010 03:44:21 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10670" name="remove_index.patch" size="734" author="gimler" created="Fri, 18 Jun 2010 03:44:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-750] migration error when deleting 2 or more related classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-750</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;That&apos;s my relevant schema.yml before changes:&lt;/p&gt;

&lt;p&gt;Customer:&lt;br/&gt;
  columns:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;CustomerPlace:&lt;br/&gt;
  columns:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Customer:&lt;br/&gt;
      local:                customer_id&lt;br/&gt;
      foreignAlias:         Addresses&lt;br/&gt;
      onDelete:             CASCADE&lt;/p&gt;

&lt;p&gt;CustomerPerson:&lt;br/&gt;
  columns:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    CustomerPlace:&lt;br/&gt;
      local:                place_id&lt;br/&gt;
      foreignAlias:         Contacts&lt;br/&gt;
      onDelete:             CASCADE&lt;/p&gt;

&lt;p&gt;I deleted all of the 3 entities, I executed symfony doctrine:generate-migrations-diff, which created the migration file containing:&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;dropTable(&apos;customer&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropTable(&apos;customer_person&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropTable(&apos;customer_place&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Executing the migration, gave me error for constrain violation. To fix the error, I 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;this&lt;/span&gt;-&amp;gt;dropForeignKey(&apos;customer_person&apos;, &apos;customer_person_place_id_customer_place_id&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropForeignKey(&apos;customer_place&apos;, &apos;customer_place_customer_id_customer_id&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11517">DC-750</key>
            <summary>migration error when deleting 2 or more related classes</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="gionn">Giovanni Toraldo</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 16:31:18 +0000</created>
                <updated>Thu, 1 Jul 2010 05:29:04 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13480" author="gionn" created="Thu, 1 Jul 2010 05:28:45 +0000"  >&lt;p&gt;Another way for fixing this issue, could be to generate a migration class for each of the related tables, so they are executed in different transaction, so integrity constrains aren&apos;t violated.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-748] Warning: implode(): Invalid arguments passed in /Doctrine/Table.php on line on line 922</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-748</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Calling to function implode() while not checked if second argument is an array.&lt;br/&gt;
Arrives anywhere on trying to create and get Doctrine_Query and Doctrine_Collection objects. Also on using Doctrine_Cli commands.&lt;br/&gt;
Here is a fragment that generates warning:&lt;/p&gt;

&lt;p&gt;class Doctrine_Table extends Doctrine_Configurable implements Countable&lt;br/&gt;
{&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;public function unique($fields, $options = array(), $createdUniqueIndex = true)&lt;br/&gt;
    {&lt;br/&gt;
        if ($createdUniqueIndex) &lt;/p&gt;
{
            $name = implode(&apos;_&apos;, $fields) . &apos;_unqidx&apos;; // this line generates warning
            $definition = array(&apos;type&apos; =&amp;gt; &apos;unique&apos;, &apos;fields&apos; =&amp;gt; $fields);
            $this-&amp;gt;addIndex($name, $definition);
        }

&lt;p&gt;        $this-&amp;gt;_uniques[] = array($fields, $options);&lt;br/&gt;
    }&lt;br/&gt;
...&lt;br/&gt;
}&lt;/p&gt;

</description>
                <environment>mysql 5.1.40, php 5.3.1</environment>
            <key id="11514">DC-748</key>
            <summary>Warning: implode(): Invalid arguments passed in /Doctrine/Table.php on line on line 922</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="victorgugo">Victor Paladiychuk</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 08:43:21 +0000</created>
                <updated>Thu, 17 Jun 2010 08:43:21 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10666" name="Table.php" size="94728" author="victorgugo" created="Thu, 17 Jun 2010 08:43:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-742] Add support for relations consist on two or more fileds</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-742</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Let&apos;s say I have following tables:&lt;/p&gt;

&lt;p&gt;article&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;art_id&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;article_version&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;art_id&lt;/li&gt;
	&lt;li&gt;art_version&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;category&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;cat_id&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;category2article&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;cat_id&lt;/li&gt;
	&lt;li&gt;art_id&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;category2article_version&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;cat_id&lt;/li&gt;
	&lt;li&gt;art_id&lt;/li&gt;
	&lt;li&gt;art_version&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As I know I can describe relation between tables `article` and `category`, but I cannot describe relation between `artcile_version` and `category`.&lt;br/&gt;
The problem is Doctrine supports only following relation mapping:&lt;br/&gt;
$this-&amp;gt;hasMany(&apos;Category as categories&apos;, array(&lt;br/&gt;
    &apos;local&apos;    =&amp;gt; &apos;art_id&apos;,&lt;br/&gt;
    &apos;foreign&apos;  =&amp;gt; &apos;cat_id&apos;,&lt;br/&gt;
    &apos;refClass&apos; =&amp;gt; &apos;Category2Article&apos;&lt;br/&gt;
));&lt;/p&gt;

&lt;p&gt;It would be nice to have also something like that:&lt;br/&gt;
$this-&amp;gt;hasMany(&apos;Category as categories&apos;, array(&lt;br/&gt;
    &apos;local&apos;    =&amp;gt; array(&apos;art_id&apos;, &apos;art_version&apos;)&lt;br/&gt;
    &apos;foreign&apos;  =&amp;gt; &apos;cat_id&apos;,&lt;br/&gt;
    &apos;refClass&apos; =&amp;gt; &apos;Category2ArticleVc&apos;&lt;br/&gt;
));&lt;/p&gt;

&lt;p&gt;In the first (supported) example Doctrine produce something like that, when I add LEFT JOIN STATEMENT:&lt;br/&gt;
SELECT *&lt;br/&gt;
FROM article a&lt;br/&gt;
LEFT OUTER JOIN category2article c2a ON c2a.art_id = a.art_id&lt;br/&gt;
LEFT OUTER JOIN category c ON c.cat_id = c2a.cat_id&lt;/p&gt;

&lt;p&gt;But I would like to have also support for following example:&lt;br/&gt;
SELECT *&lt;br/&gt;
FROM article_version a_vc&lt;br/&gt;
LEFT OUTER JOIN category2article_version c2a_vc ON c2a_vc.art_id = a_vc.art_id AND c2a_vc.art_version = a_vc.art_version&lt;br/&gt;
LEFT OUTER JOIN category c ON c.cat_id = c2a_vc.cat_id&lt;/p&gt;

&lt;p&gt;&amp;#8211;&lt;br/&gt;
Very best,&lt;br/&gt;
Tomasz Kuter&lt;/p&gt;

&lt;p&gt;PS. I will check Doctrine code.. maybe I will solve it by myself..&lt;/p&gt;</description>
                <environment>n/a</environment>
            <key id="11507">DC-742</key>
            <summary>Add support for relations consist on two or more fileds</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="evolic">Tomasz Kuter</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 10:55:27 +0000</created>
                <updated>Sat, 7 Aug 2010 15:40:14 +0000</updated>
                                                                    <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-741] Sort of Migration Class Problem With More Than 9 Classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-741</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have problem when do a migration with more than 9 classes. (Version1, Version2, Version3, ..., Version10)&lt;/p&gt;

&lt;p&gt;php doctrine-cli.php migrate 10&lt;/p&gt;

&lt;p&gt;When migration class lower than 10, migration well done.&lt;br/&gt;
The migration always return another class, not Version10.&lt;/p&gt;

&lt;p&gt;I have do a simple research, and found the problem is on the sort of the class name.&lt;br/&gt;
It use SORT_NUMERIC, and it is not suitable to sort them.&lt;/p&gt;

&lt;p&gt;So, I change the sort method to Natural Sort, to fix this issue.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04, PHP 5.3.2, Doctrine 1.2.2</environment>
            <key id="11505">DC-741</key>
            <summary>Sort of Migration Class Problem With More Than 9 Classes</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="dollyaswin">Dolly Aswin Harahap</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 08:50:45 +0000</created>
                <updated>Tue, 24 Aug 2010 12:30:40 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13340" author="dollyaswin" created="Wed, 16 Jun 2010 08:52:22 +0000"  >&lt;p&gt;Here I attach patch to fix this issue. Please check it.&lt;/p&gt;</comment>
                    <comment id="14053" author="jwage" created="Tue, 24 Aug 2010 12:30:40 +0000"  >&lt;p&gt;I am not able to produce the error, things are always in the correct order. I added a test here: &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7683&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/7683&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can you help me with how to reproduce the error?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10661" name="DC-741.patch" size="808" author="dollyaswin" created="Wed, 16 Jun 2010 08:52:22 +0000" />
                </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-739] Pager returns incorrect page number when constructed on query with HAVING</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-739</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;//method returns those categories that have any products, it returns 3 records&lt;br/&gt;
public function getCategoriesWithProductsQuery()&lt;/p&gt;
 {
   $query = $this-&amp;gt;createQuery(&apos;z&apos;)-&amp;gt;select( &apos;z.*, COUNT(p.id) prod_number&apos; )
          -&amp;gt;leftJoin( &apos;z.AdvertiseProducts p&apos; )-&amp;gt;groupBy( &apos;z.id&apos; )-&amp;gt;having(&apos;prod_number &amp;gt; 0&apos;);

   return $query;
 }

&lt;p&gt;//but when i do count() on created pager it returns 8 records (which is equal to categories in my database):&lt;/p&gt;

&lt;p&gt;$doctrinePager = $this-&amp;gt;getServiceContainer()&lt;br/&gt;
-&amp;gt;setParameter(&apos;doctrine_pager.model&apos;, &apos;ZwCategory&apos;)&lt;br/&gt;
-&amp;gt;getService(&apos;doctrine_pager&apos;)&lt;br/&gt;
&lt;del&gt;&amp;gt;setMaxPerPage($this&lt;/del&gt;&amp;gt;maxPerPage)&lt;br/&gt;
-&amp;gt;setQuery($query)&lt;br/&gt;
&lt;del&gt;&amp;gt;setPage(null === $page ? $this&lt;/del&gt;&amp;gt;page : $page)&lt;br/&gt;
-&amp;gt;init();&lt;br/&gt;
var_dump(count($doctrinePager));&lt;/p&gt;

&lt;p&gt;//pager works, but it &quot;thinks&quot; that there are more pages than in reality. with maxPerPage = 2, it thinks that there are 4 pages, but looking at query result it //should be only 2 pages.&lt;/p&gt;</description>
                <environment>Ubuntu 9.10, &lt;br/&gt;
Apache/MySQL,&lt;br/&gt;
Framework: Symfony 1.4&lt;br/&gt;
</environment>
            <key id="11499">DC-739</key>
            <summary>Pager returns incorrect page number when constructed on query with HAVING</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="pawelbaranski">Pawe&#322; Bara&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 03:14:11 +0000</created>
                <updated>Wed, 16 Jun 2010 03:16:39 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-736] [Documentation] Taking Advantage of Column Aggregation Inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-736</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The documentation at &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/taking-advantage-of-column-aggregation-inheritance/en#taking-advantage-of-column-aggregation-inheritance&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/taking-advantage-of-column-aggregation-inheritance/en#taking-advantage-of-column-aggregation-inheritance&lt;/a&gt; states when using foreign keys with column aggregation to set:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;options(&apos;export&apos;,&apos;tables&apos;);&lt;/p&gt;

&lt;p&gt;this didn&apos;t work for me after looking into it I see it should be attributes so in the base class you can write:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;setAttribute(Doctrine_Core::ATTR_EXPORT, Doctrine_Core::EXPORT_TABLES);&lt;/p&gt;

&lt;p&gt;or via schema:&lt;/p&gt;

&lt;p&gt;  attributes:&lt;br/&gt;
    export: tables&lt;/p&gt;</description>
                <environment></environment>
            <key id="11493">DC-736</key>
            <summary>[Documentation] Taking Advantage of Column Aggregation 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="baxter">Jason Brumwell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 22:03:52 +0000</created>
                <updated>Mon, 14 Jun 2010 22:03:52 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-733] Length validator fail because it was bad initialized</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-733</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;import/Oracle.php&lt;/p&gt;

&lt;p&gt;        foreach($result as $val) &lt;/p&gt;
{
            $val = array_change_key_case($val, CASE_LOWER);
            $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val);

            $descr[$val[&apos;column_name&apos;]] = array(
               &apos;name&apos;       =&amp;gt; $val[&apos;column_name&apos;],
               &apos;notnull&apos;    =&amp;gt; (bool) ($val[&apos;nullable&apos;] === &apos;N&apos;),
               &apos;ntype&apos;      =&amp;gt; $val[&apos;data_type&apos;],
               &apos;type&apos;       =&amp;gt; $decl[&apos;type&apos;][0],
               &apos;alltypes&apos;   =&amp;gt; $decl[&apos;type&apos;],
               &apos;fixed&apos;      =&amp;gt; $decl[&apos;fixed&apos;],
               &apos;unsigned&apos;   =&amp;gt; $decl[&apos;unsigned&apos;],
               &apos;default&apos;    =&amp;gt; $val[&apos;data_default&apos;],
               &apos;length&apos;     =&amp;gt; $val[&apos;data_length&apos;],
               &apos;primary&apos;    =&amp;gt; $val[&apos;primary&apos;] ? true:false,
               &apos;scale&apos;      =&amp;gt; isset($val[&apos;scale&apos;]) ? $val[&apos;scale&apos;]:null,
            );
        }




&lt;p&gt; &apos;length&apos;     =&amp;gt; $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;data_length&amp;#39;&amp;#93;&lt;/span&gt;,&lt;br/&gt;
doesn&apos;t use the $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val); witch make it Portable&lt;br/&gt;
use this instead&lt;br/&gt;
&apos;length&apos;     =&amp;gt; $decl&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;,&lt;/p&gt;</description>
                <environment>Oracle</environment>
            <key id="11487">DC-733</key>
            <summary>Length validator fail because it was bad initialized</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="tripollite">Pierre</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 08:02:28 +0000</created>
                <updated>Mon, 14 Jun 2010 08:02:28 +0000</updated>
                                                                    <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-728] Updating slug in I18N behaviour yields non-unique slug</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-728</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There seems to be a bug in the way, doctrine tries to find a unique slug for a table that is I18N-enabled and has a slug in it.&lt;/p&gt;

&lt;p&gt;Following example:&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;Problem:
  actAs:
    I18n:
      fields: [name]
      actAs:
        Sluggable: { fields: [name], uniqueBy: [lang, name], canUpdate: true }
  columns:
    name: { type: string(255), notnull: true }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Now, if we insert a new entry, the slug get&apos;s created as expected. If we now insert another entry that would yield the same slug, the slug is made unique by adding the postfix as expected - all well so far.&lt;/p&gt;

&lt;p&gt;Now, if we try to update the entry with the slug with the postfix, what i think is an error happens (Excerpt from Sluggable.php, lib/Doctrine/Template/Listener/Sluggable.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; 
public function getUniqueSlug($record, $slugFromFields)
...
if ($record-&amp;gt;exists()) {
            $identifier = $record-&amp;gt;identifier();
            $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?&apos;;
            $whereParams = array_merge($whereParams, array_values($identifier));
        }

        foreach ($this-&amp;gt;_options[&apos;uniqueBy&apos;] as $uniqueBy) {
            if (is_null($record-&amp;gt;$uniqueBy)) {
                $whereString .= &apos; AND r.&apos;.$uniqueBy.&apos; IS NULL&apos;;
            } else {
                $whereString .= &apos; AND r.&apos;.$uniqueBy.&apos; = ?&apos;;
                $value = $record-&amp;gt;$uniqueBy;
                if ($value instanceof Doctrine_Record) {
                    $value = current((array) $value-&amp;gt;identifier());
                }
                $whereParams[] = $value;
            }
        }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;So, the $record-&amp;gt;exists() check evaluates to true and $table-&amp;gt;getIdentifierColumnNames() yields the fields id and lang, so the whereString is something like&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; 
AND r.id != ? AND r.lang != ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Now for the problematic part:&lt;br/&gt;
uniqueBy is lang and name; so the code adds to the whereString:&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; 
AND r.lang = ? AND r.name = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;So the resulting whereString has something like&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; 
r.lang != ? AND r.lang = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;which will never yield a result in my eyes, thus, the postfix is never incremented and the slug defaults to the the slug of name without postfix.&lt;/p&gt;</description>
                <environment>Symfony 1.4.5&lt;br/&gt;
Doctrine ORM</environment>
            <key id="11474">DC-728</key>
            <summary>Updating slug in I18N behaviour yields non-unique slug</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="vsknight">Florian Aschenbrenner</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jun 2010 05:35:43 +0000</created>
                <updated>Tue, 5 Oct 2010 11:28:43 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>I18n</component>
                <component>Sluggable</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="13408" author="rodrigobb" created="Thu, 24 Jun 2010 13:11:47 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;We&apos;ve also found this problem and make a temporal workaround. But maybe our workaround can give someone an idea on how to fix the bug so I&apos;m pasting the changed code here&lt;/p&gt;

&lt;p&gt;In file &lt;em&gt;sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Template\Listener\Sluggable.php&lt;/em&gt; (getUniqueSlug method)&lt;/p&gt;

&lt;p&gt;Replace&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; ($record-&amp;gt;exists()) {
  $identifier = $record-&amp;gt;identifier();
  $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?&apos;;
  $whereParams = array_merge($whereParams, array_values($identifier));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;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-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($record-&amp;gt;exists()) {
  $identifier = $record-&amp;gt;identifier();
  $commonFields = array_uintersect($table-&amp;gt;getIdentifierColumnNames(), $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;uniqueBy&apos;], &lt;span class=&quot;code-quote&quot;&gt;&quot;strcasecmp&quot;&lt;/span&gt;);
  foreach ($commonFields as $key =&amp;gt; $value)
    unset ($identifier[$value]);
  
  $whereFields = array_diff($table-&amp;gt;getIdentifierColumnNames(), $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;uniqueBy&apos;]);
  $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $whereFields) . &apos; != ?&apos;;
  $whereParams = array_merge($whereParams, array_values($identifier));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14532" author="caponica" created="Tue, 5 Oct 2010 11:28:43 +0000"  >&lt;p&gt;Rodrigo, I think the solution is simpler than you might expect...&lt;/p&gt;

&lt;p&gt;The problem is that it is doing an AND where it should be doing an OR to find records other than the current one.&lt;/p&gt;

&lt;p&gt;So, you just need to replace this part of Sluggable::getUniqueSlug():&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::getUniqueSlug()&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;if&lt;/span&gt; ($record-&amp;gt;exists()) {
            $identifier = $record-&amp;gt;identifier();
            $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?&apos;;
            $whereParams = array_merge($whereParams, array_values($identifier));
        }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With this code (the 3rd line has extra brackets and OR instead of AND):&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::getUniqueSlug() (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;if&lt;/span&gt; ($record-&amp;gt;exists()) {
            $identifier = $record-&amp;gt;identifier();
            $whereString .= &apos; AND (r.&apos; . implode(&apos; != ? OR r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?)&apos;;
            $whereParams = array_merge($whereParams, array_values($identifier));
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;In more detail, the WHERE clause being built up is saying: &lt;br/&gt;
&quot;find me records WHERE (the slug begins with the same string) AND (it&apos;s not the same record) AND (the other key uniqueBy values are the same)&quot;&lt;/p&gt;

&lt;p&gt;However, to check that it&apos;s not the same record you just need one of the key values to be different (not all of them) so the check should be something like:&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;... AND (p.id != &apos;2&apos; OR p.lang != &apos;en&apos;) ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;instead of:&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;... AND p.id != &apos;2&apos; AND p.lang != &apos;en&apos; ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The modification to the code as stated above generates queries that look like this, which I&apos;m pretty sure is correct:&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;... WHERE (p.url LIKE &apos;foo%&apos; AND (p.id != &apos;2&apos; OR p.lang != &apos;en&apos;) AND p.lang = &apos;en&apos; AND p.other_uniqueby_field = &apos;1&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;C&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-724] Blameable relations import problem</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-724</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The import works only when i DISABLE the update relation. When i activate the update relation i get an sql error&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: 1452 Cannot add or update a child row: a foreign key constraint fails (`clubicious`.`location`, CONSTRAINT `location_updated_by_sf_guard_user_id` FOREIGN KEY (`updated_by`) REFERENCES `sf_guard_user` (`id`))&lt;/p&gt;

&lt;p&gt;The relation is created correct i think the problem is in the importer???&lt;/p&gt;

&lt;p&gt;Location:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
    Sortable: ~&lt;br/&gt;
    Blameable:&lt;br/&gt;
      columns:&lt;br/&gt;
        created:&lt;br/&gt;
          length: null&lt;br/&gt;
        updated:&lt;br/&gt;
          length: null&lt;br/&gt;
      relations:&lt;br/&gt;
        created:&lt;br/&gt;
          disabled: false&lt;br/&gt;
          class:    sfGuardUser&lt;br/&gt;
        updated:&lt;br/&gt;
          disabled: false&lt;br/&gt;
          class:    sfGuardUser&lt;br/&gt;
  columns:&lt;br/&gt;
    name:         &lt;/p&gt;
{ type: string(255), notnull: true }

&lt;p&gt;My fixtures:&lt;br/&gt;
sfGuardUser:&lt;br/&gt;
  gfranke:&lt;br/&gt;
    id: 1&lt;br/&gt;
    first_name: Gordon&lt;br/&gt;
    last_name: Franke&lt;br/&gt;
    email_address: franke@clubicious.com&lt;br/&gt;
    username: gfranke&lt;br/&gt;
    password: startgf&lt;br/&gt;
Location:&lt;br/&gt;
  location_atomic:&lt;br/&gt;
    name:         Atomic Cafe&lt;br/&gt;
    CreatedBy:    gfranke&lt;br/&gt;
    UpdatedBy:    gfranke&lt;/p&gt;

&lt;p&gt;  location_max:&lt;br/&gt;
    name:         Max &amp;amp; Moritz&lt;br/&gt;
    CreatedBy:    gfranke&lt;br/&gt;
    UpdatedBy:    gfranke&lt;/p&gt;</description>
                <environment>symfony 1.4.5 with latest doctrine 1.2 branch with sfDoctrineGuardPlugin</environment>
            <key id="11464">DC-724</key>
            <summary>Blameable relations import 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="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2010 06:06:06 +0000</created>
                <updated>Tue, 13 Jul 2010 07:00:31 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Extensions</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13573" author="timschofield" created="Tue, 13 Jul 2010 07:00:31 +0000"  >&lt;p&gt;Same Problem with Doctrine 1.2.2 and  Zend Framework 1.10&lt;/p&gt;

&lt;p&gt;Work around for me was to disable all Blameable relations in my schema.yml&lt;/p&gt;

&lt;p&gt;Then run &lt;/p&gt;

&lt;p&gt;./doctrine build-all-reload&lt;/p&gt;

&lt;p&gt;So that fixtures can load&lt;/p&gt;


&lt;p&gt;Then enable all Blameable relations in the schema.yml&lt;/p&gt;

&lt;p&gt;and run&lt;/p&gt;

&lt;p&gt;./doctrine generate-models-yaml&lt;/p&gt;

&lt;p&gt;So models are generated with the correct relations&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;

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

<item>
            <title>[DC-723] String = 512 becomes TEXT</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-723</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I don&apos;t know if this is a feature or a bug, but if I define a field type = string, length = 512, Doctrine creates this as a TEXT field in MySQL.  Seems to do this for a length over 255 characters, e.g. 256.  This seems like overkill possibly.  Feels like the field should be defined either as TINYTEXT or VARCHAR (which can go up to 63335 characters in length).&lt;/p&gt;

&lt;p&gt;Is there any way to control this behavior?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11463">DC-723</key>
            <summary>String = 512 becomes TEXT</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="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jun 2010 23:50:18 +0000</created>
                <updated>Wed, 9 Jun 2010 13:04:27 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13255" author="jwage" created="Wed, 9 Jun 2010 13:04:27 +0000"  >&lt;p&gt;No, it is not possible right now. The portable Doctrine types and lengths are converted to certain types for the different databases. In Doctrine2 you can specify the SQL that will create your column in the mapping if you desire something more customize or database specific&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-722] String(512) is being implemented as TEXT instead varchar(512) on MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-722</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Well&lt;br/&gt;
the titles says it all.&lt;/p&gt;

&lt;p&gt;Just now I realized the TEXT type for fields that I&apos;ve defined in the code as String(512).&lt;br/&gt;
What I understand is that TEXT has performance disvantages. Why not use varchar when there are little needs instead TEXT?&lt;/p&gt;

&lt;p&gt;Thanks in advice.&lt;br/&gt;
Greetings!&lt;/p&gt;</description>
                <environment>LAMP over Ubuntu 10.04</environment>
            <key id="11462">DC-722</key>
            <summary>String(512) is being implemented as TEXT instead varchar(512) on MySQL</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="mateo">Mateo Tibaquir&#225;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jun 2010 23:49:39 +0000</created>
                <updated>Tue, 8 Jun 2010 23:49:39 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-708] Wrong definition for MySQL string primary column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-708</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you define a primary column, the attribute &lt;b&gt;notnull&lt;/b&gt; is removed from the column definition because Doctrine assumes that primary columns are always not null.&lt;/p&gt;

&lt;p&gt;Now suppose you have a schema like this, with a &lt;b&gt;string&lt;/b&gt; primary column.&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;Client:
  columns:
    serial:    { type: string(50), notnull: &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; }
    name:      { type: string(36), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That&apos;s fine, but causes problems with MySQL where the column is created with a default value of &quot;&quot; (empty string) and not &amp;lt;none&amp;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;CREATE TABLE client (serial VARCHAR(50), name VARCHAR(36) NOT NULL, PRIMARY KEY(serial)) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note that the 2nd column is well defined and has &amp;lt;none&amp;gt; as default value (as seen from phpMyAdmin).&lt;/p&gt;

&lt;p&gt;I attached a quick-workaround to disable the code which removes the &lt;b&gt;notnull&lt;/b&gt; attribute from column definition.&lt;/p&gt;

&lt;p&gt;After that the SQL code is 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;CREATE TABLE client (serial VARCHAR(50) NOT NULL, name VARCHAR(36) NOT NULL, PRIMARY KEY(serial)) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3.1, WinXP-SP3, Doctrine 1.2.2, MySQL 5.1.41</environment>
            <key id="11422">DC-708</key>
            <summary>Wrong definition for MySQL string primary column</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="nicorac">Claudio Nicora</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 May 2010 08:41:16 +0000</created>
                <updated>Mon, 12 Jul 2010 16:32:44 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13078" author="nicorac" created="Fri, 28 May 2010 09:08:46 +0000"  >&lt;p&gt;Attached a better patch where the &lt;b&gt;notnull&lt;/b&gt; attribute is removed only if the primary column type is &lt;b&gt;string&lt;/b&gt;&lt;/p&gt;</comment>
                    <comment id="13079" author="nicorac" created="Fri, 28 May 2010 09:25:01 +0000"  >&lt;p&gt;The same behaviour happens even for integer columns, so the &lt;b&gt;notnull&lt;/b&gt; attribute should never be removed, not only for string columns. New patch attached, old one removed.&lt;/p&gt;</comment>
                    <comment id="13145" author="jwage" created="Tue, 8 Jun 2010 09:58:05 +0000"  >&lt;p&gt;The patch I see currently just comments out the offending code. Is that intended? It cannot be committed if so &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>
                    <comment id="13155" author="nicorac" created="Tue, 8 Jun 2010 10:33:26 +0000"  >&lt;p&gt;My patch only removed the effect, but it&apos;s not surely the best solution.&lt;/p&gt;

&lt;p&gt;I&apos;ve no sufficient knowledge on Doctrine to say that commenting out (or removing) that line will not affect other parts; that&apos;s why I only commented out the code instead of removing it (both on my side and on the attached patch).&lt;/p&gt;

&lt;p&gt;If you think I&apos;m not adding new bugs, I agree that removing the offending code is the cleanest way.&lt;/p&gt;</comment>
                    <comment id="13156" author="jwage" created="Tue, 8 Jun 2010 10:36:00 +0000"  >&lt;p&gt;We can&apos;t just remove the code. It will change the behavior of the builder drastically which breaks backwards compatibility.&lt;/p&gt;</comment>
                    <comment id="13168" author="nicorac" created="Tue, 8 Jun 2010 11:46:12 +0000"  >&lt;p&gt;That&apos;s what I was afraid of.&lt;br/&gt;
Maybe you should change the code that generates the SQL for MySQL to make it include the &quot;NOT NULL&quot; clause to primary keys.&lt;/p&gt;</comment>
                    <comment id="13169" author="jwage" created="Tue, 8 Jun 2010 11:48:02 +0000"  >&lt;p&gt;Hi, if you want to provide a patch that fixes your situation I can test it against our test suite and see if we can include it. You can also run your changes against the test suite to see if it causes any problems.&lt;/p&gt;</comment>
                    <comment id="13285" author="nicorac" created="Sun, 13 Jun 2010 05:39:19 +0000"  >&lt;p&gt;Hi, I attached a patch against Export/Mysql.php instead of the previous against Import/Builder.php.&lt;br/&gt;
It works on my side; can you please test it with your test suite?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10642" name="export_mysql_patch.diff" size="765" author="nicorac" created="Sun, 13 Jun 2010 05:39:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-707] When inserting node as direct children of a root node, it seems the root node is not populated with new lft/rgt values...</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-707</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;


&lt;p&gt;When inserting node as direct children of a root node, it seems the root node is not populated with new lft/rgt values...&lt;/p&gt;



&lt;p&gt;Here is a test case, simply made of the code samples given in documentation : &lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/hierarchical-data/en#nested-set:working-with-trees:creating-a-root-node&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/hierarchical-data/en#nested-set:working-with-trees:creating-a-root-node&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-java&quot;&gt;/*
 * Creating a Root Node
 */
$category = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
$category-&amp;gt;name = &apos;Root Category 1&apos;;
$category-&amp;gt;save();

$treeObject = Doctrine_Core::getTable(&apos;Category&apos;)-&amp;gt;getTree();
$treeObject-&amp;gt;createRoot($category);


/*
 * Inserting a Node
 */
$child1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
$child1-&amp;gt;name = &apos;Child Category 1&apos;;

$child2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
$child2-&amp;gt;name = &apos;Child Category 1&apos;;

$child1-&amp;gt;getNode()-&amp;gt;insertAsLastChildOf($category);
$child2-&amp;gt;getNode()-&amp;gt;insertAsLastChildOf($category);




/*
 * BUGGY !
 */
$category-&amp;gt;getNode()-&amp;gt;hasChildren();   &lt;span class=&quot;code-comment&quot;&gt;// will &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, we except &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; as we just instert 2 children to &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; root node...
&lt;/span&gt;

$category-&amp;gt;refresh();
$category-&amp;gt;getNode()-&amp;gt;hasChildren(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;... that&apos;s now ok !&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3.2 (cli) (built: Apr 12 2010 15:44:21) &lt;br/&gt;
Copyright (c) 1997-2010 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 Zend Extension Manager v5.1, Copyright (c) 2003-2010, by Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Data Cache v4.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [disabled]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Utils v1.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [enabled]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Optimizer+ v4.1, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [disabled]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [enabled]&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
MySQL&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Server: Localhost via UNIX socket&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Server version: 5.1.41-3ubuntu12.1&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Protocol version: 10</environment>
            <key id="11420">DC-707</key>
            <summary>When inserting node as direct children of a root node, it seems the root node is not populated with new lft/rgt values...</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="julien">Julien G</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 May 2010 05:03:06 +0000</created>
                <updated>Sat, 7 Aug 2010 15:39:17 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-704] Where fields not escaped properly when deleting associations.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-704</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We noticed that in both Doctrine/Record.php and Doctrine/Connection/UnitOfWork.php the fields in the where clause arent being escaped properly. A few of our fields happen to be keywords, but it seems that these queries arent escaping the names of fields that happen to be keywords.&lt;/p&gt;

&lt;p&gt;I have verified the field name is in the keywords list for my driver.&lt;/p&gt;

&lt;p&gt;This happens near the following code:&lt;br/&gt;
Doctrine/Record.php:2465&lt;br/&gt;
Doctrine/Record.php:2476&lt;br/&gt;
Doctrine/Connection/UnitOfWork.php: 443&lt;/p&gt;</description>
                <environment>Debian 5, PHP 5.3, Symfony 1.4.4, sfDoctrinePlugin, Pgsql driver</environment>
            <key id="11414">DC-704</key>
            <summary>Where fields not escaped properly when deleting associations.</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="grmartin">Glenn R. Martin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 12:33:50 +0000</created>
                <updated>Mon, 14 Jun 2010 08:26:40 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13149" author="jwage" created="Tue, 8 Jun 2010 10:19:55 +0000"  >&lt;p&gt;Can you provide a patch with the changes?&lt;/p&gt;</comment>
                    <comment id="13306" author="grmartin" created="Mon, 14 Jun 2010 08:26:40 +0000"  >&lt;p&gt;The following is the patch you requested. This is what &lt;b&gt;WE&lt;/b&gt; did for our specific case to fix this... though it wont work with any other driver... What we really should have done (if I had been given time) was to pull the escape characters from the database driver so this would work on every database, not just Postgres.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10645" name="diff.patch" size="3009" author="grmartin" created="Mon, 14 Jun 2010 08:26:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-692] Can not create a subquery in where</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-692</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi All&lt;/p&gt;

&lt;p&gt;I can not figure out how to make a subquery work in doctrine. I get the subquery to look fine in DQL but when doctrine converts the DQL to SQL the subquery is automatically removed.&lt;/p&gt;

&lt;p&gt;Here is an example:&lt;br/&gt;
This PHP:&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(); 
$q-&amp;gt;from(&apos;Customer Customer&apos;); 
$q-&amp;gt;addWhere(&apos; Customer.id in (SELECT Customer.id as customer_id FROM Customer Customer)&apos;); 
$q-&amp;gt;addSelect(&apos;Customer.id&apos;); 
$q-&amp;gt;addSelect(&apos;Customer.id as customer_id&apos;);
$q-&amp;gt;limit(20); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Creates this DQL:&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 Customer.id, Customer.id as customer_id FROM Customer Customer WHERE Customer.id in (SELECT Customer.id as customer_id FROM Customer Customer) LIMIT 20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which creates this broken 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;SELECT p.id AS p__id, p.id AS p__0 FROM product_customers p WHERE (p.id in ()) LIMIT 20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notice that the subquery has been replaced with just &quot;()&quot;.&lt;/p&gt;

&lt;p&gt;Is there something wrong with my execution, does doctrine just not support subqueries, or is there a bug here?&lt;/p&gt;

&lt;p&gt;Thanks much in advance.&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="11387">DC-692</key>
            <summary>Can not create a subquery in 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="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 May 2010 21:42:53 +0000</created>
                <updated>Wed, 19 May 2010 00:18:41 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12993" author="willf1976" created="Wed, 19 May 2010 00:18:41 +0000"  >&lt;p&gt;I have found a way around my problem (looked through the code to figure out how it worked) &amp;#8211; seems that if I put &apos;SQL:&apos; in front of my sub query, and use SQL instead of DQL in the sub 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;$q = Doctrine_Query::create(); 
$q-&amp;gt;from(&apos;Customer Customer&apos;); 
$q-&amp;gt;addWhere(&apos; Customer.id in (SQL:SELECT p.id AS p__0 FROM product_customers p)&apos;); 
$q-&amp;gt;addSelect(&apos;Customer.id&apos;); 
$q-&amp;gt;addSelect(&apos;Customer.id as customer_id&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The correct sql 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;SELECT p.id AS p__id, p.id AS p__0 FROM product_customers p WHERE (p.id in (SELECT p.id AS p__0 FROM product_customers p)) LIMIT 20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am not still not sure what is up with trying to use the DQL instead. Looking through the code I see that on line 842 of Doctrine_Query my DQL subquery was being passed to the function $this-&amp;gt;createSubquery()-&amp;gt;parseDqlQuery($trimmed) 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; $q = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createSubquery()-&amp;gt;parseDqlQuery($trimmed);
$trimmed = $q-&amp;gt;getSqlQuery();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$trimmed was coming back as false here which is why my subquery wasn&apos;t working.&lt;/p&gt;

&lt;p&gt;Hope that is helpful.&lt;/p&gt;

&lt;p&gt;Best Regards&lt;/p&gt;

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

<item>
            <title>[DC-689] Columns of type &apos;array&apos; adds default clause to the create table statement which isn&apos;t supported by MySQL.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-689</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The column type &apos;array&apos; creates a column of the type &apos;LONGTEXT&apos; but also adds the default value to the column declaration which makes the creation of the table fail.&lt;/p&gt;

&lt;p&gt;MySQL does not support default values for TEXT, BLOB or LONGTEXT. I don&apos;t know when this behavior was added to MySQL or if it always has been like that. MySQL 5.0.51 will accept it without any SQL mode set, 5.0.83 won&apos;t.&lt;/p&gt;</description>
                <environment>MySQL version 5.0.83, Doctrine 1.2.2, Revision: 7490</environment>
            <key id="11383">DC-689</key>
            <summary>Columns of type &apos;array&apos; adds default clause to the create table statement which isn&apos;t supported by MySQL.</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="daniel">Daniel Holmstrom</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 May 2010 09:31:17 +0000</created>
                <updated>Fri, 11 Jun 2010 08:31:26 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13163" author="jwage" created="Tue, 8 Jun 2010 11:06:26 +0000"  >&lt;p&gt;Could you provide a test and patch?&lt;/p&gt;</comment>
                    <comment id="13270" author="daniel" created="Fri, 11 Jun 2010 08:29:41 +0000"  >&lt;p&gt;(Un)fortunately I&apos;ll be computer-free for a month now, so I have no time to write test or do a proper patch. I&apos;ll attach the patch I use for reference.&lt;/p&gt;

&lt;p&gt;Since the default clause depends on the native type which isn&apos;t known when the default clause is constructed (in getDefaultFieldDeclaration) I&apos;ve simply added a check that sets the default clause to an empty string if the native type is one of those which isn&apos;t allowed to have a default value. I&apos;m not sure, however, what the line in Doctrine/Export/Mysql.php::276:&lt;/p&gt;

{return $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;$method($name, $field);}

&lt;p&gt; does and if that is affected by this also.&lt;/p&gt;

&lt;p&gt;I guess you want the list of native types not allowed to have default values somewhere else, but I don&apos;t have the required knowledge about the internals of Doctrine to do this.&lt;/p&gt;</comment>
                    <comment id="13271" author="daniel" created="Fri, 11 Jun 2010 08:31:26 +0000"  >&lt;p&gt;Attached patch giving example of how to fix &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-689&quot; title=&quot;Columns of type &amp;#39;array&amp;#39; adds default clause to the create table statement which isn&amp;#39;t supported by MySQL.&quot;&gt;DC-689&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10639" name="DC-689_example_patch.patch.gz" size="477" author="daniel" created="Fri, 11 Jun 2010 08:31:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-684] After adding a Reference, the ForeignKeys in the DB are not updatet</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-684</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After query a record from the DB, where a foreign key is null, and changing only the reference belonging to this foreign key, and only these reference no other value of the record, a save of the record doesn&apos;t lead to a change in the foreign key field.&lt;/p&gt;

&lt;p&gt;For example: I&apos;ll save a user record with some data of a regestration and give him the possibillity to add a city where he cames from later in his account settings, if no other user attribute is changed, the state of the user record is still CLEAN. The result is that I can access the user-&amp;gt;City property correctly only as long as no refresh from the db is done. So the changing of the foreign key belonging to the city isn&apos;t persistent in the DB.&lt;/p&gt;

&lt;p&gt;Example Code:&lt;br/&gt;
		$user = new Model_User();&lt;br/&gt;
		$user-&amp;gt;firstName = md5(rand());&lt;br/&gt;
		$user-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;		$id = $user-&amp;gt;id;&lt;br/&gt;
		unset($user);&lt;br/&gt;
		assert(! $user);&lt;/p&gt;

&lt;p&gt;		$user = Model_UserTable::getInstance()-&amp;gt;find($id);&lt;br/&gt;
		assert(!$user-&amp;gt;relatedExists(&apos;City&apos;));		&lt;/p&gt;

&lt;p&gt;		$user-&amp;gt;City-&amp;gt;name = &apos;Mainz&apos;;&lt;br/&gt;
		$user-&amp;gt;save();&lt;br/&gt;
		unset($user);&lt;/p&gt;

&lt;p&gt;		$user = Model_UserTable::getInstance()-&amp;gt;find($id);&lt;br/&gt;
		$user-&amp;gt;refresh(true);&lt;br/&gt;
		assert($user-&amp;gt;City-&amp;gt;name == &apos;Mainz&apos;);	&lt;/p&gt;

&lt;p&gt;The last assert failse. I realized the problem while updating just a referenz using the fromArray() method like $user-&amp;gt;City-&amp;gt;fromArray(). The city would be saved correctly in DB but the foreign key in the user table would not be updated. After debugging I recognized that the $user is not replaced in UnitOfWork::saveGraph() because the $user is still in CLEAN state.&lt;/p&gt;

&lt;p&gt;Using &quot; $user-&amp;gt;coreSetRelated(&apos;Country&apos;, $user-&amp;gt;Country);&quot; or &quot;$user-&amp;gt;state(Doctrine_Record::STATE_DIRTY);&quot; after &quot;$user-&amp;gt;City-&amp;gt;name = &apos;Mainz&apos;&quot; would fix the prob in this case. As well as creating a new City instance an set $user-&amp;gt;City with this instance like:&lt;/p&gt;

&lt;p&gt;                $city = new Model_City();&lt;br/&gt;
                $city-&amp;gt;name = &apos;Mainz&apos;;&lt;br/&gt;
                $user-&amp;gt;City = $city;&lt;/p&gt;

&lt;p&gt;Also $user-&amp;gt;isModified(true) is true. So I fixed the issues in my case by changing the state of my records to DIRTY if the &quot;$this-&amp;gt;state() == CLEAN &amp;amp;&amp;amp; $user-&amp;gt;isModified(true) == true&quot; in the preSave() method of an abstract class that my Base classes are extending....&lt;/p&gt;</description>
                <environment>Ubuntu 9.04, PHP 5.2.6, MySQL 5.1, Zend Framework</environment>
            <key id="11363">DC-684</key>
            <summary>After adding a Reference, the ForeignKeys in the DB are not updatet</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="lk2.0">Lars Kosubek</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 May 2010 15:02:09 +0000</created>
                <updated>Tue, 26 Oct 2010 08:13:33 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14380" author="mars105" created="Wed, 15 Sep 2010 09:12:04 +0000"  >&lt;p&gt;Spend the last hour trying to get a workaround on this one.&lt;/p&gt;

&lt;p&gt;It apear to me that the solution is not easy. The object is modified while in STATE_LOCKED state, meaning that any state change in Record::_set() is not passed back to UnitOfWork::saveGraph() and therfor not saved in the database.&lt;/p&gt;

&lt;p&gt;Finaly I&apos;ve managed to make a realy dirty fix, I&apos;ll attach it if it come handy to somebody.&lt;br/&gt;
Keep in mind this is only a workaround and has NOT been tested. Use at your own risk...&lt;/p&gt;</comment>
                    <comment id="14381" author="mars105" created="Wed, 15 Sep 2010 09:13:00 +0000"  >&lt;p&gt;Dirty fix, see comments.&lt;br/&gt;
! NOT tested thoroughly !&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10797" name="DC_684_dirty_fix.patch" size="1490" author="mars105" created="Wed, 15 Sep 2010 09:13:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-680] HYDRATE_ARRAY causes timeout with no fields selected</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-680</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Calling HYDRATE_ARRAY on a query with&lt;/p&gt;

&lt;p&gt;a) No values selected&lt;br/&gt;
b) select(&apos;*&apos;)&lt;br/&gt;
c) select(&apos;Table.*&apos;)&lt;/p&gt;

&lt;p&gt;causes the entire query object to be loaded, rather than just returning an array of all values. If a limit(1) is used, the correct result is returned. But as soon as it becomes a collection, the entire query object is returned.&lt;/p&gt;

&lt;p&gt;Code to produce problem..&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;from(&apos;Order ord&apos;)
        -&amp;gt;limit(2)
        -&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);
        
        print_r($query);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows 7, Ubuntu 9.10 (Linux), PHP 5.2.10, Zend Framework 1.10</environment>
            <key id="11355">DC-680</key>
            <summary>HYDRATE_ARRAY causes timeout with no fields selected</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="davidma7685">David Ash</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 May 2010 14:42:20 +0000</created>
                <updated>Thu, 13 May 2010 14:42:20 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-676] Validation exception thrown only if internal nesting level == 1</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-676</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I wonder why Validation exception is thrown only if internal nesting level of transaction is 1 and the manual nesting level is not considered. &lt;/p&gt;

&lt;p&gt;Line 262 - lib/Doctrine/Transaction.php: &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;if ($this-&amp;gt;_internalNestingLevel == 1) {
    $tmp = $this-&amp;gt;invalid;
    $this-&amp;gt;invalid = array();
    throw new Doctrine_Validator_Exception($tmp);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have a large database with a lot of tables and relationships. At some case the validation exception is not thrown if the validation fails. &lt;/p&gt;

&lt;p&gt;If I add $this-&amp;gt;_nestingLevel into this condition: &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;if ($this-&amp;gt;_internalNestingLevel == 1 || $this-&amp;gt;_nestingLevel == 1) {
    $tmp = $this-&amp;gt;invalid;
    $this-&amp;gt;invalid = array();
    throw new Doctrine_Validator_Exception($tmp);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then the validation exception is thrown as excepted. &lt;/p&gt;

&lt;p&gt;I don&apos;t know why you ignore here the nesting level. &lt;/p&gt;

&lt;p&gt;It would be great if you could explain me more about these lines. &lt;/p&gt;

&lt;p&gt;I ran the unit test with this modification and got the same result. &lt;/p&gt;</description>
                <environment>PHP 5.3.1, Mac OS X 10.6</environment>
            <key id="11344">DC-676</key>
            <summary>Validation exception thrown only if internal nesting level == 1</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="dreamcocoa">Fabian Spillner</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 May 2010 17:27:22 +0000</created>
                <updated>Tue, 8 Jun 2010 16:20:02 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12907" author="dreamcocoa" created="Mon, 10 May 2010 18:24:17 +0000"  >&lt;p&gt;Additional information: On doctrine 1.1.x the exception is thrown without this modification. &lt;/p&gt;</comment>
                    <comment id="12908" author="dreamcocoa" created="Tue, 11 May 2010 02:50:16 +0000"  >&lt;p&gt;It seems, the problem is the counter of internal nesting level. I output these member variables: &lt;/p&gt;

&lt;p&gt;Doctrine 1.1.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-none&quot;&gt;Doctrine_Transaction::commit invalid is not empty - internal nesting level: 1 nesting level: 2

ok 1 - Article cannot be created if empty: Doctrine_Validator_Exception: Validation failed in class Article

  1 field had validation error:

    * 1 validator failed on slug_title (notnull)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Doctrine 1.2.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-none&quot;&gt;Doctrine_Transaction::commit invalid is not empty - internal nesting level: 0 nesting level: 1

not ok 1 - Empty Artcile could be created!
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12913" author="dreamcocoa" created="Tue, 11 May 2010 08:30:25 +0000"  >&lt;p&gt;Yeah! I found the reason: &lt;/p&gt;

&lt;p&gt;I attached a template (listener) into my model which validates the body and this method call: &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;// ...
if ($obj-&amp;gt;getAuthor()-&amp;gt;getAge())  # this creates new empty Author object
{
  // ...
}
// ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On Doctrine 1.1, the method saveGraph() of class UnitOfWork executes first saveRelatedLocalKeys and then the hooks methods (preSave, etc.) and my code works!&lt;/p&gt;

&lt;p&gt;On Doctrine 1.2, the method saveGraph() call *&lt;b&gt;first&lt;/b&gt;* the hooks method and then the saveRelatedLocalKeys which save the empty author object and then destroy the internal nesting level &lt;br/&gt;
and the validation exception is not thrown. &lt;/p&gt;

&lt;p&gt;Workaround for my listener: &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;// ...
if ($obj-&amp;gt;relatedExists(&quot;Author&quot;) &amp;amp;&amp;amp; $obj-&amp;gt;getAuthor()-&amp;gt;getAge())  # relatedExists() needed to avoid create empty Author object
{
  // ...
}
// ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What do you think: It&apos;s a bug or a feature?&lt;/p&gt;</comment>
                    <comment id="12914" author="dreamcocoa" created="Tue, 11 May 2010 09:16:25 +0000"  >&lt;p&gt;A test case attached to reproduce the bug. &lt;/p&gt;

&lt;p&gt;The test passes if you remove the custom save() method of Ticket_DC676_Author class.&lt;/p&gt;

&lt;p&gt;The problem: default &quot;foobar&quot; modifies the Author and is modified. Doctrine tries to save it, &lt;br/&gt;
but because there is more than two transactions, the validation exception is not thrown for Article object. &lt;/p&gt;</comment>
                    <comment id="12915" author="jwage" created="Tue, 11 May 2010 11:42:43 +0000"  >&lt;p&gt;Something that really helps with determining what we should do is to find the exact changeset that causes the behavior. If we can look at what code was changed, we can then understand better what to do.&lt;/p&gt;</comment>
                    <comment id="13024" author="dreamcocoa" created="Thu, 20 May 2010 10:10:24 +0000"  >&lt;p&gt;This changeset affects the problem: &lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6126/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6126/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But I really don&apos;t like this logic how the validation exception is handled. I would seperate these things: &lt;/p&gt;

&lt;p&gt;The method validate() should throw exception, and the method commit() should commit only if model is valid and nothing more. &lt;/p&gt;

&lt;p&gt;1. go recursive into the model and call the validate() method&lt;/p&gt;

&lt;p&gt;2. if not valid, exception is thrown&lt;/p&gt;

&lt;p&gt;3. elseif ok, commit is called&lt;/p&gt;

&lt;p&gt;PS. Sorry for late answer: I had a lot of work ... &lt;/p&gt;</comment>
                    <comment id="13026" author="jwage" created="Thu, 20 May 2010 10:28:56 +0000"  >&lt;p&gt;Do you see something with that commit that could be changed that fixes your issue?&lt;/p&gt;</comment>
                    <comment id="13167" author="jwage" created="Tue, 8 Jun 2010 11:45:59 +0000"  >&lt;p&gt;Whoops. This change is causing some problems. It causes lots of tests to fail in our test suite. Reverting for now. Can you try your change against our test suite and see if you can determine anything? Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10600" name="DC676TestCase.php" size="3698" author="dreamcocoa" created="Tue, 11 May 2010 09:16:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-668] Call to undefined method Doctrine_Adapter_Mysqli::setAttribute() </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-668</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;i&apos;m trying to switch to php5.3.1.&lt;br/&gt;
using the same connection as before, mysql://, i get &lt;/p&gt;

&lt;p&gt;Warning: PDO::__construct() &lt;span class=&quot;error&quot;&gt;&amp;#91;pdo.--construct&amp;#93;&lt;/span&gt;: OK packet 6 bytes shorter than expected in C:\wamp\bin\php\php5.2.9-2\PEAR\Doctrine\lib\Doctrine\Connection.php  on line 470&lt;/p&gt;

&lt;p&gt;after researching this error, i found out that it is related to the new password in mysql5.&lt;br/&gt;
i tried changing the password for the connection, and made sure there is no old_password set in my.ini, without any success.&lt;/p&gt;

&lt;p&gt;so i&apos;m trying to connect using mysqli adapter, and now i get this error:&lt;br/&gt;
PHP Fatal error:  Call to undefined method Doctrine_Adapter_Mysqli::setAttribute() in C:\wamp\bin\php\php5.2.9-2\PEAR\Doctrine\lib\Doctrine\Connection.php on line 496&lt;/p&gt;

&lt;p&gt;how can i connect to mysql5.1 with php5.3, and what is the best connection to pick. mysql or mysqli.&lt;/p&gt;</description>
                <environment>windows xp, apache2.2 web server, php5.3.1, doctrine1.2.2, zend framework 1.10.3, mysql 5.1</environment>
            <key id="11323">DC-668</key>
            <summary>Call to undefined method Doctrine_Adapter_Mysqli::setAttribute() </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="nadim">nadim</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 May 2010 09:31:36 +0000</created>
                <updated>Tue, 8 Jun 2010 11:57:44 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13170" author="jwage" created="Tue, 8 Jun 2010 11:57:44 +0000"  >&lt;p&gt;What is Doctrine_Adapter_Mysqli? Is this your own class?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-667] migration fails for long foreign key names</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-667</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When having a model with short name and i18n field which is versioned, everthing is right. There are no problems when doing diff and migration again and again. Nothing will happen because nothing changed.&lt;br/&gt;
For example: &lt;br/&gt;
mytest:&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields:         [ description_front ]  &lt;br/&gt;
      actAs:  &lt;br/&gt;
        Timestampable:  &lt;br/&gt;
        Versionable:           &lt;br/&gt;
  columns:&lt;br/&gt;
    title: &lt;/p&gt;
{type: string(255)}
&lt;p&gt;    description_front: &lt;/p&gt;
{type: string(255)}

&lt;p&gt;But when using a longer model name like &apos;mytestmytestmytest&apos; then some strange errors occurred in my simple example. After creating the &apos;translation&apos; and &apos;transalation_version&apos; table in &apos;1273139712_version2.php&apos; and creating the foreign keys in &apos;1273139713_version3.php&apos; there shouldn&apos;d be a &apos;1273146011_version4.php&apos; generated by doing a diff, because everthing was already done. And of course when doing a migration with this last version, you will get errors. &lt;/p&gt;</description>
                <environment>CentOS release 5.4 (Final)&lt;br/&gt;
&lt;br/&gt;
Linux xxx 2.6.18-164.10.1.el5 #1 SMP Thu Jan 7 20:00:41 EST 2010 i686 athlon i386 GNU/Linux&lt;br/&gt;
&lt;br/&gt;
PHP 5.3.2 (cli) (built: Mar  4 2010 21:52:46)&lt;br/&gt;
Copyright (c) 1997-2010 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies&lt;br/&gt;
&lt;br/&gt;
MySQL Server version: 5.1.42-log MySQL Community Server (GPL)&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
</environment>
            <key id="11321">DC-667</key>
            <summary>migration fails for long foreign key names</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="mweber">Michael Weber</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 May 2010 09:19:20 +0000</created>
                <updated>Thu, 6 May 2010 09:19:20 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10593" name="doctrine_test.zip" size="760651" author="mweber" created="Thu, 6 May 2010 09:19:20 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-666] Unable to create relations with several fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-666</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have 2 tables.&lt;/p&gt;

&lt;p&gt;t1 :&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;id &lt;span class=&quot;error&quot;&gt;&amp;#91;Primary Key&amp;#93;&lt;/span&gt;&lt;br/&gt;
field1&lt;br/&gt;
field2&lt;br/&gt;
...&lt;br/&gt;
fieldn&lt;br/&gt;
t2_id &lt;span class=&quot;error&quot;&gt;&amp;#91;related to t2.id&amp;#93;&lt;/span&gt;&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
primary key: id&lt;/p&gt;

&lt;p&gt;t2:&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
id &lt;span class=&quot;error&quot;&gt;&amp;#91;related to t1.t2_id&amp;#93;&lt;/span&gt;&lt;br/&gt;
fixed_set &lt;span class=&quot;error&quot;&gt;&amp;#91;predefined set of values (for example &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;)&amp;#93;&lt;/span&gt;&lt;br/&gt;
field1&lt;br/&gt;
field2&lt;br/&gt;
...&lt;br/&gt;
fieldn&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
primary key: id + fixed_set&lt;/p&gt;

&lt;p&gt;I need to use relation like follows:&lt;br/&gt;
SELECT * &lt;br/&gt;
FROM t1&lt;br/&gt;
LEFT JOIN t2 ON (t1.t2_id = t2.id AND t2.fixed_set = &quot;a&quot;)&lt;/p&gt;

&lt;p&gt;There is followed text in phpdoc from Relation.php:&lt;br/&gt;
&amp;#8212;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;local                   the local field(s)&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;foreign                 the foreign reference field(s)&lt;br/&gt;
&amp;#8212;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But it is unable to use several fields in &quot;local&quot; and &quot;foreign&quot;, only one &quot;local&quot; and &quot;foreign&quot; field.&lt;/p&gt;</description>
                <environment>Windows Server 2003 SP2&lt;br/&gt;
Apache 2.2.14&lt;br/&gt;
PHP 5.3.1&lt;br/&gt;
Doctrine 1.2.2</environment>
            <key id="11320">DC-666</key>
            <summary>Unable to create relations with several fields</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="pavel">Pavel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 May 2010 11:03:01 +0000</created>
                <updated>Sat, 7 Aug 2010 15:38:53 +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>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-661] Subquery Doctrine Couldn&apos;t find class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-661</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to create a query like this one :&lt;/p&gt;

&lt;p&gt;SELECT nombre, (select count( * ) from alojamiento a left join localidad l on a.localidad_id=l.id where p.id=l.provincia_id and a.activo=true) as total from provincia p &lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create() &lt;br/&gt;
         -&amp;gt;select(&apos;p.nombre&apos;) &lt;br/&gt;
         -&amp;gt;addSelect(&apos;(select count( * ) from alojamiento a left join                   &lt;br/&gt;
                 localidad l on a.localidad_id=l.id where p.id=l.provincia_id and         &lt;br/&gt;
                 a.activo=true)&apos;) &lt;br/&gt;
         -&amp;gt;from(&apos;provincia p&apos;); &lt;/p&gt;

&lt;p&gt;but it fails : error 500, couldn&apos;t find class a.&lt;/p&gt;


&lt;p&gt;And :&lt;br/&gt;
$q = Doctrine_Query::create() -&amp;gt;select(&apos;nombre&apos;) -&amp;gt;addSelect(&apos;(select count( * ) from alojamiento left join localidad on&lt;br/&gt;
 alojamiento.localidad_id=localidad.id where&lt;br/&gt;
 provincia.id=localidad.provincia_id and alojamiento.activo=true)&apos;) -&amp;gt;from(&apos;provincia&apos;);&lt;/p&gt;

&lt;p&gt;leads to : SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;a.localidad_id&apos; in &apos;on clause&apos;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11313">DC-661</key>
            <summary>Subquery Doctrine Couldn&apos;t find class</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="guinsel">Mauro E.</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 May 2010 04:28:31 +0000</created>
                <updated>Tue, 8 Jun 2010 14:09:05 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13175" author="jwage" created="Tue, 8 Jun 2010 13:37:10 +0000"  >&lt;p&gt;You are using table names in your query and not model names.&lt;/p&gt;

&lt;p&gt;For future reference, the Jira is for reporting bugs/issues. You can ask user questions on the Doctrine mailing lists: &lt;a href=&quot;http://www.doctrine-project.org/community&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/community&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13182" author="guinsel" created="Tue, 8 Jun 2010 13:53:49 +0000"  >&lt;p&gt;My model names are: alojamiento, localidad and provincia I don&apos;t use table names.&lt;/p&gt;</comment>
                    <comment id="13183" author="jwage" created="Tue, 8 Jun 2010 13:56:28 +0000"  >&lt;p&gt;Can you provide a test case because I am not able to reproduce any problems. All of our subquery tests are passing currently and I can&apos;t seem to find any problems like you describe.&lt;/p&gt;</comment>
                    <comment id="13185" author="guinsel" created="Tue, 8 Jun 2010 14:05:36 +0000"  >&lt;p&gt;Hope it is not my stupid fault, I apologize if it&apos;s my fault.&lt;/p&gt;

&lt;p&gt;My schema.yml is:&lt;/p&gt;

&lt;p&gt;Alojamiento:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable:&lt;br/&gt;
    Sluggable:&lt;br/&gt;
      unique: true&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;nombre&amp;#93;&lt;/span&gt;&lt;br/&gt;
      canUpdate: true&lt;br/&gt;
    SoftDelete:&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    localidad_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    nombre:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    activo:&lt;br/&gt;
      type: boolean&lt;br/&gt;
      notnull: true&lt;br/&gt;
      default: false&lt;br/&gt;
  relations:&lt;br/&gt;
    Localidad:&lt;br/&gt;
      foreignType: one&lt;/p&gt;

&lt;p&gt;Localidad:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Sluggable:&lt;br/&gt;
      unique: true&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;nombre&amp;#93;&lt;/span&gt;&lt;br/&gt;
      canUpdate: true&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    nombre:&lt;br/&gt;
      type: string(250)&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    provincia_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
  relations:&lt;br/&gt;
    Provincia:&lt;br/&gt;
      onDelete: CASCADE&lt;br/&gt;
      local: provincia_id&lt;br/&gt;
      foreign: id&lt;/p&gt;

&lt;p&gt;Provincia:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Sluggable:&lt;br/&gt;
      unique: true&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;nombre&amp;#93;&lt;/span&gt;&lt;br/&gt;
      canUpdate: true&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    nombre:&lt;br/&gt;
      type: string(250)&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
  relations:&lt;br/&gt;
    Localidades:&lt;br/&gt;
      type: many&lt;br/&gt;
      class: Localidad&lt;br/&gt;
      local: id&lt;br/&gt;
      foreign: provincia_id&lt;br/&gt;
      orderBy: nombre&lt;/p&gt;</comment>
                    <comment id="13186" author="jwage" created="Tue, 8 Jun 2010 14:09:05 +0000"  >&lt;p&gt;You can read about how to create unit tests here &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/unit-testing/en#unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/unit-testing/en#unit-testing&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-655] When Export from Models to database is made some constraints may not be created</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-655</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When exporting my schema from yaml I noticed that some CONSTRAINT are not created, but all the models are. After analyzing the code I found that an issue is not related to YAML but is related to Doctrine_Table::getExportableFormat(). I have models creation option to create it in PEAR-like style.&lt;/p&gt;

&lt;p&gt;So, when you have a schema like this:&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
Partner_Code:&lt;br/&gt;
  tableName: partner_code&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    code:&lt;br/&gt;
      type: string(64)&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;/p&gt;

&lt;p&gt;Partner_Channel:&lt;br/&gt;
  tableName: partner_channel&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(64)&lt;br/&gt;
      notnull: true&lt;br/&gt;
  relations:&lt;br/&gt;
    Codes:&lt;br/&gt;
      class: Partner_Code&lt;br/&gt;
      local: channel_id&lt;br/&gt;
      foreign: code_id&lt;br/&gt;
      refClass: Partner_Channel_Code&lt;br/&gt;
      foreignAlias: Partner_Channel&lt;br/&gt;
      foreignType: one&lt;br/&gt;
      type: many&lt;/p&gt;

&lt;p&gt;Partner_Channel_Code:&lt;br/&gt;
  tableName: partner_channel_x_code&lt;br/&gt;
  columns:&lt;br/&gt;
    channel_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    code_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;it generates sql like this:&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
CREATE TABLE partner_channel (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_channel_x_code (channel_id INT UNSIGNED, code_id INT UNSIGNED, PRIMARY KEY(channel_id, code_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_code (id INT UNSIGNED AUTO_INCREMENT, code VARCHAR(64) NOT NULL UNIQUE, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_channel_id_partner_channel_id FOREIGN KEY (channel_id) REFERENCES partner_channel(id);&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;But should also generate:&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_code_id_partner_code_id FOREIGN KEY (code_id) REFERENCES partner_code(id);&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;But if I just change the schema with this changes (notice the Channel changed to Shannel):&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
Partner_Channel:&lt;br/&gt;
  relations:&lt;br/&gt;
    Codes:&lt;br/&gt;
      refClass: Partner_Shannel_Code&lt;/p&gt;

&lt;p&gt;Partner_Shannel_Code:&lt;br/&gt;
  tableName: partner_channel_x_code&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;Everything is created.&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
CREATE TABLE partner_channel (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_code (id INT UNSIGNED AUTO_INCREMENT, code VARCHAR(64) NOT NULL UNIQUE, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_channel_x_code (channel_id INT UNSIGNED, code_id INT UNSIGNED, PRIMARY KEY(channel_id, code_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_code_id_partner_code_id FOREIGN KEY (code_id) REFERENCES partner_code(id);&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_channel_id_partner_channel_id FOREIGN KEY (channel_id) REFERENCES partner_channel(id);&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;So as I figured out is that when creating the tables alphabetic order has an influence on creating the CONSTRAINT for that Model in sql. I suppose line 715 of the Doctrine/Table.php near $key = $this-&amp;gt;_checkForeignKeyExists(...) is operating, but I am not sure (when inserting into DB some tables are not created yet?).&lt;/p&gt;

&lt;p&gt;Do not know how to markup here, it&apos;s my first issue in Jira, please press &quot;edit&quot; to see the yaml code formatted &lt;/p&gt;</description>
                <environment>FreeBSD 6.1, Apache 2.2.4, PHP 5.3.2, MySQL 5.0.41</environment>
            <key id="11289">DC-655</key>
            <summary>When Export from Models to database is made some constraints may not be created</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="c0ba">Oleg Stepura</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Apr 2010 11:01:05 +0000</created>
                <updated>Fri, 11 Jun 2010 09:05:00 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12778" author="c0ba" created="Thu, 29 Apr 2010 12:57:26 +0000"  >&lt;p&gt;Also what I noticed today is that this YAML schema:&lt;/p&gt;

&lt;p&gt;Partner_Channel:&lt;br/&gt;
  tableName: partner_channel&lt;br/&gt;
  comment: List of channels.&lt;/p&gt;

&lt;p&gt;Does not add comment to the MySQL table when trying to do this through the cli build-all-load command. Neither the generated Model nor the exported sql chema have this option (&apos;comment&apos;).&lt;/p&gt;

&lt;p&gt;maybe this should be a different bug report...&lt;/p&gt;</comment>
                    <comment id="13272" author="gx" created="Fri, 11 Jun 2010 08:40:46 +0000"  >&lt;p&gt;For your missing table comment, try nesting &quot;comment&quot; into &quot;options&quot;, like this:&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;YAML&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Partner_Channel:
  tableName: partner_channel
  options:
    comment: List of channels.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&amp;#8212;&lt;/p&gt;

&lt;p&gt;Now for the missing constraints issue, I confirm! See #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-502&quot; title=&quot;sometimes not all the constraints are created for a many to many relation&quot;&gt;DC-502&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13274" author="c0ba" created="Fri, 11 Jun 2010 09:05:00 +0000"  >&lt;p&gt;Hi! As for the comments - your decision seems like a workaround. Is it so or is it the way it should work? Do you know how this kind of stuff will work in 2.0 version?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-652] unidirectionnal hasMany definition</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-652</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Here the definition of the Domain Model : &lt;a href=&quot;http://pastebin.com/i80d73s8&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/i80d73s8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To resume, Show is a mother class. Video, is a direct extend from Show.&lt;br/&gt;
ShowContainer  is an abstract class that expend Show. It define an hasMany relation to Video, through CompoShowShow.&lt;br/&gt;
Program and Playlist are extends ShowContainer.&lt;/p&gt;

&lt;p&gt;the following DQL Query work fine.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$query	= Doctrine_Query::create ()&lt;br/&gt;
	-&amp;gt;from (&quot;Model_Program program&quot;)&lt;br/&gt;
	-&amp;gt;leftJoin (&quot;program.children children&quot;);&lt;br/&gt;
$oShow = $query-&amp;gt;fetchOne ();&lt;br/&gt;
var_dump (get_class ($oShow-&amp;gt;children&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;)); //Output Model_Video&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;But, the following code isn&apos;t working :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$oProgram			= Doctrine_Core::getTable (&quot;Model_Program&quot;)-&amp;gt;find (2);&lt;br/&gt;
$oProgram-&amp;gt;children;&lt;/p&gt;

&lt;p&gt;//Throw Exception&lt;br/&gt;
//Message: Unknown record property / related component &quot;children&quot; on &quot;Model_Program&quot; &lt;br/&gt;
//Doctrine\Record.php(1381)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The Program#2 is in the database.&lt;/p&gt;

&lt;p&gt;Here we are.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11276">DC-652</key>
            <summary>unidirectionnal hasMany definition</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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Apr 2010 10:22:27 +0000</created>
                <updated>Mon, 14 Jun 2010 09:29:07 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13203" author="jwage" created="Tue, 8 Jun 2010 16:17:14 +0000"  >&lt;p&gt;We&apos;ll need some more information. I don&apos;t see the Model_Program model anywhere. Can you create a failing test case?&lt;/p&gt;</comment>
                </comments>
                    <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-649] Getting Doctrine_Validator_Exception on Doctrine_Record::replace() when using unique</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-649</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using this code:&lt;/p&gt;

&lt;p&gt;$user = new User();&lt;br/&gt;
$user-&amp;gt;mail = &apos;mail@mail.mail&apos;;&lt;br/&gt;
$user-&amp;gt;save();&lt;br/&gt;
$user2 = new User();&lt;br/&gt;
$user2-&amp;gt;mail = &apos;mail@mail.mail&apos;;&lt;br/&gt;
$user2-&amp;gt;replace();&lt;/p&gt;

&lt;p&gt;I get the following exception:&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Validator_Exception&apos; with message &apos;Validation failed in class User: 1 field had validation error: 1 validator failed on mail (unique)&apos; in D:\Workspace\Doctrine\Doctrine\Transaction.php:265&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 D:\Workspace\Doctrine\Doctrine\Connection.php(1395): Doctrine_Transaction-&amp;gt;commit(NULL)&lt;br/&gt;
#1 D:\Workspace\Doctrine\Doctrine\Connection\UnitOfWork.php(143): Doctrine_Connection-&amp;gt;commit()&lt;br/&gt;
#2 D:\Workspace\Doctrine\Doctrine\Record.php(1748): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(User), true)&lt;br/&gt;
#3 D:\Workspace\test.php: Doctrine_Record-&amp;gt;replace()&lt;br/&gt;
#4 &lt;/p&gt;
{main}
&lt;p&gt;thrown in D:\Workspace\Doctrine\Doctrine\Transaction.php on line 265&lt;/p&gt;</description>
                <environment>PHP 5.3.2, MySQL 5.1.46</environment>
            <key id="11268">DC-649</key>
            <summary>Getting Doctrine_Validator_Exception on Doctrine_Record::replace() when using 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="p4lschool">p4l</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Apr 2010 11:41:15 +0000</created>
                <updated>Mon, 26 Apr 2010 11:41:15 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <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-643] Doctrine_Collection problem duplicate record</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-643</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;blockquote&gt;
&lt;p&gt;$oVideo	= Doctrine_Core::getTable (&quot;Model_Video&quot;)-&amp;gt;find (500);&lt;br/&gt;
$oVideo	= new Model_Video ();&lt;br/&gt;
$oVideo-&amp;gt;assignIdentifier (500);&lt;/p&gt;

&lt;p&gt;$oTag	= Doctrine_Core::getTable (&quot;Model_Tag&quot;)-&amp;gt;find (500);&lt;br/&gt;
$oVideo-&amp;gt;tags-&amp;gt;clear ();&lt;br/&gt;
$oVideo-&amp;gt;tags[] = $oTag;&lt;br/&gt;
$oVideo-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The previous code can be execute a lot of time. &lt;/p&gt;

&lt;p&gt;Now, let us create the Doctrine_Collection.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$oVideo	= Doctrine_Core::getTable (&quot;Model_Video&quot;)-&amp;gt;find (500);&lt;br/&gt;
$oVideo	= new Model_Video ();&lt;br/&gt;
$oVideo-&amp;gt;assignIdentifier (500);&lt;/p&gt;

&lt;p&gt;$oTag	= Doctrine_Core::getTable (&quot;Model_Tag&quot;)-&amp;gt;find (500);&lt;br/&gt;
$oVideo-&amp;gt;tags	= new Doctrine_Collection (&quot;Model_Tag&quot;);&lt;br/&gt;
$oVideo-&amp;gt;tags[] = $oTag;&lt;br/&gt;
$oVideo-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Doctrine create a relation between the video and tag. It doesn&apos;t update it. &lt;br/&gt;
If the relation already exists into the database, Doctrine create an other record, or the DB throw an integrity error if you have constraint.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11257">DC-643</key>
            <summary>Doctrine_Collection problem duplicate 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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Apr 2010 09:53:22 +0000</created>
                <updated>Thu, 22 Apr 2010 09:53:22 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-640] Slugs aren&apos;t created when inserting/updating a table row</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-640</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Basically the slug column doesn&apos;t get updated in spite of all fields being added correctly, as far as i can tell.&lt;br/&gt;
It seems to be related to additional options because when i don&apos;t have either of the uniqueBy or canUpdate options specified, it just works.&lt;/p&gt;

&lt;p&gt;What&apos;s been missing is the &apos;slug&apos; column value in the sql statements (providing 3 examples):&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;2400 Query INSERT INTO `custom_category` (`block_id`, `name`) VALUES (&apos;1&apos;, &apos;slug test&apos;)
2526 Query INSERT INTO `custom_category` (`name`, `block_id`) VALUES (&apos;please &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; work..&apos;, &apos;1&apos;)
2560 Query UPDATE `custom_category` SET `name` = &apos;still not ok&apos; WHERE `id` = &apos;12&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The generated schema.sql includes the correct create table statement (it&apos;s also correctly inserted in the db):&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;CREATE TABLE `custom_category` (
  `id` INT UNSIGNED AUTO_INCREMENT,
  `name` VARCHAR(255) NOT NULL,
  `block_id` INT UNSIGNED NOT NULL,
  `slug` VARCHAR(255),
  UNIQUE INDEX `custom_category_sluggable_idx` (`slug`, `block_id`, `name`),
  INDEX `block_id_idx` (`block_id`),
  PRIMARY KEY(`id`)
) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The schema.yml entry is 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;CustomCategory:
  connection: removed
  tableName: custom_category
  actAs:
    Sluggable:
      fields: [name]
      uniqueBy: [block_id, name]
      canUpdate: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  columns:
    id:
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &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;
    name:
      type: string(255)
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    block_id:
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  relations:
    Products:
      class: Product
      foreignAlias: CustomCategories
      refClass: ProductCustomCategory
    Block:
      class: Block
      local: block_id
      foreign: id
      foreignType: many
      foreignAlias: CustomCategories
      type: one
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And finally the appropriate auto generated base class (removed doc block):&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-comment&quot;&gt;// Connection Component Binding
&lt;/span&gt;Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;CustomCategory&apos;, &apos;removed&apos;);

&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseCustomCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; aaDoctrineRecord
{
    &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;custom_category&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;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;unsigned&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;,
             &apos;length&apos; =&amp;gt; &apos;4&apos;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 255, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;length&apos; =&amp;gt; &apos;255&apos;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;block_id&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;length&apos; =&amp;gt; &apos;4&apos;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        parent::setUp();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Product as Products&apos;, array(
             &apos;refClass&apos; =&amp;gt; &apos;ProductCustomCategory&apos;,
             &apos;local&apos; =&amp;gt; &apos;custom_category_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;product_id&apos;));

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Block&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;block_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $sluggable0 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Template_Sluggable(array(
             &apos;fields&apos; =&amp;gt;
             array(
              0 =&amp;gt; &apos;name&apos;,
             ),
             &apos;uniqueBy&apos; =&amp;gt;
             array(
              0 =&amp;gt; &apos;block_id&apos;,
              1 =&amp;gt; &apos;name&apos;,
             ),
             &apos;canUpdate&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;actAs($sluggable0);
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Using Symfony 1.4 form svn:&lt;br/&gt;
&lt;br/&gt;
URL: &lt;a href=&quot;http://svn.symfony-project.com/branches/1.4&quot;&gt;http://svn.symfony-project.com/branches/1.4&lt;/a&gt;&lt;br/&gt;
Revision: 29223&lt;br/&gt;
Last Changed Rev: 29218&lt;br/&gt;
Last Changed Date: 2010-04-20 08:04:09 +0200 (Di, 20 Apr 2010) </environment>
            <key id="11251">DC-640</key>
            <summary>Slugs aren&apos;t created when inserting/updating a table row</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="perplexa">Daniel K&#246;nig</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Apr 2010 03:59:16 +0000</created>
                <updated>Mon, 3 May 2010 08:31:15 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Sluggable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12817" author="caponica" created="Sat, 1 May 2010 14:00:57 +0000"  >&lt;p&gt;What is the code that you&apos;re using to generate the INSERT query?&lt;/p&gt;</comment>
                    <comment id="12820" author="perplexa" created="Mon, 3 May 2010 08:31:15 +0000"  >&lt;p&gt;just instantiating the object, calling the setters, followed by a save().&lt;/p&gt;

&lt;p&gt;it&apos;s related to the uniqueBy and canUpdate options, though - it works like a charm without these two.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-637] Many-to-many: Using Association Class (refclass) property in query adds leftJoin</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-637</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to use a refclass property - i.e. normalization table column - in a query, an unnecessary join is added to the query created, which is then used to &quot;access&quot; the property.&lt;/p&gt;

&lt;p&gt;This issue has already been discussed back in May 2008 but still seems to persist.&lt;br/&gt;
Please see the google group discussion &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/c655832a450ccd1a/9cb6eca6ae1c3dee&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/c655832a450ccd1a/9cb6eca6ae1c3dee&lt;/a&gt; for example + comments.&lt;/p&gt;

&lt;p&gt;Unfortunately it is hardly possible to write a test case for this, as working SQL is generated, but the query is just not right (test case basically would have to assert the query string, wich does not make much sense).&lt;br/&gt;
Another way to test if it does &quot;what it should&quot;, could be to assert contents of $q-&amp;gt;getTableAliasMap() - but does not seem ideal either.&lt;/p&gt;

&lt;p&gt;John Wage commented on this issue &lt;br/&gt;
&quot;Can you create a ticket for this with a failing test case? I believe this&lt;br/&gt;
should be possible and we should investigate a fix for it. &lt;br/&gt;
Thanks, Jon &quot;&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/c655832a450ccd1a/9cb6eca6ae1c3dee#msg_c73934a38515cadb&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/c655832a450ccd1a/9cb6eca6ae1c3dee#msg_c73934a38515cadb&lt;/a&gt;&lt;/p&gt;</description>
                <environment>PHP 5.3.2 (cli) (built: Mar  4 2010 22:12:20)&lt;br/&gt;
mysql 5.1.45&lt;br/&gt;
centOS</environment>
            <key id="11246">DC-637</key>
            <summary>Many-to-many: Using Association Class (refclass) property in query adds leftJoin</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="grass">Pablo Grass</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Apr 2010 06:31:54 +0000</created>
                <updated>Tue, 20 Apr 2010 06:39:21 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10581" name="example.php" size="1782" author="grass" created="Tue, 20 Apr 2010 06:31:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-635] synchronizeWithArray and link-table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-635</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Tree tables : tags, compo_show_tag, shows&lt;/p&gt;

&lt;p&gt;&quot;compo_show_tag&quot; make a link between tags and shows. It&apos;s a many-to-many relationship.&lt;/p&gt;

&lt;p&gt;Assume that all the Tags / Shows are already create. The max id is 300 for shows and tags.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 200;&lt;/p&gt;

&lt;p&gt;$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;br/&gt;
echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 200&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Above create two entry into the compo_show_table. Because all element are existing.&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;/p&gt;

&lt;p&gt;$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Above remove the relation between Show#200 and Tag#38, but keep the relation between Show#36 and Tag#38.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 150;&lt;br/&gt;
$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;br/&gt;
echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 150&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Above create a new relation, like the first example.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 140;&lt;/p&gt;

&lt;p&gt;$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;br/&gt;
echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 140&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Bug is above.&lt;br/&gt;
We except that Doctrine remove the relation between Show#150 and Tag#38 and add a new one between Show#140 and Tag#38. &lt;br/&gt;
Here the bug because Doctrine doesn&apos;t change anything. &lt;/p&gt;

&lt;p&gt;Thanks.&lt;br/&gt;
Armetiz.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11231">DC-635</key>
            <summary>synchronizeWithArray and link-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="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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Apr 2010 09:04:56 +0000</created>
                <updated>Fri, 16 Apr 2010 09:07:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-634] getPopularTags() query fails on Postgresql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-634</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I run:&lt;br/&gt;
Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags();&lt;br/&gt;
I get: ERROR: column &quot;i2__1&quot; does not exist&lt;/p&gt;

&lt;p&gt;The failing query on PostgreSql is:&lt;/p&gt;

&lt;p&gt;SELECT t.id AS t_id, t.name AS tname, COUNT(DISTINCT i.id) AS i_0,&lt;br/&gt;
(COUNT(DISTINCT i.id)) AS i__1&lt;br/&gt;
FROM taggable_tag t&lt;br/&gt;
LEFT JOIN cms_model_image_taggable_tag c ON (t.id = c.tag_id)&lt;br/&gt;
LEFT JOIN image i ON i.id = c.id&lt;br/&gt;
WHERE t.id IN&lt;br/&gt;
(SELECT doctrine_subquery_alias.id&lt;br/&gt;
FROM&lt;br/&gt;
(SELECT DISTINCT t2.id, (COUNT(DISTINCT i2.id)) AS i2__1&lt;br/&gt;
FROM taggable_tag t2&lt;br/&gt;
LEFT JOIN cms_model_image_taggable_tag c2 ON (t2.id = c2.tag_id)&lt;br/&gt;
LEFT JOIN image i2 ON i2.id = c2.id&lt;br/&gt;
GROUP BY t2.id HAVING i2__1 &amp;gt; 0&lt;br/&gt;
ORDER BY i2__1 DESC LIMIT 10) AS doctrine_subquery_alias)&lt;br/&gt;
GROUP BY t.id HAVING i__1 &amp;gt; 0&lt;br/&gt;
ORDER BY i__1 DESC&lt;/p&gt;

&lt;p&gt;Seems that this just a PostgreSql issue.&lt;br/&gt;
On Mysql it runs just fine.&lt;/p&gt;

&lt;p&gt;The corrected, working query is:&lt;/p&gt;

&lt;p&gt;SELECT t.id AS t_&lt;em&gt;id, t.name AS t&lt;/em&gt;&lt;em&gt;name, COUNT(DISTINCT i.id) AS i&lt;/em&gt;_0,&lt;br/&gt;
   (COUNT(DISTINCT i.id)) AS i__1&lt;br/&gt;
FROM taggable_tag t&lt;br/&gt;
LEFT JOIN cms_&lt;em&gt;model&lt;/em&gt;_image_taggable_tag c ON (t.id = c.tag_id)&lt;br/&gt;
LEFT JOIN image i ON i.id = c.id&lt;br/&gt;
WHERE t.id IN&lt;br/&gt;
    (SELECT doctrine_subquery_alias.id&lt;br/&gt;
     FROM&lt;br/&gt;
       (SELECT DISTINCT t2.id, (COUNT(DISTINCT i2.id)) AS i2__1&lt;br/&gt;
        FROM taggable_tag t2&lt;br/&gt;
        LEFT JOIN cms_&lt;em&gt;model&lt;/em&gt;_image_taggable_tag c2 ON (t2.id = c2.tag_id)&lt;br/&gt;
        LEFT JOIN image i2 ON i2.id = c2.id&lt;br/&gt;
        GROUP BY t2.id HAVING COUNT(DISTINCT i2.id) &amp;gt; 0&lt;br/&gt;
        ORDER BY i2__1 DESC LIMIT 10) AS doctrine_subquery_alias)&lt;br/&gt;
GROUP BY t.id, t.name HAVING COUNT(DISTINCT i.id) &amp;gt; 0&lt;br/&gt;
ORDER BY i__1 DESC&lt;/p&gt;

&lt;p&gt;For more details, please read the discussion here:&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/2647537/doctrine-sql-query-works-on-mysql-on-postgresql-wont&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/2647537/doctrine-sql-query-works-on-mysql-on-postgresql-wont&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Windows, Postgresql</environment>
            <key id="11227">DC-634</key>
            <summary>getPopularTags() query fails on 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="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 14:47:56 +0000</created>
                <updated>Thu, 15 Apr 2010 14:47:56 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Extensions</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-631] Documentation </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-631</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/Doctrine_Record/1_2#method_importfrom&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/Doctrine_Record/1_2#method_importfrom&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The description of the $type parameter is : Format type: xml, yml, json&lt;br/&gt;
But it could take an array.&lt;/p&gt;

&lt;p&gt;So the documentation have to be update for this point.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11222">DC-631</key>
            <summary>Documentation </summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 05:18:30 +0000</created>
                <updated>Thu, 15 Apr 2010 05:18:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-630] Add Undelete functionality to SoftDelete behaviour</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-630</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Can an undelete function be added to the Doctrine ORM which will reset deleted_at fields to null and conform to cascade rules (just as the original delete did)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11220">DC-630</key>
            <summary>Add Undelete functionality to SoftDelete behaviour</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="harryhobbes">Harry Birrell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 01:35:57 +0000</created>
                <updated>Thu, 15 Apr 2010 01:35:57 +0000</updated>
                                                                    <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-629] Doctrine Integer Validator should use intval() rather than round(floatval())</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-629</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&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;echo PHP_INT_MAX;
echo &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
echo strval(round(floatval(PHP_INT_MAX)));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;on 64 bit machine, default php install, you get:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;9223372036854775807&lt;br/&gt;
9.22337203685E+18&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;float precision is set to 12 by default. setting it higher offers no benefit, with it set to 20+, it still doesn&apos;t match up (and is actually not reliably past a certain length, i&apos;d have to dig again to find a reference though), but as you can see, no go:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;9223372036854775807&lt;br/&gt;
9223372036854775808&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;as a result, very large #&apos;s do NOT validate as doctrine integers, even though they are.&lt;/p&gt;

&lt;p&gt;fix, use intval() instead. as far as I can tell, and as far as our 400+ unit tests in our application show, PHP_INT_MAX is fully supported everywhere else except for in Validator.php@170:&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;170c170
&amp;lt;                  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; (string) $&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; == strval(round(floatval($&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;)));
---
&amp;gt;                  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; (string) $&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; == strval(intval($&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 9.10 x64, php 5.2.10</environment>
            <key id="11219">DC-629</key>
            <summary>Doctrine Integer Validator should use intval() rather than round(floatval())</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="isleshocky77">Stephen Ostrow</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Apr 2010 15:41:01 +0000</created>
                <updated>Tue, 8 Jun 2010 17:13:14 +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>
                                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13224" author="jwage" created="Tue, 8 Jun 2010 17:13:14 +0000"  >&lt;p&gt;This breaks a 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;
Doctrine_Ticket_1783_TestCase...................................................failed


Doctrine_Ticket_1783_TestCase : method testValidateLargeIntegers failed on line 17 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-628] Two queries on the same table seems to share set of fields </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-628</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Two queries:&lt;/p&gt;

&lt;p&gt;1.              $ab1 = Doctrine_Query::create()&lt;br/&gt;
                        -&amp;gt;from(&apos;Model_UserAddressbook ab&apos;)&lt;br/&gt;
                        -&amp;gt;leftJoin(&apos;ab.UserPersons up&apos;)&lt;br/&gt;
                        -&amp;gt;leftJoin(&apos;ab.AdminUsers au&apos;);  // second one doesn&apos;t have this join&lt;/p&gt;

&lt;p&gt;2.              $ab2 = Doctrine_Query::create()&lt;br/&gt;
                        -&amp;gt;from(&apos;Model_UserAddressbook ab&apos;)&lt;br/&gt;
                        -&amp;gt;leftJoin(&apos;ab.UserPersons up&apos;);&lt;/p&gt;

&lt;p&gt;When executing the following fetchOne:&lt;/p&gt;

&lt;p&gt;A.) $x1 = $ab2-&amp;gt;fetchOne()-&amp;gt;toArray();  // has fields from addressbook, and subarray UserPersons, OK&lt;br/&gt;
B.) $x2 = $ab1-&amp;gt;fetchOne()-&amp;gt;toArray();  // has fields from addressbook, and subarray UserPersons and AdminUsers, OK&lt;br/&gt;
C.) $x3 = $ab2-&amp;gt;fetchOne()-&amp;gt;toArray();  // has fields from addressbook, and subarray UserPersons and AdminUsers, NOT OK&lt;/p&gt;

&lt;p&gt;$x1 and $x3 should have the same set of fields, but $x3 has somehow received set of fields from $x2.&lt;/p&gt;

&lt;p&gt;I haven&apos;t turned on any caching, but even if the caching is on, the result sets shouldn&apos;t mix, right?&lt;/p&gt;

&lt;p&gt;I&apos;m talking just about field names (set of fields), not fields data.&lt;/p&gt;</description>
                <environment>OS: Vista 64&lt;br/&gt;
Zend Framework 1.10.1&lt;br/&gt;
MySQL: 5.1.39</environment>
            <key id="11217">DC-628</key>
            <summary>Two queries on the same table seems to share set of fields </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="vlatko">Vlatko Basic</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Apr 2010 04:42:03 +0000</created>
                <updated>Mon, 14 Jun 2010 09:24:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-625] Doctrine_Query throws exception for custom hydrator that extends stock hydrator</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-625</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a custom hydrator that extends Doctrine_Hydrator_ScalarDriver, for the sole purpose of simplifying the column keys (by passing false as the 3rd parameter on _gatherRowData):&lt;/p&gt;

&lt;p&gt;class Doctrine_Hydrator_AssocDriver extends Doctrine_Hydrator_ScalarDriver&lt;br/&gt;
{&lt;br/&gt;
    public function hydrateResultSet($stmt)&lt;br/&gt;
    {&lt;br/&gt;
        $cache = array();&lt;br/&gt;
        $result = array();&lt;/p&gt;

&lt;p&gt;        while ($data = $stmt-&amp;gt;fetch(Doctrine_Core::FETCH_ASSOC)) &lt;/p&gt;
{
            $result[] = $this-&amp;gt;_gatherRowData($data, $cache, false);
        }

&lt;p&gt;        return $result;&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;The processPendingFields method in Doctrine_Query is unnecessarily throwing a Doctrine_Query_Exception at line 465.  This can be resolved by skipping hydration methods that extend None, Scalar and SingleScalar.&lt;/p&gt;

&lt;p&gt;A diff of the changes is attached.&lt;/p&gt;</description>
                <environment>Windows Vista, Apache 2.2, PHP 5.3, MySQL 5.1</environment>
            <key id="11198">DC-625</key>
            <summary>Doctrine_Query throws exception for custom hydrator that extends stock hydrator</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="jaredmellentine">Jared Mellentine</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Apr 2010 17:33:17 +0000</created>
                <updated>Tue, 20 Apr 2010 16:22:39 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10564" name="Query.diff" size="1171" author="jaredmellentine" created="Fri, 9 Apr 2010 17:33:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-624] Validator_Readonly fails for new objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-624</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If Readonly validator is on for some field, it fails when you trying to create new object (ie. by loading fixtures).&lt;/p&gt;

&lt;p&gt;Fix proposition is in attachment.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11196">DC-624</key>
            <summary>Validator_Readonly fails for new 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tomwys">Tomasz Wysocki</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Apr 2010 13:52:37 +0000</created>
                <updated>Fri, 9 Apr 2010 13:52:37 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10563" name="Readonly.php" size="1664" author="tomwys" created="Fri, 9 Apr 2010 13:52:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-623] Impossible to create non-unique slugs</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-623</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I want to create a non-unique slug of a title field from my table.&lt;/p&gt;

&lt;p&gt;But I&apos;ve found that when I change unique from &apos;true&apos; to &apos;false&apos; the slugs were not created or updated&lt;/p&gt;

&lt;p&gt;In lib\Doctrine\Template\Listener\Sluggable.php inside preUpdate() function the first if() statement disables the unique (false) option.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11193">DC-623</key>
            <summary>Impossible to create non-unique slugs</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="adwise">Adwise Internetmarketing</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Apr 2010 08:28:02 +0000</created>
                <updated>Tue, 31 Aug 2010 11:51:12 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Sluggable</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14176" author="jmather" created="Mon, 30 Aug 2010 16:44:12 +0000"  >&lt;p&gt;Theoretically this should clear up the issue. Sorry for not having the time for a complete test at the moment,&lt;/p&gt;</comment>
                    <comment id="14178" author="webpragmatist" created="Mon, 30 Aug 2010 16:59:52 +0000"  >&lt;p&gt;The patch by Jacob doesn&apos;t work. The reason for the unique check is to bypass appending a numeric value to the end of a slug in the even two exist.&lt;/p&gt;

&lt;p&gt;It just needs to somehow be directly sent to the urlize function.&lt;/p&gt;</comment>
                    <comment id="14196" author="jmather" created="Tue, 31 Aug 2010 11:51:12 +0000"  >&lt;p&gt;I would just like to post an update after I&apos;ve been able to test:&lt;/p&gt;

&lt;p&gt;The only functionality that i found actually broken was updating a slug with unique set to false.&lt;/p&gt;

&lt;p&gt;The reason was the wrapped if.&lt;/p&gt;

&lt;p&gt;If you set unique to false, slugs will still fail to update as canUpdate must also be set to true.&lt;/p&gt;

&lt;p&gt;The patch, so far as I can determine, does correct the underlying issue if a slug failing to update when unique is false and canUpdate is true.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10750" name="dc-623.patch" size="1661" author="jmather" created="Mon, 30 Aug 2010 16:44:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-619] preHydrate/postHydrate events do not use proper sub-class component</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-619</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am trying to use preHydrate/postHydrate with my models that use inheritance. The problem is that when using the parent table is used to query the records, the preHydrate/postHydrate events are passed to the parent record class instead of the proper sub-class for the current record.&lt;/p&gt;

&lt;p&gt;Using the example schema below, if I do a findAll() on the Person table and it contained two Student records and one Professor record... preHydrate would get called on Person instead of Student and Professor. This also applies for any listeners that are registered on Student/Professor and not Person.&lt;/p&gt;

&lt;p&gt;Person:&lt;br/&gt;
  columns:&lt;br/&gt;
    name: &lt;/p&gt;
{ type: string(50) }

&lt;p&gt;Student:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Person&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyType: 1&lt;/p&gt;

&lt;p&gt;Professor:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Person&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 2&lt;/p&gt;
</description>
                <environment>PHP 5.2.11 (cli), Doctrine 1.2 (Revision: 7537)</environment>
            <key id="11179">DC-619</key>
            <summary>preHydrate/postHydrate events do not use proper sub-class component</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="mlehner">Matt Lehner</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Apr 2010 14:55:23 +0000</created>
                <updated>Mon, 14 Jun 2010 09:28:51 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Inheritance</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</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-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-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-614] Separate the properties of the parent and the children</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-614</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I want to talk about the inheritance, simple type and columns_aggregation.&lt;/p&gt;

&lt;p&gt;Here an example of parent classes and two sub-classes : &lt;a href=&quot;http://pastebin.com/5qJKtgp1&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/5qJKtgp1&lt;/a&gt;&lt;br/&gt;
Here the generated models classes : &lt;a href=&quot;http://pastebin.com/j2PmT7sd&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/j2PmT7sd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To sum up : The parent class is Show, and the sub-classes are Video and Playlist.&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;A Show have a title.&lt;/li&gt;
	&lt;li&gt;A Video have a filename.&lt;/li&gt;
	&lt;li&gt;A Playlist have a user.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The problem that appear with the generated models, Is that the following code is working.&lt;br/&gt;
$playlist = Doctrine_Core::getTable (&quot;Model_Playlist&quot;)-&amp;gt;find (3);&lt;br/&gt;
$playlist-&amp;gt;filename;&lt;/p&gt;

&lt;p&gt;Or, the POO concept want that the filename property doesn&apos;t exist/available on a Playlist object. And Doctrine should throw an Exception ! Or, It is not the case.&lt;/p&gt;

&lt;p&gt;The solution is to move the generated code of the sub-classes into there own classes.&lt;br/&gt;
Here the complete solution : &lt;a href=&quot;http://pastebin.com/LzTG10P7&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/LzTG10P7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem with the one-to-one or many-to-many relationship is still the same.&lt;/p&gt;

&lt;p&gt;The solution is more POO compliant.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11165">DC-614</key>
            <summary>Separate the properties of the parent and the children</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Apr 2010 05:45:08 +0000</created>
                <updated>Fri, 2 Apr 2010 05:58:41 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <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-609] Symfony doctrine doesnt save an M:M table if one of the tables is in a 1:1 relationship with another table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-609</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Symfony doctrine doesnt save an M:M table if one of the tables is in a 1:1 relationship with another table. Refer to Screen.png for ER diagram.&lt;/p&gt;

&lt;p&gt;I have included the schema files as attachments.&lt;/p&gt;

&lt;p&gt;You will notice in Screen shot 2010-03-31 at 3.30.56 AM.png, an item is selected in &quot;Amenities list&quot;. When the form is submitted, everything saves in the db except for the item in the &quot;Amenities list&quot; (Screen shot 2010-03-31 at 3.31.37 AM.png)&lt;/p&gt;
</description>
                <environment>MAC, Symfony PHP framework</environment>
            <key id="11154">DC-609</key>
            <summary>Symfony doctrine doesnt save an M:M table if one of the tables is in a 1:1 relationship with another 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="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="krz">Chris F</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Mar 2010 15:42:04 +0000</created>
                <updated>Wed, 31 Mar 2010 06:39:54 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12528" author="krz" created="Wed, 31 Mar 2010 06:39:54 +0000"  >&lt;p&gt;The problem could be because i am embedding a form that has a M:M relation with another table.&lt;/p&gt;

&lt;p&gt;Which is a similar issue to &lt;a href=&quot;http://trac.symfony-project.org/ticket/5867&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/5867&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many have mentioned to override the saveEmbeddedForms() function inside BaseFormDoctrine.&lt;/p&gt;

&lt;p&gt;The patch at: &lt;a href=&quot;http://trac.symfony-project.org/ticket/5867&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/5867&lt;/a&gt; doesnt work. How can we fix this?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10532" name="Ad.yml" size="1766" author="krz" created="Tue, 30 Mar 2010 15:44:27 +0000" />
                    <attachment id="10534" name="Amenity.yml" size="303" author="krz" created="Tue, 30 Mar 2010 15:44:27 +0000" />
                    <attachment id="10533" name="Housing.yml" size="1001" author="krz" created="Tue, 30 Mar 2010 15:44:27 +0000" />
                    <attachment id="10535" name="HousingAmenity.yml" size="560" author="krz" created="Tue, 30 Mar 2010 15:44:39 +0000" />
                    <attachment id="10530" name="Screen shot 2010-03-31 at 3.30.56 AM.png" size="26945" author="krz" created="Tue, 30 Mar 2010 15:42:04 +0000" />
                    <attachment id="10531" name="Screen shot 2010-03-31 at 3.31.37 AM.png" size="28450" author="krz" created="Tue, 30 Mar 2010 15:42:04 +0000" />
                    <attachment id="10529" name="Screen.png" size="42709" author="krz" created="Tue, 30 Mar 2010 15:42:04 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-608] Limit and Offset breaks query with multiple non-join FROM statements</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-608</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;blockquote&gt;
&lt;p&gt;$query = $query-&amp;gt;select(&apos;sf_guard_permission.id,&lt;br/&gt;
      cms_section_translation.slug||\&apos; \&apos;||SUBSTRING(&quot;name&quot;, POSITION(\&apos;@\&apos; in &quot;name&quot;) + 1) as name,&lt;br/&gt;
      sf_guard_permission.description,&lt;br/&gt;
      sf_guard_permission.created_at, sf_guard_permission.updated_at&apos;);&lt;br/&gt;
    $query = $query-&amp;gt;from(&apos;sfGuardPermission sf_guard_permission&apos;);&lt;br/&gt;
    $query = $query-&amp;gt;addfrom(&apos;CmsSection cms_section&apos;);&lt;br/&gt;
    $query = $query-&amp;gt;innerJoin(&apos;cms_section.WithCmsSectionTranslation cms_section_translation&apos;);&lt;br/&gt;
    $query = $query-&amp;gt;where(&apos;cast(SUBSTRING(&quot;name&quot;, 1, POSITION(\&apos;@\&apos; in &quot;name&quot;) - 1) as integer) = cms_section.id&apos;);&lt;br/&gt;
    $query = limit(20);&lt;br/&gt;
    $query = offset(1);&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Generated:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT s.id AS s_&lt;em&gt;id, s.description AS s&lt;/em&gt;&lt;em&gt;description, s.created_at AS  s&lt;/em&gt;&lt;em&gt;created_at, s.updated_at AS s&lt;/em&gt;&lt;em&gt;updated_at, c2.slug||&apos;  &apos;||SUBSTR(&quot;name&quot;, POSITION(&apos;@&apos; in &quot;name&quot;) + 1) AS c2&lt;/em&gt;_0 FROM  sf_guard_permission s, cms_section c INNER JOIN cms_section_translation  c2 ON c.id = c2.sec_id WHERE s.id IN (SELECT doctrine_subquery_alias.id  FROM (SELECT DISTINCT s2.id, c3.deleted_at FROM sf_guard_permission s2  cms_section c3 INNER JOIN cms_section_translation c4 ON c3.id =  c4.sec_id WHERE cast(SUBSTR(&quot;name&quot;, 1, POSITION(&apos;@&apos; in &quot;name&quot;) - 1) as  integer) = c3.id ORDER BY c3.deleted_at DESC LIMIT 20) AS  doctrine_subquery_alias) AND (cast(SUBSTR(&quot;name&quot;, 1, POSITION(&apos;@&apos; in  &quot;name&quot;) - 1) as integer) = c.id) ORDER BY c.deleted_at DESC&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Notice:&lt;br/&gt;
SELECT DISTINCT s2.id, c3.deleted_at FROM sf_guard_permission s2 &lt;font color=&quot;red&quot;&gt; comma that is missing &lt;/font&gt; cms_section c3&lt;/p&gt;</description>
                <environment></environment>
            <key id="11152">DC-608</key>
            <summary>Limit and Offset breaks query with multiple non-join FROM statements</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="sid.gbf">Sid GBF</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Mar 2010 13:38:28 +0000</created>
                <updated>Tue, 30 Mar 2010 13:38:28 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10526" name="query.diff" size="552" author="sid.gbf" created="Tue, 30 Mar 2010 13:38:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-606] [Oracle] Query on M:M with relation name doesn&apos;t work</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-606</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;My 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;---
Actuality:
  connection:         web
  tableName:          actuality
  actAs:
    softDelete:       ~
    Timestampable:    ~
    Sluggable:
      fields:         [name]
      builder:        [tool, slugify]
      indexName:      actuality_sluggable
      canUpdate:      &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  columns:
    id:
      type:           integer(4)
      primary:        &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      unsigned:       &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      sequence:       actuality
    created_at:
      type:           timestamp
    updated_at:
      type:           timestamp
    published_at:
      type:           timestamp
      notnull:        &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    unpublished_at:
      type:           timestamp
    name:
      type:           string(255)
      notnull:        &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    description_short:
      type:           string(1000)
      notnull:        &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    description:
      type:           clob
      notnull:        &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    is_professional:
      type:           &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:        &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  relations:
    Categories:
      class: ActualityCategory
      local: actuality_id
      foreign: actuality_category_id
      refClass: ActualityActualityCategory
      foreignAlias: Actualities
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And my 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;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function retrieveCloud($is_professional, $limit = 20)
  {
    &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;createQuery(&apos;ac&apos;)
    -&amp;gt;leftJoin(&apos;ac.Actualities a2&apos;)
    -&amp;gt;where(&apos;ac.id IN (SELECT aac.actuality_category_id FROM Actuality a LEFTJOIN a.ActualityActualityCategory aac WHERE a.published_at &amp;lt; ? AND a.is_professional = ?)&apos;, array(date(&apos;Y-m-d H:i:s&apos;), $is_professional))
    -&amp;gt;orderBy(&apos;ac.name&apos;)
    -&amp;gt;limit($limit)
    -&amp;gt;execute();
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have this error: Doctrine_Connection_Oracle_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;ORA-01008: not all variables bound : SELECT a.id AS a__id, a.created_at AS a__created_at, a.updated_at AS a__updated_at, a.name AS a__name, a.deleted_at AS a__deleted_at, a.slug AS a__slug, a2.id AS a2__id, a2.created_at AS a2__created_at, a2.updated_at AS a2__updated_at, a2.published_at AS a2__published_at, a2.unpublished_at AS a2__unpublished_at, a2.name AS a2__name, a2.description_short AS a2__description_short, a2.description AS a2__description, a2.is_professional AS a2__is_professional, a2.deleted_at AS a2__deleted_at, a2.slug AS a2__slug FROM actuality_category a LEFT JOIN actuality_actuality_category a3 ON (a.id = a3.actuality_category_id) LEFT JOIN actuality a2 ON a2.id = a3.actuality_id AND (a2.deleted_at IS NULL) WHERE a.id IN (SELECT a4.id FROM ( SELECT DISTINCT a4.id FROM actuality_category a4 LEFT JOIN actuality_actuality_category a6 ON (a4.id = a6.actuality_category_id) LEFT JOIN actuality a5 ON a5.id = a6.actuality_id AND (a5.deleted_at IS NULL) WHERE a4.id IN (SELECT a8.actuality_category_id AS a5__actuality_category_id FROM actuality a7 LEFT JOIN actuality_actuality_category a8 ON a7.id = a8.actuality_id WHERE (a7.published_at &amp;lt; :oci_b_var_1 AND a7.is_professional = :oci_b_var_2)) AND (a4.deleted_at IS NULL) ORDER BY a4.name ) a4 WHERE ROWNUM &amp;lt;= 20) AND (a.id IN (SELECT a5.actuality_category_id AS a5__actuality_category_id FROM actuality a4 LEFT JOIN actuality_actuality_category a5 ON a4.id = a5.actuality_id WHERE (a4.published_at &amp;lt; :oci_b_var_3 AND a4.is_professional = :oci_b_var_4)) AND (a.deleted_at IS NULL)) ORDER BY a.name
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11147">DC-606</key>
            <summary>[Oracle] Query on M:M with relation name doesn&apos;t work</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="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Mar 2010 04:20:23 +0000</created>
                <updated>Mon, 29 Mar 2010 04:20:23 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-601] When using a join and giving an alias to each select column the hyrdrator only returns one row.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-601</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi All &lt;br/&gt;
I am running into a strange problem using Doctrine-1.2.2-- I have a  multi row result set but only the first row of it is returned in the hyrdated array that is generated. &lt;br/&gt;
I have tracked this down in the code to get a basic idea of whats going on &amp;#8211; it seems that the $id variable in the hydrateResultSet function in Doctrine_Hydrator_Graph isn&apos;t being populated properly with data about the fields that are returning from my query. The _gatherRowData function seems to never detect that one of my columns is an identifier (&quot;if ($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;isIdentifier&amp;#39;&amp;#93;&lt;/span&gt;) &lt;/p&gt;
{&quot; doesn&apos;t return true ever so the next line of code: &quot;$id[$dqlAlias] .= &apos;|&apos; . $value;&quot; doesn&apos;t run). 
I think this is the problem but I don&apos;t totally understand how the mapping process is taking place in this function so can&apos;t be absolutely sure. 

This hydration problem goes away if I don&apos;t use left joins in my query, or if I use a query where not every field I am requesting is assigned an alias (at least one of the fields doesn&apos;t use the &apos;as&apos; syntax). 
For instance this php: 
{code}
&lt;p&gt;$q = Doctrine_Query::create(); &lt;br/&gt;
$q-&amp;gt;from(&apos;Customer Customer&apos;); &lt;br/&gt;
$q-&amp;gt;leftJoin(&apos;Customer.Zip Zip&apos;); &lt;br/&gt;
$q-&amp;gt;addSelect(&apos;Customer.firstname as first_name&apos;); &lt;br/&gt;
$q-&amp;gt;addSelect(&apos;Customer.postalcode as postalcode&apos;); &lt;br/&gt;
$q-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY); &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;Generates &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; DQL: 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;SELECT Customer.firstname as first_name, Customer.postalcode as postalcode FROM Customer Customer LEFT JOIN Customer.Zip Zip&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;And &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; SQL:
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;SELECT c.firstname AS c_&lt;em&gt;0, c.postalcode AS c&lt;/em&gt;_1 FROM customers c LEFT JOIN zips z ON c.postalcode = z.postalcode&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;Which results in &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; after hyrdration: 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;array(&apos;0&apos;=&amp;gt;array(&apos;first_name&apos;=&amp;gt;&apos;Armando&apos;, &apos;postalcode&apos;=&amp;gt;&apos;00659&apos;)) &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;
However the following code hydrates just fine: 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;$q = Doctrine_Query::create(); &lt;br/&gt;
$q-&amp;gt;from(&apos;Customer Customer&apos;); &lt;br/&gt;
$q-&amp;gt;addSelect(&apos;Customer.firstname as first_name&apos;); &lt;br/&gt;
$q-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY); &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;As does &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; code: 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;$q = Doctrine_Query::create(); &lt;br/&gt;
$q-&amp;gt;from(&apos;Customer Customer&apos;); &lt;br/&gt;
$q-&amp;gt;leftJoin(&apos;Customer.Zip Zip&apos;); &lt;br/&gt;
$q-&amp;gt;addSelect(&apos;Customer.firstname&apos;); &lt;br/&gt;
$q-&amp;gt;addSelect(&apos;Customer.postalcode as postalcode&apos;); &lt;br/&gt;
$q-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY); &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;
Here is the yaml &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the sample data I am testing on: 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; detect_relations: false&lt;br/&gt;
 package: Example&lt;br/&gt;
 options:&lt;br/&gt;
   type: INNODB&lt;br/&gt;
   charset: utf8&lt;br/&gt;
 Customer:&lt;br/&gt;
   tableName: customers&lt;br/&gt;
   columns:&lt;br/&gt;
     customer_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;
     firstname:&lt;br/&gt;
       type: string(45)&lt;br/&gt;
     lastname:&lt;br/&gt;
       type: string(45)&lt;br/&gt;
     streetaddress:&lt;br/&gt;
       type: string(45)&lt;br/&gt;
     city:&lt;br/&gt;
       type: string(45)&lt;br/&gt;
     state:&lt;br/&gt;
       type: string(45)&lt;br/&gt;
     postalcode:&lt;br/&gt;
       type: string(45)&lt;br/&gt;
   relations:&lt;br/&gt;
     Order:&lt;br/&gt;
       type: many&lt;br/&gt;
       local: customer_id&lt;br/&gt;
       foreign: customer_id&lt;br/&gt;
     Zip:&lt;br/&gt;
       type: one&lt;br/&gt;
       local: postalcode&lt;br/&gt;
       foreign: postalcode&lt;br/&gt;
   options:&lt;br/&gt;
     type: InnoDB&lt;br/&gt;
 Zip:&lt;br/&gt;
   connection: default_schema&lt;br/&gt;
   tableName: zips&lt;br/&gt;
   columns:&lt;br/&gt;
     postalcode:&lt;br/&gt;
       type: varchar(30)&lt;br/&gt;
       primary: true&lt;br/&gt;
     latitude: &apos;float(10,6)&apos;&lt;br/&gt;
     longitude: &apos;float(10,6)&apos;&lt;br/&gt;
     city: string(50)&lt;br/&gt;
     state: string(50)&lt;br/&gt;
     country: string(50)&lt;br/&gt;
     type: string(50)&lt;br/&gt;
   relations:&lt;br/&gt;
     Customer:&lt;br/&gt;
       type: many&lt;br/&gt;
       local: postalcode&lt;br/&gt;
       foreign: postalcode&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;Perhaps there is something simple I am overlooking. To get around this I am just always selecting the primary key from my main table in every query.&lt;/p&gt;

&lt;p&gt;Thanks in advance for any advice.&lt;br/&gt;
Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="11139">DC-601</key>
            <summary>When using a join and giving an alias to each select column the hyrdrator only returns one row.</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>Thu, 25 Mar 2010 19:32:28 +0000</created>
                <updated>Mon, 2 Aug 2010 02:45:07 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                <component>Relations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12564" author="willf1976" created="Sat, 3 Apr 2010 18:13:13 +0000"  >&lt;p&gt;This problem also exists in 1.2.2 so I have updated the post to reflect this.&lt;/p&gt;</comment>
                    <comment id="12582" author="naag" created="Tue, 6 Apr 2010 08:30:00 +0000"  >&lt;p&gt;I experienced the same problem with Doctrine 1.2 (r7329). I also fixed this by adding the primary key of the table I select from to the select list.&lt;/p&gt;</comment>
                    <comment id="12603" author="willf1976" created="Wed, 7 Apr 2010 20:20:21 +0000"  >&lt;p&gt;Hi Peter&lt;/p&gt;

&lt;p&gt;Thats how I am currently working around the bug as well but hopefully it will get rectified in a later version of doctrine.&lt;/p&gt;

&lt;p&gt;Thanks for the comment.&lt;/p&gt;

&lt;p&gt;Will&lt;/p&gt;</comment>
                    <comment id="13139" author="somedoun" created="Tue, 8 Jun 2010 09:08:54 +0000"  >&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;I&apos;m new to doctrine and since yesterday, I&apos;m experiencing exactly the same behavior.&lt;br/&gt;
Any news about this subject ? Is there a doctrine version where the pb is solved ? &lt;br/&gt;
Help !&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Doun&lt;/p&gt;</comment>
                    <comment id="13239" author="willf1976" created="Tue, 8 Jun 2010 19:13:11 +0000"  >&lt;p&gt;Hi Sam&lt;/p&gt;

&lt;p&gt;Currently I am working around this bug by always adding the primary key of the table to the select (like peter also mentions above).&lt;/p&gt;

&lt;p&gt;It is a work around for the problem but so far it has been reliable for me.&lt;/p&gt;

&lt;p&gt;I hope that helps until there is a patch for it.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</comment>
                    <comment id="13246" author="somedoun" created="Wed, 9 Jun 2010 05:18:14 +0000"  >&lt;p&gt;Hi Will&lt;/p&gt;

&lt;p&gt;I&apos;ll do so.&lt;br/&gt;
Thank you VM.&lt;/p&gt;

&lt;p&gt;Sam Doun&lt;/p&gt;</comment>
                    <comment id="13756" author="shuchi" created="Mon, 2 Aug 2010 02:26:10 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Has there been any patch release for the same? &lt;br/&gt;
We just upgraded from Doctrine 1.1 to 1.2 and our project now crashes.&lt;/p&gt;

&lt;p&gt;For DQL - &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;function getServiceDetails($merchantId,$merchantServiceId) {
    $q = Doctrine_Query::create()
        -&amp;gt;select(&apos;b.*, m.name as merchant_service_name,payment_mode.name as payment_mode_name,payment_mode.id as paymentMode,p.id as paymentModeOption &apos;)
        -&amp;gt;from(&apos;ServicePaymentModeOption b&apos;)
        -&amp;gt;leftJoin(&quot;b.MerchantService m&quot;)
        -&amp;gt;leftJoin(&quot;m.Merchant merchant&quot;)
        -&amp;gt;leftJoin(&quot;b.PaymentModeOption p&quot;)
        -&amp;gt;leftJoin(&quot;p.PaymentMode payment_mode&quot;)
        -&amp;gt;where(&quot;merchant.id=?&quot;,$merchantId)
        -&amp;gt;andWhere(&quot;b.merchant_service_id=?&quot;,$merchantServiceId)
        -&amp;gt;groupBy(&apos;p.name&apos;);

    return $res = $q-&amp;gt;execute(array(),Doctrine::HYDRATE_ARRAY);
  }  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Result with Doctrine 1.1 is&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;Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 1
            [merchant_service_id] =&amp;gt; 1
            [payment_mode_option_id] =&amp;gt; 1
            [created_at] =&amp;gt;
            [updated_at] =&amp;gt;
            [deleted] =&amp;gt;
            [created_by] =&amp;gt;
            [updated_by] =&amp;gt;
            [merchant_service_name] =&amp;gt; NIS Passport
            [merchant_name] =&amp;gt; NIS
            [payment_mode_option_name] =&amp;gt; Bank
            [payment_mode_name] =&amp;gt; Bank
            [paymentMode] =&amp;gt; 1
            [paymentModeOption] =&amp;gt; 1
            [MerchantService] =&amp;gt; Array
                (
                    [merchant_service_name] =&amp;gt; NIS Passport
                    [Merchant] =&amp;gt; Array
                        (
                            [merchant_name] =&amp;gt; NIS
                        )

                )

            [PaymentModeOption] =&amp;gt; Array
                (
                    [payment_mode_option_name] =&amp;gt; Bank
                    [paymentModeOption] =&amp;gt; 1
                    [PaymentMode] =&amp;gt; Array
                        (
                            [payment_mode_name] =&amp;gt; Bank
                            [paymentMode] =&amp;gt; 1
                        )

                )

        )
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Result with Doctrine 1.2 is&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;Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 1
            [merchant_service_id] =&amp;gt; 1
            [payment_mode_option_id] =&amp;gt; 1
            [created_at] =&amp;gt;
            [updated_at] =&amp;gt;
            [deleted_at] =&amp;gt;
            [created_by] =&amp;gt;
            [updated_by] =&amp;gt;
            [merchant_service_name] =&amp;gt; NIS Passport
            [merchant_name] =&amp;gt; NIS
            [payment_mode_option_name] =&amp;gt; Bank
            [payment_mode_name] =&amp;gt; Bank
            [paymentMode] =&amp;gt; 1
            [paymentModeOption] =&amp;gt; 1
        )
)

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

&lt;p&gt;We have used Hydration for the result set at lot of places. Please suggest if there could be a fix without going about revising everything that has been coded.&lt;/p&gt;

&lt;p&gt;Looking forward to a quick response.&lt;/p&gt;





</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-600] Query Cache causes exception when using array parameter and IN in a where clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-600</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Following the documentation, I&apos;m using an IN condition in a where clause on a Doctrine_Query with Query cache enabled (APC).  Syntax:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$values = array(1, 2, 3, 4);&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;del&gt;&amp;gt;from(&apos;SomeModel s&apos;)&lt;/del&gt;&amp;gt;where(&apos;s.column IN ?&apos;, array($values));&lt;/p&gt;

&lt;p&gt;$results = $q-&amp;gt;execute();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The first time this query is run, all is fine, and any subsequent runs will be fine as well, UNLESS the values array changes length, like so:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$values = array(1, 2, 3, 4, 5);&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;del&gt;&amp;gt;from(&apos;SomeModel s&apos;)&lt;/del&gt;&amp;gt;where(&apos;s.column IN ?&apos;, array($values));&lt;/p&gt;

&lt;p&gt;$results = $q-&amp;gt;execute();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;With the query cache enabled, this will throw a PDO &quot;Invalid Parameter Count&quot; exception, because it appears that Doctrine uses the cached query which only has 4 placeholders, but the passed parameters now has a count of 5.&lt;/p&gt;

&lt;p&gt;A change in the length of the parameters array in this situation should cause Doctrine to insert a new entry into the query cache for this query.&lt;/p&gt;

&lt;p&gt;Let me know if you need more information regarding this, if I find time I can try to put together a Test case.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>PHP 5.2.11 Linux, Mysql 5.0.x</environment>
            <key id="11135">DC-600</key>
            <summary>Query Cache causes exception when using array parameter and IN in a where 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="jklehr">Jay Klehr</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Mar 2010 14:38:22 +0000</created>
                <updated>Wed, 21 Jul 2010 09:07:08 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12517" author="jklehr" created="Tue, 30 Mar 2010 15:06:03 +0000"  >&lt;p&gt;Failing test case exhibiting this bug.&lt;/p&gt;</comment>
                    <comment id="12518" author="jklehr" created="Tue, 30 Mar 2010 15:09:41 +0000"  >&lt;p&gt;I&apos;ve attached a TestCase that I put together that shows this bug.&lt;/p&gt;

&lt;p&gt;Turns out that when using the sqlite adapter, the exception isn&apos;t thrown, so I had to look at the profiler in order to show that the query fetched from the cache has the wrong parameter count.&lt;/p&gt;

&lt;p&gt;I also tested this with the &quot;whereIn()&quot; method instead of just &quot;where()&quot;.  whereIn works correctly (but isn&apos;t as flexible as where, so I don&apos;t believe it&apos;s an acceptable replacement in all situations).&lt;/p&gt;</comment>
                    <comment id="12519" author="jklehr" created="Tue, 30 Mar 2010 15:12:14 +0000"  >&lt;p&gt;fixing my quoted blocks&lt;/p&gt;</comment>
                    <comment id="12520" author="jklehr" created="Tue, 30 Mar 2010 15:19:28 +0000"  >&lt;p&gt;Updated test case.  I discovered that sqlite DOES throw an exception in the array&apos;s length grows in the second query so added another test to my test case to exhibit this.&lt;/p&gt;</comment>
                    <comment id="13633" author="commi.m" created="Wed, 21 Jul 2010 08:36:15 +0000"  >&lt;p&gt;Hi, this bug just hit me hard, and made a quick fix:&lt;/p&gt;

&lt;p&gt;in the Query/Abstract.php&lt;/p&gt;

&lt;p&gt;the function calculateQueryCacheHash was augmented with the param-count:&lt;/p&gt;

&lt;p&gt;    public function calculateQueryCacheHash($params = array())&lt;/p&gt;
    {
        $dql = $this-&amp;gt;getDql();
        /// quickfox by  Till Seifert
        $hash = md5($dql . &apos;|&apos; . count($this-&amp;gt;getFlattenedParams($params)) . &apos;|&apos; . var_export($this-&amp;gt;_pendingJoinConditions, true) . &apos;DOCTRINE_QUERY_CACHE_SALT&apos;);
        return $hash;
    }



&lt;p&gt;and in protected function _execute($params) the params are passed:&lt;/p&gt;

&lt;p&gt;Line:927&lt;br/&gt;
++                 $hash = $this-&amp;gt;calculateQueryCacheHash($dqlParams);&lt;/p&gt;



&lt;p&gt;cann anyone comment on if this could be horribly wrong? for know this fixes this bug for me.&lt;/p&gt;

&lt;p&gt;[EDIT: posted code as attachment, for better readability)&lt;/p&gt;</comment>
                    <comment id="13634" author="commi.m" created="Wed, 21 Jul 2010 08:39:37 +0000"  >&lt;p&gt;proposed fix. not a patch, sorry.&lt;/p&gt;

&lt;p&gt;it&apos;s also faulty: it runs getFlattenedParams twice, and it fails when you have more than 1 &quot;x IN Array&quot; condition. If the global number or queryparams stays the same, no new cache-entry is created, so you wold have somehow incorporate the individual param-parts-sizes in the cache-hash, not just the number of params.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10528" name="DC600TestCase.php" size="7523" author="jklehr" created="Tue, 30 Mar 2010 15:19:28 +0000" />
                    <attachment id="10702" name="quickfix.txt" size="410" author="commi.m" created="Wed, 21 Jul 2010 08:39:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-595] Array hydration fails when sorting DESC</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-595</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Wrong array hydration results.&lt;/p&gt;

&lt;p&gt;Running toArray() on non hydrated collection&lt;br/&gt;
produces different results than using array hydrator.&lt;/p&gt;


&lt;p&gt;Case1. &lt;br/&gt;
Sorting ASC (works)&lt;/p&gt;

&lt;p&gt;$reputationHydrated = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;User_Model_UserReputation ur&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.User u&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.Thread t&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;t.ForumEntry fe&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;u.id = ?&apos;, 1)&lt;br/&gt;
-&amp;gt;orderBy(&apos;ur.event ASC)&lt;br/&gt;
-&amp;gt;execute(null, Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;$reputation = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;User_Model_UserReputation ur&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.User u&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.Thread t&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;t.ForumEntry fe&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;u.id = ?&apos;, 1)&lt;br/&gt;
-&amp;gt;orderBy(&apos;ur.event ASC)&lt;br/&gt;
-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;$reputationToArray = $reputation-&amp;gt;toArray();&lt;/p&gt;

&lt;p&gt;die($reputationToArray === $reputationHydrated); // true, as expected&lt;/p&gt;


&lt;p&gt;Case 2. &lt;br/&gt;
Sorting DESC (does not work)&lt;/p&gt;

&lt;p&gt;$reputationHydrated = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;User_Model_UserReputation ur&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.User u&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.Thread t&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;t.ForumEntry fe&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;u.id = ?&apos;, 1)&lt;br/&gt;
-&amp;gt;orderBy(&apos;ur.event DESC)&lt;br/&gt;
-&amp;gt;execute(null, Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;$reputation = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;User_Model_UserReputation ur&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.User u&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ur.Thread t&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;t.ForumEntry fe&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;u.id = ?&apos;, 1)&lt;br/&gt;
-&amp;gt;orderBy(&apos;ur.event DESC)&lt;br/&gt;
-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;$reputationToArray = $reputation-&amp;gt;toArray();&lt;/p&gt;

&lt;p&gt;die($reputationToArray === $reputationHydrated); // false, should be true&lt;/p&gt;

&lt;p&gt;Other hydrators do hydrate as expected.&lt;/p&gt;

&lt;p&gt;Seems that something is wrong in Doctrine_Hydrator_Graph.&lt;/p&gt;</description>
                <environment>Windows, Ubuntu, PostgreSQL,</environment>
            <key id="11112">DC-595</key>
            <summary>Array hydration fails when sorting DESC</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="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Mar 2010 05:12:57 +0000</created>
                <updated>Tue, 23 Mar 2010 06:12:53 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12436" author="admirau" created="Tue, 23 Mar 2010 06:12:53 +0000"  >&lt;p&gt;Changed one condition in Graph.php, and it works.&lt;br/&gt;
Here is a patch:&lt;/p&gt;

&lt;p&gt;&amp;#8212; Doctrine/Hydrator/Graph.php&lt;br/&gt;
+++ Doctrine/Hydrator/Graph-new.php&lt;br/&gt;
@@ -212,7 +212,7 @@&lt;br/&gt;
                         $indexExists = isset($identifierMap&lt;span class=&quot;error&quot;&gt;&amp;#91;$path&amp;#93;&lt;/span&gt;[$id&lt;span class=&quot;error&quot;&gt;&amp;#91;$parent&amp;#93;&lt;/span&gt;][$id&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;]);&lt;br/&gt;
                         $index = $indexExists ? $identifierMap&lt;span class=&quot;error&quot;&gt;&amp;#91;$path&amp;#93;&lt;/span&gt;[$id&lt;span class=&quot;error&quot;&gt;&amp;#91;$parent&amp;#93;&lt;/span&gt;][$id&lt;span class=&quot;error&quot;&gt;&amp;#91;$dqlAlias&amp;#93;&lt;/span&gt;] : false;&lt;br/&gt;
                         $indexIsValid = $index !== false ? isset($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;&lt;span class=&quot;error&quot;&gt;&amp;#91;$index&amp;#93;&lt;/span&gt;) : false;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if ( $indexExists || ! $indexIsValid) {&lt;br/&gt;
\ No newline at end of file&lt;br/&gt;
+                        if ( ! $indexExists || ! $indexIsValid) {&lt;br/&gt;
\ No newline at end of file&lt;br/&gt;
                             $element = $this-&amp;gt;getElement($data, $componentName);&lt;br/&gt;
                             $event-&amp;gt;set(&apos;data&apos;, $element);&lt;br/&gt;
                             $listeners&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentName&amp;#93;&lt;/span&gt;-&amp;gt;postHydrate($event);&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Plase check if this does not breaks something else.&lt;br/&gt;
Tests are passing.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-589] refreshRelated() causes an id to be changed from string to int, causing an unnecessary update query.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-589</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Here is an 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;class 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;hasColumn(&apos;title&apos;, &apos;string&apos;, 255);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;body&apos;, &apos;string&apos;, 4096);
    }

    &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;Comment as Comments&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;id&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;articleId&apos;,
        ));
    }
}

class Comment &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;comment&apos;, &apos;string&apos;, 4096);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;articleId&apos;, &apos;integer&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;hasOne(&apos;Article&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;articleId&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;id&apos;,
        ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preUpdate($e)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Exception(&apos;should not get here&apos;);
    }

}

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Article();
$a-&amp;gt;title = &apos;Hi&apos;;
$a-&amp;gt;body = &apos;There&apos;;
$a-&amp;gt;save();

$c = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Comment();
$c-&amp;gt;comment = &apos;1st comment&apos;;
$c-&amp;gt;articleId = $a-&amp;gt;id;
$c-&amp;gt;save();

$a-&amp;gt;refreshRelated(&apos;Comments&apos;);

$a-&amp;gt;title = &apos;Hello&apos;;
$a-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What happens above is that the call to refreshRelated() causes the &apos;id&apos; of the comment to change from string:1 to int:1, which causes the last save of the article to try to save the comment. The exception is there just to illustrate that the Comment is being updated (which should not happen). For us - this is an issue not just because of the extra query, but because some entities in the system (like log entries) actually throw when updated.&lt;/p&gt;

&lt;p&gt;Tested against latest trunk.&lt;/p&gt;

&lt;p&gt;The issue seems to be introduced in r7361.&lt;/p&gt;</description>
                <environment>Ubuntu 9.10, PHP 5.2.10, pgsql 8.3</environment>
            <key id="11092">DC-589</key>
            <summary>refreshRelated() causes an id to be changed from string to int, causing an unnecessary update 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladev">Emil Vladev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Mar 2010 08:46:00 +0000</created>
                <updated>Mon, 29 Mar 2010 14:51:08 +0000</updated>
                                                                    <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12504" author="jwage" created="Mon, 29 Mar 2010 14:51:08 +0000"  >&lt;p&gt;How does that revision cause the problem? it doesn&apos;t change any value that is referenced by the object itself. Are you sure the description of the problem is accurate? Maybe it would be best if I could run a Doctrine failing test case to see your problem.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-587] Problem with non equal self referencing many to many relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-587</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I think that this bug has been reported already here:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&lt;br/&gt;
But I thought that it might be useful to submit a very simple test case, with the bug completely isolated.&lt;br/&gt;
When you create a self referenced non equal many-to-many relation like: person has many parents AND has many children (taken from the documentation).&lt;/p&gt;

&lt;p&gt;In the attached test case, after both collections of related records are altered within the foreach statement, Doctrine somehow messes up the Ids in the reference class. Now, it&apos;s important to note, that if you loop through just one of the collections, it won&apos;t fail.&lt;/p&gt;

&lt;p&gt;Thanks in advance!&lt;/p&gt;</description>
                <environment>Windows 7600 / Linux / PHP 5.2.13 / PHP 5.3.0</environment>
            <key id="11090">DC-587</key>
            <summary>Problem with non equal self referencing many to many 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="lilawolf">Nil Null</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2010 22:10:26 +0000</created>
                <updated>Tue, 8 Jun 2010 16:18:20 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10498" name="person.php" size="1102" author="lilawolf" created="Thu, 18 Mar 2010 22:10:26 +0000" />
                    <attachment id="10499" name="relation.php" size="506" author="lilawolf" created="Thu, 18 Mar 2010 22:10:26 +0000" />
                    <attachment id="10500" name="test.php" size="350" author="lilawolf" created="Thu, 18 Mar 2010 22:10:26 +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-581] ORACLE: Missing fields on subquery with Many:Many</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-581</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I use this 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;---
Actuality:
  connection:         web
  tableName:          actuality
  actAs:
    softDelete:       ~
    Timestampable:    ~
    Sluggable:
      fields:         [name]
      indexName:      actuality_sluggable
      canUpdate:  