<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Mon May 20 11:47:07 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+ORDER+BY+status+DESC%2C+priority+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+ORDER+BY+status+DESC%2C+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1000" total="1048"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-340] Pager does not work with MS SQL Server</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-340</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I can&apos;t use a pager. For example :&lt;br/&gt;
$q = Doctrine_Query::create()&lt;del&gt;&amp;gt;select( &quot;*&quot; )&lt;/del&gt;&amp;gt;from( &quot;utilisateur&quot; );&lt;/p&gt;

&lt;p&gt;$pager = new customDoctrinePager( $q, 1, 10 );&lt;br/&gt;
$pager-&amp;gt;init();&lt;/p&gt;

&lt;p&gt;$results = $pager-&amp;gt;getResults();&lt;/p&gt;

&lt;p&gt;gives me :&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 10007 Invalid column name &apos;id&apos;. &lt;span class=&quot;error&quot;&gt;&amp;#91;10007&amp;#93;&lt;/span&gt; (severity 5) [SELECT TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;utisateurnom&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__utisateurnom&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;utilisateur&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;]. Failing Query: &quot;SELECT TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;utisateurnom&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__utisateurnom&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;utilisateur&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;

&lt;p&gt;The query :&lt;br/&gt;
SELECT&lt;br/&gt;
	TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
FROM&lt;br/&gt;
	(&lt;br/&gt;
		SELECT&lt;br/&gt;
			TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;utisateurnom&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__utisateurnom&amp;#93;&lt;/span&gt;&lt;br/&gt;
		FROM&lt;br/&gt;
			&lt;span class=&quot;error&quot;&gt;&amp;#91;utilisateur&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;&lt;br/&gt;
	) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;is wrong.&lt;/p&gt;

&lt;p&gt;This one would be correct :&lt;br/&gt;
SELECT&lt;br/&gt;
	TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
FROM&lt;br/&gt;
	(&lt;br/&gt;
		SELECT&lt;br/&gt;
			TOP 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;utisateurnom&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;u__utisateurnom&amp;#93;&lt;/span&gt;&lt;br/&gt;
		FROM&lt;br/&gt;
			&lt;span class=&quot;error&quot;&gt;&amp;#91;utilisateur&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;u&amp;#93;&lt;/span&gt;&lt;br/&gt;
	) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This code works :&lt;br/&gt;
        $q = Doctrine_Query::create()&lt;br/&gt;
		  -&amp;gt;select( &apos;*&apos; )&lt;br/&gt;
		  -&amp;gt;from( &apos;utilisateur u&apos; );&lt;br/&gt;
		$this-&amp;gt;resultSet = $q-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;This one gives the save error :&lt;br/&gt;
        $q = Doctrine_Query::create()&lt;br/&gt;
		  -&amp;gt;select( &apos;*&apos; )&lt;br/&gt;
		  -&amp;gt;from( &apos;utilisateur u&apos; );&lt;/p&gt;

&lt;p&gt;		$q-&amp;gt;limit(10);&lt;br/&gt;
                $q-&amp;gt;offset(1);&lt;br/&gt;
		$this-&amp;gt;resultSet = $q-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;This is very blocker for me.&lt;/p&gt;

&lt;p&gt;Nb. I am not sure of the Doctrine&apos;s version used by symfony 1.4&lt;/p&gt;</description>
                <environment>Windows 2003 Server. IIS 6.0. MS SQL Server 2005. Symfony 1.4</environment>
            <key id="10584">DC-340</key>
            <summary>Pager does not work with MS SQL Server</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="lr">lr</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Dec 2009 15:28:04 +0000</created>
                <updated>Wed, 3 Mar 2010 12:58:00 +0000</updated>
                    <resolved>Wed, 3 Mar 2010 12:58:00 +0000</resolved>
                            <version>1.2.0</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11158" author="lr" created="Thu, 10 Dec 2009 09:29:21 +0000"  >&lt;p&gt;Same problem with&lt;br/&gt;
$this-&amp;gt;produit = Doctrine::getTable( &quot;TProduit&quot; )&lt;del&gt;&amp;gt;find( $request&lt;/del&gt;&amp;gt;getParameter(&quot;produitId&quot;) );&lt;/p&gt;

&lt;p&gt;The inner query gives&lt;/p&gt;

&lt;p&gt;t__produit_id&lt;/p&gt;

&lt;p&gt;but the main query tries to select&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;produit_id&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="11162" author="olivier.sieffert" created="Thu, 10 Dec 2009 21:23:19 +0000"  >&lt;p&gt;Same problem when use the pager, since Doctrine 1.2.0rc2. My config:  Linux Apache/PHP5.3, SQL Server 2000&lt;/p&gt;</comment>
                    <comment id="11232" author="gensisns" created="Fri, 18 Dec 2009 19:14:30 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; title=&quot;Using MSSQL connection the find method for models does not work&quot;&gt;&lt;del&gt;DC-289&lt;/del&gt;&lt;/a&gt;. Should be closed as duplicate.&lt;/p&gt;</comment>
                    <comment id="12011" author="guilhermeblanco" created="Wed, 3 Mar 2010 12:58:00 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; title=&quot;Using MSSQL connection the find method for models does not work&quot;&gt;&lt;del&gt;DC-289&lt;/del&gt;&lt;/a&gt; refers to same issue and it&apos;s already committed. Everything should be working now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-300] synchronizeWithArray deletes Entries in RefTable when updating related Entries</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-300</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;You have Users and Groups with a ManyToMany relation (refClass = UserGroup).&lt;br/&gt;
Then you do a synchronizeWithArray() on a user:&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; 
$user-&amp;gt;synchronizeWithArray(array(
    &apos;Groups&apos; =&amp;gt; array(
        array(&apos;name&apos; =&amp;gt; &apos;updated Group&apos;)
    )
));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When you update a record with synchronizeWithArray() and you update ManyToMany related entries, the RefTable entries gets deleted.&lt;/p&gt;

&lt;p&gt;I think the problem is located near:&lt;br/&gt;
Doctrine_Record line 2024:&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; 
        // Eliminate relationships missing in the $array
        foreach ($this-&amp;gt;_references as $name =&amp;gt; $relation) {
	        $rel = $this-&amp;gt;getTable()-&amp;gt;getRelation($name);
	
// PROBLEM: RefClass &quot;UserGroup&quot; will never be set in the sync-Array (just &quot;Groups&quot;), so all entries in UserGroup-Table will be deleted
// only new Groups that are synced will be created with a link in the refTable
		if ( ! isset($array[$name]) &amp;amp;&amp;amp; ( ! $rel-&amp;gt;isOneToOne() || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
                    unset($this-&amp;gt;$name);
                }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;TestCase follows.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10529">DC-300</key>
            <summary>synchronizeWithArray deletes Entries in RefTable when updating related Entries</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="testvogel">Marcus H&#228;u&#223;ler</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Nov 2009 13:18:59 +0000</created>
                <updated>Mon, 15 Mar 2010 11:39:23 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 11:39:23 +0000</resolved>
                            <version>1.2.0-RC1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10905" author="testvogel" created="Mon, 30 Nov 2009 13:20:29 +0000"  >&lt;p&gt;TestCase&lt;/p&gt;</comment>
                    <comment id="10911" author="jwage" created="Mon, 30 Nov 2009 16:40:56 +0000"  >&lt;p&gt;This one is proving to be very tricky to fix. Any suggestions or ideas for solutions would be appreciated.&lt;/p&gt;</comment>
                    <comment id="10926" author="testvogel" created="Mon, 30 Nov 2009 19:14:41 +0000"  >&lt;p&gt;Is there any possibilty to check wether a relation is used as &quot;refClass&quot;?&lt;br/&gt;
In setUp() you say hasMany(array(&lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;, &apos;refClass&apos; =&amp;gt; &apos;UserGroup&apos;)), but i could not find this information in the relation-object.&lt;/p&gt;

&lt;p&gt;Then you could do 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;if ( ! isset($array[$name]) &amp;amp;&amp;amp; ( (!$rel-&amp;gt;isRefClass() &amp;amp;&amp;amp; ! $rel-&amp;gt;isOneToOne()) || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
    unset($this-&amp;gt;$name);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The unlinking works anyway.&lt;/p&gt;</comment>
                    <comment id="11049" author="jwage" created="Mon, 7 Dec 2009 18:13:33 +0000"  >&lt;p&gt;This fixes your test case but I want to test it before we include it in a release(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-java&quot;&gt;Index: lib/Doctrine/Relation.php
===================================================================
--- lib/Doctrine/Relation.php	(revision 6882)
+++ lib/Doctrine/Relation.php	(working copy)
@@ -74,6 +74,8 @@
                                   &apos;orderBy&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
                                   );
 
+    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_isRefClass = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
+
     /**
      * constructor
      *
@@ -416,6 +418,24 @@
         }
     }
 
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function isRefClass()
+    {
+        &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;_isRefClass === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
+            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isRefClass = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
+            $table = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable();
+            foreach ($table-&amp;gt;getRelations() as $name =&amp;gt; $relation) {
+                foreach ($relation[&apos;table&apos;]-&amp;gt;getRelations() as $relation) {
+                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($relation[&apos;refTable&apos;]) &amp;amp;&amp;amp; $relation[&apos;refTable&apos;] === $table) {
+                        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isRefClass = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
+                        &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;(2);
+                    }
+                }
+            }
+        }
+
+        &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;_isRefClass;
+    }
+
     /**
      * __toString
      *
Index: lib/Doctrine/Record.php
===================================================================
--- lib/Doctrine/Record.php	(revision 6882)
+++ lib/Doctrine/Record.php	(working copy)
@@ -2024,8 +2024,8 @@
         &lt;span class=&quot;code-comment&quot;&gt;// Eliminate relationships missing in the $array
&lt;/span&gt;         foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_references as $name =&amp;gt; $relation) {
 	        $rel = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;getRelation($name);
-	
-			&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($array[$name]) &amp;amp;&amp;amp; ( ! $rel-&amp;gt;isOneToOne() || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
+
+            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $rel-&amp;gt;isRefClass() &amp;amp;&amp;amp; ! isset($array[$name]) &amp;amp;&amp;amp; ( ! $rel-&amp;gt;isOneToOne() || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
                 unset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name);
             }
         }
Index: tests/Ticket/DC300TestCase.php
===================================================================
--- tests/Ticket/DC300TestCase.php	(revision 0)
+++ tests/Ticket/DC300TestCase.php	(revision 0)
@@ -0,0 +1,127 @@
+&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.phpdoctrine.org&amp;gt;.
&lt;/span&gt;+ */
+
+/**
+ * Doctrine_Ticket_DC300_TestCase
+ *
+ * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
+ * @author      Konsta Vesterinen &amp;lt;kvesteri@cc.hut.fi&amp;gt;
+ * @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.phpdoctrine.org
+ * @since       1.0
+ * @version     $Revision$
+ */
+class Doctrine_Ticket_DC300_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 prepareData()
+    {
+        $g1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_Group();
+        $g1[&apos;name&apos;] = &apos;group1&apos;;
+        $g1-&amp;gt;save();
+
+        $g2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_Group();
+        $g2[&apos;name&apos;] = &apos;group2&apos;;
+        $g2-&amp;gt;save();
+
+        $g3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_Group();
+        $g3[&apos;name&apos;] = &apos;group3&apos;;
+        $g3-&amp;gt;save();
+
+        $u1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_User();
+        $u1[&apos;name&apos;] = &apos;user1&apos;;
+        $u1[&apos;Groups&apos;]-&amp;gt;add($g1);
+        $u1[&apos;Groups&apos;]-&amp;gt;add($g2);
+        $u1-&amp;gt;save();
+    }
+
+    &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;Ticket_DC300_Group&apos;;
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC300_User&apos;;
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC300_UserGroup&apos;;
+        parent::prepareTables();
+    }
+
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testRefTableEntriesOnManyToManyRelationsWithSynchronizeWithArray()
+    {
+		$u1 = Doctrine::getTable(&apos;Ticket_DC300_User&apos;)-&amp;gt;find(1);
+
+		&lt;span class=&quot;code-comment&quot;&gt;// update the groups user (id 1) is linked to
&lt;/span&gt;+		$u1-&amp;gt;synchronizeWithArray(array(
+			&apos;Groups&apos; =&amp;gt; array(
+				array(&apos;name&apos; =&amp;gt; &apos;group1 update&apos;),
+				array(&apos;name&apos; =&amp;gt; &apos;group2 update&apos;)
+			)
+		));
+		$u1-&amp;gt;save();
+
+		&lt;span class=&quot;code-comment&quot;&gt;// update the user-objects with real data from database
&lt;/span&gt;+		$u1-&amp;gt;loadReference(&apos;Groups&apos;);
+
+		&lt;span class=&quot;code-comment&quot;&gt;// check wether the two database-entries in RefTable exists
&lt;/span&gt;+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual(count($u1-&amp;gt;Groups), 2);
+    }
+   
+}
+
+class Ticket_DC300_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;name&apos;, &apos;string&apos;, 255);
+	}
+	
+	&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;Ticket_DC300_User as Users&apos;, array(
+			&apos;local&apos; =&amp;gt; &apos;group_id&apos;,
+			&apos;foreign&apos; =&amp;gt; &apos;user_id&apos;,
+			&apos;refClass&apos; =&amp;gt; &apos;Ticket_DC300_UserGroup&apos;
+		));
+	}
+}
+
+class Ticket_DC300_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;name&apos;, &apos;string&apos;, 255);
+	}
+
+	&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;Ticket_DC300_Group as Groups&apos;, array(
+			&apos;local&apos; =&amp;gt; &apos;user_id&apos;,
+			&apos;foreign&apos; =&amp;gt; &apos;group_id&apos;,
+			&apos;refClass&apos; =&amp;gt; &apos;Ticket_DC300_UserGroup&apos;
+		));
+	}
+}
+
+class Ticket_DC300_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_id&apos;, &apos;integer&apos;);
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;group_id&apos;, &apos;integer&apos;);
+	}
+}
\ No newline at end of file
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11115" author="testvogel" created="Wed, 9 Dec 2009 09:30:50 +0000"  >&lt;p&gt;I tested your patch in our project and it seems to work very well.&lt;/p&gt;

&lt;p&gt;Thank you and your team for the good work &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="10193" name="DC300TestCase.php" size="2504" author="testvogel" created="Mon, 30 Nov 2009 13:20:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-277] Doctrine_Core::loadModels() is getting class name from file name and not the actual class name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-277</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If models has any prefix Doctrine_Core::loadModels() fails as fails all export scripts, because for models:&lt;/p&gt;

&lt;p&gt;Model_Test&lt;br/&gt;
Model_Test2&lt;/p&gt;

&lt;p&gt;it returns:&lt;/p&gt;

&lt;p&gt;array(&lt;br/&gt;
   &apos;Test&apos; =&amp;gt; &apos;Test&apos;,&lt;br/&gt;
   &apos;Test2&apos; =&amp;gt; &apos;Test2&apos;&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;This is incorrect and Doctrine_Core::filterInvalidModels() filters out these classes, hence none of the models become available. &lt;/p&gt;

&lt;p&gt;Expected behaviour: classPrefix should be possible to pass to configuration of task (now I need to manually copy/paste/edit all tasks to add required class prefix).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10490">DC-277</key>
            <summary>Doctrine_Core::loadModels() is getting class name from file name and not the actual class name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 08:49:18 +0000</created>
                <updated>Tue, 24 Nov 2009 19:00:38 +0000</updated>
                    <resolved>Tue, 24 Nov 2009 19:00:38 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10828" author="jwage" created="Mon, 23 Nov 2009 23:59:05 +0000"  >&lt;p&gt;I made a fix in Doctrine 1.2 that should help. Be sure you set the model loading to be pear style.&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-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_PEAR);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10836" author="juokaz" created="Tue, 24 Nov 2009 12:23:10 +0000"  >&lt;p&gt;It does fix some things, I will explain the problem in more detail:&lt;/p&gt;

&lt;p&gt;I have models like this (zf-style)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$options = array(&lt;br/&gt;
	&apos;pearStyle&apos; =&amp;gt; true,&lt;br/&gt;
	&apos;generateTableClasses&apos; =&amp;gt; true,&lt;br/&gt;
	&apos;classPrefix&apos; =&amp;gt; &apos;Model_&apos;,&lt;br/&gt;
	&apos;baseClassPrefix&apos; =&amp;gt; &apos;Base_&apos;,&lt;br/&gt;
	&apos;baseClassesDirectory&apos; =&amp;gt; null,&lt;br/&gt;
	&apos;classPrefixFiles&apos; =&amp;gt; false,&lt;br/&gt;
	&apos;generateAccessors&apos; =&amp;gt; false,&lt;br/&gt;
);&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;As you can see, models doesn&apos;t have a folder Model, they are just in folder models, so my result is:&lt;/p&gt;

&lt;p&gt;./models&lt;br/&gt;
....Product.php --&amp;gt; Model_Product&lt;br/&gt;
....Base&lt;br/&gt;
........Product.php --&amp;gt; Model_Base_Product&lt;/p&gt;

&lt;p&gt;Hence the prefix cannot be determined from folder name as it can be anything I want. &lt;/p&gt;

&lt;p&gt;Possible fix: take into account prefix (define as a property?) or use reflection.&lt;/p&gt;</comment>
                    <comment id="10844" author="jwage" created="Tue, 24 Nov 2009 19:00:38 +0000"  >&lt;p&gt;You need to have &apos;classPrefixFiles&apos; =&amp;gt; true. With pearStyle it is required that the name of your class represent the path to the class on disk. So if you change classPrefixFiles to true everything will be fine and work the way it is supposed to. The prefix option for loadModels is not recommended.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-210] PEAR style models generation produces unusable table classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-210</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When generating models like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&apos;pearStyle&apos; =&amp;gt; true,&lt;br/&gt;
&apos;generateTableClasses&apos; =&amp;gt; true,&lt;br/&gt;
&apos;classPrefix&apos; =&amp;gt; &apos;Model_&apos;,&lt;br/&gt;
&apos;baseClassPrefix&apos; =&amp;gt; &apos;Base_&apos;,&lt;br/&gt;
&apos;baseClassesDirectory&apos; =&amp;gt; &apos;Base&apos;,&lt;br/&gt;
&apos;classPrefixFiles&apos; =&amp;gt; true&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&apos;pearStyle&apos; =&amp;gt; true,&lt;br/&gt;
&apos;generateTableClasses&apos; =&amp;gt; true,&lt;br/&gt;
&apos;classPrefix&apos; =&amp;gt; &apos;Model_&apos;,&lt;br/&gt;
&apos;baseClassPrefix&apos; =&amp;gt; &apos;Base_&apos;,&lt;br/&gt;
&apos;baseClassesDirectory&apos; =&amp;gt; &apos;Base&apos;,&lt;br/&gt;
&apos;classPrefixFiles&apos; =&amp;gt; false&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Produced files are like this:&lt;/p&gt;

&lt;p&gt;Model_ModelName extends Base_ModelName&lt;br/&gt;
Base_ModelName extends Doctrine_Record&lt;br/&gt;
ModelNameTable extends Doctrine_Table&lt;/p&gt;

&lt;p&gt;Problem is &lt;b&gt;ModelNameTable&lt;/b&gt; class is not prefixed with &quot;Model_&quot; and thus cannot be autoloaded.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10382">DC-210</key>
            <summary>PEAR style models generation produces unusable table classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Nov 2009 03:04:20 +0000</created>
                <updated>Thu, 12 Nov 2009 19:21:47 +0000</updated>
                    <resolved>Thu, 12 Nov 2009 19:21:47 +0000</resolved>
                            <version>1.2.0-BETA2</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-183] Undefined constant Doctrine_Core::ATTR_DEFAULT_TEXTFLD_LENGTH</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-183</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;File &lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/DataDict/Sqlite.php&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/DataDict/Sqlite.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Contains undefined constant Doctrine_Core::ATTR_DEFAULT_TEXTFLD_LENGTH which breaks generation of sql for sqlite&lt;/p&gt;

&lt;p&gt;Proposed fix: use $this-&amp;gt;conn-&amp;gt;options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;default_text_field_length&amp;#39;&amp;#93;&lt;/span&gt; ?&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="10333">DC-183</key>
            <summary>Undefined constant Doctrine_Core::ATTR_DEFAULT_TEXTFLD_LENGTH</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 16:41:45 +0000</created>
                <updated>Mon, 16 Nov 2009 18:09:58 +0000</updated>
                    <resolved>Mon, 16 Nov 2009 18:09:58 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10620" author="juokaz" created="Fri, 13 Nov 2009 08:53:44 +0000"  >&lt;p&gt;I&apos;ve tested it again and now it seems to be broken in that same line. &lt;/p&gt;

&lt;p&gt;Now in 76 line of Doctrine_DataDict_Sqlite I need to use:&lt;/p&gt;

&lt;p&gt;return $fixed ? ($length ? &apos;CHAR(&apos;.$length.&apos;)&apos; : &apos;CHAR(&apos;.$this-&amp;gt;conn-&amp;gt;varchar_max_length.&apos;)&apos;)&lt;/p&gt;

&lt;p&gt;Which I found in Mysql datadict, even though Mssql uses:&lt;/p&gt;

&lt;p&gt;return $fixed ? ($length ? &apos;CHAR(&apos;.$length.&apos;)&apos; : &apos;CHAR(&apos;.$this-&amp;gt;conn-&amp;gt;options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;default_text_field_length&amp;#39;&amp;#93;&lt;/span&gt;.&apos;)&apos;)&lt;/p&gt;

&lt;p&gt;Which won&apos;t work because there is no options in conn. &lt;/p&gt;

&lt;p&gt;Using rev6721&lt;/p&gt;</comment>
                    <comment id="10621" author="juokaz" created="Fri, 13 Nov 2009 09:00:43 +0000"  >&lt;p&gt;It is caused by the fact that $options in connection are (now?) protected, hence cannot be accessed like that. There is way to access them by:&lt;/p&gt;

&lt;p&gt;return $fixed ? ($length ? &apos;CHAR(&apos;.$length.&apos;)&apos; : &apos;CHAR(&apos;.$this-&amp;gt;conn-&amp;gt;getOption(&apos;default_text_field_length&apos;).&apos;)&apos;)&lt;/p&gt;

&lt;p&gt;But key doesn&apos;t exist and return value is null.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-66] Saving &quot;new Doctrine_Expression(&apos;NOW()&apos;)&quot; to database doesn&apos;t work since r6403</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-66</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record:1469&lt;/p&gt;

&lt;p&gt;        } else if ($type == &apos;timestamp&apos; || $type == &apos;date&apos;) {&lt;br/&gt;
            return strtotime($old) !== strtotime($new);&lt;/p&gt;

&lt;p&gt;These new lines cause inability to save NOW() to &quot;date&quot; field.&lt;/p&gt;

&lt;p&gt;Change was commited in r6403 branch 1.2&lt;/p&gt;

&lt;p&gt;MySQL error is:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1364 Field &apos;date&apos; doesn&apos;t have a default value&lt;/p&gt;</description>
                <environment>MySQL 5.0.51, PHP 5.3</environment>
            <key id="10117">DC-66</key>
            <summary>Saving &quot;new Doctrine_Expression(&apos;NOW()&apos;)&quot; to database doesn&apos;t work since r6403</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mg">Marcin Gil</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Sep 2009 17:03:59 +0000</created>
                <updated>Tue, 6 Oct 2009 18:01:08 +0000</updated>
                    <resolved>Tue, 6 Oct 2009 18:01:08 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10134" author="lex" created="Sun, 27 Sep 2009 23:01:45 +0000"  >&lt;p&gt;Possible fix attached.&lt;/p&gt;</comment>
                    <comment id="10135" author="mg" created="Mon, 28 Sep 2009 06:45:18 +0000"  >&lt;p&gt;The patch is effective, please apply to SVN.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="10139" author="jowe" created="Mon, 28 Sep 2009 14:27:40 +0000"  >&lt;p&gt;I don&apos;t want to rewrite all my &quot;NOW()&quot; values! Please fix this ASAP!&lt;br/&gt;
thx!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10043" name="timestamp-validation.patch" size="627" author="lex" created="Sun, 27 Sep 2009 23:01:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-69] Linking between one to one relations with synchronizeWithArray fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-69</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Linking between one to one relations with synchronizeWithArray() ends up in an error message.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
Group has one User&lt;br/&gt;
User has one Group&lt;/p&gt;

&lt;p&gt;When I have a group-object and do the following:&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;$group-&amp;gt;synchronizeWithArray(array(
	&apos;User&apos; =&amp;gt; array(1)
));
$group-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I get the message: &quot;Fatal error: Call to a member function identifier() on a non-object in &lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;lib/Doctrine/Record.php on line 2327&quot;&lt;/p&gt;

&lt;p&gt;Apparantly $this-&amp;gt;_references&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; should be an collection, but in an one to one relation it is a record (which makes sense in my opinion).&lt;/p&gt;</description>
                <environment>tested on&lt;br/&gt;
MySQL&lt;br/&gt;
Doctrine Version 1.0.11 Revision: 6380&lt;br/&gt;
Doctrine Version 1.1.3 Revision: 6380&lt;br/&gt;
Doctrine Version 1.1.4 Revision: 6409&lt;br/&gt;
Doctrine Version 1.2 </environment>
            <key id="10120">DC-69</key>
            <summary>Linking between one to one relations with synchronizeWithArray fails</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="testvogel">Marcus H&#228;u&#223;ler</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Sep 2009 13:51:43 +0000</created>
                <updated>Mon, 2 Nov 2009 20:13:37 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 20:13:37 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10157" author="testvogel" created="Thu, 1 Oct 2009 16:06:49 +0000"  >&lt;p&gt;I just realized that the whole linking process in one to one relations is not working.&lt;/p&gt;

&lt;p&gt;A simple&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;$group-&amp;gt;link(&apos;User&apos;, 1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;ends up in &amp;lt;b&amp;gt;Fatal error&amp;lt;/b&amp;gt;:  Uncaught exception &apos;Doctrine_Exception&apos; with message &apos;Add is not supported for User&apos; in &lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;/Doctrine/Access.php:201&lt;/p&gt;

&lt;p&gt;Because in Doctrine_Record the add-method is completely missing &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;br/&gt;
I hope it&apos;s just more or less a copy/past of Doctrine_Collection-&amp;gt;add()&lt;/p&gt;</comment>
                    <comment id="10191" author="testvogel" created="Fri, 9 Oct 2009 10:43:52 +0000"  >&lt;p&gt;I have build a fix that works for me, but I did not tested it fully.&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;Index: library/Doctrine/Doctrine/Record.php
===================================================================
--- library/Doctrine/Doctrine/Record.php        (Revision 6462)
+++ library/Doctrine/Doctrine/Record.php        (Arbeitskopie)
@@ -2323,13 +2323,23 @@
         }

         if (isset($this-&amp;gt;_references[$alias])) {
-            foreach ($this-&amp;gt;_references[$alias] as $k =&amp;gt; $record) {
-                if (in_array(current($record-&amp;gt;identifier()), $ids) || empty($ids)) {
-                    $this-&amp;gt;_references[$alias]-&amp;gt;remove($k);
-                }
-            }

-            $this-&amp;gt;_references[$alias]-&amp;gt;takeSnapshot();
+                       /*
+                        * Fix for One To One Relations
+                        */
+               if ($this-&amp;gt;_references[$alias] instanceof Doctrine_Record) {
+                       if (in_array($this-&amp;gt;_references[$alias]-&amp;gt;identifier(), $ids) || empty($ids)) {
+                               unset($this-&amp;gt;_references[$alias]);
+                       }
+               } else {
+                       foreach ($this-&amp;gt;_references[$alias] as $k =&amp;gt; $record) {
+                               if (in_array(current($record-&amp;gt;identifier()), $ids) || empty($ids)) {
+                                       $this-&amp;gt;_references[$alias]-&amp;gt;remove($k);
+                               }
+                       }
+                   $this-&amp;gt;_references[$alias]-&amp;gt;takeSnapshot();
+               }
+
         }

         if ( ! $this-&amp;gt;exists() || $now === false) {
@@ -2406,7 +2416,14 @@
                 -&amp;gt;execute();

             foreach ($records as $record) {
-                $this-&amp;gt;$alias-&amp;gt;add($record);
+               /*
+                * Fix for One To One Relations
+                */
+               if ($this-&amp;gt;$alias instanceof Doctrine_Record) {
+                       $this-&amp;gt;$alias = $record;
+               } else {
+                       $this-&amp;gt;$alias-&amp;gt;add($record);
+               }
             }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-40] Problems with alias in where section</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-40</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using a mysql function to calculate the distance between 2 points. When I&apos;m using this funciton in a doctrine query it works. But when I&apos;m using the functions result in a where clause it dont work:&lt;/p&gt;

&lt;p&gt;The Query:&lt;br/&gt;
$basicQuery = $query-&amp;gt;select(&apos;id, getGeoDistanceKM(lng, lat, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lng&amp;#39;&amp;#93;&lt;/span&gt;.&apos;, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lat&amp;#39;&amp;#93;&lt;/span&gt;.&apos;) AS distance, getGeoDistanceKM(lng, lat, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lng&amp;#39;&amp;#93;&lt;/span&gt;.&apos;, &apos;.$points&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;lat&amp;#39;&amp;#93;&lt;/span&gt;.&apos;) AS distance, IF(count(r.id) &amp;gt; 0, AVG(r.rating), 0) as ratingAvg&apos;)&lt;br/&gt;
			-&amp;gt;from(&apos;ProomsOffer o&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.PublicTransports pt&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.Unavailabilities ua&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.Ratings r&apos;)&lt;br/&gt;
			-&amp;gt;leftJoin(&apos;o.Bookings b&apos;)&lt;br/&gt;
			-&amp;gt;where(&apos;distance != 0&apos;)&lt;br/&gt;
			-&amp;gt;groupBy(&apos;o.id&apos;)&lt;br/&gt;
			-&amp;gt;orderBy(&apos;distance, ratingAvg&apos;);&lt;/p&gt;

&lt;p&gt;The Error message:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;m__1&apos; in &apos;where clause&apos;&lt;br/&gt;
#0 /Applications/MAMP/htdocs/prooms/cms/library/Doctrine/Doctrine/Connection.php(1015): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql))&lt;br/&gt;
#1 /Applications/MAMP/htdocs/prooms/cms/library/Doctrine/Doctrine/Connection.php(790): Doctrine_Connection-&amp;gt;execute(&apos;SELECT COUNT&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;...&apos;, Array)&lt;br/&gt;
#2 /Applications/MAMP/htdocs/prooms/cms/library/Doctrine/Doctrine/Query.php(2037): Doctrine_Connection-&amp;gt;fetchAll(&apos;SELECT COUNT&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;...&apos;, Array)&lt;br/&gt;
#3 /Applications/MAMP/htdocs/prooms/cms/application/modules/prooms/controllers/SearchController.php(163): Doctrine_Query-&amp;gt;count()&lt;br/&gt;
#4 /Applications/MAMP/htdocs/prooms/cms/library/Zend/Controller/Action.php(513): Prooms_SearchController-&amp;gt;searchAction()&lt;br/&gt;
#5 /Applications/MAMP/htdocs/prooms/cms/library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action-&amp;gt;dispatch(&apos;searchAction&apos;)&lt;br/&gt;
#6 /Applications/MAMP/htdocs/prooms/cms/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(CMS_Controller_Request), Object(Zend_Controller_Response_Http))&lt;br/&gt;
#7 /Applications/MAMP/htdocs/prooms/cms/library/CMS/Application.php(372): Zend_Controller_Front-&amp;gt;dispatch()&lt;br/&gt;
#8 /Applications/MAMP/htdocs/prooms/cms/library/CMS/Application.php(241): CMS_Application-&amp;gt;_dispatch(Object(Zend_Controller_Front))&lt;br/&gt;
#9 /Applications/MAMP/htdocs/prooms/cms/public/index.php(50): CMS_Application-&amp;gt;run()&lt;br/&gt;
#10 &lt;/p&gt;
{main}
&lt;p&gt; &lt;/p&gt;


&lt;p&gt;The getSqlQuery:&lt;br/&gt;
SELECT `m`.`id` AS `m_&lt;em&gt;id`, getGeoDistanceKM(`m`.`lng`, `m`.`lat`, 48.2092062, 16.3727778) AS `m&lt;/em&gt;&lt;em&gt;0`, getGeoDistanceKM(`m`.`lng`, `m`.`lat`, 48.2092062, 16.3727778) AS `m&lt;/em&gt;&lt;em&gt;1`, IF(COUNT(`m4`.`id`) &amp;gt; 0, AVG(`m4`.`rating`), 0) AS `m4&lt;/em&gt;&lt;em&gt;1` FROM `module_prooms_offers` `m` LEFT JOIN `module_prooms_offers_public_transport` `m2` ON `m`.`id` = `m2`.`id_offer` LEFT JOIN `module_prooms_offers_unavailability` `m3` ON `m`.`id` = `m3`.`id_offer` LEFT JOIN `module_prooms_offers_ratings` `m4` ON `m`.`id` = `m4`.`id_offer` LEFT JOIN `module_prooms_bookings` `m5` ON `m`.`id` = `m5`.`id_offer` WHERE `m&lt;/em&gt;&lt;em&gt;1` != 0 GROUP BY `m`.`id` ORDER BY `m&lt;/em&gt;&lt;em&gt;1`, `m4&lt;/em&gt;_1`&lt;/p&gt;</description>
                <environment>MAMP</environment>
            <key id="10085">DC-40</key>
            <summary>Problems with alias in where section</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="jowe">Johannes Weber</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Sep 2009 14:16:50 +0000</created>
                <updated>Thu, 24 Sep 2009 19:57:46 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 19:57:46 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10115" author="guilhermeblanco" created="Thu, 24 Sep 2009 19:57:46 +0000"  >&lt;p&gt;You must disable PORTABILITY_EXPR in order to get it working correcrly.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-561] Doctrine autoloader tries to load class again and fails with fatal error - with fix</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-561</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Core::autoload around line 1107&lt;br/&gt;
        if (strpos($className, &apos;sfYaml&apos;) === 0 || class_exists($className, false)) {&lt;/p&gt;

&lt;p&gt;should be changed to&lt;/p&gt;

&lt;p&gt;        if (strpos($className, &apos;sfYaml&apos;) === 0) {&lt;/p&gt;

&lt;p&gt;otherwise you get:&lt;br/&gt;
Warning: require(/srv/www/pacs.lan/site/lib/Doctrine/Parser/sfYaml/Doctrine_Query_From.php) &lt;span class=&quot;error&quot;&gt;&amp;#91;function.require&amp;#93;&lt;/span&gt;: failed to open stream: No such file or directory in /srv/www/pacs.lan/site/lib/Doctrine/Core.php  on line 1108&lt;/p&gt;

&lt;p&gt;Fatal error: require() &lt;span class=&quot;error&quot;&gt;&amp;#91;function.require&amp;#93;&lt;/span&gt;: Failed opening required &apos;/srv/www/pacs.lan/site/lib/Doctrine/Parser/sfYaml/Doctrine_Query_From.php&apos; (include_path=&apos;/srv/www/pacs.lan/site/lib/:/srv/www/pacs.lan/site/lib/Dwoo/:.:/usr/local/lib/php&apos;) in /srv/www/pacs.lan/site/lib/Doctrine/Core.php on line 1108&lt;/p&gt;</description>
                <environment></environment>
            <key id="11023">DC-561</key>
            <summary>Doctrine autoloader tries to load class again and fails with fatal error - with fix</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Mar 2010 15:49:26 +0000</created>
                <updated>Mon, 15 Mar 2010 15:14:08 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:14:08 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12219" author="jwage" created="Mon, 15 Mar 2010 15:14:08 +0000"  >&lt;p&gt;It appears this is already fixed in the latest SVN of 1.2.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-508] All but the first migrations fail with PostgreSQL [patch included]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-508</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem is in this 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;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _createMigrationTable()
{
    &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;_migrationTableCreated) {
        &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;this&lt;/span&gt;-&amp;gt;_migrationTableCreated = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;

    &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_connection-&amp;gt;export-&amp;gt;createTable($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_migrationTableName, array(&apos;version&apos; =&amp;gt; array(&apos;type&apos; =&amp;gt; &apos;integer&apos;, &apos;size&apos; =&amp;gt; 11)));

        &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;catch&lt;/span&gt;(Exception $e) {
        &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;When &lt;tt&gt;migration_version&lt;/tt&gt; table doesn&apos;t exist, everything works like it should. But subsequent migrations fail, because after failing at creating &lt;tt&gt;migration_version&lt;/tt&gt; table every subsequent queries in that transaction fail.&lt;/p&gt;

&lt;p&gt;It works flawlessly with MySQL, but fails with PostgreSQL.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10911">DC-508</key>
            <summary>All but the first migrations fail with PostgreSQL [patch included]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="elnur">Elnur Abdurrakhimov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Feb 2010 14:17:50 +0000</created>
                <updated>Mon, 15 Mar 2010 12:12:04 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:12:04 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11768" author="elnur" created="Sat, 20 Feb 2010 04:36:07 +0000"  >&lt;p&gt;My previous patch broke MySQL migrations. This new patch resolves that problem.&lt;/p&gt;

&lt;p&gt;My solution is not neat, but at least migrations work and I can continue developing my project.&lt;/p&gt;</comment>
                    <comment id="11889" author="jwage" created="Mon, 1 Mar 2010 15:43:59 +0000"  >&lt;p&gt;This isn&apos;t really a good patch. I don&apos;t wanna have driver specific conditional statements like that.&lt;/p&gt;

&lt;p&gt;What about if we started and committed our own transaction for the create table so that everything else is in another transaction and would not conflict.&lt;/p&gt;</comment>
                    <comment id="12197" author="elnur" created="Mon, 15 Mar 2010 12:07:12 +0000"  >&lt;p&gt;This time solution is neater.&lt;/p&gt;</comment>
                    <comment id="12198" author="elnur" created="Mon, 15 Mar 2010 12:07:32 +0000"  >&lt;p&gt;Provided a patch with a neater solution.&lt;/p&gt;</comment>
                    <comment id="12199" author="jwage" created="Mon, 15 Mar 2010 12:12:04 +0000"  >&lt;p&gt;Thanks for following up on this and fixing the root cause of the problem.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10470" name="patch-doctrine-migration-pgsql-2.diff" size="578" author="elnur" created="Mon, 15 Mar 2010 12:07:12 +0000" />
                    <attachment id="10377" name="patch-migration-pgsql.diff" size="1216" author="elnur" created="Sat, 20 Feb 2010 04:36:07 +0000" />
                    <attachment id="10373" name="patch-migrations.diff" size="887" author="elnur" created="Wed, 17 Feb 2010 14:17:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-242] Linking (re-linking) o/m2m relations with array of ids in Doctrine_Record fromArray stopped working</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-242</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;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;username&apos;, &apos;string&apos;, 64, 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;password&apos;, &apos;string&apos;, 128, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Roles&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;SoftDelete&apos;);
	}
}

class Role &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 64);
	}
	
	&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;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_user&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;));
	}
}

class UserRole &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_user&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role&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&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}


$role = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role-&amp;gt;name = &apos;publisher&apos;;
$role-&amp;gt;save();

$role = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role-&amp;gt;name = &apos;reviewer&apos;;
$role-&amp;gt;save();

$role = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role-&amp;gt;name = &apos;mod&apos;;
$role-&amp;gt;save();

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;fromArray(array(
	&apos;username&apos; =&amp;gt; &apos;test&apos;,
	&apos;password&apos; =&amp;gt; &apos;test&apos;,
	&apos;Roles&apos; =&amp;gt; array(1, 2, 3),
));
$user-&amp;gt;save();

&lt;span class=&quot;code-comment&quot;&gt;//--------------------- here goes the failure
&lt;/span&gt;$user-&amp;gt;fromArray(array(
	&apos;Roles&apos; =&amp;gt; array(1, 3),
));
$user-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After a User is saved once with some roles, it cannot be saved here with another combination of roles, consisting of some roles which was saved to the User before.&lt;br/&gt;
In short, -&amp;gt;unlink() in fromArray method does not schedule a deletion of old relations before adding new ones on save, like it was in previous versions of Doctrine.&lt;br/&gt;
Hence the primary key constraint is violated and the exception is thrown:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;2-1&apos; for key 1&lt;br/&gt;
#0 D:\projekty\cms-trunk\cms\library\Doctrine\Doctrine\Connection\Statement.php(269): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Statement))&lt;br/&gt;
#1 (...)\library\Doctrine\Doctrine\Connection.php(1032): Doctrine_Connection_Statement-&amp;gt;execute(Array)&lt;br/&gt;
#2 (...)\library\Doctrine\Doctrine\Connection.php(677): Doctrine_Connection-&amp;gt;exec(&apos;INSERT INTO `us...&apos;, Array)&lt;br/&gt;
#3 (...)\library\Doctrine\Doctrine\Connection\UnitOfWork.php(631): Doctrine_Connection-&amp;gt;insert(Object(Doctrine_Table), Array)&lt;br/&gt;
#4 (...)\library\Doctrine\Doctrine\Connection\UnitOfWork.php(562): Doctrine_Connection_UnitOfWork-&amp;gt;processSingleInsert(Object(UserRole))&lt;br/&gt;
#5 (...)\library\Doctrine\Doctrine\Connection\UnitOfWork.php(81): Doctrine_Connection_UnitOfWork-&amp;gt;insert(Object(UserRole))&lt;br/&gt;
#6 (...)\library\Doctrine\Doctrine\Connection\UnitOfWork.php(452): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(UserRole))&lt;br/&gt;
#7 (...)\library\Doctrine\Doctrine\Connection\UnitOfWork.php(137): Doctrine_Connection_UnitOfWork-&amp;gt;saveAssociations(Object(User))&lt;br/&gt;
#8 (...)\library\Doctrine\Doctrine\Record.php(1690): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(User))&lt;br/&gt;
#9 (...)\test3.php(124): Doctrine_Record-&amp;gt;save()&lt;br/&gt;
#10 &lt;/p&gt;
{main}</description>
                <environment>1.2 svn</environment>
            <key id="10433">DC-242</key>
            <summary>Linking (re-linking) o/m2m relations with array of ids in Doctrine_Record fromArray stopped working</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Nov 2009 02:00:38 +0000</created>
                <updated>Tue, 17 Nov 2009 21:20:10 +0000</updated>
                    <resolved>Tue, 17 Nov 2009 21:20:10 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10696" author="mh" created="Tue, 17 Nov 2009 02:06:11 +0000"  >&lt;p&gt;Now I see I duplicated the following ticket: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-228&quot; title=&quot;Doctrine_Record::fromArray() may fail when input contains related component IDs.&quot;&gt;&lt;del&gt;DC-228&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Please fix this issue.&lt;/p&gt;</comment>
                    <comment id="10697" author="mh" created="Tue, 17 Nov 2009 02:09:33 +0000"  >&lt;p&gt;Aaand &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-189&quot; title=&quot;When applying changes to n:n relations that contain partially same data DELET is not fired&quot;&gt;&lt;del&gt;DC-189&lt;/del&gt;&lt;/a&gt; is also related.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-241] Count query with join o2m + limit + where throws an exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-241</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;class Poll &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;module_polls&apos;);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_category&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, 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;question&apos;, &apos;string&apos;, 256);
	}
	
	&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;PollAnswer as Answers&apos;, array(&apos;local&apos; =&amp;gt; &apos;id&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_poll&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
	}
}

class PollAnswer &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;module_polls_answers&apos;);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_poll&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, 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;answer&apos;, &apos;string&apos;, 256);
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;votes&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos; =&amp;gt; 0));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;position&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;Poll&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_poll&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}

$query = Doctrine_Query::create()
	-&amp;gt;from(&apos;Poll p&apos;)
	-&amp;gt;leftJoin(&apos;p.Answers pa&apos;)
	-&amp;gt;where(&apos;id_category = ?&apos;, 1)
	-&amp;gt;limit(10);

print_r($query-&amp;gt;count());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This fails with the following exception being thrown:&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 Something is wrong in your syntax obok &apos;? LIMIT 10&apos; w linii 1. Failing Query: &quot;SELECT DISTINCT `m3`.`id` FROM `module_polls` `m3` LEFT JOIN `module_polls_answers` `m4` ON `m3`.`id` = `m4`.`id_poll` WHERE `m3`.`id_category` = ? LIMIT 10&quot;&lt;br/&gt;
#0 (...)\library\Doctrine\Doctrine\Connection.php(1015): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql), &apos;SELECT DISTINCT...&apos;)&lt;br/&gt;
#1 (...)\library\Doctrine\Doctrine\Query.php(1246): Doctrine_Connection-&amp;gt;execute(&apos;SELECT DISTINCT...&apos;, Array)&lt;br/&gt;
#2 (...)\library\Doctrine\Doctrine\Query.php(1106): Doctrine_Query-&amp;gt;buildSqlQuery()&lt;br/&gt;
#3 (...)\library\Doctrine\Doctrine\Query\Abstract.php(1126): Doctrine_Query-&amp;gt;getSqlQuery(Array)&lt;br/&gt;
#4 (...)\library\Doctrine\Doctrine\Query\Abstract.php(1088): Doctrine_Query_Abstract-&amp;gt;_getDqlCallbackComponents(Array)&lt;br/&gt;
#5 (...)\library\Doctrine\Doctrine\Query.php(1126): Doctrine_Query_Abstract-&amp;gt;_preQuery()&lt;br/&gt;
#6 (...)\library\Doctrine\Doctrine\Query.php(1106): Doctrine_Query-&amp;gt;buildSqlQuery()&lt;br/&gt;
#7 (...)\library\Doctrine\Doctrine\Query.php(1995): Doctrine_Query-&amp;gt;getSqlQuery()&lt;br/&gt;
#8 (...)\library\Doctrine\Doctrine\Query.php(2091): Doctrine_Query-&amp;gt;getCountSqlQuery()&lt;br/&gt;
#9 (...)\test2.php(123): Doctrine_Query-&amp;gt;count()&lt;br/&gt;
#10 &lt;/p&gt;
{main}

&lt;p&gt;You can see the generated query which is wrong, moreover it is passed with an empty params array().&lt;br/&gt;
Without either where condition or limit removed, it works. With a combo of both of them it fails.&lt;/p&gt;

&lt;p&gt;E.g. without where condition the following query is generated:&lt;br/&gt;
SELECT COUNT&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/star_yellow.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; AS `num_results` FROM (SELECT `m`.`id` FROM `module_polls` `m` LEFT JOIN `module_polls_answers` `m2` ON `m`.`id` = `m2`.`id_poll` GROUP BY `m`.`id`) `dctrn_count_query`&lt;/p&gt;</description>
                <environment>1.2 svn</environment>
            <key id="10432">DC-241</key>
            <summary>Count query with join o2m + limit + where throws an exception</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Nov 2009 01:14:03 +0000</created>
                <updated>Tue, 17 Nov 2009 23:08:51 +0000</updated>
                    <resolved>Tue, 17 Nov 2009 23:08:51 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10695" author="mh" created="Tue, 17 Nov 2009 01:18:35 +0000"  >&lt;p&gt;This is related to recently closed, but not fixed due to unability to reproduce, &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-138&quot; title=&quot;WHERE LIKE doesn&amp;#39;t work on JOIN SELECTs.&quot;&gt;&lt;del&gt;DC-138&lt;/del&gt;&lt;/a&gt; - seems like the same problem. In that ticket it was not clearly stated that -&amp;gt;count() method is used on the query. It fails when a &apos;where&apos; condition is added to the query, no matter if it&apos;s simple =? condition or LIKE one.&lt;/p&gt;</comment>
                    <comment id="10713" author="jwage" created="Tue, 17 Nov 2009 18:27:37 +0000"  >&lt;p&gt;I am not sure that these are the same issues. Can you test this patch though?&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: lib/Doctrine/Query.php
===================================================================
--- lib/Doctrine/Query.php	(revision 6739)
+++ lib/Doctrine/Query.php	(working copy)
@@ -1334,15 +1334,6 @@
             array_pop($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]);
         }
 
-        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($needsSubQuery) {
-            &lt;span class=&quot;code-comment&quot;&gt;// We need to &lt;span class=&quot;code-object&quot;&gt;double&lt;/span&gt; shift &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &amp;gt; 2
&lt;/span&gt;-            &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;_sqlParts[&apos;where&apos;]) &amp;gt; 2) {
-                array_shift($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]);
-            }
-
-            array_shift($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]);
-        }
-
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sql = $q;
 
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;clear();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think this should fix the issue. I am not sure what that block of code is supposed to be doing, but I think it is there incorrectly.&lt;/p&gt;</comment>
                    <comment id="10715" author="mh" created="Tue, 17 Nov 2009 18:42:52 +0000"  >&lt;p&gt;Unfortunately this patch does not fix the problem. The result is the same exception being thrown.&lt;br/&gt;
I think that part of code is there for some purpose, are you sure that removing will not break anything else? It is steered by $needsSubQuery variable which is set to true or false in few conditions above it.&lt;/p&gt;</comment>
                    <comment id="10717" author="jwage" created="Tue, 17 Nov 2009 18:47:29 +0000"  >&lt;p&gt;No after talking with the team we realized that the code is not needed and should have been removed. It was there to &quot;fix&quot; a problem but at some point the real problem was fixed so this is no longer needed.&lt;/p&gt;</comment>
                    <comment id="10718" author="jwage" created="Tue, 17 Nov 2009 18:50:30 +0000"  >&lt;p&gt;I committed some changes, can you test those? Also, can you get on IRC or something where we can chat so we can get this issue fixed today?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-39] Linking between one to many relations with synchronizeWithArray fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-39</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Linking between one to many relations with synchronizeWithArray() has a strange behavior.&lt;/p&gt;

&lt;p&gt;Example (fully example is in the attachment):&lt;br/&gt;
Group has many Users&lt;br/&gt;
User has one Group&lt;/p&gt;

&lt;p&gt;When I have a group-object (id 2) and do the following:&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;$group-&amp;gt;synchronizeWithArray(array(
	&apos;Users&apos; =&amp;gt; array(1,2)
));
$group-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;on the first execute of the script the users with id 1 and 2 are linked to group 2 (with foreign key = group_id in user table) -&amp;gt; right&lt;br/&gt;
on the second execute of the script the users with id 1 and 2 are linked to null -&amp;gt; failure&lt;br/&gt;
on the third execute of the script the users with id 1 and 2 are linked to group 2 -&amp;gt; right&lt;br/&gt;
on the fourth execute of the script the users with id 1 and 2 are linked to null -&amp;gt; failure&lt;br/&gt;
and so on&lt;/p&gt;

&lt;p&gt;I tried to find the error on my self, but had no luck.&lt;br/&gt;
That&apos;s what I have found:&lt;br/&gt;
On every script-execution the relations to group 2 are first nulled.&lt;br/&gt;
If they were allready null f&#252;r user 1 and 2, the relations are build with an update -&amp;gt; right!; but when this two users had allready this relation they are only nulled and no update is processed.&lt;br/&gt;
Thats why there is this strange toggling on the foreign key on every script execution.&lt;/p&gt;

&lt;p&gt;Maybe it has something to do with the record_state which is clean, when the relations are allready set in the DB -&amp;gt; no update is executed, but the nulling of all foreign key linked to group 2.&lt;/p&gt;</description>
                <environment>tested on&lt;br/&gt;
PHP Version 5.2.6-3ubuntu4.2, PHP Version 5.3&lt;br/&gt;
MySQL, PgSQL&lt;br/&gt;
Doctrine Version 1.0.11 Revision: 6380&lt;br/&gt;
Doctrine Version 1.1.3 Revision: 6380&lt;br/&gt;
Doctrine Version 1.1.4 Revision: 6409&lt;br/&gt;
Doctrine Version 1.2</environment>
            <key id="10084">DC-39</key>
            <summary>Linking between one to many relations with synchronizeWithArray fails</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="testvogel">Marcus H&#228;u&#223;ler</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Sep 2009 09:05:15 +0000</created>
                <updated>Mon, 2 Nov 2009 20:14:05 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 20:14:05 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10136" author="testvogel" created="Mon, 28 Sep 2009 10:03:18 +0000"  >&lt;p&gt;I changed the code on record.php near line 1923 to&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; 
                if (is_array($value)) {
                    if (isset($value[0]) &amp;amp;&amp;amp; ! is_array($value[0])) {
                        $this-&amp;gt;unlink($key, array(), true); // parameter set to true
                        foreach ($value as $id) {
                            $this-&amp;gt;link($key, $id, true); // parameter set to true
                        }
                    } else {
                        $this-&amp;gt;$key-&amp;gt;synchronizeWithArray($value);
                    }
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;With this changed parameters the described bug does not appear, cause the whole state-checking (in UnitOfWork-&amp;gt;saveGraph()) is not used and the querys are submitted emidiatly.&lt;/p&gt;

&lt;p&gt;Of course this can not be the way, but I hope it helps you a bit to find the error and others who need the synchronizeWithArray method working now.&lt;/p&gt;</comment>
                    <comment id="10173" author="jwage" created="Tue, 6 Oct 2009 18:06:08 +0000"  >&lt;p&gt;Have you tried producing a test case for this? When I tested it I was not able to produce the same behavior in Doctrine standalone. Does this happen in your project or did you try outside of your project with just Doctrine?&lt;/p&gt;</comment>
                    <comment id="10176" author="testvogel" created="Wed, 7 Oct 2009 07:17:44 +0000"  >&lt;p&gt;I tested this with doctrine as a standalone.&lt;/p&gt;

&lt;p&gt;Have you looked at the database entries with an external query-browser or have you just looked at the objects?&lt;br/&gt;
The doctrine_records/collections are build right while the database entries can act with the described behavior.&lt;/p&gt;

&lt;p&gt;I will try to build a testcase but tell me wether you looked in the database to recognize the behavior.&lt;/p&gt;</comment>
                    <comment id="10177" author="testvogel" created="Wed, 7 Oct 2009 08:15:03 +0000"  >&lt;p&gt;Testcase uploaded.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10059" name="DC39TestCase.php" size="3270" author="testvogel" created="Wed, 7 Oct 2009 08:15:03 +0000" />
                    <attachment id="10029" name="example.php" size="1373" author="testvogel" created="Fri, 18 Sep 2009 09:05:15 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-366] Error with tokenizer for JOINs (comments include proposed solutions)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-366</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the attached schema.yml works fine with Symfony-1.2 and Doctrine-1.0. It even works when I have tested it with Symfony-1.2 and Doctrine-1.1.&lt;/p&gt;

&lt;p&gt;However, when using Symfony-1.3 and Doctrine-1.2 the following happens:&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;gt; php symfony doctrine:build-all-reload
&amp;gt;&amp;gt; doctrine  Dropping &quot;doctrine&quot; database
&amp;gt;&amp;gt; doctrine  Creating &quot;dev&quot; environment &quot;doctrine&quot; database
&amp;gt;&amp;gt; doctrine  generating model classes
&amp;gt;&amp;gt; file+     C:\Users\XXXXXXXXXXXXXXXX\AppDa...\Temp/doctrine_schema_30398.yml
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/model/doctrine/base/BaseBar.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/model/doctrine/base/BaseFoo.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/model...e/base/BaseJoinFooBar.class.php
&amp;gt;&amp;gt; autoload  Resetting application autoloaders
&amp;gt;&amp;gt; file-     C:/web/sf_sandbox-1.3/cache/fro.../config/config_autoload.yml.php
&amp;gt;&amp;gt; doctrine  generating form classes
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/BaseForm.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/doctrine/BarForm.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/...rine/base/BaseBarForm.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/...rine/base/BaseFooForm.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/...se/BaseJoinFooBarForm.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/...rine/BaseFormDoctrine.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/doctrine/FooForm.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/form/doctrine/JoinFooBarForm.class.php
&amp;gt;&amp;gt; autoload  Resetting application autoloaders
&amp;gt;&amp;gt; file-     C:/web/sf_sandbox-1.3/cache/fro.../config/config_autoload.yml.php
&amp;gt;&amp;gt; doctrine  generating filter form classes
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte...octrine/BarFormFilter.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte...ase/BaseBarFormFilter.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte...ase/BaseFooFormFilter.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte...eJoinFooBarFormFilter.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte...aseFormFilterDoctrine.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte...octrine/FooFormFilter.class.php
&amp;gt;&amp;gt; tokens    C:/web/sf_sandbox-1.3/lib/filte.../JoinFooBarFormFilter.class.php
&amp;gt;&amp;gt; autoload  Resetting application autoloaders
&amp;gt;&amp;gt; file-     C:/web/sf_sandbox-1.3/cache/fro.../config/config_autoload.yml.php
&amp;gt;&amp;gt; doctrine  generating sql for models
&amp;gt;&amp;gt; doctrine  Generated SQL successfully for models
&amp;gt;&amp;gt; doctrine  created tables successfully
&amp;gt;&amp;gt; doctrine  Loading data fixtures from &quot;C:\web\sf_sandbox-1.3\data/fixtures&quot;


  Couldn&apos;t find class FooBar

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

&lt;p&gt;The attached schema.yml looks 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;# /config/doctrine/schema.yml
Foo:
  columns:
    id:
      type:                    integer(8)
      primary:                 true
      autoincrement:           true
    foo_field:                 string(100)
  relations:
    Bars:
      class:                   Bar
      refClass:                JoinFooBar
      local:                   foo_id
      foreign:                 bar_id
Bar:
  columns:
    id:
      type:                    integer(8)
      primary:                 true
      autoincrement:           true
    bar_field:               string(30)
JoinFooBar:
  columns:
    foo_id:
      type:                    integer(8)
      primary:                 true
    bar_id:
      type:                    integer(8)
      primary:                 true

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

&lt;p&gt;As you can see, there is not &lt;em&gt;meant&lt;/em&gt; to be any class called FooBar (the reference class for the many-to-many join is called &lt;em&gt;JoinFooBar&lt;/em&gt;) so where is the name &quot;FooBar&quot; being picked up from and why is the code complaining that it cannot be found?&lt;/p&gt;

&lt;p&gt;The fixture file is empty so there shouldn&apos;t be anything causing problems there.&lt;/p&gt;

&lt;p&gt;This bug is making it impossible to upgrade our existing projects to Symfony-1.3 + Doctrine-1.2 so I&apos;d be most grateful if you could look into this.&lt;/p&gt;

&lt;p&gt;If the schema is changed from:&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;...
    bar_field:               string(30)
JoinFooBar:
  columns:
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To:&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;...
    bar_field:               string(30)
FooBar:
  columns:
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it seems to work, (that error disappears - even though the refClass is still set to *Join*FooBar) but we cannot easily justify changing all the classnames of all our Join tables in the projects we want to upgrade!&lt;/p&gt;

&lt;p&gt;I hope you can see some simple solution to this and I&apos;m happy to answer any questions you have.&lt;/p&gt;

&lt;p&gt;(To reproduce this bug use the symfony sandbox, create a database and then use the attached schema.yml file.)&lt;/p&gt;


&lt;p&gt;C&lt;/p&gt;</description>
                <environment>Symfony-1.3, reporting below is based on the symfony-1.3.1 sandbox, but same problem occurs in other (non-sandbox) symfony-1.3 environments</environment>
            <key id="10630">DC-366</key>
            <summary>Error with tokenizer for JOINs (comments include proposed solutions)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="caponica">Christian Seaman</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Dec 2009 06:09:14 +0000</created>
                <updated>Tue, 2 Mar 2010 10:30:52 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 10:30:52 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11314" author="caponica" created="Mon, 4 Jan 2010 23:50:07 +0000"  >&lt;p&gt;As reported here:&lt;br/&gt;
&lt;a href=&quot;http://forum.symfony-project.org/index.php/t/24441/&quot; class=&quot;external-link&quot;&gt;http://forum.symfony-project.org/index.php/t/24441/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It seems that the problem is with the doctrine:build-all-reload in symfony and not anything deeper.&lt;/p&gt;

&lt;p&gt;As such, I think it would make sense to disactivate that task in symfony (rather than marking it as deprecated) since it is broken and a note in it directing people to use the new tasks would be far more useful.&lt;/p&gt;


&lt;p&gt;C&lt;/p&gt;</comment>
                    <comment id="11315" author="caponica" created="Mon, 4 Jan 2010 23:51:02 +0000"  >&lt;p&gt;As noted above, this is not a Critical error with Doctrine, but rather a problem with a symfony task.&lt;/p&gt;</comment>
                    <comment id="11395" author="caponica" created="Sun, 17 Jan 2010 01:38:47 +0000"  >&lt;p&gt;On further inspection, this is not an error with the symfony task, but a problem with the Tokenizer class, in particular where Doctrine_Query_From::parse() calls Doctrine_Query_Tokenizer::bracketExplode() with the delimiter set to &apos;JOIN&apos;.&lt;/p&gt;</comment>
                    <comment id="11396" author="caponica" created="Sun, 17 Jan 2010 02:05:19 +0000"  >&lt;p&gt;OK... I think I have found and solved this one but a more experienced member of the Doctrine team should review what I propose before adding it to the codebase.&lt;/p&gt;

&lt;p&gt;The problem occurs because Doctrine_Query_Tokenizer::getSplitRegExpFromArray() is being passed a string with no word boundaries (the parameter being passed to it by Doctrine_Query_From::parse() is &quot;JOIN&quot;). getSplitRegExpFromArray() then treats this string as a case insensitive regex so if any of your class or field names contain this string they are treated as a split.&lt;/p&gt;

&lt;p&gt;E.g. &quot;JoinFooBar JOIN BanjoIndia&quot; would be split into array (&quot;&quot;, &quot;FooBar&quot;, &quot;Ban&quot;, &quot;dia&quot;).&lt;/p&gt;

&lt;p&gt;This is clearly wrong and would mean that no table or fieldnames could contain the letters j-o-i-n in that order.&lt;/p&gt;

&lt;p&gt;The proposed solution is as follows:&lt;/p&gt;

&lt;p&gt;Current version of Doctrine_Query_Tokenizer::getSplitRegExpFromArray() (Doctrine 1.2, as of r7034):&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; 
    private function getSplitRegExpFromArray(array $d){
        $d = array_map(&apos;preg_quote&apos;, $d);

        if (in_array(&apos; &apos;, $d)) {
            $d[] = &apos;\s&apos;;
        }

        return &apos;#(&apos; . implode(&apos;|&apos;, $d) . &apos;)#&apos;;
    }

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

&lt;p&gt;Proposed modification checks each delimiter given. If that delimiter consists only of \w characters (i.e. &lt;span class=&quot;error&quot;&gt;&amp;#91;0-9a-zA-Z_&amp;#93;&lt;/span&gt;) then a word boundary is required before and after that delimiter if it&apos;s going to be used as a match:&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; 
    private function getSplitRegExpFromArray(array $d){
        foreach ($d as $key =&amp;gt; $string) {
            $escapedString = preg_quote($string);
            if (preg_match(&apos;#^\w+$#&apos;, $string)) $escapedString = &quot;\W$escapedString\W&quot;;
            $d[$key] = $escapedString;
        }

        if (in_array(&apos; &apos;, $d)) {
            $d[] = &apos;\s&apos;;
        }

        return &apos;#(&apos; . implode(&apos;|&apos;, $d) . &apos;)#&apos;;
    }

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

&lt;p&gt;Now, this seems to work for me in brief testing for my own purposes. However, the test cases in TokenizerTestCase.php (particularly testBracketExplode()) are far from exhaustive so I&apos;m not sure if this proposed solution would suit all cases. E.g. do you ever need the delimiter to match at the very beginning or end of a string? At the moment it would not match but you could deal with this by using this instead:&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; if (preg_match(&apos;#^\w+$#&apos;, $string)) $escapedString = &quot;(^|\W)$escapedString($|\W)&quot;;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;An alternative solution, but far less robust, would be just to modify Doctrine_Query_From::parse() from&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 parse($str, $return = false)
    {
        $str = trim($str);
        $parts = $this-&amp;gt;_tokenizer-&amp;gt;bracketExplode($str, &apos;JOIN&apos;);

        $from = $return ? array() : null;
...

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

&lt;p&gt;to this, with spaces around the JOIN string passed to bracketExplode():&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 parse($str, $return = false)
    {
        $str = trim($str);
        $parts = $this-&amp;gt;_tokenizer-&amp;gt;bracketExplode($str, &apos; JOIN &apos;);

        $from = $return ? array() : null;
...

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

&lt;p&gt;This is probably going to run marginally faster, but it leaves the risk that some change in future will bring up the same problem again, so the former (fixed regexp) solution would seem to be better for stability.&lt;/p&gt;

&lt;p&gt;I hope you can pick this up, review it and implement the most suitable change (and update the test cases too) - at the moment this is a big bug since any schema which defines table or fieldnames that contain the consecutive letters j-o-i-n will break.&lt;/p&gt;


&lt;p&gt;C&lt;/p&gt;</comment>
                    <comment id="11423" author="gruzilla" created="Mon, 18 Jan 2010 23:17:35 +0000"  >&lt;p&gt;I found the same bug.&lt;/p&gt;

&lt;p&gt;The error i got was &quot;Couldn&apos;t find class ed&quot;. at first i wondered where i used &quot;ed&quot; but i did nowhere. the code i used was:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$from = &apos;Media&apos;;
$alias = &apos;Content&apos;;

$qry = Doctrine_Query::create();
$qry-&amp;gt;from(&lt;span class=&quot;code-quote&quot;&gt;&quot;$from orig&quot;&lt;/span&gt;);
$qry-&amp;gt;leftJoin(&lt;span class=&quot;code-quote&quot;&gt;&quot;orig.$alias joined&quot;&lt;/span&gt;); &lt;span class=&quot;code-comment&quot;&gt;// here the error occoures using &lt;span class=&quot;code-quote&quot;&gt;&quot;joined&quot;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I located the Bug in Doctrine_Query_From using $this-&amp;gt;_tokenizer-&amp;gt;bracketExplode for checking the right arm of the join so i only can confirm this bug.&lt;/p&gt;</comment>
                    <comment id="11426" author="caponica" created="Tue, 19 Jan 2010 12:44:02 +0000"  >&lt;p&gt;Matthias,&lt;/p&gt;

&lt;p&gt;feel free to use the fix detailed above. I have been using this in my local copy of Doctrine and it seems to work well so far.&lt;/p&gt;

&lt;p&gt;We just need a member of Doctrine&apos;s dev team to decide which of the fixes above makes most sense and then to update the code for the next Doctrine release.&lt;/p&gt;

&lt;p&gt;The fix I am using at the moment is the first one:&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;          if (preg_match(&apos;#^\w+$#&apos;, $string)) $escapedString = &quot;\W$escapedString\W&quot;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11891" author="jwage" created="Mon, 1 Mar 2010 15:50:30 +0000"  >&lt;p&gt;Hi, before I can test your proposed solution. I need to see a patch with your changes. I can&apos;t very easily and reliably copy and paste your changes from the comments.&lt;/p&gt;</comment>
                    <comment id="11944" author="caponica" created="Tue, 2 Mar 2010 08:14:33 +0000"  >&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;Thanks for looking into this.&lt;/p&gt;

&lt;p&gt;I will generate a patch and attach it to this ticket for your review.&lt;/p&gt;

&lt;p&gt;Feel free to rip it apart and change the test cases or regex used.&lt;/p&gt;

&lt;p&gt;C&lt;/p&gt;</comment>
                    <comment id="11945" author="caponica" created="Tue, 2 Mar 2010 08:15:15 +0000"  >&lt;p&gt;Patch with suggested fix for the tokenizer and basic test case.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10407" name="jira-ticket-dc366.patch" size="1605" author="caponica" created="Tue, 2 Mar 2010 08:15:15 +0000" />
                    <attachment id="10238" name="schema.yml" size="734" author="caponica" created="Fri, 18 Dec 2009 06:09:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-337] Doctrine needs support for union all</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-337</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The following query cannot be retrieved as objects. The following will work with -&amp;gt;fetchAll(). However, the result set will return as an array. I need this to be as an object.&lt;/p&gt;

&lt;p&gt;return Doctrine_Manager::getInstance()&lt;del&gt;&amp;gt;getCurrentConnection()&lt;/del&gt;&amp;gt;fetchAll(&quot;&lt;/p&gt;

&lt;p&gt;SELECT &lt;/p&gt;

&lt;p&gt;v1.*&lt;/p&gt;

&lt;p&gt;      FROM (&lt;br/&gt;
          SELECT &lt;br/&gt;
            &apos;song_comment&apos; as user_action, &lt;br/&gt;
            null as artist_id, user_id, song_id, null as video_id, null as event_id, null as ip_address, null as is_going,&lt;br/&gt;
            comment, created_at&lt;br/&gt;
            FROM tbl_user_song_comment&lt;br/&gt;
          UNION ALL&lt;br/&gt;
          SELECT &lt;br/&gt;
            &apos;videocomment&apos; as user_action, &lt;br/&gt;
            null as artist_id, user_id, null as song_id, video_id, null as event_id, null as ip_address, null as is_going,&lt;br/&gt;
            comment, created_at &lt;br/&gt;
            FROM tbl_user_video_comment&lt;br/&gt;
          UNION ALL&lt;br/&gt;
          SELECT &lt;br/&gt;
            &apos;event_comment&apos; as user_action, &lt;br/&gt;
            null as artist_id, user_id, null as song_id, null as video_id, event_id, null as ip_address, null as is_going,&lt;br/&gt;
            comment, created_at &lt;br/&gt;
            FROM tbl_user_event_comment&lt;br/&gt;
        ) AS v1&lt;/p&gt;

&lt;p&gt;        ORDER BY created_at DESC&lt;/p&gt;

&lt;p&gt;&quot;);&lt;/p&gt;

&lt;p&gt;In summary, what I am trying to do is select all comments from tbl_user_song_comment, tbl_user_video_comment and tbl_user_event_comment and order by date (created_at).&lt;/p&gt;

&lt;p&gt;The following ticket at &lt;a href=&quot;http://trac.doctrine-project.org/ticket/18&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/18&lt;/a&gt; should have been implemented! &lt;br/&gt;
There is no way in Doctrine to -&amp;gt;select() a view. In this case &apos;v1&apos;, since -&amp;gt;from() only expects a class!&lt;/p&gt;</description>
                <environment>Mac Snow Leopard, Win XP&lt;br/&gt;
PHP, MySql</environment>
            <key id="10581">DC-337</key>
            <summary>Doctrine needs support for union all</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="krz">Chris F</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Dec 2009 07:48:04 +0000</created>
                <updated>Wed, 3 Mar 2010 12:56:32 +0000</updated>
                    <resolved>Wed, 3 Mar 2010 12:56:32 +0000</resolved>
                            <version>1.2.1</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12010" author="guilhermeblanco" created="Wed, 3 Mar 2010 12:56:32 +0000"  >&lt;p&gt;Branch 1.2 is our last branch in 1.X series and we do not expect to have any other enhancements so far.&lt;br/&gt;
Marking this as won&apos;t fix, since we&apos;re not planning new middle point releases for 1.X series.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-333] Doctrine_Migration_Diff reuses the same temporary folder on consecutive runs, resulting in collisions between projects</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-333</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;svn co &lt;a href=&quot;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&quot; class=&quot;external-link&quot;&gt;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&lt;/a&gt; cmstest13&lt;br/&gt;
cd cmstest13&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;edited config/doctrine/schema.yml and added a trivial table so there would be something at the app level&amp;#93;&lt;/span&gt;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;successful doctrine:build --all followed&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;./symfony doctrine:generate-migrations-diff&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  generating migration diff&lt;br/&gt;
&amp;gt;&amp;gt; file+     /private/var/folders/3H/3Hu3TTyjFt...TI/&lt;del&gt;Tmp&lt;/del&gt;/doctrine_schema_15549.yml&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;EventUser&apos; not found in /private/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/&lt;del&gt;Tmp&lt;/del&gt;/fromprfx_doctrine_tmp_dirs/base/BaseEventGuest.class.php on line 7&lt;/p&gt;

&lt;p&gt;I recognize my personal temp folder from my environment in there:&lt;/p&gt;

&lt;p&gt;TMPDIR=/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/&lt;del&gt;Tmp&lt;/del&gt;/&lt;/p&gt;

&lt;p&gt;So presumably these tasks are supposed to clean it up after they use it. But none of my attempts to use this task so far have succeeded, so I suspect the problem is that the folder does not get cleaned up in the event of an error. This folder needs to get cleaned up on all errors, or perhaps cleared at the start of a new run (that is probably going to turn out to be a more reliable fix).&lt;/p&gt;

&lt;p&gt;I&apos;ll manually clear it and move on to the bug I was originally looking to reproduce.&lt;/p&gt;</description>
                <environment>Symfony 1.3 with MacPorts PHP 5.3.1</environment>
            <key id="10576">DC-333</key>
            <summary>Doctrine_Migration_Diff reuses the same temporary folder on consecutive runs, resulting in collisions between projects</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Dec 2009 18:35:53 +0000</created>
                <updated>Mon, 7 Dec 2009 21:29:50 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 21:29:50 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11054" author="jwage" created="Mon, 7 Dec 2009 19:37:53 +0000"  >&lt;p&gt;Hmm. When I look at Doctrine_Migration_Diff we implement a _cleanup() method that is for that purpose. Does it not clean up the directory properly?&lt;/p&gt;</comment>
                    <comment id="11058" author="boutell" created="Mon, 7 Dec 2009 19:51:11 +0000"  >&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Peeks at source&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Looks like you do it last. If an exception is thrown it doesn&apos;t happen (I just verified that I have a full folder of classes left behind after an attempt to use it). Then you have a lingering problem confounding your attempts to try again. &lt;/p&gt;

&lt;p&gt;Suggest you call _cleanup() at the start and the end. The first call won&apos;t take much time at all if the last run was a happy one. If it was an unhappy one you really need it.&lt;/p&gt;

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


&lt;p&gt;A much more minor issue:&lt;/p&gt;

&lt;p&gt;I&apos;m a little nervous about the fact that if I were running two schema diffs for two different projects at once, they would still collide, sharing the same tmp folder. I would suggest starting everything from TMP/doctrine-$pid where $pid = getpid() or something like that.&lt;/p&gt;

&lt;p&gt;In pkToolkit we use SF_ROOT_DIR/data/pk_writable/tmp because that is safely project-specific. &lt;/p&gt;</comment>
                    <comment id="11060" author="jwage" created="Mon, 7 Dec 2009 19:58:10 +0000"  >&lt;p&gt;Tom, as you have an environment setup with the problem exposed, could you prepare a patch that fixes the problems you are encountering?&lt;/p&gt;</comment>
                    <comment id="11068" author="jwage" created="Mon, 7 Dec 2009 21:18:48 +0000"  >&lt;p&gt;So I just want to confirm. We have two issues now. The _cleanup() method needs to be called when it starts. This patch should take care of that:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Index: lib/Doctrine/Migration/Diff.php
===================================================================
--- lib/Doctrine/Migration/Diff.php	(revision 6882)
+++ lib/Doctrine/Migration/Diff.php	(working copy)
@@ -93,6 +93,8 @@
      */
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function generateChanges()
     {
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_cleanup();
+
         $from = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(self::$_fromPrefix, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_from);
         $to = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(self::$_toPrefix, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_to);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we have another issue where the paths could conflict. Can we open another ticket to work on that issue? Can you confirm that the above patch fixes this individual issue?&lt;/p&gt;</comment>
                    <comment id="11069" author="boutell" created="Mon, 7 Dec 2009 21:24:53 +0000"  >&lt;p&gt;Yes that is the correct patch, I just prepared the exact same patch and went back to my email to find the ticket and saw your comment.&lt;/p&gt;

&lt;p&gt;I will open a separate ticket re: the potential clash between projects. It&apos;s certainly less probable but it doesn&apos;t make sense for them to contend for a single folder.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="11071" author="jwage" created="Mon, 7 Dec 2009 21:27:28 +0000"  >&lt;p&gt;Cool. Yes I think we can fix the other issue but in another revision/ticket. I will go ahead and commit that patch and close this ticket.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-316] Model classes aren&apos;t loaded anymore when migrating to 1.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-316</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When migrating from doctrine 1.1.0 to 1.2 it fails to load the model classes anymore. It complains it cannot find the model class &apos;Building&apos; when doing a Doctrine::getTable(&apos;Building&apos;)-&amp;gt;findAll(). See attached backtrace. After hours of digging in the code and countless debug statements I found out that the automatic loading of the model classes is removed (for some good reason?) from the doctrine autoloader(). This will off course give exceptions for people depending on this mechanism! &lt;/p&gt;

&lt;p&gt;It seems that the solution is to add another spl_autoload_register(array(&apos;Doctrine&apos;,&apos;modelsAutoload&apos;)); to the bootstrapper (apart from the normal spl_autoload_register(array(&apos;Doctrine&apos;,&apos;autoload&apos;));&lt;/p&gt;

&lt;p&gt;But the strangest thing is: I could not find any information about this, although this is (I would say) VERY critical information for people depending on auto model class loading and would like to keep it working! So I would suggest to put this critical information into the (&apos;migration&apos; or &apos;what is new&apos;) documentation of 1.2 because I could not find it. Yes, there is something about PEAR like model loading, but that is not what I want, I would like to keep my app still working after migrating to 1.2.&lt;/p&gt;</description>
                <environment>Mac os, leopard 10.5. I use conservative model loading and autoload table classes.</environment>
            <key id="10551">DC-316</key>
            <summary>Model classes aren&apos;t loaded anymore when migrating to 1.2</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aiso">aiso haikens</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 10:46:08 +0000</created>
                <updated>Wed, 30 Dec 2009 08:03:47 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 19:18:36 +0000</resolved>
                            <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11051" author="jwage" created="Mon, 7 Dec 2009 19:18:36 +0000"  >&lt;p&gt;I added some information about this to the upgrade file. Thanks for reporting it and sorry about the missing information.&lt;/p&gt;</comment>
                    <comment id="11304" author="abeaumont" created="Wed, 30 Dec 2009 08:03:47 +0000"  >&lt;p&gt;I had the same problem, but I was not migrating but trying doctrine for the first time. I suggest you to modify the &quot;Doctrine ORM for PHP&quot; document for 1.2 since it doesn&apos;t talk about this issue and it&apos;s rather frustrating to see how the generate.php doesn&apos;t work at all for no aparent reason (no error, no warning). I also had to dig in the code for some hours, which is not something that should be expected on a first aproach... and may give a bad impression to many newcomers.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10204" name="ff.txt" size="1290" author="aiso" created="Thu, 3 Dec 2009 10:46:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-205] Problem with serial fields on PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-205</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When a new record is inserted into a table with an autoincrement primary key, the function Doctrine_Connection_UnitOfWork::processSingleInsert is called with the record to insert as parameter.&lt;/p&gt;

&lt;p&gt;In Doctrine 1.1.x (&lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.1/lib/Doctrine/Connection/UnitOfWork.php#L590&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.1/lib/Doctrine/Connection/UnitOfWork.php#L590&lt;/a&gt;) this method was the responsible for getting the new ID value from the sequence, and with this value, it MODIFIED THE ARRAY OF FIELD VALUES to be inserted into the table.&lt;/p&gt;

&lt;p&gt;Now this is done at a protected method named _assignSequence (&lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php#L629&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php#L629&lt;/a&gt;) which assigns the identifier to the record, but DOES NOT MODIFY THE ARRAY OF VALUES to be send to the database for the insert so when my db receive a null value for the ID column, generate a new one from the sequence.&lt;/p&gt;

&lt;p&gt;The result is that the record gets an identifier which is different from the one that it really has on the database.&lt;/p&gt;


&lt;p&gt;An example: on a db with a table &apos;foo&apos; with two columns, &apos;id&apos; and &apos;name&apos;, and a sequence called &apos;foo_id_seq&apos; with a value of 6, when I try to insert a record with a named &apos;bar&apos;, the function $this-&amp;gt;conn-&amp;gt;insert($table, $fields); at &lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.1/lib/Doctrine/Connection/UnitOfWork.php#L595&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.1/lib/Doctrine/Connection/UnitOfWork.php#L595&lt;/a&gt; receive as parameters &apos;foo&apos; and array(&apos;id&apos; =&amp;gt;7, &apos;name&apos; =&amp;gt;&apos;bar&apos;)&lt;/p&gt;

&lt;p&gt;In Doctrine 1.2 the function at &lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php#L630&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php#L630&lt;/a&gt; recevie as parameters &apos;foo&apos; and array(&apos;name&apos; =&amp;gt;&apos;bar&apos;)&lt;/p&gt;

&lt;p&gt;(Sorry for my poor English)&lt;/p&gt;</description>
                <environment>PHP 5.2.3&lt;br/&gt;
PostgreSQL 8.1</environment>
            <key id="10376">DC-205</key>
            <summary>Problem with serial fields on PostgreSQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ajgarlag">Antonio J. Garcia Lagar</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Nov 2009 10:30:17 +0000</created>
                <updated>Tue, 10 Nov 2009 16:18:03 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 16:18:03 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10561" author="ajgarlag" created="Tue, 10 Nov 2009 10:54:19 +0000"  >&lt;p&gt;This error is a consecuence of the changeset 6635 (&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6635/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6635/branches/1.2/lib/Doctrine/Connection/UnitOfWork.php&lt;/a&gt;)&lt;/p&gt;</comment>
                    <comment id="10565" author="jwage" created="Tue, 10 Nov 2009 16:18:03 +0000"  >&lt;p&gt;Thanks for the ticket. I committed a fix that will be in BETA2. Could you test and confirm that it fixes the issue?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-189] When applying changes to n:n relations that contain partially same data DELET is not fired</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-189</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When changing n:n relations in a way that the new dataset contains relations that were present in the previous state (as in adding a relation to existing ones) DELETE is not fired before insert is done. In the example below I simply reapply an existing relation. This is done by Record::synchronizeWithArray().&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;Doctrine_Connection_Mysql_Exception: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;4-14&apos; for key &apos;PRIMARY&apos;&lt;/p&gt;

&lt;p&gt;SQL Query pre r6611:&lt;br/&gt;
		    6 Query	START TRANSACTION&lt;br/&gt;
		    6 Query	UPDATE `structure` SET `user_create_id` = NULL, `user_modify_id` = NULL, `updated_at` = &apos;2009-11-04 23:38:02&apos; WHERE `id` = &apos;4&apos;&lt;br/&gt;
		    6 Query	DELETE FROM `structure_category` WHERE (`structure_id` = &apos;4&apos;)&lt;br/&gt;
		    6 Query	INSERT INTO `structure_category` (`category_id`, `structure_id`) VALUES (&apos;5&apos;, &apos;4&apos;)&lt;br/&gt;
		    6 Query	COMMIT&lt;/p&gt;

&lt;p&gt;SQL QUERY with r6611:&lt;br/&gt;
		    5 Query	START TRANSACTION&lt;br/&gt;
		    5 Query	UPDATE `structure` SET `user_create_id` = NULL, `user_modify_id` = NULL, `updated_at` = &apos;2009-11-04 23:36:33&apos; WHERE `id` = &apos;4&apos;&lt;br/&gt;
		    5 Query	INSERT INTO `structure_category` (`category_id`, `structure_id`) VALUES (&apos;5&apos;, &apos;4&apos;)&lt;br/&gt;
		    5 Query	ROLLBACK&lt;/p&gt;</description>
                <environment>Error introduced in revision 6611</environment>
            <key id="10341">DC-189</key>
            <summary>When applying changes to n:n relations that contain partially same data DELET is not fired</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="squashee">Jaanus Heeringson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 22:42:07 +0000</created>
                <updated>Tue, 17 Nov 2009 21:20:26 +0000</updated>
                    <resolved>Tue, 17 Nov 2009 21:20:26 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10503" author="squashee" created="Wed, 4 Nov 2009 22:46:11 +0000"  >&lt;p&gt;Added 1.2.0-BETA2&lt;/p&gt;</comment>
                    <comment id="10676" author="jwage" created="Mon, 16 Nov 2009 18:30:44 +0000"  >&lt;p&gt;Can you show the code you&apos;re using? a test case of some sort. It is really hard to fix the problem with so little information &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10692" author="squashee" created="Mon, 16 Nov 2009 22:54:52 +0000"  >&lt;p&gt;&lt;b&gt;This is quite a complex project so I&apos;ll try as best as I can.&lt;/b&gt;&lt;br/&gt;
What is happening here is that I&apos;m adding another category (id:28) to the object (in this case an entry) that allready has one existing category (id: 10). The primary Id&apos;s are named - id!&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;The Code&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 setJsonData($query,$data){
		$_query=$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;primaryQuery($query,self::RELATIONS_FULL); &lt;span class=&quot;code-comment&quot;&gt;//generates DQL query - not relevant
&lt;/span&gt;		$_record=$_query-&amp;gt;getOne(array(),2); &lt;span class=&quot;code-comment&quot;&gt;//Fetches the existing record from DQL query
&lt;/span&gt;		$data=$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;fromJsonData($data,$query); &lt;span class=&quot;code-comment&quot;&gt;//Cleans up the recieved JSON data and returns an array
&lt;/span&gt;		ss_error::log($data,&apos;In data&apos;); &lt;span class=&quot;code-comment&quot;&gt;//Data output 1 - incoming data
&lt;/span&gt;		ss_error::log($_record-&amp;gt;toArray(),&apos;Existing data&apos;); &lt;span class=&quot;code-comment&quot;&gt;//Data output 2 - record contents
&lt;/span&gt;		$_record-&amp;gt;synchronizeWithArray($data,&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);&lt;span class=&quot;code-comment&quot;&gt;//Synchronize
&lt;/span&gt;		ss_error::log($_record-&amp;gt;toArray(),&apos;Merged data&apos;); &lt;span class=&quot;code-comment&quot;&gt;//Data output 3 - resulting datac
&lt;/span&gt;		$_record-&amp;gt;save(); &lt;span class=&quot;code-comment&quot;&gt;//#ERROR#
&lt;/span&gt;		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $_record-&amp;gt;toArray(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
	}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Data output 1 - incoming, cleaned up data&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array (
  &apos;id&apos; =&amp;gt; &apos;5&apos;,
  &apos;active&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  &apos;timedpub&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  &apos;slug&apos; =&amp;gt; &apos;how_we_work&apos;,
  &apos;date_pub&apos; =&amp;gt; NULL,
  &apos;date_rej&apos; =&amp;gt; NULL,
  &apos;UserCreate&apos; =&amp;gt; NULL,
  &apos;UserModify&apos; =&amp;gt; NULL,
  &apos;Category&apos; =&amp;gt; 
  array (
    0 =&amp;gt; &apos;10&apos;,
    1 =&amp;gt; &apos;28&apos;,
  ),
  &apos;User&apos; =&amp;gt; 
  array (
  ),
  &apos;Translation&apos; =&amp;gt; 
  array (
    &apos;en&apos; =&amp;gt; 
    array (
      &apos;headline&apos; =&amp;gt; &apos;How we work&apos;,
      &apos;name&apos; =&amp;gt; &apos;how we work&apos;,
      &apos;teaser&apos; =&amp;gt; NULL,
      &apos;text&apos; =&amp;gt; &apos;...&apos;,
      &apos;lang&apos; =&amp;gt; &apos;en&apos;,
      &apos;id&apos; =&amp;gt; &apos;5&apos;,
    ),
    &apos;sv&apos; =&amp;gt; 
    array (
      &apos;headline&apos; =&amp;gt; &apos;S&#229; arbetar vi&apos;,
      &apos;name&apos; =&amp;gt; &apos;S&#229; arbetar vi&apos;,
      &apos;teaser&apos; =&amp;gt; &apos;&amp;lt;br /&amp;gt;&apos;,
      &apos;text&apos; =&amp;gt; &apos;...&apos;,
      &apos;lang&apos; =&amp;gt; &apos;sv&apos;,
      &apos;id&apos; =&amp;gt; &apos;5&apos;,
    ),
  ),
  &apos;user_create_id&apos; =&amp;gt; NULL,
  &apos;user_modify_id&apos; =&amp;gt; NULL,
)
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Data output 2 - record contents&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array (
  &apos;id&apos; =&amp;gt; &apos;5&apos;,
  &apos;active&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  &apos;timedpub&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  &apos;slug&apos; =&amp;gt; &apos;how_we_work&apos;,
  &apos;date_pub&apos; =&amp;gt; NULL,
  &apos;date_rej&apos; =&amp;gt; NULL,
  &apos;user_create_id&apos; =&amp;gt; NULL,
  &apos;user_modify_id&apos; =&amp;gt; NULL,
  &apos;created_at&apos; =&amp;gt; &apos;2009-11-12 01:41:36&apos;,
  &apos;updated_at&apos; =&amp;gt; &apos;2009-11-12 01:41:36&apos;,
  &apos;Category&apos; =&amp;gt; 
  array (
    0 =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;10&apos;,
      &apos;slug&apos; =&amp;gt; &apos;arbetsmetod&apos;,
      &apos;path&apos; =&amp;gt; &apos;/om_hamilton/arbetsmetod&apos;,
      &apos;parent_id&apos; =&amp;gt; NULL,
      &apos;owner_id&apos; =&amp;gt; &apos;8&apos;,
      &apos;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
      &apos;created_at&apos; =&amp;gt; &apos;2009-11-12 01:41:38&apos;,
      &apos;updated_at&apos; =&amp;gt; &apos;2009-11-12 01:41:38&apos;,
      &apos;Translation&apos; =&amp;gt; 
      array (
        &apos;sv&apos; =&amp;gt; 
        array (
          &apos;id&apos; =&amp;gt; &apos;10&apos;,
          &apos;name&apos; =&amp;gt; &apos;arbetsmetod&apos;,
          &apos;headline&apos; =&amp;gt; &apos;V&#229;r arbetsmetod&apos;,
          &apos;lang&apos; =&amp;gt; &apos;sv&apos;,
        ),
      ),
    ),
  ),
  &apos;User&apos; =&amp;gt; 
  array (
  ),
  &apos;Translation&apos; =&amp;gt; 
  array (
    &apos;en&apos; =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;5&apos;,
      &apos;headline&apos; =&amp;gt; &apos;How we work&apos;,
      &apos;name&apos; =&amp;gt; &apos;how we work&apos;,
      &apos;teaser&apos; =&amp;gt; NULL,
      &apos;text&apos; =&amp;gt; &apos;...&apos;,
      &apos;lang&apos; =&amp;gt; &apos;en&apos;,
    ),
    &apos;sv&apos; =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;5&apos;,
      &apos;headline&apos; =&amp;gt; &apos;S&#229; arbetar vi&apos;,
      &apos;name&apos; =&amp;gt; &apos;S&#229; arbetar vi&apos;,
      &apos;teaser&apos; =&amp;gt; &apos;&amp;lt;br /&amp;gt;&apos;,
      &apos;text&apos; =&amp;gt; &apos;...&apos;,
      &apos;lang&apos; =&amp;gt; &apos;sv&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Data output 3 - result after Synchronize&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;array (
  &apos;id&apos; =&amp;gt; &apos;5&apos;,
  &apos;active&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  &apos;timedpub&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
  &apos;slug&apos; =&amp;gt; &apos;how_we_work&apos;,
  &apos;date_pub&apos; =&amp;gt; NULL,
  &apos;date_rej&apos; =&amp;gt; NULL,
  &apos;user_create_id&apos; =&amp;gt; NULL,
  &apos;user_modify_id&apos; =&amp;gt; NULL,
  &apos;created_at&apos; =&amp;gt; &apos;2009-11-12 01:41:36&apos;,
  &apos;updated_at&apos; =&amp;gt; &apos;2009-11-12 01:41:36&apos;,
  &apos;Category&apos; =&amp;gt; 
  array (
    0 =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;10&apos;,
      &apos;slug&apos; =&amp;gt; &apos;arbetsmetod&apos;,
      &apos;path&apos; =&amp;gt; &apos;/om_hamilton/arbetsmetod&apos;,
      &apos;parent_id&apos; =&amp;gt; NULL,
      &apos;owner_id&apos; =&amp;gt; &apos;8&apos;,
      &apos;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
      &apos;created_at&apos; =&amp;gt; &apos;2009-11-12 01:41:38&apos;,
      &apos;updated_at&apos; =&amp;gt; &apos;2009-11-12 01:41:38&apos;,
      &apos;Translation&apos; =&amp;gt; 
      array (
        &apos;sv&apos; =&amp;gt; 
        array (
          &apos;id&apos; =&amp;gt; &apos;10&apos;,
          &apos;name&apos; =&amp;gt; &apos;arbetsmetod&apos;,
          &apos;headline&apos; =&amp;gt; &apos;V&#229;r arbetsmetod&apos;,
          &apos;lang&apos; =&amp;gt; &apos;sv&apos;,
        ),
      ),
    ),
    1 =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;28&apos;,
      &apos;slug&apos; =&amp;gt; &apos;att_arbeta_hos_oss&apos;,
      &apos;path&apos; =&amp;gt; &apos;/karriar/arbeta_hos_oss&apos;,
      &apos;parent_id&apos; =&amp;gt; NULL,
      &apos;owner_id&apos; =&amp;gt; &apos;21&apos;,
      &apos;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
      &apos;created_at&apos; =&amp;gt; &apos;2009-11-12 01:41:39&apos;,
      &apos;updated_at&apos; =&amp;gt; &apos;2009-11-12 01:41:39&apos;,
    ),
  ),
  &apos;User&apos; =&amp;gt; 
  array (
  ),
  &apos;Translation&apos; =&amp;gt; 
  array (
    &apos;en&apos; =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;5&apos;,
      &apos;headline&apos; =&amp;gt; &apos;How we work&apos;,
      &apos;name&apos; =&amp;gt; &apos;how we work&apos;,
      &apos;teaser&apos; =&amp;gt; NULL,
      &apos;text&apos; =&amp;gt; &apos;...&apos;,
      &apos;lang&apos; =&amp;gt; &apos;en&apos;,
    ),
    &apos;sv&apos; =&amp;gt; 
    array (
      &apos;id&apos; =&amp;gt; &apos;5&apos;,
      &apos;headline&apos; =&amp;gt; &apos;S&#229; arbetar vi&apos;,
      &apos;name&apos; =&amp;gt; &apos;S&#229; arbetar vi&apos;,
      &apos;teaser&apos; =&amp;gt; &apos;&amp;lt;br /&amp;gt;&apos;,
      &apos;text&apos; =&amp;gt; &apos;...&apos;,
      &apos;lang&apos; =&amp;gt; &apos;sv&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;The error&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&apos;SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &apos;5-10&apos; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; key &apos;PRIMARY&apos;&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10693" author="jwage" created="Mon, 16 Nov 2009 23:10:08 +0000"  >&lt;p&gt;Is it possible for you to make an actual test case? That way I can just execute it and troubleshoot the problem very fast.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-146] GenerateMigrationsDiff task does not use new order of changeColumn()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-146</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The GenerateMigrationsDiff task generates migrations which still use the old ordering of parameters of changeColumn().&lt;/p&gt;

&lt;p&gt;This is how it gets generated:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;changeColumn(&apos;my_table&apos;, &apos;my_column&apos;, &apos;25&apos;, &apos;timestamp&apos;, array(&lt;br/&gt;
             &apos;notnull&apos; =&amp;gt; &apos;1&apos;,&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;Why it should be like this&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;changeColumn(&apos;my_table&apos;, &apos;my_column&apos;, &apos;timestamp&apos;, &apos;25&apos;, array(&lt;br/&gt;
             &apos;notnull&apos; =&amp;gt; &apos;1&apos;,&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;I also added a patch to fix this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10243">DC-146</key>
            <summary>GenerateMigrationsDiff task does not use new order of changeColumn()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="denderello">Dennis Benkert</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Oct 2009 16:43:21 +0000</created>
                <updated>Fri, 30 Oct 2009 15:46:36 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 15:46:36 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10101" name="Builder.php.diff" size="640" author="denderello" created="Tue, 27 Oct 2009 16:43:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-145] Invalid parameter number: number of bound variables does not match number of tokens </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-145</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Please see description posted on Doctrine&apos;s group:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/6cc308526e5ab075&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/6cc308526e5ab075&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10240">DC-145</key>
            <summary>Invalid parameter number: number of bound variables does not match number of tokens </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="colnector">Amir W</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Oct 2009 09:34:49 +0000</created>
                <updated>Mon, 16 Nov 2009 18:34:21 +0000</updated>
                    <resolved>Mon, 16 Nov 2009 18:34:21 +0000</resolved>
                            <version>1.0.13</version>
                <version>1.1.4</version>
                                <fixVersion>1.0.14</fixVersion>
                <fixVersion>1.1.6</fixVersion>
                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>8</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="10313" author="jwage" created="Tue, 27 Oct 2009 16:03:31 +0000"  >&lt;p&gt;Possible to give some more information? Code you&apos;re using to produce the error. We need to be able to produce the issue with some code in order to fix it. If you could make a test case that will help us. Otherwise it is very difficult to fix an issue blindly &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; Thanks. Something that also helps is singling out the revision that caused the problem.&lt;/p&gt;</comment>
                    <comment id="10316" author="krues8dr" created="Tue, 27 Oct 2009 19:01:40 +0000"  >&lt;p&gt;I&apos;ve discovered the same issue, with the symfony doctrine plugin Revision 23394.  I just updated to the latest version and a &quot;andWhereNotIn&quot; clause which worked perfectly before is now failing -&lt;/p&gt;

&lt;p&gt;$q-&amp;gt;andWhereNotIn(&apos;hr.providerid&apos;, $ignoreProviderIds);&lt;/p&gt;

&lt;p&gt;where $ignoreProviderIds = array(&apos;51&apos;, &apos;31&apos;);&lt;/p&gt;

&lt;p&gt;The stack trace is making it look like it&apos;s repeating the parameters somehow?  Note the &quot;&apos;51&apos;, &apos;31&apos;, &apos;51&apos;, &apos;31&apos;&quot; line below...&lt;/p&gt;



&lt;ol&gt;
	&lt;li&gt;at ()&lt;br/&gt;
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Connection.php line 1086 ...&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;      1083.         &lt;br/&gt;
      1084.         $name = &apos;Doctrine_Connection_&apos; . $this-&amp;gt;driverName . &apos;_Exception&apos;;&lt;br/&gt;
      1085.&lt;br/&gt;
      1086.         $exc  = new $name($e-&amp;gt;getMessage(), (int) $e-&amp;gt;getCode());&lt;br/&gt;
      1087.         if ( ! isset($e-&amp;gt;errorInfo) || ! is_array($e-&amp;gt;errorInfo)) &lt;/p&gt;
{
      1088.             $e-&amp;gt;errorInfo = array(null, null, null, null);
      1089.         }

&lt;ol&gt;
	&lt;li&gt;at Doctrine_Connection-&amp;gt;rethrowException(object(&apos;PDOException&apos;), object(&apos;Doctrine_Connection_Statement&apos;))&lt;br/&gt;
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Connection/Statement.php line 253 ...&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;       250.         } catch (Doctrine_Adapter_Exception $e) &lt;/p&gt;
{
       251.         }
&lt;p&gt;       252.&lt;br/&gt;
       253.         $this-&amp;gt;_conn-&amp;gt;rethrowException($e, $this);&lt;br/&gt;
       254.&lt;br/&gt;
       255.         return false;&lt;br/&gt;
       256.     }&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;at Doctrine_Connection_Statement-&amp;gt;execute(array(&apos;51&apos;, &apos;31&apos;, &apos;51&apos;, &apos;31&apos;))&lt;br/&gt;
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Connection.php line 1014 ...&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;      1011.         try {&lt;br/&gt;
      1012.             if ( ! empty($params)) &lt;/p&gt;
{
      1013.                 $stmt = $this-&amp;gt;prepare($query);
      1014.                 $stmt-&amp;gt;execute($params);
      1015.
      1016.                 return $stmt;
      1017.             }
&lt;p&gt; else &lt;/p&gt;
{

# at Doctrine_Connection-&amp;gt;execute(&apos;SELECT DISTINCT h6.hotelid, COUNT(h10.hotelid) AS h10__0 FROM hotel h6 LEFT JOIN hotelDetails h7 ON h6.hotelid = h7.hotelid LEFT JOIN hotelProvider h8 ON h6.hotelid = h8.hotelid LEFT JOIN hotelPriceDetails h9 ON h6.hotelid = h9.hotelid LEFT JOIN location l4 ON h6.locationid = l4.locationid LEFT JOIN location l5 ON h6.locationid = l5.locationid LEFT JOIN locationAdmin1Code l6 ON l5.admin1codeid = l6.locationadmin1codeid LEFT JOIN hotelRating h10 ON h6.hotelid = h10.hotelid WHERE h6.hotelrating &amp;gt;= 3.0 AND h6.hotelrating &amp;lt; 5 AND h6.hotellatitude IS NOT NULL AND h6.hotellatitude != 0 AND h6.hotellongitude IS NOT NULL AND h6.hotellongitude != 0 AND h9.hotelavgminprice &amp;lt; 500 AND h6.hotelstars &amp;gt;= 2 AND h6.locationid = 33033 AND h10.providerid NOT IN (?, ?) GROUP BY h6.hotelid HAVING h10__0 &amp;gt; 0 ORDER BY h6.hotelrating desc LIMIT 3&apos;, array(&apos;51&apos;, &apos;31&apos;, &apos;51&apos;, &apos;31&apos;))
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Query.php line 1155 ...

      1152.                     $this-&amp;gt;useQueryCache(false);
      1153.             
      1154.                     // mysql doesn&apos;t support LIMIT in subqueries
      1155.                     $list = $this-&amp;gt;_conn-&amp;gt;execute($subquery, $this-&amp;gt;getParams($params))-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);
      1156.                     $subquery = implode(&apos;, &apos;, array_map(array($this-&amp;gt;_conn, &apos;quote&apos;), $list));
      1157.
      1158.                     break;

# at Doctrine_Query-&amp;gt;getSqlQuery(array(&apos;51&apos;, &apos;31&apos;))
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Query/Abstract.php line 977 ...

       974.                     }
&lt;p&gt;       975.                 }&lt;br/&gt;
       976.             } else &lt;/p&gt;
{
       977.                 $query = $this-&amp;gt;getSqlQuery($params);
       978.             }
&lt;p&gt;       979.         } else &lt;/p&gt;
{
       980.             $query = $this-&amp;gt;_view-&amp;gt;getSelectSql();

# at Doctrine_Query_Abstract-&amp;gt;_execute(array(&apos;51&apos;, &apos;31&apos;))
in SF_ROOT_DIR/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Query/Abstract.php line 1036 ...

      1033.                 $result = $this-&amp;gt;_constructQueryFromCache($cached);
      1034.             }
&lt;p&gt;      1035.         } else {&lt;br/&gt;
      1036.             $stmt = $this-&amp;gt;_execute($params);&lt;br/&gt;
      1037.&lt;br/&gt;
      1038.             if (is_integer($stmt)) {&lt;br/&gt;
      1039.                 $result = $stmt;&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;at Doctrine_Query_Abstract-&amp;gt;execute()&lt;br/&gt;
in SF_ROOT_DIR/apps/frontend/modules/common/actions/components.class.php line 1129 ...&lt;/li&gt;
&lt;/ol&gt;
</comment>
                    <comment id="10318" author="krues8dr" created="Tue, 27 Oct 2009 19:25:37 +0000"  >&lt;p&gt;Here&apos;s a diff of the changes that seem to be problematic:&lt;/p&gt;

&lt;p&gt;sfDoctrinePlugin/lib/doctrine/Doctrine/Query.php&lt;/p&gt;

&lt;p&gt;&amp;lt;  *  $Id: Query.php 6564 2009-10-23 18:21:16Z jwage $&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;  *  $Id: Query.php 6407 2009-09-24 21:38:36Z guilhermeblanco $&lt;br/&gt;
329,330d328&lt;br/&gt;
&amp;lt;         } else if ( ! ($this-&amp;gt;_conn-&amp;gt;getAttribute(Doctrine::ATTR_PORTABILITY) &amp;amp; Doctrine::PORTABILITY_EXPR)){&lt;br/&gt;
&amp;lt;             return $dqlAlias;&lt;br/&gt;
1155c1153&lt;br/&gt;
&amp;lt;                     $list = $this-&amp;gt;_conn-&amp;gt;execute($subquery, $this-&amp;gt;getParams($params))-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;                     $list = $this-&amp;gt;_conn-&amp;gt;execute($subquery, $params)-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);&lt;/p&gt;</comment>
                    <comment id="10485" author="ublo" created="Wed, 4 Nov 2009 12:42:12 +0000"  >&lt;p&gt;The problem comes from what Bill Hunt says.&lt;br/&gt;
Tha fact is that parameters ($params) are duplicated by function getParams($params).&lt;/p&gt;</comment>
                    <comment id="10507" author="oncletom" created="Thu, 5 Nov 2009 10:11:41 +0000"  >&lt;p&gt;I also encouter it and it&apos;s really blocking (as exception is thrown, failing page to display).&lt;/p&gt;

&lt;p&gt;The most &quot;funny&quot; things it does not always happen (even though I have it through sfDoctrinePager).&lt;br/&gt;
But clearly, I encountered it on parts of code I have not changed since months.&lt;/p&gt;</comment>
                    <comment id="10508" author="zhekanax" created="Thu, 5 Nov 2009 10:32:46 +0000"  >&lt;p&gt;For me it happens when I&apos;m trying to &apos;limit&apos; the query. Query is complicated and contains joins, &apos;where&apos; conditions, grouping and &apos;havings&apos;.&lt;br/&gt;
And now it fails with duplicating bound params. Right after last subversion update and only when &apos;limiting&apos;.&lt;/p&gt;</comment>
                    <comment id="10509" author="zhekanax" created="Thu, 5 Nov 2009 11:37:00 +0000"  >&lt;p&gt;Oh. Forgot to say - I&apos;m using 1.0 version (which comes with symfony 1.2)&lt;/p&gt;</comment>
                    <comment id="10515" author="krues8dr" created="Thu, 5 Nov 2009 18:19:00 +0000"  >&lt;p&gt;As a temporary fix, I&apos;ve downgraded the file in question on my site until the bug is patched.  This may help some of you:&lt;/p&gt;

&lt;p&gt;svn update -r 6407 symfony/plugins/sfDoctrinePlugin/lib/doctrine/Doctrine/Query.php&lt;/p&gt;

&lt;p&gt;You may need to modify your path to suit your own needs, of course.&lt;/p&gt;</comment>
                    <comment id="10528" author="hucliez" created="Fri, 6 Nov 2009 19:19:24 +0000"  >&lt;p&gt;same problems since I have updated, yesterday (11/05).&lt;br/&gt;
I observe in the stack trace a parameters duplication, with a special effect when parameter value is zero (see  &quot;array(0, )&quot;) :&lt;/p&gt;

&lt;p&gt;at Doctrine_Connection-&amp;gt;execute(&apos;SELECT DISTINCT c3.id FROM contact c3 LEFT JOIN adresse_contact a2 ON c3.id = a2.contact_id LEFT JOIN etablissement e3 ON a2.etablissement_id = e3.id LEFT JOIN centre c4 ON a2.centre_id = c4.id LEFT JOIN email_contact e4 ON c3.id = e4.contact_id WHERE c3.non_valide = ? ORDER BY c3.nom, c3.prenom, c3.id LIMIT 16&apos;, array(0, ))&lt;br/&gt;
in SF_ROOT_DIR\lib\vendor\symfony\lib\plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Query.php line 1155 &lt;/p&gt;

&lt;p&gt;I just add this comment to say - like Eugeniy- I&apos;m using 1.0.13 version (Revision: 6645) wich comes with symfony 1.2.9DEV&lt;/p&gt;</comment>
                    <comment id="10547" author="caffeineinc" created="Mon, 9 Nov 2009 10:04:34 +0000"  >&lt;p&gt;I&apos;ve got the same problem, which seems to only affect the query when a limit is applied. (same reasons as above).&lt;/p&gt;

&lt;p&gt;I&apos;d probably revert the revision, but specifically you can fix it with &lt;/p&gt;

&lt;p&gt;in Query.php  1155 removing $this-&amp;gt;getParams($params) to $params&lt;/p&gt;

&lt;p&gt;$list = $this-&amp;gt;_conn-&amp;gt;execute($subquery, $params)-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);&lt;/p&gt;

&lt;p&gt;and moving         $q = $this-&amp;gt;getCountQuery();&lt;/p&gt;

&lt;p&gt;from 1930 to 1937 after         $params = $this-&amp;gt;_conn-&amp;gt;convertBooleans($params);&lt;/p&gt;
</comment>
                    <comment id="10558" author="zhekanax" created="Tue, 10 Nov 2009 09:44:57 +0000"  >&lt;p&gt;I think it&apos;s critical, isn&apos;t it?&lt;/p&gt;</comment>
                    <comment id="10606" author="zhekanax" created="Thu, 12 Nov 2009 14:21:56 +0000"  >&lt;p&gt;This bug affects sympal too&lt;/p&gt;</comment>
                    <comment id="10664" author="evoilliot" created="Mon, 16 Nov 2009 16:52:25 +0000"  >&lt;p&gt;Some informations to solve the problem : $this-&amp;gt;getParams($params) merge arrays, and values are duplicated &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="10677" author="jwage" created="Mon, 16 Nov 2009 18:34:21 +0000"  >&lt;p&gt;This was already fixed in all versions in SVN. The fix will be in the next scheduled releases.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10162" name="ScreenHunter_01 Nov. 16 17.50.gif" size="34233" author="evoilliot" created="Mon, 16 Nov 2009 16:52:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-134] Parse error in lib/Doctrine/Cache/Xcache.php (missing ;) and delete() should be deleteCache() (patch included)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-134</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Missing ; in saveCache() function and delete method should also be named deleteCache as in other drivers.&lt;br/&gt;
This prevents xcache driver from working as well as compiling Doctrine to single PHP file. Patch included to fix the issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10227">DC-134</key>
            <summary>Parse error in lib/Doctrine/Cache/Xcache.php (missing ;) and delete() should be deleteCache() (patch included)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="reko_t">Reko Tiira</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2009 09:03:30 +0000</created>
                <updated>Fri, 23 Oct 2009 17:10:28 +0000</updated>
                    <resolved>Fri, 23 Oct 2009 17:10:28 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10095" name="Doctrine_Cache_Xcache.patch" size="666" author="reko_t" created="Fri, 23 Oct 2009 09:13:09 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-103] doctrine 1.0 not getting table correctly - huge bug - not usable</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-103</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the method coreSetRelated from Record.php for 1-1 relation the table is not obtained correctly!&lt;/p&gt;


&lt;p&gt;                if ($value !== self::$_null) &lt;/p&gt;
{
                    $relatedTable = $value-&amp;gt;getTable();
                    $foreignFieldName = $relatedTable-&amp;gt;getFieldName($rel-&amp;gt;getForeign());
                }

&lt;p&gt;instead of                     &lt;/p&gt;

&lt;p&gt;$relatedTable = $value-&amp;gt;getTable();&lt;/p&gt;

&lt;p&gt;you should put &lt;/p&gt;

&lt;p&gt;$relatedTable = $rel-&amp;gt;getTable();&lt;/p&gt;

&lt;p&gt;This is a huge bug that can be fixed very easily so please fix is asap!&lt;/p&gt;

&lt;p&gt;I can not deploy my project until this is fixed!&lt;/p&gt;

&lt;p&gt;Thanks a lot!&lt;/p&gt;

&lt;p&gt;I do not know if other versions are affected! I use symfony 1.2.9! Should I make a ticket also for Symfony!&lt;/p&gt;

&lt;p&gt;You do a great job with doctrine! Great project! I really like it&lt;/p&gt;</description>
                <environment>WIN XP</environment>
            <key id="10179">DC-103</key>
            <summary>doctrine 1.0 not getting table correctly - huge bug - not usable</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="domnulnopcea">Nopcea Flavius</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Oct 2009 13:46:42 +0000</created>
                <updated>Fri, 30 Oct 2009 17:35:45 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 17:35:45 +0000</resolved>
                            <version>1.0.12</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10221" author="jwage" created="Tue, 13 Oct 2009 17:49:44 +0000"  >&lt;p&gt;This sounds like a bug in your own code. $value should be an instance of Doctrine_Record and it is not. Make sure you&apos;re code is not passing an array or invalid value through to coreSetRelated(). If you&apos;re using symfony, a common cause of this is that you have an embedded form that has the same name as your relationship. This can cause issues currently.&lt;/p&gt;</comment>
                    <comment id="10222" author="domnulnopcea" created="Wed, 14 Oct 2009 06:09:08 +0000"  >&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;I am using symfony but I have a regular form! Not an embedded one!&lt;/p&gt;

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

&lt;p&gt;            $form-&amp;gt;getObject()-&amp;gt;setAuthorId($authorId);&lt;/p&gt;

&lt;p&gt;and when I do a $form-&amp;gt;save I get an error in that method when dealing with the author!&lt;/p&gt;

&lt;p&gt;If I do a var_dump($value) it will not be an object but a string variable!&lt;/p&gt;

&lt;p&gt;$relatedTable = $value-&amp;gt;getTable();&lt;/p&gt;

&lt;p&gt;I worked with previous versions of symfony/doctrine but once I upgraded to 1.2.9 it doesn&apos;t work anymore!&lt;/p&gt;

&lt;p&gt;To me it seems that in the saving process Doctrine is not getting the correct $value object!&lt;/p&gt;</comment>
                    <comment id="10223" author="domnulnopcea" created="Wed, 14 Oct 2009 06:12:06 +0000"  >&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;I am using symfony but I have a regular form! Not an embedded one!&lt;/p&gt;

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

&lt;p&gt;           $form-&amp;gt;getObject()-&amp;gt;setAuthorId($authorId);&lt;/p&gt;

&lt;p&gt;and when I do a $form-&amp;gt;save I get an error in that method when dealing with the author!&lt;/p&gt;

&lt;p&gt;If I do a var_dump($value) it will not be an object but a string variable!&lt;/p&gt;

&lt;p&gt;$relatedTable = $value-&amp;gt;getTable();&lt;/p&gt;

&lt;p&gt;I worked with previous versions of symfony/doctrine but once I upgraded to 1.2.9 it doesn&apos;t work anymore!&lt;/p&gt;

&lt;p&gt;To me it seems that in the saving process Doctrine is not getting the correct $value object!&lt;/p&gt;</comment>
                    <comment id="10287" author="guu_sama" created="Fri, 23 Oct 2009 14:18:43 +0000"  >&lt;p&gt;Quite same problem here.&lt;/p&gt;

&lt;p&gt;My code worked fine with Symfony 1.2.7, but I have the same fatal error since 1.2.8. If I change $value to $rel, everything works fine.&lt;/p&gt;

&lt;p&gt;I&apos;m using embedded forms with Doctrine and I have another way to solve it :&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;With this, I&apos;ve got the issue :&lt;br/&gt;
$this-&amp;gt;embedForm(&apos;contact_physique&apos;, $contactForm);&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;But no anymore with this :&lt;br/&gt;
$this-&amp;gt;embedForm(&apos;ContactPhysique&apos;, $contactForm);&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;contact_physique is a relationship in my schema.&lt;/p&gt;

&lt;p&gt;I do not know if that &quot;new behavior&quot; comes from Doctrine or Symfony, but it may help with Nopcea Flavius&apos; problem.&lt;/p&gt;

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

<item>
            <title>[DC-93] Calling refreshRelated causes hasOne records to be created in error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-93</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Calling save() on a record, then refreshRelated(), then save() again will cause hasOne rows to be generated in error. I&apos;ve attached a Doctrine sandbox with everything you need to reproduce it. Below is a summary. &lt;/p&gt;

&lt;p&gt;schema.yml&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; 
---
Staff:
  columns:
    username: string(50)
    password: string(255)
    active:
      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;
  indexes:
    user_pass_active_idx:
      fields: [username, password, active]


Tickets:
  columns:
    mask:
      unique: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      type: string(10)
    staff_id: integer(9)
  relations:
    Staff:
      local: staff_id
      foreign: id
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; 
&amp;lt;?php
$ticket = new Tickets();
$ticket-&amp;gt;save();
$ticket-&amp;gt;refreshRelated();
$ticket-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Queries that were run:&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;root@localhost on doctrine11sandbox
START TRANSACTION
INSERT INTO tickets (id, mask, staff_id) VALUES (NULL, NULL, NULL)
COMMIT
START TRANSACTION
*INSERT INTO staff (active) VALUES (&apos;1&apos;)*
&lt;span class=&quot;code-keyword&quot;&gt;UPDATE&lt;/span&gt; tickets SET staff_id = &apos;2&apos; &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; id = &apos;2&apos;
COMMIT
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Linux</environment>
            <key id="10161">DC-93</key>
            <summary>Calling refreshRelated causes hasOne records to be created in error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jmazzi">Justin Mazzi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Oct 2009 19:56:30 +0000</created>
                <updated>Fri, 30 Oct 2009 17:31:23 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 17:31:23 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.0.13</fixVersion>
                <fixVersion>1.1.5</fixVersion>
                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10190" author="jmazzi" created="Thu, 8 Oct 2009 20:14:10 +0000"  >&lt;p&gt;This seems to be enough to trigger it:&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
$ticket = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Tickets();
$ticket-&amp;gt;refreshRelated();
$ticket-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10220" author="jmazzi" created="Tue, 13 Oct 2009 15:27:16 +0000"  >&lt;p&gt;I&apos;ve tracked this down to fetchRelatedFor. This is the function creating the record:&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;LocalKey.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
/*
 *  $Id: LocalKey.php 5798 2009-06-02 15:10:46Z piccoloprincipe $
 *
 * 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.phpdoctrine.org&amp;gt;.
&lt;/span&gt; */

/**
 * Doctrine_Relation_LocalKey
 * This class represents a local key relation
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
 * @subpackage  Relation
 * @author      Konsta Vesterinen &amp;lt;kvesteri@cc.hut.fi&amp;gt;
 * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt; * @link        www.phpdoctrine.org
 * @since       1.0
 * @version     $Revision: 5798 $
 */
class Doctrine_Relation_LocalKey &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Relation
{
    /**
     * fetchRelatedFor
     *
     * fetches a component related to given record
     *
     * @param Doctrine_Record $record
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Record|Doctrine_Collection
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function fetchRelatedFor(Doctrine_Record $record)
    {
        $localFieldName = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;definition[&apos;local&apos;]);
        $id = $record-&amp;gt;get($localFieldName);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_null($id) || ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;definition[&apos;table&apos;]-&amp;gt;getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
            /* HERE */
            $related = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;create();

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10066" name="Doctrine-1.1.4-Sandbox.tar.gz" size="365584" author="jmazzi" created="Thu, 8 Oct 2009 19:56:30 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-92] Doctrine_Import_Pgsql::listTableColumns() creates wrong default values for boolean fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-92</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When importing a db table as a model, we see the following for a boolean field:&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;hasColumn(&apos;is_blocked&apos;, &apos;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&apos;, 1, array(
             &apos;type&apos; =&amp;gt; &apos;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&apos;,
             &apos;length&apos; =&amp;gt; 1,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos; =&amp;gt; &apos;&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&apos;,   &lt;span class=&quot;code-comment&quot;&gt;// &amp;lt;----- &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; field not 0, 1 or a &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;, but a string literal linstead
&lt;/span&gt;             &apos;primary&apos; =&amp;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;Creating an object and immediately saving it results in two validation errors for this field:&lt;/p&gt;

&lt;p&gt;1. The field is not boolean, but string&lt;br/&gt;
2. The field is not length 1, but length 5 (string &quot;false&quot;)&lt;/p&gt;

&lt;p&gt;I applied the following patch to the listTableColumns() function:&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;            elseif (preg_match(&lt;span class=&quot;code-quote&quot;&gt;&quot;/^&apos;(.*)&apos;::character varying$/&quot;&lt;/span&gt;, $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;], $matches)) {
                $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = $matches[1];
            }
+           elseif ($description[&apos;type&apos;] == &apos;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&apos;) {
+               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] === &apos;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&apos;) {
+                   $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
+               } elseif ($description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] === &apos;&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&apos;) {
+                   $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
+               }
+           }

            $columns[$val[&apos;field&apos;]] = $description;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This makes the import work as expected for us.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10160">DC-92</key>
            <summary>Doctrine_Import_Pgsql::listTableColumns() creates wrong default values for boolean fields</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Oct 2009 18:08:21 +0000</created>
                <updated>Tue, 13 Oct 2009 03:39:46 +0000</updated>
                    <resolved>Tue, 13 Oct 2009 03:39:46 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.0.13</fixVersion>
                <fixVersion>1.1.5</fixVersion>
                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-80] Doctrine/Import/Pgsql.php generates wrong default values for varchar fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-80</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We run a postgres database and have generated out base models from the database. In the base models, we see the following issue:&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;hasColumn(&apos;contractor_type&apos;, &apos;string&apos;, 150, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;length&apos; =&amp;gt; &apos;150&apos;,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos; =&amp;gt; &apos;\&apos;enduser\&apos;::character varying&apos;,
             &apos;primary&apos; =&amp;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;So, the default value is showing some PostgreSQL meta information. We fixed this by changing function listTableColumns():&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (preg_match(&lt;span class=&quot;code-quote&quot;&gt;&quot;/^nextval\(&apos;(.*)&apos;(::.*)?\)$/&quot;&lt;/span&gt;, $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;], $matches)) {

                $description[&apos;sequence&apos;] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;formatter-&amp;gt;fixSequenceName($matches[1]);
                $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
            }
+           elseif (preg_match(&lt;span class=&quot;code-quote&quot;&gt;&quot;/^&apos;(.*)&apos;::character varying$/&quot;&lt;/span&gt;, $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;], $matches)) {
+               $description[&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;] = $matches[1];
+           }

            $columns[$val[&apos;field&apos;]] = $description;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu Linux, PostgreSQL 8.3, PHP 5.2.6</environment>
            <key id="10142">DC-80</key>
            <summary>Doctrine/Import/Pgsql.php generates wrong default values for varchar fields</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Oct 2009 06:23:38 +0000</created>
                <updated>Tue, 6 Oct 2009 18:13:42 +0000</updated>
                    <resolved>Tue, 6 Oct 2009 18:13:42 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-73] TestCase framework normally uses identityMap for records created in prepareData() what can cause side effects</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-73</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;All new records are stored in the identityMap during insertion. This default behavior takes place also while executing test cases. &lt;/p&gt;

&lt;p&gt;In other words every record created in the prepareData() method gets to the identityMap.  Afterwards, in a test method, it is silently retrived from identityMap instead of (expected!) quering from sqlite. &lt;/p&gt;

&lt;p&gt;IMHO a testing environment should be as pure as possible and no such side effects are acceptable.&lt;/p&gt;

&lt;p&gt;I&apos;m including a test case and patch for Doctrine_UnitTestCase. After putting the patch, I have found that 2 test cases causes fail: 1449 and 736. In the first test IMHO there is a problem in a content test - I&apos;m including appropriate fix.&lt;br/&gt;
It seems that the second test, in fact, have never been passing. I think that positive result was caused by the side effect of identityMap.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10126">DC-73</key>
            <summary>TestCase framework normally uses identityMap for records created in prepareData() what can cause side effects</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Sep 2009 12:33:08 +0000</created>
                <updated>Fri, 30 Oct 2009 17:17:02 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 17:17:02 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10212" author="jwage" created="Tue, 13 Oct 2009 03:50:26 +0000"  >&lt;p&gt;This breaks the 1.2 test suite. Can you retry your patch?&lt;/p&gt;</comment>
                    <comment id="10258" author="j.debowczyk" created="Tue, 20 Oct 2009 12:56:33 +0000"  >&lt;p&gt;Yes, the patch breaks 2 test cases: 1449 and 736. &lt;br/&gt;
I explained it above in the ticket description.&lt;/p&gt;</comment>
                    <comment id="10259" author="jwage" created="Tue, 20 Oct 2009 14:36:33 +0000"  >&lt;p&gt;Does your patch fix those 2 failing test cases now?&lt;/p&gt;</comment>
                    <comment id="10265" author="j.debowczyk" created="Tue, 20 Oct 2009 15:41:37 +0000"  >&lt;p&gt;Ok, now I&apos;m including a patch that also fixes both test cases and causes all 1.2 tests passes.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10085" name="DC73-full.patch" size="1521" author="j.debowczyk" created="Tue, 20 Oct 2009 15:41:37 +0000" />
                    <attachment id="10083" name="DC73TestCase.php" size="2223" author="j.debowczyk" created="Tue, 20 Oct 2009 12:44:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-573] Invalid SQL generated by Doctrine_Query::getLimitSubquery() when ordering by multiple columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-573</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When attempting to order a query by multiple columns I came across this bug. I&apos;ve attached a reproduction script which will hopefully illustrate the behaviour, but essentially getLimitSubquery() is parsing the order by column incorrectly, leading to an erroneous comma in the sub-select field select clause, e.g&lt;/p&gt;

&lt;p&gt;SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;date&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__date&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;model_id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__model_id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__name&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;model&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt; INNER JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;relation&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt; ON &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;model_id&amp;#93;&lt;/span&gt; WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; FROM (SELECT DISTINCT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;,, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;model&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt; INNER JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;relation&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt; ON &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;model_id&amp;#93;&lt;/span&gt; ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; DESC, &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; DESC) ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;(note &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;,, &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; - that&apos;s the offender).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a patch against 1.2 HEAD that strips any commas from the fields before they are added to the select clause; it works for me but I&apos;m not sure of all the use cases across the relevant drivers.&lt;/p&gt;</description>
                <environment>PHP 5.3&lt;br/&gt;
Windows XP&lt;br/&gt;
MSSQL Server 2008</environment>
            <key id="11057">DC-573</key>
            <summary>Invalid SQL generated by Doctrine_Query::getLimitSubquery() when ordering by multiple columns</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Mar 2010 08:40:22 +0000</created>
                <updated>Mon, 15 Mar 2010 11:36:02 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 11:36:02 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12188" author="jwage" created="Mon, 15 Mar 2010 11:18:27 +0000"  >&lt;p&gt;I don&apos;t see any patch attached to the ticket. If you can provide more information and a diff/patch we can consider it for the next release. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12192" author="craigmarvelley" created="Mon, 15 Mar 2010 11:28:07 +0000"  >&lt;p&gt;Sigh. Sorry, attached the file instead of the patch.&lt;/p&gt;</comment>
                    <comment id="12194" author="jwage" created="Mon, 15 Mar 2010 11:36:02 +0000"  >&lt;p&gt;Thanks for the issue and patch &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="10469" name="doctrine_query_patch.patch" size="704" author="craigmarvelley" created="Mon, 15 Mar 2010 11:28:07 +0000" />
                    <attachment id="10462" name="index.php" size="2235" author="craigmarvelley" created="Mon, 15 Mar 2010 08:40:22 +0000" />
                    <attachment id="10463" name="Query.php" size="83731" author="craigmarvelley" created="Mon, 15 Mar 2010 08:40:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-565] Versionable bugging when used with I18N</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-565</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The solution was to allow Versionable to skip fields.&lt;br/&gt;
I&apos;ve fixed with this changing:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Doctrine/AuditLog.php&lt;/tt&gt;&lt;br/&gt;
#84:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;        $skipFields = (isset($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;skipFields&amp;#39;&amp;#93;&lt;/span&gt;))?$this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;skipFields&amp;#39;&amp;#93;&lt;/span&gt;:array();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;#88:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;//inside the foreach&lt;br/&gt;
            if(in_array($column, $skipFields)) &lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {                continue;            }&lt;/span&gt; &lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;After that the Versionable will accept some parameters.&lt;/p&gt;

&lt;p&gt;ps: If possible, let me know about this changes cause my sources are with this fix.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11042">DC-565</key>
            <summary>Versionable bugging when used with I18N</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sid.gbf">Sid GBF</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Mar 2010 07:45:59 +0000</created>
                <updated>Mon, 15 Mar 2010 16:01:29 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 16:01:29 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10464" name="audit_log.diff" size="1113" author="sid.gbf" created="Mon, 15 Mar 2010 09:25:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-524] Out Of Range in Template Geographical Calculation using Postgresql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-524</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;500 | Internal Server Error | Doctrine_Connection_Pgsql_Exception&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22003&amp;#93;&lt;/span&gt;: Numeric value out of range: 7 ERROR: input is out of range&lt;/p&gt;

&lt;p&gt;DQL:&lt;/p&gt;

&lt;p&gt;at Doctrine_Connection-&amp;gt;execute(&apos;SELECT h.id AS h_&lt;em&gt;id, h.name AS h&lt;/em&gt;&lt;em&gt;name, h.address AS h&lt;/em&gt;&lt;em&gt;address, h.zip AS h&lt;/em&gt;&lt;em&gt;zip, h.url AS h&lt;/em&gt;&lt;em&gt;url, h.photo_url AS h&lt;/em&gt;&lt;em&gt;photo_url, h.checkin_from AS h&lt;/em&gt;&lt;em&gt;checkin_from, h.checkin_to AS h&lt;/em&gt;&lt;em&gt;checkin_to, h.checkout_from AS h&lt;/em&gt;&lt;em&gt;checkout_from, h.checkout_to AS h&lt;/em&gt;&lt;em&gt;checkout_to, h.is_published AS h&lt;/em&gt;&lt;em&gt;is_published, h.class AS h&lt;/em&gt;&lt;em&gt;class, h.currencycode AS h&lt;/em&gt;&lt;em&gt;currencycode, h.minrate AS h&lt;/em&gt;&lt;em&gt;minrate, h.maxrate AS h&lt;/em&gt;&lt;em&gt;maxrate, h.preferred AS h&lt;/em&gt;&lt;em&gt;preferred, h.nr_rooms AS h&lt;/em&gt;&lt;em&gt;nr_rooms, h.bookable_direct AS h&lt;/em&gt;&lt;em&gt;bookable_direct, h.ranking AS h&lt;/em&gt;&lt;em&gt;ranking, h.city_id AS h&lt;/em&gt;&lt;em&gt;city_id, h.policygroup_id AS h&lt;/em&gt;&lt;em&gt;policygroup_id, h.is_closed AS h&lt;/em&gt;&lt;em&gt;is_closed, h.hoteltype_id AS h&lt;/em&gt;&lt;em&gt;hoteltype_id, h.class_is_estimated AS h&lt;/em&gt;&lt;em&gt;class_is_estimated, h.review_nr AS h&lt;/em&gt;&lt;em&gt;review_nr, h.review_score AS h&lt;/em&gt;&lt;em&gt;review_score, h.created_at AS h&lt;/em&gt;&lt;em&gt;created_at, h.updated_at AS h&lt;/em&gt;&lt;em&gt;updated_at, h.latitude AS h&lt;/em&gt;&lt;em&gt;latitude, h.longitude AS h&lt;/em&gt;&lt;em&gt;longitude, ((ACOS(SIN(45.41244780000000000000 * PI() / 180) * SIN(h.latitude * PI() / 180) + COS(45.41244780000000000000 * PI() / 180) * COS(h.latitude * PI() / 180) * COS((6.63685100000000000000 - h.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS h&lt;/em&gt;&lt;em&gt;0, ((ACOS(SIN(45.41244780000000000000 * PI() / 180) * SIN(h.latitude * PI() / 180) + COS(45.41244780000000000000 * PI() / 180) * COS(h.latitude * PI() / 180) * COS((6.63685100000000000000 - h.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515 * 1.609344) AS h&lt;/em&gt;&lt;em&gt;1 FROM hotel h WHERE (((ACOS(SIN(45.41244780000000000000 * PI() / 180) * SIN(h.latitude * PI() / 180) + COS(45.41244780000000000000 * PI() / 180) * COS(h.latitude * PI() / 180) * COS((6.63685100000000000000 - h.longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515 * 1.609344) &amp;lt; 3 AND h.is_published = ? AND h.id != ?) ORDER BY h&lt;/em&gt;_1 asc LIMIT 5&apos;, array(&apos;true&apos;, 189646))&lt;/p&gt;


&lt;p&gt;in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 976&lt;/p&gt;


&lt;p&gt;I&apos;m using NUMERIC on column type with precision 10, but the problem is not in the column latitude and longitude, it&#180;s on calculation.&lt;br/&gt;
To resolve this bug I made a casting inside of ACOS function calculation, but I don&apos;t know how it work on mysql.&lt;/p&gt;


&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;I&apos;ve posted a patch file attached here with the change that I made.&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Examples of result of h_&lt;em&gt;0, h&lt;/em&gt;_1 on sql fixed.&lt;/p&gt;

&lt;p&gt;0.132901717706014221300;   0.213884392376139928479590400&lt;br/&gt;
0.15938002241913817800;   0.256497124695862251207283200&lt;br/&gt;
0.205676327970298764600;   0.331003964361032495016422400&lt;br/&gt;
0.205676327970298764600;   0.331003964361032495016422400&lt;/p&gt;</description>
                <environment>PostgreSQL 8.3 on Linux</environment>
            <key id="10955">DC-524</key>
            <summary>Out Of Range in Template Geographical Calculation using Postgresql</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nei.rauni">Nei Rauni Santos</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Feb 2010 10:48:21 +0000</created>
                <updated>Mon, 1 Mar 2010 16:15:31 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:15:31 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Geographical</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10392" name="Geographical.patch" size="1130" author="nei.rauni" created="Thu, 25 Feb 2010 10:48:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-521] Empty records cannot be inserted on PostgreSQL with autoincrement identifiers</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-521</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If a record does not have any values set, but its identifier is defined as autoincrement, the record cannot be inserted into PostgreSQL.&lt;/p&gt;

&lt;p&gt;In Doctrine_Connection_UnitOfWork::processSingleInsert():&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; 
       $fields = $record-&amp;gt;getPrepared();
        $table = $record-&amp;gt;getTable();

       // Populate fields with a blank array so that a blank records can be inserted
        if (empty($fields)) {
            foreach ($table-&amp;gt;getFieldNames() as $field) {
                $fields[$field] = null;
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This code snippet will add null values to all fields, including to the autoincrement identifier.&lt;br/&gt;
Then later in Doctrine_Connection_Pgsql::insert():&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;       // fix #1786 and #2327 (default values when table is just &apos;id&apos; as PK)
        if(count($fields) === 1 &amp;amp;&amp;amp; $table-&amp;gt;isIdentifier(key($fields)) &amp;amp;&amp;amp; $table-&amp;gt;isIdentifierAutoincrement() )
        {
            return $this-&amp;gt;exec(&apos;INSERT INTO &apos; . $this-&amp;gt;quoteIdentifier($tableName)
                              . &apos; &apos;
                              . &apos; VALUES (DEFAULT)&apos;);
        }

        foreach ($fields as $fieldName =&amp;gt; $value) {
            $cols[] = $this-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName));
            if ($value instanceof Doctrine_Expression) {
                $a[] = $value-&amp;gt;getSql();
                unset($fields[$fieldName]);
            } else {
                $a[] = &apos;?&apos;;
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The claimed fix for the referenced tickets does not work correctly for 2 reasons:&lt;br/&gt;
1. It only works for tables with a single id field&lt;br/&gt;
2. It only works correctly if the id field had no value assigned. If there was a value assigned, it silently bypasses it, and inserts with the autoincremented value.&lt;/p&gt;

&lt;p&gt;Patch with test case will be attached to the ticket.&lt;/p&gt;

&lt;p&gt;References:&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/ticket/2327&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2327&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/ticket/1786&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1786&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Ubuntu 9.10&lt;br/&gt;
PostgreSQL 8.4&lt;br/&gt;
PHP 5.2.10-2ubuntu6.4&lt;br/&gt;
Doctrine 1.2 stable branch (r7206)</environment>
            <key id="10943">DC-521</key>
            <summary>Empty records cannot be inserted on PostgreSQL with autoincrement identifiers</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kisg">Gergely Kis</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Feb 2010 15:26:55 +0000</created>
                <updated>Thu, 17 Jun 2010 05:57:33 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:05:47 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11807" author="kisg" created="Tue, 23 Feb 2010 19:25:19 +0000"  >&lt;p&gt;The patch contains:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Fix for the empty insert issue in PostgreSQL&lt;/li&gt;
	&lt;li&gt;Fix in the UnitOfWork to handle autoincrement fields correctly, if an increment field value was explicitly specified (previously it queried the lastInsertId(), which fails for postgres, since it uses a sequence, which is not updated in case an id is explicitly inserted. (It might be a good idea to also move the postgres sequence in the Pgsql::insert() to the maximum inserted value to make sure that it correctly simulates autoincrement fields, and does not generate conflicting ids -&amp;gt; this is not done yet)&lt;/li&gt;
	&lt;li&gt;Add unit test&lt;/li&gt;
	&lt;li&gt;Add tearDown() support for the unit test framework&lt;/li&gt;
	&lt;li&gt;Fix 741 ticket test (it seems to have relied on a bug in the handling of autoincrement fields: basically a second record was inserted silently) The correct state is DIRTY instead of TDIRTY.&lt;/li&gt;
	&lt;li&gt;Put the new unit test onto the exclusion list because it interferes with the Query test (despite using tearDown() to reset the connection). It also relies explicitly on PostgreSQL.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="11819" author="kisg" created="Thu, 25 Feb 2010 09:08:53 +0000"  >&lt;p&gt;Increasing priority to critical because this is a major issue with the current 1.2 series.&lt;/p&gt;</comment>
                    <comment id="13349" author="enrico" created="Thu, 17 Jun 2010 05:40:26 +0000"  >&lt;p&gt;Environment: doctrine 1.2.4, symfony 1.4&lt;/p&gt;

&lt;p&gt;I moved our project from doctrine 1.2.1 to 1.2.4. The build process stops because of this patch. We are using primary keys with an alias. It seems that the generation of the sequence name in the build-process is different to the one used in UnitOfWorks.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Authority:&lt;br/&gt;
  columns:&lt;br/&gt;
    a_id:         &lt;/p&gt;
{ name: a_id as id, type: integer, primary: true, autoincrement: true }
&lt;p&gt;    name:       &lt;/p&gt;
{ type: string }

&lt;p&gt;This will generate a sequence called &quot;authority_a_id&quot;, but it will try no &quot;currval&quot; the sequence &quot;authority_id&quot;.&lt;/p&gt;

&lt;p&gt;I&apos;ll try to provide a UnitTest. The current seems broken.&lt;/p&gt;

&lt;p&gt;php -l Ticket/DC521TestCase.php &lt;br/&gt;
PHP Parse error:  syntax error, unexpected $end, expecting T_FUNCTION in Ticket/DC521TestCase.php on line 143&lt;/p&gt;

&lt;p&gt;Parse error: syntax error, unexpected $end, expecting T_FUNCTION in Ticket/DC521TestCase.php on line 143&lt;br/&gt;
Errors parsing Ticket/DC521TestCase.php&lt;/p&gt;</comment>
                    <comment id="13350" author="enrico" created="Thu, 17 Jun 2010 05:57:33 +0000"  >&lt;p&gt;@see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-747&quot; title=&quot;Sequence name of build process is different to the one used in UnitOfWorks (based on DC521 with updated TestCase) &quot;&gt;DC-747&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10389" name="doctrine-1.2-emptyinsert.patch" size="9821" author="kisg" created="Tue, 23 Feb 2010 19:25:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-460] Doctrine_Cache_Apc/Core changes in 1.2 cause instability and crashes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-460</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Since upgrading to Doctrine 1.2 my application has begun to get increasingly slower as hours elapse. I&apos;ve pinpointed the cause to the new doctrine_cache_keys feature.&lt;/p&gt;

&lt;p&gt;I&apos;ve found at least three issues with this new method.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;First&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The key cache does not track enforce unique entries, thus multiple entries can be in the cache. See:&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;    protected function _saveKey($key)
    {
        $keys = $this-&amp;gt;fetch($this-&amp;gt;_cacheKeyIndexKey);
        $keys[] = $key;

        return $this-&amp;gt;save($this-&amp;gt;_cacheKeyIndexKey, $keys, null, false);
    }

    public function _deleteKey($key)
    {
        $keys = $this-&amp;gt;fetch($this-&amp;gt;_cacheKeyIndexKey);
        $key = array_search($key, $keys);
        if ($key !== false) {
            unset($keys[$key]);

            return $this-&amp;gt;save($this-&amp;gt;_cacheKeyIndexKey, $keys, null, false);
        }

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

&lt;p&gt;&lt;b&gt;Second&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The doctrine_cache_key is being updated on &lt;em&gt;every&lt;/em&gt; cache save or delete. With any caching strategy (APC, Memcached, Xcache) cache writes for the same key are (naturally) serialized. This leads to the &quot;timebomb&quot; situation described here: &lt;a href=&quot;http://t3.dotgnu.info/blog/php/user-cache-timebomb.html&quot; class=&quot;external-link&quot;&gt;http://t3.dotgnu.info/blog/php/user-cache-timebomb.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem is exarcerbated by the infinitely increasing size of the doctrine_cache_key array noted above. Depending on the caching engine, the lock time increases as well (APC &amp;amp; XCache free the previous entry inside the lock). This causes the application to spiral out of control, even with relatively trivial loads.&lt;/p&gt;

&lt;p&gt;Personally, I don&apos;t think the &quot;benefit&quot; of having prefix/regex deletes is worth having this. Jon, you suggested having it disabled by default, but even with it enabled, this problem is reintroduced when someone decides to use it.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Third&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;For most (maybe all?) cache engines the doctrine_cache_key seems entirely unnecessary. &lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;APC
	&lt;ul&gt;
		&lt;li&gt;apc_cache_info(&apos;user&apos;) returns the list of cache entries&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Memcached
	&lt;ul&gt;
		&lt;li&gt;$memcache-&amp;gt;getExtendedStats(&apos;cachedump&apos;, $slabId) can return the list of cache keys&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;XCache
	&lt;ul&gt;
		&lt;li&gt;According to the API docs xcache_list() behaves similar to apc_cache_info()&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;DB
	&lt;ul&gt;
		&lt;li&gt;a simple query can get this&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Array
	&lt;ul&gt;
		&lt;li&gt;array_keys() ?&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;As this is currently broken for production use I intend to immediately fix both the first and second items above by preventing duplicate entries and disabling the doctrine_cache_keys behavior by default.&lt;/p&gt;

&lt;p&gt;With more input/discussion I think the long term solution is to use the tools provided by the engines to get a list of keys, rather than maintain a list. I&apos;d be willing to develop this as long as it is approved.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10795">DC-460</key>
            <summary>Doctrine_Cache_Apc/Core changes in 1.2 cause instability and crashes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hobodave">David Abdemoulaie</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jan 2010 22:22:45 +0000</created>
                <updated>Mon, 1 Mar 2010 15:58:12 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 15:58:12 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11496" author="hobodave" created="Wed, 27 Jan 2010 23:32:42 +0000"  >&lt;p&gt;I fixed the first issue in the following revision:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/changeset/7070&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/7070&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;cache_keys entries are now stored as the key of an array. This allows for simple uniqueness enforcement, as well as being significantly faster for deletion: array_key_exists is O(log n), array_search is O( n ).&lt;/p&gt;</comment>
                    <comment id="11497" author="romanb" created="Wed, 27 Jan 2010 23:35:35 +0000"  >&lt;p&gt;I have to agree with this feature turning out to be extremely problematic. See &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-390&quot; title=&quot;doctrine_cache_keys bigger than 1mb&quot;&gt;DC-390&lt;/a&gt; for a related problem (I linked it to this one). It should really be disabled by default, at least. Of course it can not be stripped out of 1.2.&lt;/p&gt;

&lt;p&gt;We will strongly reconsider it in 2.0.&lt;/p&gt;</comment>
                    <comment id="11498" author="hobodave" created="Wed, 27 Jan 2010 23:37:47 +0000"  >&lt;p&gt;Jon,&lt;/p&gt;

&lt;p&gt;I was about to backport the 2.0 code to allow enabling/disabling the use of doctrine_cache_keys, but I noticed that it is already in 1.2 at the last second:&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 save($id, $data, $lifeTime = false, $saveKey = true)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think the 2.0 method is the &lt;b&gt;better&lt;/b&gt; way to go about doing this, because afaik users generally don&apos;t call save() directly, the Doctrine code does. Thus there&apos;s really no way to disable this class-wide. &lt;/p&gt;

&lt;p&gt;I don&apos;t know if such an API change is acceptable to you in 1.2 though. I think it should be done due to the basic unusability of 1.2 caching in production.&lt;/p&gt;

&lt;p&gt;If not, can we just change the $saveKey param default to false?&lt;/p&gt;</comment>
                    <comment id="11515" author="hobodave" created="Fri, 29 Jan 2010 00:12:13 +0000"  >&lt;p&gt;Per discussion on IRC I have completely removed the doctrine_cache_keys functionality from Doctrine_Cache. &lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;deleteByPrefix()&lt;/tt&gt;, &lt;tt&gt;deleteBySuffix()&lt;/tt&gt;, and &lt;tt&gt;deleteByRegex()&lt;/tt&gt; methods are still present, but they use driver-specific methods to retrieve a list of cache keys. Due to this the following methods have been deprecated and removed:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;Doctrine_Cache_Driver::count()&lt;/tt&gt; &amp;#8212; Counting is no longer possible or relevant because the items cached by Doctrine are indistinguishable from items cached from other parts of your application(s)&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;Doctrine_Cache_Driver::deleteAll()&lt;/tt&gt; &amp;#8212; Same as above.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The only other API change made is the signature of the &lt;tt&gt;Doctrine_Cache_Interface::save()&lt;/tt&gt; methods:&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 save($id, $data, $lifeTime = false, $saveKey = true)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;is now&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 save($id, $data, $lifeTime = false)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;See &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7074&quot; class=&quot;external-link&quot;&gt;r7074&lt;/a&gt; and &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7075&quot; class=&quot;external-link&quot;&gt;r7075&lt;/a&gt;&lt;/p&gt;
</comment>
                    <comment id="11516" author="hobodave" created="Fri, 29 Jan 2010 01:43:13 +0000"  >&lt;p&gt;Ported changes to 2.0 trunk in &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7076&quot; class=&quot;external-link&quot;&gt;r7076&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10669">DC-390</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-240] Automatic ordering through orderBy in many-to-many relation definition issue</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-240</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I would like to utilize new nice feature in Doctrine 1.2, namely automatic ordering of relations using orderBy property in relation definition. However I see small flaw with m2m relations:&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;setTableName(&apos;core_users&apos;);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;username&apos;, &apos;string&apos;, 64, 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;password&apos;, &apos;string&apos;, 128, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Roles&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;SoftDelete&apos;);
	}
}

class Role &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;core_roles&apos;);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 64);
	}
	
	&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;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_user&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Parents&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;refClass&apos; =&amp;gt; &apos;RoleReference&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Children&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;refClass&apos; =&amp;gt; &apos;RoleReference&apos;));
	}
}

class UserRole &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;core_users_roles&apos;);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_user&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role&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;position&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;User&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}

class RoleReference &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;core_roles_reference&apos;);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role_parent&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role_child&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;position&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role as Parent&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role as Child&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}

$query = Doctrine_Query::create()
	-&amp;gt;from(&apos;User u&apos;)
	-&amp;gt;leftJoin(&apos;u.Roles r&apos;)
	-&amp;gt;orderBy(&apos;username ASC&apos;)
	-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Results in following query being 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;SELECT `c`.`id` AS `c__id`, `c`.`username` AS `c__username`, `c`.`password` AS `c__password`, `c`.`deleted_at` AS `c__deleted_at`, `c2`.`id` AS `c2__id`, `c2`.`name` AS `c2__name` FROM `core_users` `c` LEFT JOIN `core_users_roles` `c3` ON (`c`.`id` = `c3`.`id_user`) LEFT JOIN `core_roles` `c2` ON `c2`.`id` = `c3`.`id_role` WHERE (`c`.`deleted_at` IS NULL) ORDER BY `c`.`username` ASC, position
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, &apos;position&apos; column at the end is not prefixed by an alias (should be `c3` here), which may arise problems when there are more than one column of that name used within tables used in the query.&lt;/p&gt;

&lt;p&gt;Same with lazy-loading:&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;User u&apos;)
	-&amp;gt;orderBy(&apos;username ASC&apos;);
	
$result = $query-&amp;gt;execute();
foreach($result as $item)
{
	echo count($item-&amp;gt;Roles);
}

SELECT `c`.`id` AS `c__id`, `c`.`name` AS `c__name`, `c2`.`id_user` AS `c2__id_user`, `c2`.`id_role` AS `c2__id_role`, `c2`.`position` AS `c2__position` FROM `core_roles` `c` LEFT JOIN `core_users_roles` `c2` ON `c`.`id` = `c2`.`id_role` WHERE (`c2`.`id_user` IN (?)) ORDER BY position
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>1.2 svn</environment>
            <key id="10431">DC-240</key>
            <summary>Automatic ordering through orderBy in many-to-many relation definition issue</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Nov 2009 00:47:06 +0000</created>
                <updated>Tue, 17 Nov 2009 20:08:07 +0000</updated>
                    <resolved>Tue, 17 Nov 2009 20:08:07 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-238] Doctrine_Query::count() doesn&apos;t follow useResultCache</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-238</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The count method of Doctrine_Query doesn&apos;t follow useResultCache option, so I have to make loop away with fetchOne or something like that use &quot;execute()&quot;. &lt;/p&gt;

&lt;p&gt;So I fixed this issue, see the attachment for details! &lt;/p&gt;</description>
                <environment></environment>
            <key id="10429">DC-238</key>
            <summary>Doctrine_Query::count() doesn&apos;t follow useResultCache</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dreamcocoa">Fabian Spillner</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Nov 2009 21:29:28 +0000</created>
                <updated>Tue, 17 Nov 2009 21:38:16 +0000</updated>
                    <resolved>Tue, 17 Nov 2009 21:38:16 +0000</resolved>
                            <version>1.1.5</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10721" author="jwage" created="Tue, 17 Nov 2009 21:38:16 +0000"  >&lt;p&gt;I decided to fix this in Doctrine 1.2 before it really is too late.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10163" name="doctrine-query-count-cache.diff" size="1368" author="dreamcocoa" created="Mon, 16 Nov 2009 21:29:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-236] Doctrine_Collection-&gt;toHierarchy() : __children field doesn&apos;t contain correct children</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-236</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This bug was discovered while using getDescendants with the new toHierarchy function.  Rather than containing the correct child elements in the __children field, it contains whatever the next record is.  Each record only has a single child, which is the record with the next-highest lft value.  You can see this in the following pastebin.  Notice that the very bottom element is placed around level 15 in the tree, yet it should be level 4 according to the &quot;level&quot; field.&lt;/p&gt;

&lt;p&gt;The line that was used to produce the above pastebin was:&lt;br/&gt;
print_r($children = $file-&amp;gt;getNode()&lt;del&gt;&amp;gt;getDescendants(null, false)&lt;/del&gt;&amp;gt;toHierarchy()-&amp;gt;toArray());&lt;br/&gt;
The class used for $file is: &lt;a href=&quot;http://pastebin.ca/1673706&quot; class=&quot;external-link&quot;&gt;http://pastebin.ca/1673706&lt;/a&gt;&lt;/p&gt;</description>
                <environment>PHP 5.2.9 on Windows Server 2003 with MySQL</environment>
            <key id="10426">DC-236</key>
            <summary>Doctrine_Collection-&gt;toHierarchy() : __children field doesn&apos;t contain correct children</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shibz">Nate</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Nov 2009 18:30:08 +0000</created>
                <updated>Mon, 16 Nov 2009 18:59:00 +0000</updated>
                    <resolved>Mon, 16 Nov 2009 18:59:00 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10678" author="jwage" created="Mon, 16 Nov 2009 18:59:00 +0000"  >&lt;p&gt;Thanks for reporting the issue, it is fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-223] Cloning a query object re-creates hydrator object and loses hydration mode in the process.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-223</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is obviously wrong since cloning should result in identical object, but why this is such a critical bug is because it breaks setting array hydration for nested set base query, because the query object gets cloned during the fetching of tree. This bug was introduced in revsion 6691 in attempt to fix &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-204&quot; class=&quot;external-link&quot;&gt;DC-204&lt;/a&gt;. Included is a patch that correctly clones the hydrator instead of resetting its information completely.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10397">DC-223</key>
            <summary>Cloning a query object re-creates hydrator object and loses hydration mode in the process.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="reko_t">Reko Tiira</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Nov 2009 13:44:31 +0000</created>
                <updated>Thu, 12 Nov 2009 18:28:33 +0000</updated>
                    <resolved>Thu, 12 Nov 2009 18:28:33 +0000</resolved>
                            <version>1.2.0-BETA2</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10157" name="Doctrine_Query.patch" size="516" author="reko_t" created="Thu, 12 Nov 2009 13:44:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-25] Joining the same m2m relation more than one time produces query with duplicated aliases</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-25</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;em&gt;moved my ticket #1941 from trac&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let&apos;s consider an environment: &lt;/p&gt;

&lt;p&gt;We have a table &quot;Article&quot; and another table &quot;Tag&quot;. There is a many to many relation between those two tables via link table &quot;TagArticle&quot;. Schema and fixtures provided in attachments. It is simple. &lt;/p&gt;

&lt;p&gt;Now let&apos;s consider a situation: &lt;/p&gt;

&lt;p&gt;We want to display a list of all articles with on of tags. But we want to display this list also with the rest of tags connected to articles with specified tag: &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;Article1: tag1, tag2, tag3, tag4
Article2: tag2, tag3
Article3: tag4
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We want a list of all articles with &quot;tag2&quot; - so it will be Article1 and Article2, but the same query should also retrieve the rest of tags. &lt;/p&gt;

&lt;p&gt;It is really simple to do with one-to-many relation: by just joining two tables with different aliases. &lt;/p&gt;

&lt;p&gt;However, it is impossible now to do it with many-to-many relation, because Doctrine generates wrong table aliases in 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;$query = Doctrine_Query::create()-&amp;gt;select(&apos;a.id, tg.*&apos;)
    -&amp;gt;from(&apos;Article a&apos;)
    -&amp;gt;leftJoin(&apos;a.Tags tg&apos;)
    -&amp;gt;innerJoin(&apos;a.Tags tg2 WITH tg2.name = ?&apos;, &apos;tag2&apos;)
    ;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Looks logical. But it throws an exception: &lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&quot;Doctrine_Connection_Mysql_Exception&quot; with message &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1066 Not unique table/alias: &apos;t2&apos;&quot; in ...doctrine\lib\DoctrineConnection.php:1084&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Let&apos;s look at our 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;SELECT a.id AS a__id, t.id AS t__id, t.name AS t__name 
FROM article a 
LEFT JOIN tag_article t2 ON a.id = t2.article_id 
LEFT JOIN tag t ON t.id = t2.tag_id 
INNER JOIN tag_article t2 ON a.id = t2.article_id 
INNER JOIN tag t3 ON t3.id = t2.tag_id AND t3.name = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As we can see, there is a duplicated alias on &quot;tag_article&quot;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10069">DC-25</key>
            <summary>Joining the same m2m relation more than one time produces query with duplicated aliases</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="extreme">Jacek J&#281;drzejewski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Sep 2009 15:04:04 +0000</created>
                <updated>Thu, 24 Sep 2009 21:39:11 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 21:39:11 +0000</resolved>
                            <version>1.1.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10122" author="guilhermeblanco" created="Thu, 24 Sep 2009 21:39:11 +0000"  >&lt;p&gt;This issue was fixed in r6407&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-851] Temporary schema filename is not unique enough</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-851</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Random filename generation is not sufficiently unique when working with multiple developers on a single development server.&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;$file = realpath(sys_get_temp_dir()).&apos;/doctrine_schema_&apos;.rand(11111, 99999).&apos;.yml&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Attached patch replaces rand() call with a uniqid() call.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11862">DC-851</key>
            <summary>Temporary schema filename is not unique enough</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="trivoallan">Tristan Rivoallan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Sep 2010 06:45:04 +0000</created>
                <updated>Wed, 1 Sep 2010 14:41:38 +0000</updated>
                    <resolved>Wed, 1 Sep 2010 14:41:38 +0000</resolved>
                            <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14224" author="jwage" created="Wed, 1 Sep 2010 14:41:38 +0000"  >&lt;p&gt;This issue is in the Symfony code, not Doctrine. Please open a ticket in &lt;a href=&quot;http://trac.symfony-project.org&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10764" name="tmp_schema_unicity.patch" size="1500" author="trivoallan" created="Wed, 1 Sep 2010 06:45:04 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-458] Doctrine_Validator_Ip fails on IPV6 IP addresses.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-458</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Validator_Ip-&amp;gt;validate() uses ip2long() in order to validate IP addresses.&lt;/p&gt;

&lt;p&gt;However, ip2long() only works for IPv4 addresses, and not IPv6 addresses.&lt;/p&gt;

&lt;p&gt;Attached is a patch to use filter_var which validates both IPv4 and IPv6 properly.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10792">DC-458</key>
            <summary>Doctrine_Validator_Ip fails on IPV6 IP addresses.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jboyd">Josh Boyd</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jan 2010 19:36:18 +0000</created>
                <updated>Mon, 1 Mar 2010 20:11:23 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 20:11:23 +0000</resolved>
                            <version>1.1.6</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10320" name="fix_ip_validator_to_validate_ipv6_and_ipv4.patch" size="470" author="jboyd" created="Wed, 27 Jan 2010 19:36:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-446] Doctrine_Record_Generator::createClass with Doctrine_Record_Listener</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-446</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record_Generator::initialize first builds the table class and then a &quot;Doctrine_Record&quot; from that. This is surprising, as the result is a &quot;double conversion&quot; from record to table and back.&lt;/p&gt;

&lt;p&gt;Furthermore, writing files, &lt;b&gt;no&lt;/b&gt; record listeners can be attached (see createClassFromTable)!&lt;/p&gt;

&lt;p&gt;I therefore suggest adding the possibility to add listeners - which the builder already does! - to the Record_Generator.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10772">DC-446</key>
            <summary>Doctrine_Record_Generator::createClass with Doctrine_Record_Listener</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kampfcaspar">Hans-Peter Oeri</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Jan 2010 07:54:21 +0000</created>
                <updated>Tue, 2 Mar 2010 12:21:50 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:21:50 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10314" name="diff" size="661" author="kampfcaspar" created="Mon, 25 Jan 2010 07:54:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-437] Connection::query() can use wrong connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-437</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;As I understand, &lt;tt&gt;Doctrine_Connection::query()&lt;/tt&gt; method is intended to execute DQL queries using precisely this connection.&lt;br/&gt;
But here is 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;894     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function query($query, array $params = array(), $hydrationMode = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
895     {
896         $parser = Doctrine_Query::create();                                                                                
897         $res = $parser-&amp;gt;query($query, $params, $hydrationMode);
898         $parser-&amp;gt;free();
899 
900         &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $res;
901     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;Doctrine_Query::create()&lt;/tt&gt; statement will create a query that is using a default connection, not the current one.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10748">DC-437</key>
            <summary>Connection::query() 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="esycat">Eugene Janusov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jan 2010 05:48:46 +0000</created>
                <updated>Mon, 15 Mar 2010 11:53:16 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 11:53:16 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11424" author="esycat" created="Tue, 19 Jan 2010 05:59:47 +0000"  >&lt;p&gt;Attached proposed patch.&lt;/p&gt;</comment>
                    <comment id="11429" author="esycat" created="Tue, 19 Jan 2010 23:23:51 +0000"  >&lt;p&gt;Attached test case.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10297" name="DC-437.patch" size="505" author="esycat" created="Tue, 19 Jan 2010 05:59:47 +0000" />
                    <attachment id="10304" name="DC437TestCase.php" size="4284" author="esycat" created="Wed, 20 Jan 2010 01:22:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-428] Bug on DropDB on Oracle. The sequence isn&apos;t not correct</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-428</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The sequence of drop database is not correct.&lt;/p&gt;

&lt;p&gt;I change this in my patch.&lt;/p&gt;

&lt;p&gt;Thank&apos;s&lt;/p&gt;</description>
                <environment></environment>
            <key id="10732">DC-428</key>
            <summary>Bug on DropDB on Oracle. The sequence isn&apos;t not correct</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Jan 2010 10:03:39 +0000</created>
                <updated>Thu, 11 Mar 2010 10:57:30 +0000</updated>
                    <resolved>Thu, 11 Mar 2010 10:57:30 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11562" author="adrive" created="Sun, 31 Jan 2010 20:58:40 +0000"  >&lt;p&gt;Hi Bertrand,&lt;/p&gt;

&lt;p&gt;Can you provide more informations on this issue? Some test cases, oracle error messages, oracle settings..&lt;/p&gt;

&lt;p&gt;You are proposing to remove the double quotes from DROP TABLE statements. You can turn identifier quoting on and off. When you have ATTR_QUOTE_IDENTIFIERS to on, all your identifier names are double quoted in oracle and if you do something like &lt;br/&gt;
SELECT * FROM user_tables, the TABLE_NAME column contains table names lovercased. So you need the double quotes in DROP TABLE statements. If your table name is &quot;my_table&quot; and you do DROP TABLE my_table; you get an error about nonexistent table. You need to do DROP TABLE &quot;my_table&quot;. That&apos;s exactly what doctrine does now.&lt;/p&gt;

&lt;p&gt;Another scenario is doublequotes turned off. So all your tables are handled in oracle uppercased. So my_table is internally handled as MY_TABLE. That&apos;s alredy what you recieve from USER_TABLES. And when you do DROP TABLE &quot;MY_TABLE&quot; that is the same as DROP TABLE my_table.&lt;/p&gt;

&lt;p&gt;I use this heavily in both cases and I have no problems with that.&lt;/p&gt;

&lt;p&gt;The issue with I.SEQUENCE_OWNER in DROP SEQUENCE statement I fixed in r6896 (&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6896&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6896&lt;/a&gt;).&lt;/p&gt;
</comment>
                    <comment id="11563" author="garfield-fr" created="Sun, 31 Jan 2010 21:11:18 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;The symfony use the last version 1.2.1 revision 6894 and the change is on 6896.&lt;/p&gt;

&lt;p&gt;A release date for version 1.2.2 ?&lt;/p&gt;

&lt;p&gt;Thank&apos;s for your help.&lt;/p&gt;</comment>
                    <comment id="11565" author="adrive" created="Sun, 31 Jan 2010 21:21:39 +0000"  >&lt;p&gt;Just update it yourself with svn up &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; or use your version in YOUR_PROJECT/lib/vendor/doctrine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10286" name="Oracle.php.patch" size="890" author="garfield-fr" created="Fri, 15 Jan 2010 10:03:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

&lt;p&gt;The column aggregation inheritance does&apos;nt take care of others slugs.&lt;/p&gt;</description>
                <environment>Symfony 1.4.1 LAMP</environment>
            <key id="10714">DC-419</key>
            <summary>Sluggable and inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pier">Pierre B</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 22:43:38 +0000</created>
                <updated>Tue, 6 Sep 2011 08:52:11 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:11:27 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11885" author="jan.misek" created="Mon, 1 Mar 2010 12:08:12 +0000"  >&lt;p&gt;First, inheritance is great feature, thanks doctrine team.&lt;/p&gt;

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

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

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





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

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

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

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

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

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

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

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

<item>
            <title>[DC-411] Doctrine::Inflector does not handle table names with dashes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-411</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have some tables in my DB with dashes in name, ex. &quot;table-name&quot;.&lt;br/&gt;
While generating schema.yml with ./doctrine-cli generate-yaml-db it generated model classes with dashes, ex. class Table-name ...&lt;/p&gt;

&lt;p&gt;Here&apos;s a small patch to treat - in table names same as _.&lt;/p&gt;

&lt;p&gt;&amp;#8212; library/Doctrine/Inflector.php	(wersja 7016)&lt;br/&gt;
+++ library/Doctrine/Inflector.php	(kopia robocza)&lt;br/&gt;
@@ -57,7 +57,7 @@&lt;br/&gt;
     public static function classify($word)&lt;/p&gt;
     {
         $word = preg_replace(&apos;/[$]/&apos;, &apos;&apos;, $word);
-        return preg_replace_callback(&apos;~(_?)(_)([\w])~&apos;, array(&quot;Doctrine_Inflector&quot;, &quot;classifyCallback&quot;), ucfirst(strtolower($word)));
+        return preg_replace_callback(&apos;~(_?)([-_])([\w])~&apos;, array(&quot;Doctrine_Inflector&quot;, &quot;classifyCallback&quot;), ucfirst(strtolower($word)));
     }

&lt;p&gt;     /**&lt;/p&gt;</description>
                <environment></environment>
            <key id="10704">DC-411</key>
            <summary>Doctrine::Inflector does not handle table names with dashes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="smoku">Tomasz Sterna</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jan 2010 23:45:36 +0000</created>
                <updated>Mon, 1 Mar 2010 20:17:19 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 20:17:19 +0000</resolved>
                            <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11358" author="smoku" created="Fri, 8 Jan 2010 23:46:44 +0000"  >&lt;p&gt;linebreaks got lost.&lt;br/&gt;
basically (_)(&lt;span class=&quot;error&quot;&gt;&amp;#91;\w&amp;#93;&lt;/span&gt;) turns to (&lt;span class=&quot;error&quot;&gt;&amp;#91;-_&amp;#93;&lt;/span&gt;)(&lt;span class=&quot;error&quot;&gt;&amp;#91;\w&amp;#93;&lt;/span&gt;)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-404] Allow custom language field name in I18n Behavior </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-404</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I18n behavior assumes language field name of &apos;lang&apos;. It would be nice if this was configurable. &lt;/p&gt;

&lt;p&gt;This was mentioned and a proposed solution was given here: &lt;a href=&quot;http://forum.symfony-project.org/index.php/m/85623/&quot; class=&quot;external-link&quot;&gt;http://forum.symfony-project.org/index.php/m/85623/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a patch which implements this solution, it essentially adds an i18nField option to the behaviour. The field defaults to &apos;lang&apos;. &lt;/p&gt;

&lt;p&gt;The patch was made against r7016 of the 1.2 branch. &lt;/p&gt;

&lt;p&gt;Note: &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Leaving the field name as &apos;lang&apos; does not cause unit test failures.&lt;/li&gt;
	&lt;li&gt;Changing the name of the field does cause some unit tests to fail for me. I&apos;m not sure if the dependency on the field name exists in the unit tests or in the doctrine library itself. If dependencies exist in the library, this patch may not be sufficient to add the feature.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Sorry if the patch is incomplete, I&apos;m new to Doctrine in general.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10695">DC-404</key>
            <summary>Allow custom language field name in I18n Behavior </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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="stephenminded">Steve Lounsbury</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Jan 2010 21:01:17 +0000</created>
                <updated>Mon, 1 Mar 2010 20:04:43 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 20:04:43 +0000</resolved>
                            <version>1.2.1</version>
                <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10270" name="i18n_configurable_field.diff" size="1259" author="stephenminded" created="Thu, 7 Jan 2010 21:01:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-398] PORTABILITY_EMPTY_TO_NULL doesn&apos;t do anything for statements</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-398</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I found this ticket on the old Trac system, but not on JIRA.  It is still broken in the 1.1 branch, as of revision 7004.  It is also broken in 1.0.14, 1.1.6, and 1.2.1.  (These were the &apos;stable&apos; releases at the time I reported this bug.)  It is likely broken in older releases as well.&lt;/p&gt;

&lt;p&gt;When saving to the database, Doctrine ignores the setting of PORTABILITY_EMPTY_TO_NULL.  Currently, it will never change empty strings to NULL, no matter what the setting is for ATRR_PORTABILITY.  This is because there is an error in the following &apos;if&apos; statement:&lt;/p&gt;

&lt;p&gt;Doctrine_Connection_Statement starting on line: 234&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; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;getAttribute(Doctrine::PORTABILITY_EMPTY_TO_NULL)) {
    foreach ($params as $key =&amp;gt; $value) {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($value == &apos;&apos;) {
            $params[$key] = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the first test in this block should be (Portability Mode Attributes must be handled this way):&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; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;getAttribute(Doctrine::ATTR_PORTABILITY) &amp;amp; Doctrine::PORTABILITY_EMPTY_TO_NULL) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the second test 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;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_string($value) &amp;amp;&amp;amp; $value === &apos;&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In newer versions of php(not sure which), test for empty string must look like &apos;===&apos; not only &apos;==&apos;. It prevents integer and boolean value 0 to be handled as an empty string. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10685">DC-398</key>
            <summary>PORTABILITY_EMPTY_TO_NULL doesn&apos;t do anything for 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="thomasalbright">Thomas Albright</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 15:17:28 +0000</created>
                <updated>Mon, 15 Mar 2010 12:15:55 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:15:55 +0000</resolved>
                            <version>1.0.14</version>
                <version>1.1.6</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11352" author="dorian53" created="Fri, 8 Jan 2010 14:40:58 +0000"  >&lt;p&gt;It&apos;s the same problem with.&lt;/p&gt;

&lt;p&gt;$oDCon-&amp;gt;setAttribute(Doctrine::ATTR_PORTABILITY,    Doctrine::PORTABILITY_RTRIM);&lt;/p&gt;

&lt;p&gt;I think Doctrine::ATTR_ don&apos;t work.&lt;/p&gt;</comment>
                    <comment id="11366" author="ezzatron" created="Tue, 12 Jan 2010 02:17:59 +0000"  >&lt;p&gt;It would be really great to see this issue fixed. As for the suggested changes above, I believe the === operator checks against type also, and therefore the is_string() call is redundant.&lt;/p&gt;</comment>
                    <comment id="11789" author="thomasalbright" created="Mon, 22 Feb 2010 21:30:29 +0000"  >&lt;p&gt;Here is a patch for 1.2.1.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10384" name="patch.diff" size="802" author="thomasalbright" created="Mon, 22 Feb 2010 21:30:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-397] unlinking of associations with aliased local-/foreignKeys is broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-397</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Connection_UnitOfWork-&amp;gt;saveAssociations() does not use column-aliases for database-columns but only field-names. The following patch deals with this problem: &lt;/p&gt;

&lt;p&gt;Index: lib/Doctrine/Connection/UnitOfWork.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; lib/Doctrine/Connection/UnitOfWork.php	(revision 7004)&lt;br/&gt;
+++ lib/Doctrine/Connection/UnitOfWork.php	(working copy)&lt;br/&gt;
@@ -439,8 +439,8 @@&lt;br/&gt;
                 $assocTable = $rel-&amp;gt;getAssociationTable();&lt;br/&gt;
                 foreach ($v-&amp;gt;getDeleteDiff() as $r) &lt;/p&gt;
{
                     $query = &apos;DELETE FROM &apos; . $assocTable-&amp;gt;getTableName()
-                           . &apos; WHERE &apos; . $rel-&amp;gt;getForeign() . &apos; = ?&apos;
-                           . &apos; AND &apos; . $rel-&amp;gt;getLocal() . &apos; = ?&apos;;
+                           . &apos; WHERE &apos; . $rel-&amp;gt;getForeignRefColumnName() . &apos; = ?&apos;
+                           . &apos; AND &apos; . $rel-&amp;gt;getLocalRefColumnName() . &apos; = ?&apos;;
 
                     $this-&amp;gt;conn-&amp;gt;execute($query, array($r-&amp;gt;getIncremented(), $record-&amp;gt;getIncremented()));
                 }</description>
                <environment></environment>
            <key id="10683">DC-397</key>
            <summary>unlinking of associations with aliased local-/foreignKeys is 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="floriank">Florian Klucke</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 14:02:48 +0000</created>
                <updated>Tue, 2 Mar 2010 12:31:24 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:31:24 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10265" name="patch_DC-397.diff" size="884" author="floriank" created="Tue, 5 Jan 2010 14:05:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-394] Searchable behavior&apos;s batchUpdateIndex fails if a table has a composite primary key.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-394</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;You will get the following error when you try to batchUpdateIndex a table with composite key:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fatal error: Uncaught exception &apos;ErrorException&apos; with message &apos;strpos() expects parameter 1 to be string, array given&apos; in library/Doctrine/Connection.php:725&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Here&apos;s the full stack trace:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Stack trace:&lt;br/&gt;
#0 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Bootstrap-&amp;gt;errorHandler(2, &apos;strpos() expect...&apos;, &apos;/Users/reko/Sit...&apos;, 725, Array)&lt;br/&gt;
#1 /Users/reko/Sites/MyProject/library/Doctrine/Connection.php(725): strpos(Array, &apos;.&apos;)&lt;br/&gt;
#2 /Users/reko/Sites/MyProject/library/Doctrine/Search.php(246): Doctrine_Connection-&amp;gt;quoteIdentifier(Array)&lt;br/&gt;
#3 /Users/reko/Sites/MyProject/library/Doctrine/Template/Searchable.php(69): Doctrine_Search-&amp;gt;batchUpdateIndex(NULL, NULL, NULL)&lt;br/&gt;
#4 /Users/reko/Sites/MyProject/library/Doctrine/Template/Searchable.php(81): Doctrine_Template_Searchable-&amp;gt;batchUpdateIndex(NULL, NULL, NULL)&lt;br/&gt;
#5 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Template_Searchable-&amp;gt;batchUpdateIndexTableProxy()&lt;br/&gt;
#6 /Users/reko/Sites/MyProject/library/Doctrine/Record.php(2622): call_user_func_array(Array, Array)&lt;br/&gt;
#7 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Record-&amp;gt;__call(&apos;batchUpdateInde...&apos;, Array)&lt;br/&gt;
#8 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: In in /Users/reko/Sites/MyProject/library/Doctrine/Connection.php on line 725&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I know that it&apos;s recommended that you don&apos;t use composite primary keys, but this happens to occur when you stack the I18n and Searchable behaviour together, since the Translation table I18n behavior creates uses a composite key on (id, lang).&lt;/p&gt;

&lt;p&gt;Anyways, the bug was quite simple one to fix and I&apos;ve attached a patch that fixes the issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10676">DC-394</key>
            <summary>Searchable behavior&apos;s batchUpdateIndex fails if a table has a composite primary key.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="reko_t">Reko Tiira</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jan 2010 14:37:45 +0000</created>
                <updated>Tue, 2 Mar 2010 12:34:28 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:34:28 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10263" name="Doctrine_Search.patch" size="2330" author="reko_t" created="Mon, 4 Jan 2010 14:37:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

<item>
            <title>[DC-384] Nested set API allows inconsistent trees to be created</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-384</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;First create a tree as follows:&lt;/p&gt;

&lt;p&gt;A&lt;br/&gt;
  B&lt;br/&gt;
    C&lt;br/&gt;
    D&lt;/p&gt;

&lt;p&gt;That is, C and D are both children of B, and B is a child of A.&lt;/p&gt;

&lt;p&gt;At this point our db looks as follows:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select SLUG, LFT, RGT, LEVEL from pk_context_cms_page;&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;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; SLUG     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LFT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; RGT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LEVEL &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;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /        &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   12 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /about   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   10 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   11 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; global   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  NULL &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    9 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    3 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    8 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     2 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    4 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    5 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     3 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c/d &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     3 &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;br/&gt;
7 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;Now, call D-&amp;gt;moveAsLastChildOf(C). D is now a child of C.&lt;/p&gt;

&lt;p&gt;So far so good:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select SLUG, LFT, RGT, LEVEL from pk_context_cms_page;&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;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; SLUG     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LFT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; RGT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LEVEL &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;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /        &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   12 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /about   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   10 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   11 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; global   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  NULL &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    9 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    3 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    8 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     2 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    4 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     3 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c/d &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    5 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     4 &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;br/&gt;
7 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;Now, call C-&amp;gt;moveAsLastChildOf(D). This should pull D out from under C. &lt;/p&gt;

&lt;p&gt;Instead the values of LFT and RGT get messed up:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select SLUG, LFT, RGT, LEVEL from pk_context_cms_page&lt;br/&gt;
    -&amp;gt; ;&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;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; SLUG     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LFT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; RGT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LEVEL &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;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /        &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   12 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /about   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   10 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   11 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; global   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  NULL &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    9 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    3 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    8 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     2 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     5 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c/d &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     4 &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;br/&gt;
7 rows in set (0.00 sec)&lt;/p&gt;

&lt;p&gt;moveAsLastChildOf should either (1) implement moving ancestors beneath their children correctly or (2) refuse to do so.&lt;/p&gt;

&lt;p&gt;Note: these actions were carried out as separate PHP requests.&lt;/p&gt;

&lt;p&gt;This is easy to reproduce by firing up the Apostrophe sandbox project, logging in as admin/admin, creating the page structure described, and then clicking the apostrophe in the upper left and then the Reorganize tool. &lt;/p&gt;

&lt;p&gt;Instructions to check out the current sandbox are here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.apostrophenow.com/home/readme&quot; class=&quot;external-link&quot;&gt;http://www.apostrophenow.com/home/readme&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You&apos;ll need to set up databases.yml and do a build --all and a data-load, that&apos;s about it.&lt;/p&gt;

&lt;p&gt;Be sure to open a second tab so that you can have two views of the tree showing the initial state (C and D both as kids of B) so that you can drag D under C in the first tab and then try to drag C under D in the second tab. Otherwise the tree editor itself will block you from trying to move C under D. &lt;/p&gt;

&lt;p&gt;The implementation of pkContextCMS/executeTreeMove is calling moveAsLastChildOf() in both cases and doing so to the right pages. I&apos;ve added logging to verify this, look for references to TREEMOVE in the frontend_log.dev file.&lt;/p&gt;

&lt;p&gt;We are going to add checks at the pkContextCMS level to refuse to attempt to move an ancestor beneath one of its children as a workaround, although in principle that should be possible (at least if the ancestor has no children? Not sure if it always makes sense if it does have children other than the ancestors of the new parent).&lt;/p&gt;
</description>
                <environment>Symfony 1.4</environment>
            <key id="10659">DC-384</key>
            <summary>Nested set API allows inconsistent trees to 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Dec 2009 18:04:18 +0000</created>
                <updated>Mon, 15 Mar 2010 12:04:13 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:04:13 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Nested Set</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11292" author="dordille" created="Wed, 23 Dec 2009 21:46:46 +0000"  >&lt;p&gt;I have attached a symfony project to demonstrate the problem.  Project is using latest symfony version form 1.4 svn.  Run test located in test/unit/corrupt.php&lt;/p&gt;

&lt;p&gt;The test creates 3 nodes A, B, and C.&lt;br/&gt;
Inserts B as last child of a.&lt;br/&gt;
Inserts C as last child of a.&lt;br/&gt;
The nodes then have the following properties.&lt;/p&gt;

&lt;p&gt;Node   lft   rgt   lvl&lt;br/&gt;
A          1    6      0&lt;br/&gt;
B          2    3      1&lt;br/&gt;
C          5    5      1&lt;/p&gt;

&lt;p&gt;A is then moved as the first child of B which causes corrupted nested sets.&lt;/p&gt;

&lt;p&gt;Node   lft   rgt   lvl&lt;br/&gt;
A          3    6      2&lt;br/&gt;
B          4    3      1&lt;br/&gt;
C          4    5      1&lt;/p&gt;

&lt;p&gt;A is still the parent of B and C, yet its level is 2.&lt;/p&gt;

&lt;p&gt;This problem exists whenever a node is moved into one of its children or descendants. &lt;/p&gt;</comment>
                    <comment id="11293" author="dordille" created="Wed, 23 Dec 2009 22:35:37 +0000"  >&lt;p&gt;I created a patch that prevents moving a node into its descendants.&lt;/p&gt;

&lt;p&gt;I was trying to think what the ideal behavior would be in this situation, but at least this patch will prevent corruption.&lt;/p&gt;</comment>
                    <comment id="12196" author="jwage" created="Mon, 15 Mar 2010 12:04:13 +0000"  >&lt;p&gt;Thanks for the issue Tom and patch Dan. Let me know if we still have any issues remaining.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10254" name="nest.tgz" size="7473" author="dordille" created="Wed, 23 Dec 2009 21:46:46 +0000" />
                    <attachment id="10255" name="no-move-into-descendant.patch" size="2067" author="dordille" created="Wed, 23 Dec 2009 22:35:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-380] Sequence SQL is not generated when exporing sql for postgres - with patch</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-380</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I spent a couple of hours on Saturday debugging why the heck the sql for sequences doesn&apos;t get generated for Postgresql. As it seems somebody forget about that when writing the export driver.&lt;/p&gt;

&lt;p&gt;Attached is a patch against 1.2.1 version.&lt;br/&gt;
This probably also applies to Doctrine 2!&lt;/p&gt;</description>
                <environment></environment>
            <key id="10653">DC-380</key>
            <summary>Sequence SQL is not generated when exporing sql for postgres - with 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Dec 2009 09:51:21 +0000</created>
                <updated>Mon, 1 Mar 2010 19:58:54 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 19:58:54 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11933" author="jwage" created="Mon, 1 Mar 2010 19:58:54 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10252" name="pgsql_sql_sequence.patch" size="385" author="mvrhov" created="Wed, 23 Dec 2009 09:51:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-374] importing sqlite db with doctrine does not detect autoincrement fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-374</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;when importing a sqlite db with doctrine it fails to detect autoincrement fields resulting in exceptions when inserting records, like this one:&lt;br/&gt;
Uncaught exception &apos;Doctrine_Connection_Sqlite_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 19 usergroup.group_id may not be NULL&apos; in /Users/aiso/dev/php/cms/mix/lib/ext/doctrine/Doctrine/Connection.php:1083. &lt;/p&gt;

&lt;p&gt;This is caused by the fact that there is no check on &apos;autoincrement&apos; in Import/Sqlite.php. In sqlite3 a field is autoincrement whenever its type is integer and is a primary key.&lt;/p&gt;

&lt;p&gt;a patch is included.&lt;/p&gt;</description>
                <environment>sqlite3</environment>
            <key id="10643">DC-374</key>
            <summary>importing sqlite db with doctrine does not detect autoincrement 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aiso">aiso haikens</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Dec 2009 17:42:06 +0000</created>
                <updated>Mon, 1 Mar 2010 20:09:00 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 20:09:00 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10246" name="sqlite-autoincrement.patch" size="527" author="aiso" created="Mon, 21 Dec 2009 17:42:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-381] Automatic sequence names - with patch</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-381</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Right now in yaml schema if you write sequence: true all the sequence names are set to 1. &lt;br/&gt;
This fixes the class generator in such way that the table name is used for sequence name if sequence === true otherwise it works just like before.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10654">DC-381</key>
            <summary>Automatic sequence names - with 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Dec 2009 09:53:42 +0000</created>
                <updated>Mon, 1 Mar 2010 19:53:59 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 19:53:59 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10253" name="schema_sequence.patch" size="1301" author="mvrhov" created="Wed, 23 Dec 2009 09:53:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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


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

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

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

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

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

<item>
            <title>[DC-365] softdelete documentation is outof date</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-365</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;out of date &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/behaviors#core-behaviors:softdelete&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/behaviors#core-behaviors:softdelete&lt;/a&gt; the behavior add a deleted_at column from type timestamp&lt;/p&gt;</description>
                <environment></environment>
            <key id="10628">DC-365</key>
            <summary>softdelete documentation is outof date</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Dec 2009 14:46:26 +0000</created>
                <updated>Tue, 2 Mar 2010 14:25:11 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 14:25:11 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-351] Moving nodes between trees doesn&apos;t work properly </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-351</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Moving node with children from one tree too another tree is not working properly.&lt;/p&gt;

&lt;p&gt;Database schema and fixtrues are attached to this ticket. tree_before.png.&lt;/p&gt;

&lt;p&gt;I want move &apos;Children 2&apos; with descendants to second tree as first child&lt;/p&gt;

&lt;p&gt;code:&lt;br/&gt;
    $treeObject = Doctrine::getTable(&apos;Tree&apos;)-&amp;gt;findOneById(6);&lt;/p&gt;

&lt;p&gt;    $newParent = Doctrine::getTable(&apos;Tree&apos;)-&amp;gt;findOneById(11);&lt;br/&gt;
    $treeObject-&amp;gt;getNode()-&amp;gt;moveAsFirstChildOf($newParent);&lt;/p&gt;

&lt;p&gt;This causes a problem. Doctrine inproperly moves &apos;Child 2&apos; with descendants  and &apos;GrandChild 1 of Child 3&apos;. (picture tree_after_move without_patch.png)&lt;/p&gt;

&lt;p&gt;I found why it&apos;s working wrong.&lt;/p&gt;

&lt;p&gt;It is because in NestesSet.php in function _moveBetweenTrees close gap in old tree is run too fast.&lt;br/&gt;
After moving only node which I want, it doesn&apos;t move descendants, but it lower values lft, rgt of next old siblings of node.&lt;br/&gt;
And this cause that values(lft,rgt)/ranges overlap of descendants of moving node and values of old siblings with their descendants.&lt;br/&gt;
And during update lft/rgt/root/level for all descendants from old range of moving node, it updates also some next old siblings.&lt;/p&gt;

&lt;p&gt;You can see this at picture tree_before_update without_patch.png, i stop script before &quot;// Update lft/rgt/root/level for all descendants&quot;.&lt;/p&gt;

&lt;p&gt;I&apos;ve moved closing gap in old tree.&lt;/p&gt;

&lt;p&gt;And after patching, moving node works properly. ( picture tree_after_move with_patch.png)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10600">DC-351</key>
            <summary>Moving nodes between trees doesn&apos;t work properly </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kibao">Przemys&#322;aw Piechota</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Dec 2009 13:00:26 +0000</created>
                <updated>Mon, 1 Mar 2010 21:05:21 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 21:05:21 +0000</resolved>
                            <version>1.1.6</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11159" author="romanb" created="Thu, 10 Dec 2009 13:27:42 +0000"  >&lt;p&gt;I think this issue is valid and the patch correct. I remember we had that same issue in trac at some point.&lt;/p&gt;

&lt;p&gt;+1 from me for applying that patch.&lt;/p&gt;</comment>
                    <comment id="11939" author="guilhermeblanco" created="Mon, 1 Mar 2010 21:05:21 +0000"  >&lt;p&gt;In r7285 this issue was fixed. Thanks for report and patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10231" name="moveBetweenTrees.patch" size="976" author="kibao" created="Thu, 10 Dec 2009 13:00:26 +0000" />
                    <attachment id="10230" name="sample.yml" size="733" author="kibao" created="Thu, 10 Dec 2009 13:00:26 +0000" />
                    <attachment id="10229" name="schema.yml" size="226" author="kibao" created="Thu, 10 Dec 2009 13:00:26 +0000" />
                    <attachment id="10233" name="tree_after_move without_patch.png" size="33494" author="kibao" created="Thu, 10 Dec 2009 13:00:55 +0000" />
                    <attachment id="10234" name="tree_after_move with_patch.png" size="34025" author="kibao" created="Thu, 10 Dec 2009 13:00:55 +0000" />
                    <attachment id="10232" name="tree_before.png" size="36273" author="kibao" created="Thu, 10 Dec 2009 13:00:55 +0000" />
                    <attachment id="10235" name="tree_before_update without_patch.png" size="34893" author="kibao" created="Thu, 10 Dec 2009 13:01:09 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-342] when a table has multiple relations to an other one, then only the last one will be created in the base models</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-342</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Amongst many tables, I have these two below. When creating the models, it only creates the &quot;CommentsBy&quot; relation. Even if I move those two&lt;br/&gt;
relations into the &quot;Comment&quot; table definition and I make the necessary changes, the result will be the same. However, if I put one relation&lt;br/&gt;
into one table and the other into the other one, then it will be created. So, that would be a work-around, but it is still just a work-around,&lt;br/&gt;
plus when I also want (and I want) to create realtions pointing from the Comment to the User, I run into the same issue, but now in both of the tables.&lt;/p&gt;

&lt;p&gt;I am building a site where I want to list the comments (comment text, comment by (username), comment time) and the users, so the relations are&lt;br/&gt;
needed in both ways (user -&amp;gt; comment and comment -&amp;gt; user) for the different pages, and Doctrine knows the trick, but it doesn&apos;t let me do it.&lt;/p&gt;

&lt;p&gt;I am using Smarty, so for example I could to use something like this:&lt;/p&gt;

&lt;p&gt;$smarty-&amp;gt;assign(&apos;theuser&apos;, Doctrine::getTable(&apos;User&apos;)-&amp;gt;find(123456));&lt;/p&gt;

&lt;p&gt;{$theuser.username}&lt;/p&gt;

{foreach $theuser.CommentsAbout item=onecomment}
&lt;p&gt;    {$onecomment.comment} ... {$onecomment.ByUser.username} ... {$onecomment.created}&lt;/p&gt;
{/foreach}


&lt;p&gt;User:&lt;br/&gt;
    tableName: user&lt;br/&gt;
    columns:&lt;br/&gt;
        id:&lt;br/&gt;
            type: integer(8)&lt;br/&gt;
            unsigned: true&lt;br/&gt;
            notnull: false&lt;br/&gt;
        username:&lt;br/&gt;
            type: string(64)&lt;/p&gt;

&lt;p&gt;        ... and so on ...&lt;/p&gt;

&lt;p&gt;    relations:&lt;br/&gt;
        Comment:&lt;br/&gt;
            alias: CommentsAbout&lt;br/&gt;
            local: id&lt;br/&gt;
            foreign: about_user_id&lt;br/&gt;
            foreignType: one&lt;br/&gt;
            type: many&lt;br/&gt;
        Comment:&lt;br/&gt;
            alias: CommentsBy&lt;br/&gt;
            local: id&lt;br/&gt;
            foreign: by_user_id&lt;br/&gt;
            foreignType: one&lt;br/&gt;
            type: many&lt;br/&gt;
    actAs:&lt;br/&gt;
        Timestampable:&lt;br/&gt;
            created:&lt;br/&gt;
                name: created&lt;br/&gt;
            updated:&lt;br/&gt;
                name: updated&lt;/p&gt;

&lt;p&gt;Comment:&lt;br/&gt;
    columns:&lt;br/&gt;
        id:&lt;br/&gt;
            type: integer(8)&lt;br/&gt;
            primary: true&lt;br/&gt;
            notnull: true&lt;br/&gt;
            autoincrement: true&lt;br/&gt;
        by_user_id:&lt;br/&gt;
            type: integer(8)&lt;br/&gt;
        about_user_id:&lt;br/&gt;
            type: integer(8)&lt;br/&gt;
        comment:&lt;br/&gt;
            type: string&lt;br/&gt;
    actAs:&lt;br/&gt;
        Timestampable:&lt;br/&gt;
            created:&lt;br/&gt;
                name: created&lt;br/&gt;
            updated:&lt;br/&gt;
                name: updated&lt;/p&gt;</description>
                <environment>Ubuntu Linux 9.04 64 bit, Doctrine 1.1.6 (possibly runs from a different, central server/repo), PHP 5.2.10-2ubuntu6.3 with Suhosin-Patch 0.9.7</environment>
            <key id="10587">DC-342</key>
            <summary>when a table has multiple relations to an other one, then only the last one will be created in the base models</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hroland">Roland Huszti</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Dec 2009 18:10:19 +0000</created>
                <updated>Tue, 2 Mar 2010 14:18:26 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 14:18:26 +0000</resolved>
                            <version>1.1.6</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11203" author="mchojrin" created="Wed, 16 Dec 2009 17:26:31 +0000"  >&lt;p&gt;Hi:&lt;/p&gt;

&lt;p&gt;  I hade a similar problem, and I solved it like this:&lt;/p&gt;

&lt;p&gt;  On the yml file I just changed the name of the relation to the alias I wanted to give it. i.e.:&lt;/p&gt;

&lt;p&gt;relations:&lt;br/&gt;
    Producer:&lt;br/&gt;
      class: sfGuardUser&lt;br/&gt;
      foreign: id&lt;br/&gt;
      local: producer_id&lt;br/&gt;
    GOSContact:&lt;br/&gt;
      class: sfGuardUser&lt;br/&gt;
      foreign: id&lt;br/&gt;
      local: gos_contact_id&lt;br/&gt;
    GOSDD:&lt;br/&gt;
      class: sfGuardUser&lt;br/&gt;
      foreign: id&lt;br/&gt;
      local: gos_dd_id&lt;/p&gt;

&lt;p&gt;Hope it helps!&lt;/p&gt;</comment>
                    <comment id="11986" author="jwage" created="Tue, 2 Mar 2010 14:18:26 +0000"  >&lt;p&gt;If you have multiple relationships to the same model, then you need to give them aliases.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-332] Doctrine_Migration_Diff doesn&apos;t work when plugin schemas are present but there is no app schema</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-332</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;A project with plugin schemas, but no project-level schema, which Symfony is otherwise fine with:&lt;/p&gt;

&lt;p&gt;svn co &lt;a href=&quot;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&quot; class=&quot;external-link&quot;&gt;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&lt;/a&gt; cmstest13&lt;br/&gt;
cd cmstest13&lt;br/&gt;
./symfony doctrine:generate-migrations-diff&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt; doctrine  generating migration diff&lt;br/&gt;
&amp;gt;&amp;gt; file+     /private/var/folders/3H/3Hu3TTyjFt...TI/&lt;del&gt;Tmp&lt;/del&gt;/doctrine_schema_81204.yml&lt;/p&gt;

&lt;p&gt;Notice: Undefined variable: extension in /Users/boutell/Sites/cmstest13-jonwagetest/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php on line 320&lt;/p&gt;

&lt;p&gt;Notice: Undefined variable: extension in /Users/boutell/Sites/cmstest13-jonwagetest/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php on line 324&lt;/p&gt;


&lt;p&gt;  No php or yml files found at path: &quot;/Users/boutell/Sites/cmstest13-jonwagetest/lib/model/doctrine&quot;  &lt;/p&gt;
</description>
                <environment>Symfony 1.3</environment>
            <key id="10575">DC-332</key>
            <summary>Doctrine_Migration_Diff doesn&apos;t work when plugin schemas are present but there is no app schema</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Dec 2009 18:27:30 +0000</created>
                <updated>Tue, 2 Mar 2010 12:38:55 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:38:55 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11967" author="jwage" created="Tue, 2 Mar 2010 12:38:55 +0000"  >&lt;p&gt;I fixed this at some point. It was fixed by &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7067&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/7067&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please confirm or re-open if you have any issues.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-320] Doctrine_Record fails to correctly update columns named data (conflict with getData method)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-320</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a table with a &quot;data&quot; column (DATE type but the issue is not strictly related to the datatype), when updating/insering a record it fails with this error:&lt;/p&gt;

&lt;p&gt;strtotime() expects parameter 1 to be string, array given in /usr/share/pear/Doctrine/lib/Doctrine/Record.php on line 1526&lt;/p&gt;

&lt;p&gt;With some debugging I found that the value stored in $old was the internal $data array, and not my value. I assume that there&apos;s a conflict with the get/setData methods.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment>linux, apache 2, mysql 5.1, php 5.2</environment>
            <key id="10557">DC-320</key>
            <summary>Doctrine_Record fails to correctly update columns named data (conflict with getData method)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mtorromeo">Massimiliano Torromeo</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 16:06:27 +0000</created>
                <updated>Fri, 12 Mar 2010 06:50:41 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:59:34 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="11010" author="mtorromeo" created="Fri, 4 Dec 2009 17:02:12 +0000"  >&lt;p&gt;I noticed another problem related to this:&lt;br/&gt;
when I dump the data with &quot;doctrine dump-data&quot; the resulting yaml is corrupted on records with fields named &quot;data&quot;&lt;/p&gt;</comment>
                    <comment id="11012" author="juokaz" created="Fri, 4 Dec 2009 17:09:59 +0000"  >&lt;p&gt;This is caused by the column having a name &quot;data&quot;.&lt;/p&gt;

&lt;p&gt;Because if you have Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE enabled, Doctrine fill try method setField and getField and hence setData and getData breaks it.&lt;/p&gt;

&lt;p&gt;I recommend changing a field name or disabling this option. Otherwise, this issue is Invalid (but probably need to be documented more).&lt;/p&gt;</comment>
                    <comment id="11013" author="mtorromeo" created="Fri, 4 Dec 2009 17:30:28 +0000"  >&lt;p&gt;I started using Doctrine on a pre-existing database and changing all the data fields is really troublesome right now, and having AUTO_ACCESSOR_OVERRIDE would be nice.&lt;br/&gt;
I temporarily solved my problem by changing line 1321 of Record.php with:&lt;/p&gt;

&lt;p&gt;if ($fieldName!=&quot;data&quot; &amp;amp;&amp;amp; $this-&amp;gt;_table-&amp;gt;getAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE) || $this-&amp;gt;hasAccessor($fieldName)) {&lt;/p&gt;

&lt;p&gt;This way I only lose the possibility of having a custom accessor for the data field and not all the others.&lt;br/&gt;
I still think this can be fixed, without having to disable AUTO_ACCESSOR_OVERRIDE.&lt;/p&gt;

&lt;p&gt;If this is not a BUG maybe it could be considered a feature request then?&lt;/p&gt;</comment>
                    <comment id="11014" author="juokaz" created="Sat, 5 Dec 2009 04:30:47 +0000"  >&lt;p&gt;I understand you, sometimes adopting a framework can be a pain &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;Problem is coming from the lines:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if ($load) {&lt;br/&gt;
	$old = $this-&amp;gt;get($fieldName, $load);&lt;br/&gt;
} else {&lt;br/&gt;
	$old = $this-&amp;gt;_data&lt;span class=&quot;error&quot;&gt;&amp;#91;$fieldName&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;in _set method of Doctrine_Record. Here it calls get(&apos;data&apos;) method and your problem occurs.&lt;/p&gt;

&lt;p&gt;Speaking of solution for this I&apos;m not sure what is a way - field name &quot;data&quot; is reserved in Doctrine mainly because there is a method set/getData. However, in the same way a lot of fields can create this problem - just search for methods staring with get and you will find a bunch of them. All these will fail if your column is named the same. &lt;br/&gt;
From my point of view, it is how Doctrine is written and it&apos;s quite hard to change it now - you have getX for both your custom mutators and Doctrine methods as well. I don&apos;t know any possible way how to distinguish between them and only possible way seems to be that option ACCESSOR_OVERRIDE which only means that you need to register your custom code as mutators (very easy).&lt;/p&gt;

&lt;p&gt;I didn&apos;t managed to find a documentation about this, so I guess we need to wait for someone in a higher level to comment. Right now I see it as invalid/won&apos;t fix mainly because it would require a major rewrite of a lot code to remove that ambiguity between method names and I would suggest disabling override, but it&apos;s just 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;&lt;/p&gt;</comment>
                    <comment id="11016" author="jamiel" created="Sat, 5 Dec 2009 11:45:51 +0000"  >&lt;p&gt;This should get picked up in the generator classes and the developer should be notified as this error occurring at runtime is a real time consumer to debug.&lt;/p&gt;</comment>
                    <comment id="11066" author="jwage" created="Mon, 7 Dec 2009 21:02:54 +0000"  >&lt;p&gt;Can you test this patch? It will throw an exception if you use a invalid field name:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Index: lib/Doctrine/Import/Builder.php
===================================================================
--- lib/Doctrine/Import/Builder.php	(revision 6882)
+++ lib/Doctrine/Import/Builder.php	(working copy)
@@ -508,9 +508,25 @@
      */
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function buildColumns(array $columns)
     {
+        $manager = Doctrine_Manager::getInstance();
+        $refl = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ReflectionClass($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_baseClassName);
+
         $build = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
         foreach ($columns as $name =&amp;gt; $column) {
             $columnName = isset($column[&apos;name&apos;]) ? $column[&apos;name&apos;]:$name;
+            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($manager-&amp;gt;getAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE)) {
+                $e = explode(&apos; as &apos;, $columnName);
+                $fieldName = isset($e[1]) ? $e[1] : $e[0];
+                $classified = Doctrine_Inflector::classify($fieldName);
+                $getter = &apos;get&apos; . $classified;
+                $setter = &apos;set&apos; . $classified;
+
+                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($refl-&amp;gt;hasMethod($getter) || $refl-&amp;gt;hasMethod($setter)) {
+                    &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Import_Exception(
+                        sprintf(&apos;When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name &lt;span class=&quot;code-quote&quot;&gt;&quot;%s&quot;&lt;/span&gt; because it is reserved by Doctrine. You must choose another field name.&apos;, $fieldName)
+                    );
+                }
+            }
             $build .= &lt;span class=&quot;code-quote&quot;&gt;&quot;        &quot;&lt;/span&gt;.&apos;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(\&apos;&apos; . $columnName . &apos;\&apos;, \&apos;&apos; . $column[&apos;type&apos;] . &apos;\&apos;&apos;;
 
             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($column[&apos;length&apos;]) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11078" author="mtorromeo" created="Tue, 8 Dec 2009 10:02:42 +0000"  >&lt;p&gt;I can test the patch in a couple of days, I&apos;ll post the results here.&lt;br/&gt;
Thanks.&lt;/p&gt;</comment>
                    <comment id="11309" author="mtorromeo" created="Thu, 31 Dec 2009 08:24:35 +0000"  >&lt;p&gt;Sorry for the long delay. I applied the patch but I don&apos;t know when it is supposed to throw the exception.&lt;br/&gt;
It doesn&apos;t warn on existing databases does it?&lt;/p&gt;</comment>
                    <comment id="11376" author="quirko" created="Wed, 13 Jan 2010 19:58:41 +0000"  >&lt;p&gt;Try to modify file Doctrine/lib/Doctrine/Record.php at line: 1433&lt;br/&gt;
I don&apos;t know if this is the best solution but works for me.&lt;br/&gt;
if ($load) {&lt;br/&gt;
                if ($fieldName == &apos;data&apos;) &lt;/p&gt;
{
                    $old = $this-&amp;gt;get($fieldName, $load);
                    $old = $old[&apos;data&apos;];
                }
&lt;p&gt;                else &lt;/p&gt;
{
                    $old = $this-&amp;gt;get($fieldName, $load);
                }
&lt;p&gt;            } else &lt;/p&gt;
{
                $old = $this-&amp;gt;_data[$fieldName];
            }</comment>
                    <comment id="11969" author="jwage" created="Tue, 2 Mar 2010 12:45:16 +0000"  >&lt;p&gt;It only throws exceptions when you build your classes.&lt;/p&gt;</comment>
                    <comment id="12115" author="tkeller" created="Fri, 12 Mar 2010 06:50:41 +0000"  >&lt;p&gt;The exception doesn&apos;t work for me either, though the field(s) which make problems here are `name` and `description`. More information can be found here: &amp;lt;&lt;a href=&quot;http://github.com/sympal/sympal/issues/issue/7/#comment_157161&quot; class=&quot;external-link&quot;&gt;http://github.com/sympal/sympal/issues/issue/7/#comment_157161&lt;/a&gt;&amp;gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-317] Using NestedSet behavior, createRoot function doesn&apos;t behave as expected with string multiple root key</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-317</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have defined this model :&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; 
Page:
  options: { type: InnoDB, collate: utf8_unicode_ci, charset: utf8 }
  columns:
    topic:       { type: string(32), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    title:        { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
  actAs:
    NestedSet:      { hasManyRoots: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, rootColumnName: topic }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And use this code (database is empty) :&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;?

$page = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Page;
$page-&amp;gt;topic = &apos;my-topic&apos;;
$page-&amp;gt;title = &apos;My Title&apos;;
$page-&amp;gt;save();

print_r( $page-&amp;gt;topic );  &lt;span class=&quot;code-comment&quot;&gt;// OK, here it&apos;s perfect
&lt;/span&gt;
Doctrine::getTable(&apos;Page&apos;)-&amp;gt;getTree()-&amp;gt;createRoot( $page );

print_r( $page-&amp;gt;topic ); &lt;span class=&quot;code-comment&quot;&gt;// Now topic == 1 . It&apos;s buggy !
&lt;/span&gt;

Doctrine::getTable(&apos;Page&apos;)-&amp;gt;getTree()-&amp;gt;fetchTree( &apos;my-topic&apos; ); &lt;span class=&quot;code-comment&quot;&gt;// Buggy : &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&gt;
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;



&lt;p&gt;Let me know if you need more explainations,&lt;br/&gt;
julien&lt;/p&gt;</description>
                <environment>Using Symfony 1.4 and  MySQL</environment>
            <key id="10554">DC-317</key>
            <summary>Using NestedSet behavior, createRoot function doesn&apos;t behave as expected with string multiple root key</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="julien">Julien G</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 14:19:38 +0000</created>
                <updated>Mon, 7 Dec 2009 20:34:19 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 20:34:19 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Behaviors</component>
                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-323] when inserting a record into sql server (via odbc) doctrine fails to get last inserted ID</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-323</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;in Doctrine/Sequence/Mssql.php the function lastInsertId() fails to retrieve the last inserted ID when inserting a record. Because the major release of my sql server is bigger than 8, it chooses $query = &apos;select SCOPY_IDENTITY()&apos; which does not return a number (in fact it does not return anything), although the record IS inserted succesfully. The backtrace is attached.&lt;br/&gt;
If, on the other hand, I force doctrine to use &apos;select @@IDENTITY&apos; the query does return the correct number and everything goes fine!&lt;br/&gt;
So I think the conditions which query to choose is incorrect. I tried both queries in SQL server itself and both queries returned the right number. But one of them gets lost somewhere when using it in doctrine.&lt;/p&gt;</description>
                <environment>windows XP SP3, SQL server version:(&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[major] =&amp;gt; 9&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[minor] =&amp;gt; 00&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[patch] =&amp;gt; 4035&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[extra] =&amp;gt; &lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[native] =&amp;gt; Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) &lt;br/&gt;
	Nov 24 2008 13:01:59 &lt;br/&gt;
	Copyright (c) 1988-2005 Microsoft Corporation&lt;br/&gt;
	Express Edition on Windows NT 5.1 (Build 2600: Service Pack 3))&lt;br/&gt;
</environment>
            <key id="10560">DC-323</key>
            <summary>when inserting a record into sql server (via odbc) doctrine fails to get last inserted ID</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aiso">aiso haikens</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 20:05:39 +0000</created>
                <updated>Mon, 15 Mar 2010 21:45:38 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:35:48 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="10996" author="juokaz" created="Thu, 3 Dec 2009 21:16:05 +0000"  >&lt;p&gt;Microsoft SQL Server works in a such way, that different things have different &lt;b&gt;scopes&lt;/b&gt;. Running query as prepared statement and then executing it results in different scope, hence running &quot;select scope_identity()&quot; after this query returns nothing. This is expected behaviour, and this is how Microsoft SQL Server should work.&lt;/p&gt;

&lt;p&gt;To overcome this issue, I used a popular &quot;hack&quot; (maybe not really a hack) - add this query to the actual query (more here &lt;a href=&quot;http://forums.devshed.com/ms-sql-development-95/insert-and-return-the-primary-key-232783.html&quot; class=&quot;external-link&quot;&gt;http://forums.devshed.com/ms-sql-development-95/insert-and-return-the-primary-key-232783.html&lt;/a&gt; or all other the web):&lt;/p&gt;

&lt;p&gt;INSERT INTO X VALUES(1,1,2); SELECT SCOPE_IDENTITY();&lt;/p&gt;

&lt;p&gt;Only using this way, I managed to make my component (Zend_Db_Adapter_Sqlsrv) to work. However, since Doctrine is very different and INSERT method is processed in completely different fashion I don&apos;t think that there is a way to overcome this issue. &lt;/p&gt;</comment>
                    <comment id="11000" author="aiso" created="Thu, 3 Dec 2009 22:18:48 +0000"  >&lt;p&gt;unfortunately, retrieving the lastInsertedId() is part of the insert() functionality. So an exception is thrown everytime I try to insert a new record, which I must overcome&lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; (the record is by the way perfectly added to the db)&lt;/p&gt;

&lt;p&gt;For me there is a perfect workaround: just use &apos;select @@IDENTITY&apos; which works flawlessly.&lt;/p&gt;

&lt;p&gt;So this is the point: I think more often &apos;select @@IDENTITY&apos; must be chosen over &apos;select SCOPY_IDENTITY()&apos; &apos;cause the latter does not (always?) return the id.&lt;/p&gt;</comment>
                    <comment id="11001" author="juokaz" created="Thu, 3 Dec 2009 22:28:26 +0000"  >&lt;p&gt;I googled some more:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.sqlauthority.com/2007/03/25/sql-server-identity-vs-scope_identity-vs-ident_current-retrieve-last-inserted-identity-of-record/&quot; class=&quot;external-link&quot;&gt;http://blog.sqlauthority.com/2007/03/25/sql-server-identity-vs-scope_identity-vs-ident_current-retrieve-last-inserted-identity-of-record/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://beyondrelational.com/blogs/jacob/archive/2009/02/05/sql-server-identity-scope-identity-and-ident-current.aspx&quot; class=&quot;external-link&quot;&gt;http://beyondrelational.com/blogs/jacob/archive/2009/02/05/sql-server-identity-scope-identity-and-ident-current.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically @@IDENTITY works in most cases, but it can go very wrong if you have triggers or stuff like that (which is not that rare in mssql world). &lt;/p&gt;

&lt;p&gt;However, since with scope_identity() there are problems, I would say that Doctrine should use @@IDENTITY, because SCOPE_IDENTITY() will never return a value. Just impossible to fix.&lt;/p&gt;</comment>
                    <comment id="11004" author="aiso" created="Fri, 4 Dec 2009 09:28:46 +0000"  >&lt;p&gt;Ah, I see, you are right, @@IDENTITY has to many drawbacks. &lt;/p&gt;

&lt;p&gt;But in the first link you provided was the answer to overcome scope and trigger problems: the best option should be to actually use &apos;select IDENT_CURRENT(&apos;table_name&apos;)&apos;. I just tested it and it works perfect! You only need to pass the table name in UnitOfWork.php in case the driver is mssql.&lt;/p&gt;
</comment>
                    <comment id="11009" author="juokaz" created="Fri, 4 Dec 2009 17:01:07 +0000"  >&lt;p&gt;I&apos;ve attached a possible fix.&lt;/p&gt;

&lt;p&gt;Test it if you can and when approved I will commit it.&lt;/p&gt;</comment>
                    <comment id="11154" author="aiso" created="Wed, 9 Dec 2009 22:12:15 +0000"  >&lt;p&gt;I tested your patch, but it didn&apos;t work since the $table var is empty in my case. This is because the function _assignIdentifier() in UnitOfWork won&apos;t set the $seq var in case of &apos;mssql&apos;. So first of all we need to pass the table name to this function like this in UnitOfWork line 925:&lt;/p&gt;

&lt;p&gt;+           } elseif ($driver == &apos;oracle&apos; || $driver == &apos;mssql&apos;) &lt;/p&gt;
{
                $seq = $table-&amp;gt;getTableName();
            }

&lt;p&gt;            $id = $this-&amp;gt;conn-&amp;gt;sequence-&amp;gt;lastInsertId($seq);&lt;/p&gt;

&lt;p&gt;And furthermore I need to quote the table name before it worked like this in Mssql line 141:&lt;/p&gt;

&lt;p&gt;                $query = &apos;SELECT IDENT_CURRENT(\&apos;&apos; . $this-&amp;gt;conn-&amp;gt;quoteIdentifier($table) . &apos;\&apos;)&apos;;&lt;/p&gt;

&lt;p&gt;After these changes it worked. But don&apos;t you think we have to get rid of the SCOPE_IDENTITY entirely?&lt;br/&gt;
I attached this patch.&lt;/p&gt;</comment>
                    <comment id="11239" author="aiso" created="Sat, 19 Dec 2009 17:24:46 +0000"  >&lt;p&gt;OK, what to do next? The last patch works fine for me. It seems to be the solution to the problem. So, can I check it in? Or should someone else do this? Or do I simply set the status to &apos;resolve&apos; and someone else does the rest?&lt;/p&gt;</comment>
                    <comment id="12002" author="craigmarvelley" created="Wed, 3 Mar 2010 07:58:06 +0000"  >&lt;p&gt;I tried the last patch and it works fine for me on SQL Server 2005/2008. +1 for committing it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="12202" author="jwage" created="Mon, 15 Mar 2010 12:35:48 +0000"  >&lt;p&gt;Thanks for everyones work on this issue.&lt;/p&gt;</comment>
                    <comment id="12270" author="xborns" created="Mon, 15 Mar 2010 21:45:38 +0000"  >&lt;p&gt;Tried the patch and it works on SQL Server 2005 as well. Lots of fun trying to find it. Thanks for the fix. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10207" name="ff.txt" size="628" author="aiso" created="Thu, 3 Dec 2009 20:07:23 +0000" />
                    <attachment id="10211" name="mssql.patch" size="690" author="juokaz" created="Fri, 4 Dec 2009 17:01:07 +0000" />
                    <attachment id="10226" name="mssql2.patch" size="1343" author="aiso" created="Wed, 9 Dec 2009 22:12:35 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-318] Doctrine_Table::find(x) fails for odbc/mssql connection due to limit() clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-318</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;call that fails is Doctrine::getTable(&apos;Building&apos;)-&amp;gt;find(1). With mysql all is fine, but if I use MSSQL via odbc (SQL Native Client) I get an exception saying:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22018&amp;#93;&lt;/span&gt;: Invalid character value for cast specification: 206 &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 Native Client&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Er is een conflict met het type operand ontstaan: text is incompatibel met int (SQLExecute&lt;span class=&quot;error&quot;&gt;&amp;#91;206&amp;#93;&lt;/span&gt; at ext\pdo_odbc\odbc_stmt.c:254)&lt;br/&gt;
see attached stacktrace.&lt;br/&gt;
So find(1) fails but a call to e.g. findAll() works fine.&lt;/p&gt;

&lt;p&gt;I found out that if I leave out the limit(1) from the function find() on line 1602 it gives me the correct object and no exception!&lt;br/&gt;
So actually what goes wrong is the limit(1) clause in this call:&lt;br/&gt;
$object = Doctrine_Query::create()&lt;del&gt;&amp;gt;from(&apos;Building b&apos;)&lt;/del&gt;&amp;gt;where(&apos;b.id = 1&apos;)&lt;del&gt;&amp;gt;limit(1)&lt;/del&gt;&amp;gt;fetchOne();&lt;br/&gt;
with getSqlquery() this becomes:&lt;br/&gt;
SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;version&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__version&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;number&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__number&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;title_nl&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__title_nl&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;title_en&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__title_en&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;published&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__published&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;If executed with sqlcmd.exe this gives an error saying &apos;no columnname id&apos;, what seems to be correct since it should be &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; iso &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_table&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;, so I suspect that the modifyLimitQuery() function in Connection/Mssql.php is not correct either.&lt;/p&gt;

&lt;p&gt;I can work around this problem by doing a fetchOne() iso find().&lt;/p&gt;</description>
                <environment>windows XP SP3</environment>
            <key id="10555">DC-318</key>
            <summary>Doctrine_Table::find(x) fails for odbc/mssql connection due to limit() 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aiso">aiso haikens</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 14:39:03 +0000</created>
                <updated>Mon, 22 Mar 2010 13:15:41 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:51:11 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11015" author="juokaz" created="Sat, 5 Dec 2009 05:02:56 +0000"  >&lt;p&gt;This is because of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$field_array = explode(&apos;,&apos;, $fields_string);&lt;br/&gt;
$aux2 = explode(&apos;.&apos;, $field_array&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;);&lt;br/&gt;
$key_field = trim(end($aux2));&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;With query like SELECT t.id as t__id FROM X it works like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SELECT t.id as t__id FROM X &amp;#8211; &amp;gt;&lt;br/&gt;
t.id as t__id --&amp;gt;&lt;br/&gt;
array(&apos;t.id as t__id&apos;) --&amp;gt;&lt;br/&gt;
array(&apos;t&apos;, &apos;.id as t__id&apos;)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Which is wrong. It should split on &quot;as&quot; an then use it.&lt;/p&gt;

&lt;p&gt;I created a patch for this, which should make it work. Test it if you can and I hopefully it will be included into source.&lt;/p&gt;</comment>
                    <comment id="11064" author="jwage" created="Mon, 7 Dec 2009 20:39:57 +0000"  >&lt;p&gt;The patch looks good it just doesn&apos;t follow the coding standards. $variableName not $variable_name and &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
{
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;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;} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You might want to read up on the Doctrine coding standards. Whenever you commit something you must make 100% sure that it follows the standards. If you fix the coding standards in the patch you can commit it.&lt;/p&gt;</comment>
                    <comment id="11065" author="juokaz" created="Mon, 7 Dec 2009 20:48:11 +0000"  >&lt;p&gt;I reattached updated patch, please review if that&apos;s what you meant and I will commit it. Variables names were already there, but I fixed them now&lt;/p&gt;</comment>
                    <comment id="11107" author="gensisns" created="Wed, 9 Dec 2009 02:49:47 +0000"  >&lt;p&gt;All the if statements are unnecessary, look a few lines above, the 2-3 lines handle splitting on the as and &quot;.&quot; without all the if statements. Related to issue &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; title=&quot;Using MSSQL connection the find method for models does not work&quot;&gt;&lt;del&gt;DC-289&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="11109" author="juokaz" created="Wed, 9 Dec 2009 03:09:20 +0000"  >&lt;p&gt;Yes, somehow missed that one. This one should fix it&lt;/p&gt;</comment>
                    <comment id="11110" author="juokaz" created="Wed, 9 Dec 2009 03:12:19 +0000"  >&lt;p&gt;I looked at &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; title=&quot;Using MSSQL connection the find method for models does not work&quot;&gt;&lt;del&gt;DC-289&lt;/del&gt;&lt;/a&gt; and it seems to be the same thing as this error. So I suggest closing this as duplicate and fixing that one with a patch provided. &lt;/p&gt;</comment>
                    <comment id="11122" author="aiso" created="Wed, 9 Dec 2009 11:19:50 +0000"  >&lt;p&gt;I agree, it is a duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; title=&quot;Using MSSQL connection the find method for models does not work&quot;&gt;&lt;del&gt;DC-289&lt;/del&gt;&lt;/a&gt;. I will add my comments about this patch to that one.&lt;/p&gt;</comment>
                    <comment id="11233" author="gensisns" created="Fri, 18 Dec 2009 20:59:31 +0000"  >&lt;p&gt;Should be closed as duplicate.&lt;/p&gt;</comment>
                    <comment id="12430" author="gguedes" created="Mon, 22 Mar 2010 13:15:41 +0000"  >&lt;p&gt;Hello everyone, i&apos;m new here but i&apos;m having the same problem, but i&apos;m not clear about the fixing, please could someone telme realy how can i patch the select sql problem whit mssql, i&apos;m using symfony 1.4 and mssql server 2005, and when i do:&lt;/p&gt;

&lt;p&gt;Doctrine_Query::CREATE()&lt;br/&gt;
-&amp;gt;select(&apos;u.username&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;then i get the messagge error:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 10007 Invalid &lt;br/&gt;
column name...&lt;/p&gt;

&lt;p&gt;to resolve this is very important for me.&lt;/p&gt;

&lt;p&gt;sorry my english&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="10505">DC-289</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10205" name="ff.txt" size="1195" author="aiso" created="Thu, 3 Dec 2009 14:39:03 +0000" />
                    <attachment id="10218" name="mssqlimit.patch" size="2615" author="juokaz" created="Mon, 7 Dec 2009 20:48:11 +0000" />
                    <attachment id="10213" name="mssqllimit.patch" size="1082" author="juokaz" created="Sat, 5 Dec 2009 05:02:56 +0000" />
                    <attachment id="10221" name="mssqlllimit2.patch" size="782" author="juokaz" created="Wed, 9 Dec 2009 03:09:20 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-314] length option ignored in addColumn method in Doctrine 1.2 migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-314</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using &lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib&quot; class=&quot;external-link&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib&lt;/a&gt; and saw this problem with revision 6806.&lt;/p&gt;

&lt;p&gt;The &apos;length&apos; parameter in the options array seems to be&lt;br/&gt;
ignored by addColumn in Doctrine 1.2 migrations. No matter what we specified for&lt;br/&gt;
&apos;length&apos; we got a bigint in MySQL, resulting in failure later when we&lt;br/&gt;
tried to add a foreign key because we needed a 4-byte integer. There&lt;br/&gt;
does not seem to be any documentation of what is valid in the options&lt;br/&gt;
array when calling addColumn, however I see that length is still used&lt;br/&gt;
when passing an apparently identical options array for a particular&lt;br/&gt;
column when calling createTable. &lt;/p&gt;

&lt;p&gt;That is, this code:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;pg_event_request&apos;, &apos;event_id&apos;, &apos;integer&apos;,&lt;br/&gt;
array(&apos;length&apos; =&amp;gt; 4));&lt;/p&gt;

&lt;p&gt;Does not work properly in Doctrine 1.2 (you get a bigint in MySQL).&lt;/p&gt;

&lt;p&gt;We were able to work around it by implementing a migrate() method&lt;br/&gt;
instead, passing 4 as the final argument (there doesn&apos;t seem to be&lt;br/&gt;
clear documentation of this final argument but in the example in the&lt;br/&gt;
documentation it is the length of a string column, and sure enough it&lt;br/&gt;
does the same thing for an integer). Passing 4 here worked, we got a&lt;br/&gt;
4-byte integer.&lt;/p&gt;</description>
                <environment>Symfony 1.3</environment>
            <key id="10549">DC-314</key>
            <summary>length option ignored in addColumn method in Doctrine 1.2 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 16:58:45 +0000</created>
                <updated>Wed, 2 Dec 2009 17:12:28 +0000</updated>
                    <resolved>Wed, 2 Dec 2009 17:12:28 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10973" author="jwage" created="Wed, 2 Dec 2009 17:12:28 +0000"  >&lt;p&gt;I just fixed this here hehe&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6842&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6842&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, the function signature in 1.2 is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addColumn($tableName, $columnName, $type, $length = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array $options = array())
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It has the $length argument, but you can still pass the length via the options. In the end all that information is just in one array.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-302] Issues when using automatic relations ordering through &apos;orderBy&apos; param in m2m relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-302</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Partially related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-240&quot; title=&quot;Automatic ordering through orderBy in many-to-many relation definition issue&quot;&gt;&lt;del&gt;DC-240&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I found some additional problems, mainly with self-referenced relations.&lt;br/&gt;
I use ACL system with multiple inheritance, where order of inherited elements matters. &lt;br/&gt;
Here we have (Role &amp;lt;- m2m orderBy position - &amp;gt; Role) and (User &amp;lt; - m2m orderBy position -&amp;gt; Role):&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 Role &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 64);
	}
	
	&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;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_user&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Parents&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;refClass&apos; =&amp;gt; &apos;RoleReference&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Children&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;refClass&apos; =&amp;gt; &apos;RoleReference&apos;));
	}
}

class RoleReference &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role_parent&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role_child&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;position&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role as Parent&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_parent&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role as Child&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role_child&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}

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;username&apos;, &apos;string&apos;, 64, 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;password&apos;, &apos;string&apos;, 128, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Role as Roles&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_role&apos;, &apos;refClass&apos; =&amp;gt; &apos;UserRole&apos;, &apos;orderBy&apos; =&amp;gt; &apos;position&apos;));
	}
}

class UserRole &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_user&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_role&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;position&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, 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;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;User&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_user&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Role&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_role&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sample data:&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;$role1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role1-&amp;gt;name = &apos;admin&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 1
&lt;/span&gt;$role1-&amp;gt;save();

$role2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role2-&amp;gt;name = &apos;publisher&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 2
&lt;/span&gt;$role2-&amp;gt;save();

$role3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role3-&amp;gt;name = &apos;reviewer&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 3
&lt;/span&gt;$role3-&amp;gt;save();

$role4 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Role();
$role4-&amp;gt;name = &apos;mod&apos;; &lt;span class=&quot;code-comment&quot;&gt;// id: 4
&lt;/span&gt;$role4-&amp;gt;save();

&lt;span class=&quot;code-comment&quot;&gt;// reviewer inherits from admin, mod, publisher - in that order
&lt;/span&gt;$role3-&amp;gt;Parents[] = $role1;
$role3-&amp;gt;Parents[] = $role4;
$role3-&amp;gt;Parents[] = $role2;
$role3-&amp;gt;save();

&lt;span class=&quot;code-comment&quot;&gt;// update positions
&lt;/span&gt;$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;RoleReference&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 0)
	-&amp;gt;where(&apos;id_role_child = ?&apos;, 3)
	-&amp;gt;andWhere(&apos;id_role_parent = ?&apos;, 1)
	-&amp;gt;execute();
$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;RoleReference&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 1)
	-&amp;gt;where(&apos;id_role_child = ?&apos;, 3)
	-&amp;gt;andWhere(&apos;id_role_parent = ?&apos;, 4)
	-&amp;gt;execute();
$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;RoleReference&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 2)
	-&amp;gt;where(&apos;id_role_child = ?&apos;, 3)
	-&amp;gt;andWhere(&apos;id_role_parent = ?&apos;, 2)
	-&amp;gt;execute();
	

&lt;span class=&quot;code-comment&quot;&gt;// add test user
&lt;/span&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;username = &apos;test&apos;;
$user-&amp;gt;password = &apos;test&apos;;
$user-&amp;gt;fromArray(array(&apos;Roles&apos; =&amp;gt; array(4, 2)));
$user-&amp;gt;save();
&lt;span class=&quot;code-comment&quot;&gt;// update positions
&lt;/span&gt;$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;UserRole&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 0)
	-&amp;gt;where(&apos;id_user = ?&apos;, 1)
	-&amp;gt;andWhere(&apos;id_role = ?&apos;, 4)
	-&amp;gt;execute();
$query = Doctrine_Query::create()
	-&amp;gt;update(&apos;UserRole&apos;)
	-&amp;gt;set(&apos;position&apos;, &apos;?&apos;, 1)
	-&amp;gt;where(&apos;id_user = ?&apos;, 1)
	-&amp;gt;andWhere(&apos;id_role = ?&apos;, 2)
	-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Now, lazy-loading self-referenced m2m relations seems to be the issue (I know lazy-loading is wrong but it&apos;s needed to be like that in some parts of our system):&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;$role = Doctrine::getTable(&apos;Role&apos;)-&amp;gt;find(3);
print_r($role-&amp;gt;Parents-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The query which is created and executed during lazy-load of Parents relations is 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;SELECT role.id AS role__id, role.name AS role__name, role_reference.id_role_parent AS role_reference__id_role_parent, role_reference.id_role_child AS role_reference__id_role_child, role_reference.position AS role_reference__position FROM role INNER JOIN role_reference ON role.id = role_reference.id_role_parent WHERE role.id IN (SELECT id_role_parent FROM role_reference WHERE id_role_child = ?) ORDER BY role.id ASC, position
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(seems a little strange as there are no automatically generated aliases e.g. r1, r2 etc. but whole table names)&lt;br/&gt;
The result is ordered by role.id first, then by position (without any alias and that could be an additional problem in some cases)&lt;/p&gt;

&lt;p&gt;The result is: (as you can see the order of roles is 1, 2, 4 (positions: 0, 2, 1) instead of 1, 4, 2)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 1
            [name] =&amp;gt; admin
            [RoleReference] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [id_role_parent] =&amp;gt; 1
                            [id_role_child] =&amp;gt; 3
                            [position] =&amp;gt; 0
                            [Parent] =&amp;gt; 
                        )

                )

        )

    [1] =&amp;gt; Array
        (
            [id] =&amp;gt; 2
            [name] =&amp;gt; publisher
            [RoleReference] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [id_role_parent] =&amp;gt; 2
                            [id_role_child] =&amp;gt; 3
                            [position] =&amp;gt; 2
                            [Parent] =&amp;gt; 
                        )

                )

        )

    [2] =&amp;gt; Array
        (
            [id] =&amp;gt; 4
            [name] =&amp;gt; mod
            [RoleReference] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [id_role_parent] =&amp;gt; 4
                            [id_role_child] =&amp;gt; 3
                            [position] =&amp;gt; 1
                            [Parent] =&amp;gt; 
                        )

                )

        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is NOT an issue with lazy-loading m2m relations between two different models:&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 = Doctrine::getTable(&apos;User&apos;)-&amp;gt;find(1);
print_r($user-&amp;gt;Roles-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The query generated seems to be correct: (well &lt;b&gt;except&lt;/b&gt; the lack of an alias in front of position column in ORDER BY clause)&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 `r`.`id` AS `r__id`, `r`.`name` AS `r__name`, `u`.`id_user` AS `u__id_user`, `u`.`id_role` AS `u__id_role`, `u`.`position` AS `u__position` FROM `role` `r` LEFT JOIN `user_role` `u` ON `r`.`id` = `u`.`id_role` WHERE (`u`.`id_user` IN (?)) ORDER BY position
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It works well for self-referenced relations where relation are defined in DQL e.g.:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = Doctrine_Query::create()
	-&amp;gt;from(&apos;Role r&apos;)
	-&amp;gt;leftJoin(&apos;r.Parents rp&apos;)
	-&amp;gt;orderBy(&apos;r.name ASC&apos;)
	-&amp;gt;where(&apos;r.id = ?&apos;, 3);
	
var_dump($query-&amp;gt;getSqlQuery());
$result = $query-&amp;gt;fetchOne();

print_r($result-&amp;gt;Parents-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;To sum up:&lt;br/&gt;
1. orderBy in m2m self-referenced relations does not work when they are lazy-loaded&lt;br/&gt;
2. lack of table alias for orderBy column when lazy-loading m2m relations between separate models (possibly not an issue?)&lt;/p&gt;

&lt;p&gt;I am not sure if the first one could be fixed at all, due to specific query construction? If not, I would be glad to see a possible workaround for this problem.&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description>
                <environment>php 5.3/win, doctrine 1.2 svn, ATTR_QUOTE_IDENTIFIER = true, ATTR_USE_DQL_CALLBACKS = true</environment>
            <key id="10533">DC-302</key>
            <summary>Issues when using automatic relations ordering through &apos;orderBy&apos; param in m2m 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 14:39:18 +0000</created>
                <updated>Tue, 1 Dec 2009 19:03:23 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:03:23 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10946" author="mh" created="Tue, 1 Dec 2009 18:01:16 +0000"  >&lt;p&gt;Attached test case. I did not know how to test the second issue - is there a db profiler available during unit testing?&lt;/p&gt;</comment>
                    <comment id="10952" author="jwage" created="Tue, 1 Dec 2009 19:03:23 +0000"  >&lt;p&gt;Thanks for the report and test case. I made a change and your test case passes now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10197" name="DC302TestCase.php" size="6926" author="mh" created="Tue, 1 Dec 2009 18:01:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-305] Oracle adapter statement closeCursor() is not working properly</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-305</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Close cursor method cleans up non-existing array &lt;b&gt;$bind_params&lt;/b&gt;, correct variable name is &lt;b&gt;$bindParams&lt;/b&gt;. (comment of $bindParams is wrong to because it also speaks about $bind_params)&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;public function closeCursor()&lt;br/&gt;
{&lt;br/&gt;
	$this-&amp;gt;bind_params = array();&lt;br/&gt;
	return oci_free_statement($this-&amp;gt;statement);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Fix:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;public function closeCursor()&lt;br/&gt;
{&lt;br/&gt;
	$this-&amp;gt;bindParams = array();&lt;br/&gt;
	return oci_free_statement($this-&amp;gt;statement);&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="10536">DC-305</key>
            <summary>Oracle adapter statement closeCursor() is not working properly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2009 18:48:43 +0000</created>
                <updated>Tue, 1 Dec 2009 19:09:01 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:09:01 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-298] Doctrine_Cache_Driver : array_search() expects parameter 2 to be array, boolean given at line 283</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-298</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Cache_Driver::fetch() is supposed to return a string, but an array_search() is made on it by Doctrine_Cache_Driver::_deleteKey() (at line 283).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10521">DC-298</key>
            <summary>Doctrine_Cache_Driver : array_search() expects parameter 2 to be array, boolean given at line 283</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="theredled">Beno&#238;t Guchet</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Nov 2009 15:03:59 +0000</created>
                <updated>Tue, 1 Dec 2009 19:19:27 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 19:19:27 +0000</resolved>
                            <version>1.2.0-RC1</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10907" author="jwage" created="Mon, 30 Nov 2009 15:52:19 +0000"  >&lt;p&gt;I don&apos;t quite understand. Can you explain more?&lt;/p&gt;</comment>
                    <comment id="10913" author="jwage" created="Mon, 30 Nov 2009 17:11:48 +0000"  >&lt;p&gt;Reading your description it doesn&apos;t make any sense. Re-open if you have a better more clear description of the problem.&lt;/p&gt;</comment>
                    <comment id="10915" author="theredled" created="Mon, 30 Nov 2009 17:19:58 +0000"  >&lt;p&gt;It&apos;s not very complicated :&lt;/p&gt;

&lt;p&gt;In Doctrine_Cache_Driver::_deleteKey, you do array_search() with the array $keys as haystack:&lt;/p&gt;

&lt;p&gt;        $keys = $this-&amp;gt;fetch($this-&amp;gt;_cacheKeyIndexKey);&lt;br/&gt;
        $key = array_search($key, $keys);&lt;/p&gt;

&lt;p&gt;But $keys is a string, because Doctrine_Cache_Driver::fetch returns a string (or false) :&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Fetch a cache record from this cache driver instance&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param string $id cache id&lt;/li&gt;
	&lt;li&gt;@param boolean $testCacheValidity        if set to false, the cache validity won&apos;t be tested&lt;/li&gt;
	&lt;li&gt;@return string cached datas (or false)&lt;br/&gt;
     */&lt;br/&gt;
    public function fetch($id, $testCacheValidity = true)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You can&apos;t make an array_search on a string.&lt;/p&gt;

&lt;p&gt;I can&apos;t be more clear &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.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;edit : You may tell me that the PHPdoc is wrong : but the problem still appears when ::fetch returns false.&lt;/p&gt;</comment>
                    <comment id="10917" author="jwage" created="Mon, 30 Nov 2009 17:30:47 +0000"  >&lt;p&gt;The api documentation is wrong, fetch always returns the data structure that was originally stored. So in this case it is an array.&lt;/p&gt;</comment>
                    <comment id="10918" author="theredled" created="Mon, 30 Nov 2009 17:32:30 +0000"  >&lt;p&gt;Ok i&apos;ve anticipated this answer &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;

&lt;p&gt;So Cf. edit of my last comment.&lt;/p&gt;</comment>
                    <comment id="10919" author="jwage" created="Mon, 30 Nov 2009 17:32:31 +0000"  >&lt;p&gt;I updated the API doc blocks.&lt;/p&gt;</comment>
                    <comment id="10939" author="theredled" created="Tue, 1 Dec 2009 13:08:07 +0000"  >&lt;p&gt;Sorry, I reopen this issue again because I still encounter it.&lt;/p&gt;

&lt;p&gt;I&apos;ve watched it deeper to make it reproductible : &lt;/p&gt;

&lt;p&gt;I&apos;m using Doctrine_Cache_Array.&lt;br/&gt;
The problem simply appears when you try to delete a cache entry that does not exist.&lt;/p&gt;

&lt;p&gt;example :&lt;/p&gt;

&lt;p&gt;    $cache = new Doctrine_Cache_Array();&lt;br/&gt;
    $cache-&amp;gt;delete(45);&lt;/p&gt;
</comment>
                    <comment id="10940" author="theredled" created="Tue, 1 Dec 2009 13:29:58 +0000"  >&lt;p&gt;Patch to Doctrine_Cache_Array::_doDelete() so that it returns false if the entry does not exist.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10196" name="Doctrine_Cache_Array.doDelete.new" size="130" author="theredled" created="Tue, 1 Dec 2009 13:29:58 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-289] Using MSSQL connection the find method for models does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-289</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;using a doctrine generated class&apos;s find method produced erroneous SQL such as:&lt;/p&gt;

&lt;p&gt;SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;alias&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__alias&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;ip&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__ip&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;operator_id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__operator_id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;cell_id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__cell_id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;latitude&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__latitude&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;longtitude&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__longtitude&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;community_read&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__community_read&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;community_write&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__community_write&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;last_found_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__last_found_at&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;active&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__active&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;type&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__type&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;poll_mac_behind_sus&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__poll_mac_behind_sus&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__created_at&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;basestation&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &apos;2&apos;)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;commenting out the following line (193)  in&apos; function modifyLimitQuery&apos; for lib/Doctrine/Connection/Mssql.php &lt;/p&gt;

&lt;p&gt;            $query = preg_replace(&apos;/^&apos;.$selectRegExp.&apos;/i&apos;, $selectReplace . &apos;TOP &apos; . ($count + $offset) . &apos; &apos;, $query);&lt;/p&gt;

&lt;p&gt;            //$query = &apos;SELECT TOP &apos; . $count . &apos; &apos; . $this-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;) . &apos;.&apos; . $key_field . &apos; FROM (&apos; . $query . &apos;) AS &apos; . $this-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;);&lt;/p&gt;

&lt;p&gt;            if ($orderby !== false) {&lt;/p&gt;

&lt;p&gt;It  appears to have worked.  This method was part of jwage&apos;s commit for change set 6795 (&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6795/branches/1.2/lib/Doctrine/Connection/Mssql.php&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6795/branches/1.2/lib/Doctrine/Connection/Mssql.php&lt;/a&gt;) so there must be a reason for this change.  This is very preliminary.  If the change works there is a considerable amount of refactoring that way be done.  I will commit a proper patch once I am able to test exhaustively, at the moment this is a show stopper and I need to continue development.&lt;/p&gt;</description>
                <environment>php 5.3.1,&lt;br/&gt;
Symfony 1.4.0-DEV&lt;br/&gt;
Doctrine 1.2.0-RC1&lt;br/&gt;
pdo_mssql (libdb)</environment>
            <key id="10505">DC-289</key>
            <summary>Using MSSQL connection the find method for models does not 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="trevor.lanyon@lanyonconsulting.com">Trevor Lanyon</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Nov 2009 13:03:15 +0000</created>
                <updated>Tue, 2 Mar 2010 12:56:35 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:56:35 +0000</resolved>
                            <version>1.2.0-RC1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>7</watches>
                        <comments>
                    <comment id="10870" author="gensisns" created="Thu, 26 Nov 2009 04:37:36 +0000"  >&lt;p&gt;Trevor,&lt;/p&gt;

&lt;p&gt;I had worked on these changes the jwage committed as I couldn&apos;t find any way how the old code worked. Did this code work in versions before 1.2.0-RC1 or are you just finding this using the new version? &lt;/p&gt;

&lt;p&gt;What code are you using for the find? The code works okay when running a normal dql query.&lt;/p&gt;

&lt;p&gt;Mike&lt;/p&gt;</comment>
                    <comment id="10878" author="trevor.lanyon@lanyonconsulting.com" created="Thu, 26 Nov 2009 13:45:30 +0000"  >&lt;p&gt;Michael,&lt;/p&gt;

&lt;p&gt;It seems as though I first encountered the problem after I did an svn update.  I can assume that it was changeset 6795 as the problem is created in lib/Doctrine/Connection/Mssql.php and the weeks before changeset 6795 the exact same code worked.&lt;/p&gt;

&lt;p&gt;The dql does work very well.  I don&apos;t really use find methods too often as I like to bring my models back with as few loads as possible and most of my models aren&apos;t flat enough to use a find.&lt;/p&gt;

&lt;p&gt;I found the error mostly with the pages that were generated by symonfy as doctrine:generate-model generates lines such as : $this-&amp;gt;forward404Unless($Basestation = Doctrine::getTable(&apos;Basestation&apos;)&lt;del&gt;&amp;gt;find(array($request&lt;/del&gt;&amp;gt;getParameter(&apos;id&apos;))), sprintf(&apos;Object Basestation does not exist (%s).&apos;, $request-&amp;gt;getParameter(&apos;id&apos;));&lt;/p&gt;

&lt;p&gt;The problem is very obvious.  The changeset removed the &apos;SELECT *&apos; and tried to do a &apos;SELECT &lt;/p&gt;
{key}&apos;.  The {key}
&lt;p&gt; is referring to the raw column name but is selecting from a subquery that has already aliased the &lt;/p&gt;
{key} field so it comes back with an error.  I imagine there&apos;s a reason for only selecting the {key}
&lt;p&gt; but I haven&apos;t encountered that yet.  Once I have code that breaks with my change I will be able to implement a better fix.&lt;/p&gt;

&lt;p&gt;For now it seems to be working.&lt;/p&gt;</comment>
                    <comment id="10897" author="gensisns" created="Mon, 30 Nov 2009 04:23:53 +0000"  >&lt;p&gt;Hey Trevor,&lt;/p&gt;

&lt;p&gt;Commenting out the line like you did won&apos;t work when using both a limit and an offset, you have to have the inner and outer queries to have the limit and offset work correctly.&lt;/p&gt;

&lt;p&gt;Regular dql does a &quot;select ... from table where key in (limit suquery here)&quot; for the limit subquery has to only return 1 field.&lt;/p&gt;

&lt;p&gt;What did you mean by &quot;The &lt;/p&gt;
{key} is referring to the raw column name but is selecting from a subquery that has already aliased the {key}
&lt;p&gt; field so it comes back with an error.&quot; Maybe I can work out some code that works in all situations.&lt;/p&gt;

&lt;p&gt;Mike&lt;/p&gt;</comment>
                    <comment id="10904" author="trevor.lanyon@lanyonconsulting.com" created="Mon, 30 Nov 2009 13:00:28 +0000"  >&lt;p&gt;Hi Micheal,&lt;/p&gt;

&lt;p&gt;&quot;Commenting out the line like you did won&apos;t work when using both a limit and an offset, you have to have the inner and outer queries to have the limit and offset work correctly.&quot;&lt;/p&gt;

&lt;p&gt;&amp;#8211; exactly.&lt;/p&gt;

&lt;p&gt;I finally had need for a limit on Friday and had started working on a proper adjustment.  If it is something that you might be able to do that would be fantastic.&lt;/p&gt;

&lt;p&gt;&quot;What did you mean by &quot;The &lt;/p&gt;
{key} is referring to the raw column name but is selecting from a subquery that has already aliased the {key}
&lt;p&gt; field so it comes back with an error.&quot; Maybe I can work out some code that works in all situations.&quot;&lt;/p&gt;

&lt;p&gt;If you look at the SQL that is in the first comment I appended you&apos;ll see:&lt;/p&gt;

&lt;p&gt;&apos;&lt;br/&gt;
SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, ..................&lt;br/&gt;
&apos;&lt;/p&gt;

&lt;p&gt;Which will cause an error as the first statement &quot;SELECT TOP &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM &quot; tries to select &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; however &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; does not exist, it has been aliased to &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.[&lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; as per the SQL in the inner join.&lt;/p&gt;

&lt;p&gt;I hope that is more clear.&lt;/p&gt;

&lt;p&gt;I&apos;m going to fumble around the code a little this morning and see if I can come up with something. &lt;/p&gt;

&lt;p&gt;Thank you Michael.&lt;/p&gt;</comment>
                    <comment id="11047" author="jwage" created="Mon, 7 Dec 2009 17:34:05 +0000"  >&lt;p&gt;Any updates or new information on this issue?&lt;/p&gt;</comment>
                    <comment id="11106" author="gensisns" created="Wed, 9 Dec 2009 02:43:30 +0000"  >&lt;p&gt;I&apos;m working on a fix, have something in a couple days.&lt;/p&gt;</comment>
                    <comment id="11123" author="aiso" created="Wed, 9 Dec 2009 11:34:47 +0000"  >&lt;p&gt;Hi, I will put my comments to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-318&quot; title=&quot;Doctrine_Table::find(x) fails for odbc/mssql connection due to limit() clause&quot;&gt;&lt;del&gt;DC-318&lt;/del&gt;&lt;/a&gt; here since it is a duplicate of this one.&lt;/p&gt;

&lt;p&gt;the last patch of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-318&quot; title=&quot;Doctrine_Table::find(x) fails for odbc/mssql connection due to limit() clause&quot;&gt;&lt;del&gt;DC-318&lt;/del&gt;&lt;/a&gt; gives this sql statement:&lt;br/&gt;
SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;version&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__version&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;number&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__number&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;title_nl&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__title_nl&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;title_en&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__title_en&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;published&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__published&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;which is a correct sql statement if executed with sqlcmd.exe. But it still gives me the same exception as shown in the backtrace attached to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-318&quot; title=&quot;Doctrine_Table::find(x) fails for odbc/mssql connection due to limit() clause&quot;&gt;&lt;del&gt;DC-318&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
But isn&apos;t it strange that just the id is return iso the complete record?? If I remove the limit(1) clause from the find function in Table.php it give this sql statement and works perfectly:&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;version&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__version&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;number&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__number&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;title_nl&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__title_nl&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;title_en&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__title_en&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;published&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__published&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)&lt;/p&gt;</comment>
                    <comment id="11157" author="gensisns" created="Thu, 10 Dec 2009 03:37:34 +0000"  >&lt;p&gt;Its more complicated, I&apos;ll write a patch this weekend.&lt;/p&gt;

&lt;p&gt;It needs to be broken out to use seperate functions for modifyLimitQuery and modifyLimitSubQuery, the one function is trying to handle two different things. For a simple dql statement the modifyLimitQuery needs to return all fields. In a complex dql query, it needs to return the key field only as it is used as part of the where statement in the overall query.&lt;/p&gt;</comment>
                    <comment id="11234" author="gensisns" created="Fri, 18 Dec 2009 21:08:54 +0000"  >&lt;p&gt;I&apos;m attaching a patch Mssql-Patch-20091218.php. This should fix all the find problems and the pager problems.&lt;/p&gt;

&lt;p&gt;Trevor and Aiso, can you test the patch before Jon applies it. I&apos;ve tested it using regular dql querying, it needs to be tested using the find function and also using the pager. Two things to look for - does it work obviously, which means it fixed the field name error, and second, does it return all the fields, before it was only returning the id field.&lt;/p&gt;

&lt;p&gt;Jon - To avoid tons of code duplicaton between modifyLimitQuery and modifyLimitSubQuery, I added a parameter to modifyLimitQuery, if this is no good, we can change it to just duplicate the code between the two functions.&lt;/p&gt;

&lt;p&gt;Mike&lt;/p&gt;</comment>
                    <comment id="11241" author="aiso" created="Sat, 19 Dec 2009 20:49:50 +0000"  >&lt;p&gt;Thanks Michael for the patch. I just tested it and it doesn&apos;t work. Still the same odbc exception when executing the sql statement. The exception goes like this:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22018&amp;#93;&lt;/span&gt;: Invalid character value for cast specification: 206 &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 Native Client&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;Er is een conflict met het type operand ontstaan: text is incompatibel met int (SQLExecute&lt;span class=&quot;error&quot;&gt;&amp;#91;206&amp;#93;&lt;/span&gt; at ext\pdo_odbc\odbc_stmt.c:254)&lt;/p&gt;

&lt;p&gt;the query that is finally produced by modifyLimitQuery() (so the one that fails) is:&lt;/p&gt;

&lt;p&gt;SELECT * FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;published&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__published&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Note that if I return the $query on line 194, just after the preg_replace, everything is fine. In that case the sql statement is (so basically the inner most select):&lt;/p&gt;

&lt;p&gt;SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;published&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__published&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)&lt;/p&gt;

&lt;p&gt;so, I have 2 questions:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;why not return this last (working) query in this case? Why bother with doing the 3 nested selects?&lt;/li&gt;
	&lt;li&gt;I don&apos;t see how the nested queries can work in the first place since the second query selects only the id, iso the complete entry. I tried this : &apos;SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)&apos; and although I do not get an exception I don&apos;t get the right record! But not very suprising to me since you return only an id.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note that if I run the failing query (so the 3 nested selects) in SQL Server Manager I get the id without problems, so the statement itself is correct (although I do not think it is correct only to return the id). So maybe this is a problem in pdo_odbc only?&lt;/p&gt;</comment>
                    <comment id="11242" author="aiso" created="Sat, 19 Dec 2009 21:39:22 +0000"  >&lt;p&gt;Hi Michael, I completely missed the rest of your last comment, sorry about that: so my questions are a bit awkward. I read also that in some cases it is necessary to use the nested selects. &lt;br/&gt;
To comment on your 2 things to look for: it does work in the sense that the field name error is solved, but wrt your second thing: maybe all fields are return in the end but I could not test this properly since the pdo_odbc will not tolerate the nested selects construction so it seems.&lt;/p&gt;

&lt;p&gt;Note that I get the same exception when using only 2 selects like this:&lt;br/&gt;
SELECT * FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;published&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;b__published&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;building&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;b&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                    <comment id="11243" author="aiso" created="Sun, 20 Dec 2009 15:27:41 +0000"  >&lt;p&gt;I figured out that my app suffers from a very old bug in the SQL server client app. See &lt;a href=&quot;http://bugs.php.net/bug.php?id=36561&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/bug.php?id=36561&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It says it cannot handle bound params in a subquery! So I don&apos;t know how you fellows make this work??? It basically means that all this code is useless since it will never work for mssql until microsoft comes up with a solution!&lt;/p&gt;

&lt;p&gt;I just upgraded from sql server 2005 express to 2008 express to see if that helped but it didn&apos;t. So this is a very disturbing bug that is in the code since 2006 and till this day is never solved....&lt;/p&gt;

&lt;p&gt;So, are there any versions of mssql server that can handle these subqueries, I wonder? What do you guys use to make this work??? I think the conclusion is that pdo_odbc and doctrine will never work.&lt;/p&gt;</comment>
                    <comment id="11257" author="trevor.lanyon@lanyonconsulting.com" created="Mon, 21 Dec 2009 13:41:05 +0000"  >&lt;p&gt;Hi Michael and Aiso,&lt;/p&gt;

&lt;p&gt;I had ran into that problem with sub query casting integers as strings.  That cost me about 4 hours.  I had to go into the Query Analyzer to find that pdo_lib was encapsulating the integers in quotation marks (making them strings) even though the query debug window was showing them without encapsulation.  Although it is a terrible solution I embedded the integers directly into the SQL.  It was the only option and it worked good enough (for now).&lt;/p&gt;

&lt;p&gt;I agree that mssql (using pdo_lib for connectivity) might be too limited.  As well as the bug you&apos;ve indicated pdo_lib also limits column names to 30 characters.  These limitations are very, very frustrating.&lt;/p&gt;

&lt;p&gt;In regards to the patch I&apos;m still generating errors:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 207 General SQL Server error: Check messages from the SQL Server &lt;span class=&quot;error&quot;&gt;&amp;#91;207&amp;#93;&lt;/span&gt; (severity 16) &lt;span class=&quot;error&quot;&gt;&amp;#91;(null)&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;With the following code:&lt;/p&gt;

&lt;p&gt; 45 $q = Doctrine::getTable( &apos;Radiusdat&apos; )-&amp;gt;createQuery(  &apos;r&apos; )&lt;br/&gt;
 46          &lt;del&gt;&amp;gt;where( &apos;r.username LIKE ?&apos;, $this&lt;/del&gt;&amp;gt;getUsername( ) )&lt;br/&gt;
 47          -&amp;gt;orderBy( &apos;r.callstart DESC&apos; )&lt;br/&gt;
 48          -&amp;gt;limit( $limit );&lt;/p&gt;


&lt;p&gt;The SQL generated looks like this:&lt;/p&gt;

&lt;p&gt;SELECT * &lt;br/&gt;
  FROM (SELECT TOP 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;r__username&amp;#93;&lt;/span&gt; &lt;br/&gt;
          FROM (SELECT TOP 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;username&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__username&amp;#93;&lt;/span&gt;&lt;br/&gt;
                            , &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;callstart&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__callstart&amp;#93;&lt;/span&gt;&lt;br/&gt;
                            , &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;callend&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__callend&amp;#93;&lt;/span&gt;&lt;br/&gt;
                            , &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;sessid&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;r__sessid&amp;#93;&lt;/span&gt;&lt;br/&gt;
						 FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;radiusdat&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt; &lt;br/&gt;
        WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;username&amp;#93;&lt;/span&gt; LIKE &apos;&apos;) &lt;br/&gt;
     ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;r&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;callstart&amp;#93;&lt;/span&gt; DESC) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; &lt;br/&gt;
     ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;r__callstart&amp;#93;&lt;/span&gt; ASC) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt; &lt;br/&gt;
     ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;r__callstart&amp;#93;&lt;/span&gt; DESC&lt;/p&gt;

&lt;p&gt;Running the query manually I get the following:&lt;br/&gt;
&quot;Invalid column name &apos;r__callstart&apos;&quot;&lt;/p&gt;

&lt;p&gt;If you look at the SQL you&apos;ll see that it is trying to ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;r__callstart&amp;#93;&lt;/span&gt; by &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;r__callstart&amp;#93;&lt;/span&gt; does not exist, only &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;r__username&amp;#93;&lt;/span&gt; exists.&lt;/p&gt;

&lt;p&gt;Please let me know if I can test anything else.&lt;/p&gt;</comment>
                    <comment id="11260" author="gensisns" created="Mon, 21 Dec 2009 15:22:59 +0000"  >&lt;p&gt;Trevor - added a new patch, can you give this one a try. I think this should work in both situations now: modify limit queries and modify limit subqueries.&lt;/p&gt;</comment>
                    <comment id="11261" author="trevor.lanyon@lanyonconsulting.com" created="Mon, 21 Dec 2009 17:35:40 +0000"  >&lt;p&gt;Hi Michael - Tried applying the patch : didn&apos;t work (tried applying it to the previously patched then I deleted the file, svn updated and tried applying it still didn&apos;t work) so I did it by hand.  The results might be wrong  because I messed up the application.&lt;/p&gt;

&lt;p&gt;It is having a problem now in that it isn&apos;t aliasing the outside table, ie:&lt;/p&gt;

&lt;p&gt;The application generates this code:&lt;br/&gt;
SELECT * FROM ( SELECT TOP 1 * FROM ( SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;login_name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__login_name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;last_login_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__last_login_at&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;display_name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__display_name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__created_at&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;ad_user&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;login_name&amp;#93;&lt;/span&gt; = &apos;tlanyon&apos;)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;which is missing a &quot;) as &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;

&lt;p&gt;results of the attempted patch:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;tlanyon@samadams Connection&amp;#93;&lt;/span&gt;$ rm Mssql.php &lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;tlanyon@samadams Connection&amp;#93;&lt;/span&gt;$ svn update &lt;br/&gt;
Restored &apos;Mssql.php&apos;&lt;br/&gt;
At revision 6971.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;tlanyon@samadams Connection&amp;#93;&lt;/span&gt;$ patch Mssql.php Mssql-Patch-20091221.php &lt;br/&gt;
(Stripping trailing CRs from patch.)&lt;br/&gt;
patching file Mssql.php&lt;br/&gt;
patch unexpectedly ends in middle of line&lt;br/&gt;
patch: **** unexpected end of file in patch at line 47&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;</comment>
                    <comment id="11268" author="gensisns" created="Tue, 22 Dec 2009 15:41:21 +0000"  >&lt;p&gt;Hi Trevor, patch corrected, I think it was missing a new line at the end. Let me know is it works now. or if it is still not including the &quot;) as &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;</comment>
                    <comment id="11269" author="trevor.lanyon@lanyonconsulting.com" created="Tue, 22 Dec 2009 16:27:05 +0000"  >&lt;p&gt;Hi Michael,&lt;/p&gt;

&lt;p&gt;The patch applied.  Thank you.&lt;/p&gt;

&lt;p&gt;The solution did not work however.  The below code:&lt;/p&gt;

&lt;p&gt;Doctrine::getTable( &apos;CcmePoll&apos; )&lt;br/&gt;
 86                    -&amp;gt;createQuery( &apos;p&apos; )&lt;br/&gt;
 87                    -&amp;gt;innerJoin( &apos;p.CcmeEphoneAct a&apos; )&lt;br/&gt;
 88                    &lt;del&gt;&amp;gt;where( &apos;p.created_at &amp;lt; ?&apos;, $this&lt;/del&gt;&amp;gt;start )&lt;br/&gt;
 89                    -&amp;gt;andWhere( &apos;a.tag = ?&apos;, $ePhone&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;tag&amp;#39;&amp;#93;&lt;/span&gt; )&lt;br/&gt;
 90                    -&amp;gt;orderBy( &apos;p.created_at desc&apos; )&lt;br/&gt;
 91                    -&amp;gt;limit( 1 ) &lt;br/&gt;
 92                    -&amp;gt;fetchOne(  );&lt;/p&gt;

&lt;p&gt;generated this SQL:&lt;/p&gt;

&lt;p&gt;SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;type&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__type&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__created_at&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_poll_id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__ccme_poll_id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;tag&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__tag&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;device_name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__device_name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;registration_state&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__registration_state&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;active_dn&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__active_dn&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;activity_status&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__activity_status&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;keep_alive_count&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__keep_alive_count&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;pending_reset&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__pending_reset&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;registration_time&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__registration_time&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;current_firmware&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__current_firmware&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;previous_firmware&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__previous_firmware&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;last_error&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__last_error&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;observed_type&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__observed_type&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;login_status&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__login_status&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;dnd_status&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__dnd_status&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;debug_status&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__debug_status&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;media_active&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__media_active&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;tapi_client&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__tapi_client&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;media_capability&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__media_capability&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;remote&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c2__remote&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_poll&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; INNER JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_ephone_act&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt; ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_poll_id&amp;#93;&lt;/span&gt; WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; FROM (SELECT DISTINCT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_poll&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; INNER JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_ephone_act&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt; ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;ccme_poll_id&amp;#93;&lt;/span&gt; WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; &amp;lt; &apos;2009-12-22 8:0:00&apos; AND &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;tag&amp;#93;&lt;/span&gt; = &apos;13&apos; ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; desc) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.[ ASC) AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; &amp;lt; &apos;2009-12-22 8:0:00&apos; AND &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;tag&amp;#93;&lt;/span&gt; = &apos;13&apos;) ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; desc&lt;/p&gt;

&lt;p&gt;Without having to go through the whole thing please pay special attention to this, near the bottom of the statement:&lt;/p&gt;

&lt;p&gt;           AND &lt;span class=&quot;error&quot;&gt;&amp;#91;c2&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;tag&amp;#93;&lt;/span&gt; = &apos;13&apos; &lt;br/&gt;
          ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; desc) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; &lt;br/&gt;
 ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.[ ASC) &lt;/p&gt;

&lt;p&gt;The code is not including the entire field name.&lt;/p&gt;

&lt;p&gt;Hope this helps.  &lt;/p&gt;
</comment>
                    <comment id="11271" author="gensisns" created="Tue, 22 Dec 2009 19:06:57 +0000"  >&lt;p&gt;After attempting to debug this for about 30 minutes, I realized your probably not running 1.2.0RC1, apply the changes in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-254&quot; title=&quot;getLimitSubquery Not Including All Order By Parts&quot;&gt;DC-254&lt;/a&gt; and this problem your having should go away.&lt;/p&gt;

&lt;p&gt;On another note, does the query that was producing:&lt;br/&gt;
SELECT * FROM ( SELECT TOP 1 * FROM ( SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;login_name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__login_name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;last_login_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__last_login_at&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;display_name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__display_name&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;created_at&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__created_at&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;ad_user&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;login_name&amp;#93;&lt;/span&gt; = &apos;tlanyon&apos;)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;br/&gt;
work now?&lt;/p&gt;
</comment>
                    <comment id="11272" author="trevor.lanyon@lanyonconsulting.com" created="Tue, 22 Dec 2009 19:28:01 +0000"  >&lt;p&gt;Hi Micheal,  &lt;/p&gt;

&lt;p&gt;I&apos;m sorry if I have in anyway wasted your time.  The fix &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-254&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-254&lt;/a&gt; has already been applied to my code base (according to the symfony debug window I&apos;m running (Doctrine Version: 1.2.1 which seems to include the modification).  I maybe be confused.&lt;/p&gt;

&lt;p&gt;Yes.  The select without the embedded order by works perfectly now.&lt;/p&gt;

&lt;p&gt;Please let me know if I can be more of a help. &lt;/p&gt;

&lt;p&gt;Thank you for your attention.&lt;/p&gt;</comment>
                    <comment id="11273" author="gensisns" created="Tue, 22 Dec 2009 19:53:07 +0000"  >&lt;p&gt;No problem at all, I really thought that was the issue &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;Are you using dblib? If so, edit \lib\Doctrine\Query.php line 1367:&lt;br/&gt;
&amp;lt;         if ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;         if ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos; || $driverName == &apos;dblib&apos;) {&lt;/p&gt;

&lt;p&gt;Then give it a try again and let me know if we&apos;ve got it now.&lt;/p&gt;

&lt;p&gt;MIke&lt;/p&gt;</comment>
                    <comment id="11274" author="trevor.lanyon@lanyonconsulting.com" created="Tue, 22 Dec 2009 20:33:10 +0000"  >&lt;p&gt;That did it.&lt;/p&gt;

&lt;p&gt;Excellent.  Excellent.  Excellent.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</comment>
                    <comment id="11275" author="gensisns" created="Tue, 22 Dec 2009 20:37:57 +0000"  >&lt;p&gt;Give it a try on a bucnh of queries and see it you can come up with anything that isn&apos;t working (because of this issue &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;) otherwise, maybe we can finally get this committed.&lt;/p&gt;

&lt;p&gt;Mike&lt;/p&gt;</comment>
                    <comment id="11277" author="trevor.lanyon@lanyonconsulting.com" created="Tue, 22 Dec 2009 20:59:43 +0000"  >&lt;p&gt;Hi Mike,&lt;/p&gt;

&lt;p&gt;I&apos;ve tested it on ten different scenarios ranging from find() to complex dql including inner joins, left joins, orderBy and limit statements. &lt;/p&gt;

&lt;p&gt;I have not tested in the example of a pager as I have no need for one.  I will create a pager and have an answer for you within 24 hours.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    <comment id="11285" author="trevor.lanyon@lanyonconsulting.com" created="Wed, 23 Dec 2009 19:47:26 +0000"  >&lt;p&gt;I tested the pager and I had some mixed results.&lt;/p&gt;

&lt;p&gt;The pager seemed to only work if you indicate a orderBy clause in the query you send the pager.&lt;/p&gt;

&lt;p&gt;I imagine this has to with the strange way one must order results to facilitate the LIMIT X,Y functionality of other  (IMHO superior) DBMSs.&lt;/p&gt;

&lt;p&gt;I&apos;m expecting this information may make sense to and should suffice for 99% of usage as most people would sort the results when using a pager.&lt;/p&gt;

&lt;p&gt;Please let me know if I may help at all.&lt;/p&gt;

&lt;p&gt;Thank you again!&lt;/p&gt;</comment>
                    <comment id="11286" author="gensisns" created="Wed, 23 Dec 2009 19:53:53 +0000"  >&lt;p&gt;What sql does it spit out if you don&apos;t use an order by statement? Maybe there is a small tweak I can make to get it working in those situations.&lt;/p&gt;</comment>
                    <comment id="11287" author="trevor.lanyon@lanyonconsulting.com" created="Wed, 23 Dec 2009 20:21:45 +0000"  >&lt;p&gt;The below is an example of the same query for page 1, 2, 3 with first no order by and then order by.&lt;/p&gt;

&lt;p&gt;Please let me know if my summary has left out inportant information&lt;/p&gt;

&lt;p&gt;Query Used:&lt;/p&gt;

&lt;p&gt;68           $query = Doctrine_Query::create()&lt;br/&gt;
69                   -&amp;gt;from( &quot;Customer c&quot; )&lt;br/&gt;
70                   -&amp;gt;leftJoin( &apos;c.Accessdatas a&apos; )&lt;br/&gt;
71                   -&amp;gt;leftJoin( &apos;c.SipPhoneServices s&apos; )&lt;br/&gt;
72                   -&amp;gt;where( $whereSQL );&lt;/p&gt;

&lt;p&gt;/*No Order By Page 1&lt;br/&gt;
  ---------------*/&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
     , &lt;span class=&quot;error&quot;&gt;&amp;#91;lots.of.fields&amp;#93;&lt;/span&gt;  &lt;br/&gt;
FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   FROM (SELECT DISTINCT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;) &lt;br/&gt;
                   AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;)&lt;/p&gt;

&lt;p&gt;/*No Order By Page 2&lt;br/&gt;
  ---------------*/&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
     , &lt;span class=&quot;error&quot;&gt;&amp;#91;lots.of.fields&amp;#93;&lt;/span&gt;  &lt;br/&gt;
FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   FROM (SELECT DISTINCT TOP 40 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;) &lt;br/&gt;
                   AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;)&lt;/p&gt;

&lt;p&gt;/*No Order By Page 3&lt;br/&gt;
  ---------------*/&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
     , &lt;span class=&quot;error&quot;&gt;&amp;#91;lots.of.fields&amp;#93;&lt;/span&gt;  &lt;br/&gt;
FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   FROM (SELECT DISTINCT TOP 60 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;) &lt;br/&gt;
                   AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;)&lt;/p&gt;

&lt;p&gt;Query Used:&lt;/p&gt;

&lt;p&gt;68           $query = Doctrine_Query::create()&lt;br/&gt;
69                   -&amp;gt;from( &quot;Customer c&quot; )&lt;br/&gt;
70                   -&amp;gt;leftJoin( &apos;c.Accessdatas a&apos; )&lt;br/&gt;
71                   -&amp;gt;leftJoin( &apos;c.SipPhoneServices s&apos; )&lt;br/&gt;
72                   -&amp;gt;where( $whereSQL )&lt;br/&gt;
73                   -&amp;gt;orderBy( &apos;c.Name&apos; );&lt;/p&gt;

&lt;p&gt;/*Order By Page 1&lt;br/&gt;
  ---------------*/&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
     , &lt;span class=&quot;error&quot;&gt;&amp;#91;lots.of.fields&amp;#93;&lt;/span&gt;  &lt;br/&gt;
FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   FROM (SELECT DISTINCT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;&lt;br/&gt;
                         , &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LIKE &apos;%smith%&apos; &lt;br/&gt;
                         ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; DESC) &lt;br/&gt;
AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;) &lt;br/&gt;
ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;/*Order By Page 2&lt;br/&gt;
  ---------------*/&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
     , &lt;span class=&quot;error&quot;&gt;&amp;#91;lots.of.fields&amp;#93;&lt;/span&gt;  &lt;br/&gt;
FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   FROM (SELECT DISTINCT TOP 40 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LIKE &apos;%smith%&apos; &lt;br/&gt;
                         ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; DESC) &lt;br/&gt;
AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;) &lt;br/&gt;
ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;/*Order By Page 3&lt;br/&gt;
  ---------------*/&lt;br/&gt;
SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;c__id&amp;#93;&lt;/span&gt;&lt;br/&gt;
     , &lt;span class=&quot;error&quot;&gt;&amp;#91;lots.of.fields&amp;#93;&lt;/span&gt;  &lt;br/&gt;
FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; IN (SELECT TOP 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   FROM (SELECT DISTINCT TOP 60 &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt;&lt;br/&gt;
                         , &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;customer&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;accessdata&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         LEFT JOIN &lt;span class=&quot;error&quot;&gt;&amp;#91;sipPhoneService&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         ON &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;d_custid&amp;#93;&lt;/span&gt; &lt;br/&gt;
                         WHERE &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos; &lt;br/&gt;
                         ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; &lt;br/&gt;
                   ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; DESC) &lt;br/&gt;
AND (&lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;email&amp;#93;&lt;/span&gt; LIKE &apos;%smith%&apos;) ORDER BY &lt;span class=&quot;error&quot;&gt;&amp;#91;c&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;/p&gt;
</comment>
                    <comment id="11288" author="gensisns" created="Wed, 23 Dec 2009 20:28:57 +0000"  >&lt;p&gt;Was it producing bad sql or just weird results. It looks like the queries for no order by are valid.&lt;/p&gt;</comment>
                    <comment id="11289" author="trevor.lanyon@lanyonconsulting.com" created="Wed, 23 Dec 2009 20:35:09 +0000"  >&lt;p&gt;The SQL was valid. &lt;/p&gt;

&lt;p&gt;Just weird results.  Moving through the pages would not move through the results predictably.  Moving from page 1 to page 2 would display the same results.  Moving from page 2 to page 3 would again show the same results.  Moving from page 3 to page four would then show the last page&apos;s results (or something similar).  &lt;/p&gt;</comment>
                    <comment id="11290" author="gensisns" created="Wed, 23 Dec 2009 20:40:52 +0000"  >&lt;p&gt;Good, weird results is okay, just wanted to make sure the sql wasn&apos;t causing errors.&lt;/p&gt;</comment>
                    <comment id="11291" author="gensisns" created="Wed, 23 Dec 2009 20:42:53 +0000"  >&lt;p&gt;@jwage Can you commit the most recent patch, everything is finally working correctly.&lt;/p&gt;</comment>
                    <comment id="11576" author="datiecher" created="Tue, 2 Feb 2010 13:37:58 +0000"  >&lt;p&gt;@Michael Card&lt;/p&gt;

&lt;p&gt;The issue with limit and offset methods not working properly punched me in the face today. After an hour of going through a lot of ways to simulate them in SQL Server i came up with two ways of doing it:&lt;/p&gt;

&lt;p&gt;Default way (the one M$ suggests)&lt;br/&gt;
--------------&lt;br/&gt;
Create a query that looks like this:&lt;/p&gt;

&lt;p&gt;SELECT * FROM (&lt;br/&gt;
  SELECT TOP $limit * FROM (&lt;br/&gt;
    SELECT TOP ($limit + $offset) &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id_tipo_produto&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__id_tipo_produto&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;nm_produto_base&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__nm_produto_base&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;fg_ativo&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__fg_ativo&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;ad_produto_base&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; order by &lt;span class=&quot;error&quot;&gt;&amp;#91;a__id&amp;#93;&lt;/span&gt; ASC&lt;br/&gt;
  ) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt; ORDER BY 1 DESC&lt;br/&gt;
) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt; ORDER BY 1 ASC&lt;/p&gt;

&lt;p&gt;Problem with this solution:&lt;br/&gt;
When you are near the end of the paging and queries for the remaining results you will receive all the results from the last page AND some results from the previous one.&lt;/p&gt;

&lt;p&gt;Way that I came up with when drinking some tea&lt;br/&gt;
----------------------------------------------&lt;br/&gt;
Simply add the suffix &quot; WHERE $index &amp;gt; $offset&quot; to the end of the $query variable before wrapping it in its outer selects.&lt;/p&gt;

&lt;p&gt;This would produce something along the lines of:&lt;br/&gt;
SELECT * FROM (&lt;br/&gt;
  SELECT TOP 2 * FROM (&lt;br/&gt;
    SELECT &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id_tipo_produto&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__id_tipo_produto&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;nm_produto_base&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__nm_produto_base&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;fg_ativo&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;a__fg_ativo&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;ad_produto_base&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt; WHERE $index &amp;gt; $offset&lt;br/&gt;
  ) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;&lt;br/&gt;
) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Problem with this solution: your inner select WILL need to have an integer index to compare to the value of $offset. In my case all my tables have an id field so that&apos;s not a problem but I guess this would not always be the case. Besides that, I couldn&apos;t find a way to retrieve the primary key name (my $index) from inside the method you modified and hardcoded  &quot; WHERE id &amp;gt; {$offset}&quot; on it instead.&lt;/p&gt;

&lt;p&gt;I&apos;m sure that with my 2 cents we will be able to work out a more reliable solution to this issue.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;</comment>
                    <comment id="11579" author="gensisns" created="Tue, 2 Feb 2010 15:59:47 +0000"  >&lt;p&gt;@Daniel&lt;/p&gt;

&lt;p&gt;That solution would work of sorting by anything but the id field though, the solution needs to be able to sort by any field. I will take a look at the issue you mentioned, about the last page of the paging results, and see what can be done.&lt;/p&gt;

&lt;p&gt;Mike&lt;/p&gt;</comment>
                    <comment id="11884" author="craigmarvelley" created="Mon, 1 Mar 2010 10:59:43 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I was wondering what the status of this issue was? We&apos;re also suffering the pain of trying to get Doctrine working with ODBC and MSSQL, and the patch solved a few bugs for us. Obviously there are still some kinks to be worked out but the driver&apos;s unusable in it&apos;s current state. If it&apos;s a case of needing the pager issue resolved first I&apos;d gladly look at fixing it.&lt;/p&gt;

&lt;p&gt;Incidentally, regarding Aiso Haikens&apos; comment above - we&apos;ve also come up against the binding issue and like Trevor have temporarily got around it by rewriting queries so the parameters are inline rather than bound. Not pleasant. We&apos;re investigating whether it can be patched at the PDO driver level but so far no joy. Do you think it would be worth adding our rewrite patch in the meantime so at least queries aren&apos;t subject to that bug?&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;

</comment>
                    <comment id="11971" author="jwage" created="Tue, 2 Mar 2010 12:56:35 +0000"  >&lt;p&gt;I committed the most recent patch and all tests passed. Thanks for everyones work and comments on the issue.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Jon&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="10555">DC-318</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10240" name="Mssql-Patch-20091218.php" size="1597" author="gensisns" created="Fri, 18 Dec 2009 21:09:02 +0000" />
                    <attachment id="10245" name="Mssql-Patch-20091221.php" size="2153" author="gensisns" created="Mon, 21 Dec 2009 15:20:38 +0000" />
                    <attachment id="10249" name="Mssql-Patch-20091222.php" size="2155" author="gensisns" created="Tue, 22 Dec 2009 15:41:32 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-285] Doctrine_Migration::createForeignKey takes 2 args, documentation says 3 args, code in docs does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-285</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The documentation here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_0/en/migrations:writing-migration-classes:available-operations:create-foreign-key&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_0/en/migrations:writing-migration-classes:available-operations:create-foreign-key&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Says that when coding a migration, createForeignKey should take three arguments like so:&lt;/p&gt;

&lt;p&gt;this-&amp;gt;createForeignKey(&apos;table_name&apos;, &apos;email_foreign_key&apos;, $definition);&lt;/p&gt;

&lt;p&gt;That produces this error:&lt;/p&gt;

&lt;p&gt;macintosh-4:pogil boutell$ ./symfony doctrine:migrate&lt;br/&gt;
Catchable fatal error: Argument 2 passed to Doctrine_Migration::createForeignKey() must be an array, string given, called in /Users/boutell/Sites/pogil/lib/migration/doctrine/022_eventrequestcreator.class.php on line 17 and defined in /Users/boutell/Sites/pogil/lib/vendor/doctrine/Doctrine/Migration.php on line 487&lt;/p&gt;

&lt;p&gt;The source code says:&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;createForeignKey&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param string $tableName&lt;/li&gt;
	&lt;li&gt;@param string $constraintName&lt;/li&gt;
	&lt;li&gt;@return void&lt;br/&gt;
     */&lt;br/&gt;
    public function createForeignKey($tableName, array $definition)
    {
        $options = get_defined_vars();
        
        $this-&amp;gt;addChange(&apos;created_fks&apos;, $options);
    }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I grepped for created_fks and found no references to it except in calls to addChange(), so I don&apos;t know where it&apos;s consumed or how, so... I don&apos;t know what the correct code might look like.&lt;/p&gt;

&lt;p&gt;Right now it is not possible to add foreign keys in a migration by following the 1.0.x documentation.&lt;/p&gt;</description>
                <environment>Symfony 1.2, but using branches/1.0 of Doctrine</environment>
            <key id="10501">DC-285</key>
            <summary>Doctrine_Migration::createForeignKey takes 2 args, documentation says 3 args, code in docs does not 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Nov 2009 20:06:03 +0000</created>
                <updated>Wed, 25 Nov 2009 00:27:42 +0000</updated>
                    <resolved>Tue, 24 Nov 2009 20:53:50 +0000</resolved>
                            <version>1.0.13</version>
                <version>1.0.14</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10849" author="jwage" created="Tue, 24 Nov 2009 20:53:50 +0000"  >&lt;p&gt;The documentation is just wrong. The api is correct.&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;$definition = array(
            &apos;name&apos;          =&amp;gt; &apos;email_foreign_key&apos;,
            &apos;local&apos;         =&amp;gt; &apos;email_id&apos;,
            &apos;foreign&apos;       =&amp;gt; &apos;id&apos;,
            &apos;foreignTable&apos;  =&amp;gt; &apos;email&apos;,
            &apos;onDelete&apos;      =&amp;gt; &apos;CASCADE&apos;
);

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createForeignKey(&apos;table_name&apos;, $definition);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10857" author="boutell" created="Wed, 25 Nov 2009 00:27:42 +0000"  >&lt;p&gt;Makes sense. I suppose I should have tried &apos;name.&apos; (: Thanks for fixing the docs.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-279] Code Corrections For MsSql modifyLimitQuery</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-279</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Below are some code corrections for the modifyLimitQuery. These fixes should also fix &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-37&quot; title=&quot;Performing JOIN and ORDERBY and using the PAGER in MSSQL results in bad query&quot;&gt;&lt;del&gt;DC-37&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code details:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Fixed case on sorting orders to match all other syntax.&lt;/li&gt;
	&lt;li&gt;Added additional explode to ensure we only get fieldname and not tablename.fieldname.&lt;/li&gt;
	&lt;li&gt;Added code to determine primary key for use in select statement. There may be a better way of doing this, but not with the input sent to the function I don&apos;t think.&lt;/li&gt;
	&lt;li&gt;Removed the outer table (not sure how this could have ever worked) and switched inner table to return only primary key and not all fields.&lt;/li&gt;
	&lt;li&gt;Removed outer table order by logic.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Diff - Old To New:&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;160c160
&amp;lt;                     $sorts[$i] = (stripos($orders[$i], &apos; desc&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) ? &apos;desc&apos; : &apos;asc&apos;;
---
&amp;gt;                     $sorts[$i] = (stripos($orders[$i], &apos; desc&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) ? &apos;DESC&apos; : &apos;ASC&apos;;
171a172
&amp;gt;                     $aux2 = explode(&apos;.&apos;, end($aux2));
185a187,191
&amp;gt;             $fields_string = substr($query, strlen($selectReplace), strpos($query, &apos; FROM &apos;) - strlen($selectReplace));
&amp;gt;             $field_array = explode(&apos;,&apos;, $fields_string);
&amp;gt;             $aux2 = explode(&apos;.&apos;, $field_array[0]);
&amp;gt;             $key_field = trim(end($aux2));
&amp;gt; 
187c193
&amp;lt;             $query = &apos;SELECT * FROM (SELECT TOP &apos; . $count . &apos; * FROM (&apos; . $query . &apos;) AS &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;);
---
&amp;gt;             $query = &apos;SELECT TOP &apos; . $count . &apos; &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;) . &apos;.&apos; . $key_field . &apos; FROM (&apos; . $query . &apos;) AS &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;);
199,212d204
&amp;lt;                 }
&amp;lt;             }
&amp;lt; 
&amp;lt;             $query .= &apos;) AS &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;outer_tbl&apos;);
&amp;lt; 
&amp;lt;             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderby !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
&amp;lt;                 $query .= &apos; ORDER BY &apos;; 
&amp;lt; 
&amp;lt;                 &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0, $l = count($orders); $i &amp;lt; $l; $i++) { 
&amp;lt;                     &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($i &amp;gt; 0) { &lt;span class=&quot;code-comment&quot;&gt;// not first order clause 
&lt;/span&gt;&amp;lt;                         $query .= &apos;, &apos;; 
&amp;lt;                     } 
&amp;lt; 
&amp;lt;                     $query .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;outer_tbl&apos;) . &apos;.&apos; . $aliases[$i] . &apos; &apos; . $sorts[$i];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entire New Function:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function modifyLimitQuery($query, $limit = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $offset = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isManip = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($limit &amp;gt; 0) {
            $count = intval($limit);
            $offset = intval($offset);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset &amp;lt; 0) {
                &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Connection_Exception(&lt;span class=&quot;code-quote&quot;&gt;&quot;LIMIT argument offset=$offset is not valid&quot;&lt;/span&gt;);
            }

            $orderby = stristr($query, &apos;ORDER BY&apos;);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderby !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
                &lt;span class=&quot;code-comment&quot;&gt;// Ticket #1835: Fix &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ORDER BY alias
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// Ticket #2050: Fix &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; multiple ORDER BY clause
&lt;/span&gt;                $order = str_ireplace(&apos;ORDER BY&apos;, &apos;&apos;, $orderby);
                $orders = explode(&apos;,&apos;, $order);

                &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; count($orders); $i++) {
                    $sorts[$i] = (stripos($orders[$i], &apos; desc&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) ? &apos;DESC&apos; : &apos;ASC&apos;;
                    $orders[$i] = trim(preg_replace(&apos;/\s+(ASC|DESC)$/i&apos;, &apos;&apos;, $orders[$i]));

                    &lt;span class=&quot;code-comment&quot;&gt;// find alias in query string
&lt;/span&gt;                    $helper_string = stristr($query, $orders[$i]);

                    $from_clause_pos = strpos($helper_string, &apos; FROM &apos;);
                    $fields_string = substr($helper_string, 0, $from_clause_pos + 1);

                    $field_array = explode(&apos;,&apos;, $fields_string);
                    $field_array = array_shift($field_array);
                    $aux2 = spliti(&apos; as &apos;, $field_array);
                    $aux2 = explode(&apos;.&apos;, end($aux2));

                    $aliases[$i] = trim(end($aux2));
                }
            }

            &lt;span class=&quot;code-comment&quot;&gt;// Ticket #1259: Fix &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; limit-subquery in MSSQL
&lt;/span&gt;            $selectRegExp = &apos;SELECT\s+&apos;;
            $selectReplace = &apos;SELECT &apos;;

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (preg_match(&apos;/^SELECT(\s+)DISTINCT/i&apos;, $query)) {
                $selectRegExp .= &apos;DISTINCT\s+&apos;;
                $selectReplace .= &apos;DISTINCT &apos;;
            }

            $fields_string = substr($query, strlen($selectReplace), strpos($query, &apos; FROM &apos;) - strlen($selectReplace));
            $field_array = explode(&apos;,&apos;, $fields_string);
            $aux2 = explode(&apos;.&apos;, $field_array[0]);
            $key_field = trim(end($aux2));

            $query = preg_replace(&apos;/^&apos;.$selectRegExp.&apos;/i&apos;, $selectReplace . &apos;TOP &apos; . ($count + $offset) . &apos; &apos;, $query);
            $query = &apos;SELECT TOP &apos; . $count . &apos; &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;) . &apos;.&apos; . $key_field . &apos; FROM (&apos; . $query . &apos;) AS &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderby !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
                $query .= &apos; ORDER BY &apos;; 

                &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0, $l = count($orders); $i &amp;lt; $l; $i++) { 
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($i &amp;gt; 0) { &lt;span class=&quot;code-comment&quot;&gt;// not first order clause 
&lt;/span&gt;                        $query .= &apos;, &apos;; 
                    } 

                    $query .= $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;inner_tbl&apos;) . &apos;.&apos; . $aliases[$i] . &apos; &apos;; 
                    $query .= (stripos($sorts[$i], &apos;asc&apos;) !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) ? &apos;DESC&apos; : &apos;ASC&apos;;
                }
            }
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10493">DC-279</key>
            <summary>Code Corrections For MsSql modifyLimitQuery</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gensisns">Michael Card</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 19:09:21 +0000</created>
                <updated>Mon, 23 Nov 2009 23:25:38 +0000</updated>
                    <resolved>Mon, 23 Nov 2009 23:25:38 +0000</resolved>
                            <version>1.1.5</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10826" author="jwage" created="Mon, 23 Nov 2009 23:25:38 +0000"  >&lt;p&gt;Thanks for the ticket and changes to the function.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-282] Memory Leak in Doctrine_Query_Abstract._getDqlCallbackComponents()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-282</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The following iteration shows increasing memory usage:&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; $manager = Doctrine_Manager::getInstance();
$manager-&amp;gt;setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, true);
$manager-&amp;gt;....connection....

for($i=0; $i&amp;lt;10;$i++) {
  $tx = Doctrine_Query::create()
    -&amp;gt;from(&apos;Some_Entity cot&apos;)
    -&amp;gt;andWhere(&apos;cot.id = ?&apos;, $someid)
     -&amp;gt;fetchOne();
			
  $usage = memory_get_usage();
  echo $i.&apos;: &apos;.$usage.&quot;\n&quot;;
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;This results in an exceed-max-memory-fatal (750 MB) with a more complex application i am running that iterates &amp;gt;20,000 times.&lt;br/&gt;
I found out that there is a memory leak in Doctrine_Query_Abstract._getDqlCallbackComponents():&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;...
$copy-&amp;gt;getSqlQuery($params);
$componentsAfter = $copy-&amp;gt;getQueryComponents();
$copy-&amp;gt;free(); //This is the solution
...&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Sincerly,&lt;br/&gt;
Markus&lt;/p&gt;</description>
                <environment>PHP 5.2.11, Apache 2.2, Ubuntu Linux 9.1</environment>
            <key id="10497">DC-282</key>
            <summary>Memory Leak in Doctrine_Query_Abstract._getDqlCallbackComponents()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mthielen">Markus Thielen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Nov 2009 10:54:26 +0000</created>
                <updated>Tue, 24 Nov 2009 19:41:30 +0000</updated>
                    <resolved>Tue, 24 Nov 2009 19:41:30 +0000</resolved>
                            <version>1.1.5</version>
                                <fixVersion>1.2.0</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-276] HAVING does not parse column aliases</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-276</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;h4&gt;&lt;a name=&quot;Howtoreproduce&quot;&gt;&lt;/a&gt;How to reproduce&lt;/h4&gt;
&lt;p&gt;$query-&amp;gt;having(&apos;&amp;lt;aggregate_alias&amp;gt; &amp;lt;operator&amp;gt; &amp;lt;column_alias&amp;gt;&apos;). &lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;ExpectedSQL%3A&quot;&gt;&lt;/a&gt;Expected SQL:&lt;/h4&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;HAVING&lt;/span&gt; &amp;lt;internal_aggregate_alias&amp;gt; &amp;lt;operator&amp;gt; a&amp;lt;N&amp;gt;__&amp;lt;column_name&amp;gt;...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h4&gt;&lt;a name=&quot;ProducedSQL&quot;&gt;&lt;/a&gt;Produced SQL&lt;/h4&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;HAVING&lt;/span&gt; &amp;lt;internal_aggregate_alias&amp;gt; &amp;lt;operator&amp;gt; &amp;lt;column_alias&amp;gt; ... /* yes, the same &amp;lt;column_alias&amp;gt; as in -&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;having&lt;/span&gt;() call! */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;ve prepared this &lt;a href=&quot;http://gist.github.com/240326&quot; class=&quot;external-link&quot;&gt;&quot;real-world example&quot;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please fix it someone since I&apos;m forced to invent weird workarounds to emulate this behaviour.&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10489">DC-276</key>
            <summary>HAVING does not parse column aliases</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="develop7">Andrei Dziahel</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Nov 2009 23:17:50 +0000</created>
                <updated>Fri, 8 Jan 2010 16:52:19 +0000</updated>
                    <resolved>Mon, 23 Nov 2009 22:27:34 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11355" author="thaberkern" created="Fri, 8 Jan 2010 16:39:34 +0000"  >&lt;p&gt;Doesn&apos;t work for me in Symfony 1.3.1, Doctrine 1.2.1&lt;/p&gt;

&lt;p&gt;using this DQL:&lt;/p&gt;

&lt;p&gt;Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&apos;COUNT(s.status) as cn MIN(s.status) as minstat&apos;)&lt;br/&gt;
                    -&amp;gt;from(&apos;LogisticOrder o&apos;)&lt;br/&gt;
                    -&amp;gt;innerJoin(&apos;o.Status os&apos;)&lt;br/&gt;
                    -&amp;gt;innerJoin(&apos;o.PickingRequests r&apos;)&lt;br/&gt;
                    -&amp;gt;innerJoin(&apos;r.Status s&apos;)&lt;br/&gt;
                    -&amp;gt;where(&apos;os.status=?&apos;, OrderStatusLog::$STATUS_PICKING)&lt;br/&gt;
                    -&amp;gt;groupBy(&apos;r.order_id&apos;)&lt;br/&gt;
                    -&amp;gt;having(&apos;minstat=? AND cn=1&apos;, array(512))&lt;br/&gt;
                    -&amp;gt;getSqlQuery();&lt;/p&gt;

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

&lt;p&gt;SELECT COUNT(s4.status) AS s4__0 FROM sd_logisticorder s INNER JOIN sd_order_status_log s2 ON s.status_id = s2.id INNER JOIN sd_picking_request s3 ON s.id = s3.order_id INNER JOIN sd_picking_request_status s4 ON s3.id = s4.request_id WHERE (s2.status = ?) GROUP BY s3.order_id HAVING (minstat=? AND cn=1 )&lt;/p&gt;</comment>
                    <comment id="11356" author="thaberkern" created="Fri, 8 Jan 2010 16:52:19 +0000"  >&lt;p&gt;Just to inform you: The problem is the missing space at the having operators&lt;/p&gt;

&lt;p&gt;Doesn&apos;t work:&lt;br/&gt;
-&amp;gt;having(&apos;minstat=? AND cn=1&apos;, array(512))&lt;/p&gt;

&lt;p&gt;Works:&lt;br/&gt;
-&amp;gt;having(&apos;minstat = ? AND cn = 1&apos;, array(512))&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-207] Masked exception makes it very difficult to debug</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-207</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you try to save an object, but the database does not exist, Doctrine throws a Doctrine_Transaction_Exception exception with the message &quot;Rollback failed. There is no active transaction.&quot;.&lt;/p&gt;

&lt;p&gt;But the real problem is that the database does not exit. The problem is in the Doctrine_Connection_UnitOfWork class around line 146:&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;catch&lt;/span&gt; (Exception $e) {
            &lt;span class=&quot;code-comment&quot;&gt;// Make sure we roll back our internal transaction
&lt;/span&gt;            &lt;span class=&quot;code-comment&quot;&gt;//$record-&amp;gt;state($state);
&lt;/span&gt;            $conn-&amp;gt;rollback();
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The exception occurs because of &quot;$conn-&amp;gt;rollback();&quot;, and so the &quot;throw $e;&quot; is never reached.&lt;/p&gt;

&lt;p&gt;We should probably throws an exception earlier about the fact that the database does not exist.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10379">DC-207</key>
            <summary>Masked exception makes it very difficult to debug</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fabpot">Fabien Potencier</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Nov 2009 14:23:12 +0000</created>
                <updated>Tue, 10 Nov 2009 16:34:31 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 16:34:31 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-213] Doctrine_Import_Schema::parseSchema(): handling of global options in schema definition</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-213</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine allows schema files (schema.yml in my case as symfony user) to define global settings that shall be valid for each class (within the same schema file) to be taken as default unless specified otherwise within the class.&lt;br/&gt;
However, once an individual class does specify (even only) one single option, none of the global options are being used anymore at all. This is the current implementation as of in Doctrine_Import_Schema::parseSchema(), line 330.&lt;br/&gt;
IMHO this implementation makes the feature of rather little benefit for users, particularly because &apos;options&apos; is an array, even a nested one since symfony 1.3 did introduce their own options therein (&apos;forms&apos; and &apos;filters&apos;).&lt;/p&gt;

&lt;p&gt;Following example:&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;# global settings, as &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; all classes
detect_relations:                   &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
options:
    type:                           innodb
    collate:                        utf8_unicode_ci
    charset:                        utf8
    symfony:
        form:                       &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        filter:                     &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;

DocumentSource:
    tableName:                      dk_doc_source
    &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt;:                       &apos;Possible sources &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; documents (code set)&apos;
    options:
        symfony:                    { filter: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
    actAs:
        Timestampable:              ~
    columns:
        name:                       { type: string(63), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
        description:                { type: string(255) }

DocumentType:
    tableName:                      dk_doc_type
    &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt;:                       &apos;Allowed types &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; documents&apos;
    options:
        symfony:                    { form: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, filter: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
    actAs:
        Timestampable:              ~
    columns:
        name:                       { type: string(63), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
        description:                { type: string(255) }

DocumentTag:
    tableName:                      dk_doc_tag
    &lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt;:                       &apos;Tags &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; documents&apos;
    actAs:
        Timestampable:              ~
    columns:
        name:                       { type: string(63), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
        description:                { type: string(255) }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After an import with the current implementation, the classes end up having the following options:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;DocumentSource:
&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;    options:                             # taken from the specific class, no global setting was taken over
        symfony:                    { filter: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li&gt;DocumentType:
&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;    options:                            # taken from the specific class , again no global setting was taken over
        symfony:                    { form: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, filter: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li&gt;DocumentTag:
&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;options:                            # taken from the globals
    type:                           innodb
    collate:                        utf8_unicode_ci
    charset:                        utf8
    symfony:
        form:                       &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        filter:                     &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As a developer I originally understood the feature in that DocumentSource and DocumentType would still get the global option settings like collate, charset etc without having to repeat them again and again.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Like e.g. for DocumentSource:
&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;options:                            # global and class specific options brought together
    type:                           innodb
    collate:                        utf8_unicode_ci
    charset:                        utf8
    symfony:
        form:                       &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        filter:                     &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;--&amp;gt; is the effect of the current implementation is intentional?&lt;br/&gt;
I.e. I wish to raise the question: shall globals...&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;only be applicable to an individual class if the latter doesn&apos;t specifiy any option at all? (principle of XOR), or&lt;/li&gt;
	&lt;li&gt;complement the class&apos; individual options, i.e. the developer defines the desired default options as globals, and specifies any difference from that in the individual class? (principle of inheritance).&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;IMHO as a user of Doctrine &amp;amp; Symfony, I cleary prefer the inheritance principle (2).&lt;/p&gt;

&lt;p&gt;A thinkable solution is to use &lt;em&gt;array_replace_recursive()&lt;/em&gt; or a similar function instead of a simple assignment:&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_Schema::parseSchema();  lines 326 - 333&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CURRENT:
        &lt;span class=&quot;code-comment&quot;&gt;// Apply the globals to each table &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it does not have a custom value set already
&lt;/span&gt;        foreach ($array as $className =&amp;gt; $table) {
            foreach ($globals as $key =&amp;gt; $value) {
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( !isset($array[$className][$key])) {
                    $array[$className][$key] = $value;
                }
            }
        }
PATCH:
        &lt;span class=&quot;code-comment&quot;&gt;// Apply the globals to each table &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it does not have a custom value set already
&lt;/span&gt;        foreach ($array as $className =&amp;gt; $table) {
            foreach ($globals as $key =&amp;gt; $value) {
                   $array[$className][$key] = array_replace_recursive($value, $array[$className][$key]);    &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; inherit the global settings
&lt;/span&gt;            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I haven&apos;t yet tried out this patch nor even tested it, since anything first depends from a clarification on the common expectations from the feature of globals in schema files.&lt;/p&gt;

&lt;p&gt;Cheers, RAPHAEL&lt;/p&gt;

&lt;p&gt;PS. update: I created a corresponding issue in &lt;a href=&quot;http://trac.symfony-project.org/ticket/7566&quot; class=&quot;external-link&quot;&gt;Symfony trac&lt;/a&gt;.&lt;/p&gt;</description>
                <environment>(independent from specific env)</environment>
            <key id="10386">DC-213</key>
            <summary>Doctrine_Import_Schema::parseSchema(): handling of global options in schema 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rschumacher">Raphael Schumacher</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Nov 2009 10:48:38 +0000</created>
                <updated>Thu, 12 Nov 2009 20:14:40 +0000</updated>
                    <resolved>Thu, 12 Nov 2009 20:14:40 +0000</resolved>
                            <version>1.2.0-BETA2</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-204] [patch] Cloning or copying a query object keeps a reference to the previous hydrator</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-204</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Upon cloning or copying a query object, the hydrator property still points to the original query. Changing it in the child object changes it for the parent object.&lt;/p&gt;

&lt;p&gt;thanks to gnat42 for the patch&lt;/p&gt;</description>
                <environment></environment>
            <key id="10375">DC-204</key>
            <summary>[patch] Cloning or copying a query object keeps a reference to the previous 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="aarjona">Ariel Arjona</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Nov 2009 21:04:33 +0000</created>
                <updated>Tue, 10 Nov 2009 16:56:43 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 16:56:43 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10150" name="query_clone.patch" size="747" author="aarjona" created="Mon, 9 Nov 2009 21:04:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-199] Combination of Searchable and I18n behaviors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-199</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;br class=&quot;atl-forced-newline&quot; /&gt;
I know, Doctrine allows to inherit behaviors. In my schema.yml i have added Searchable behavior to an I18n behavior.
&lt;br class=&quot;atl-forced-newline&quot; /&gt;
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Screencast:
  tableName: screencast
  actAs:
    Timestampable: ~
    I18n:
      fields:
        - title
        - is_sub_visible
      actAs:
        Searchable:
          fields: [title]
  columns:
    id:
      type: integer
      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;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    slug: { type: string(127), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    is_visible: &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    title: string(255)
    is_sub_visible: &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
  indexes:
    is_visible: { fields: [is_visible] }
    slug: { fields: [slug], type: unique }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;br class=&quot;atl-forced-newline&quot; /&gt;
&lt;br class=&quot;atl-forced-newline&quot; /&gt;
By calling &quot;Doctrine_Table::search&quot; without defining second parameter (custom Doctrine_Query) works fine. &lt;br/&gt;
Then, when i pass the second paramter (by calling &lt;tt&gt;$q-&amp;gt;execute()&lt;/tt&gt; i got this exception:
&lt;br class=&quot;atl-forced-newline&quot; /&gt;
&lt;br class=&quot;atl-forced-newline&quot; /&gt;
&lt;font color=&quot;red&quot;&gt;&lt;br/&gt;
Doctrine_Hydrator_Exception: Couldn&apos;t hydrate. Found non-unique key mapping named &apos;lang&apos;. in /usr/lib/symfony/1.3-svn/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 156&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Hire is my test example &quot;test.php&quot;
&lt;br class=&quot;atl-forced-newline&quot; /&gt;
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&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;test.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

&lt;span class=&quot;code-comment&quot;&gt;// initializing Screencast and ScreencastTranslation tables
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// in other &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt;, will be thrown Doctrine_Exception with message &lt;span class=&quot;code-quote&quot;&gt;&quot;Couldn&apos;t find class ScreencastTranslation&quot;&lt;/span&gt;
&lt;/span&gt;ScreencastTable::getTable();


$i18nTable = Doctrine::getTable(&apos;ScreencastTranslation&apos;);

&lt;span class=&quot;code-comment&quot;&gt;// create query instance and add filter by &lt;span class=&quot;code-quote&quot;&gt;&quot;is_sub_visible = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt; column
&lt;/span&gt;$q = $i18nTable-&amp;gt;createQuery(&apos;st&apos;)-&amp;gt;addWhere(&apos;st.is_sub_visible = ?&apos;, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);

&lt;span class=&quot;code-comment&quot;&gt;// run search query
&lt;/span&gt;$q = $i18nTable-&amp;gt;search(&apos;doctrine&apos;, $q);

&lt;span class=&quot;code-comment&quot;&gt;// prints:
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// FROM ScreencastTranslation st WHERE st.is_sub_visible = ? AND st.id IN (SQL:SELECT id FROM screencast_translation_index WHERE keyword = ? GROUP BY id)
&lt;/span&gt;print $q-&amp;gt;getDql();

$doctrineCollection = $q-&amp;gt;execute(); &lt;span class=&quot;code-comment&quot;&gt;// on &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; line &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Doctrine_Hydrator_Exception
&lt;/span&gt;
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Fedora 10, php 5.2.8, nginx, symfony 1.3-beta1</environment>
            <key id="10365">DC-199</key>
            <summary>Combination of Searchable and I18n behaviors</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fruit">Ilya Sabelnikov</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Nov 2009 12:48:57 +0000</created>
                <updated>Wed, 18 Nov 2009 21:46:30 +0000</updated>
                    <resolved>Wed, 18 Nov 2009 21:46:30 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10744" author="jwage" created="Wed, 18 Nov 2009 21:46:30 +0000"  >&lt;p&gt;Sorry this is a known issue with the behaviors and it is a bigger problem that can&apos;t be fixed. Some behaviors just won&apos;t work together.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-202] Alias in InnerJoin-Update-Queries wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-202</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I tried to do an UPDATE-Operation like the following example:&lt;/p&gt;

&lt;p&gt;$query = Doctrine_Query::create()&lt;br/&gt;
                        -&amp;gt;update(&apos;PickingRequestStatus s&apos;)&lt;br/&gt;
                        -&amp;gt;innerJoin(&apos;s.Request r&apos;)&lt;br/&gt;
                        -&amp;gt;innerJoin(&apos;r.WorkStatus ws&apos;)&lt;br/&gt;
                        -&amp;gt;set(&apos;s.status=?&apos;, PickingRequestStatus::$STATUS_WORK_CANCELLED)&lt;br/&gt;
                        -&amp;gt;where(&apos;s.status = ?&apos;, array(PickingRequestStatus::$STATUS_WORK_STARTED))&lt;br/&gt;
                        -&amp;gt;andWhere(&apos;ws.last_action_at &amp;lt; ?&apos;, $threshold);&lt;/p&gt;

&lt;p&gt;The created SQL-Statement is wrong:&lt;br/&gt;
UPDATE sd_picking_request_status INNER JOIN sd_picking_request s2 ON s.request_id = s2.id INNER JOIN sd_picking_request_work_status s3 ON s2.id = s3.request_id SET status = 16 WHERE status = 8 AND last_action_at &amp;lt; &apos;2009-11-08 11:00&apos;&lt;/p&gt;

&lt;p&gt;and you will get the following error-message:   SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;s.request_id&apos; in &apos;on clause&apos;&lt;/p&gt;

&lt;p&gt;If you remove the s. in the JOIN-Statement everthing is fine:&lt;/p&gt;

&lt;p&gt;UPDATE sd_picking_request_status INNER JOIN sd_picking_request s2 ON request_id = s2.id INNER JOIN sd_picking_request_work_status s3 ON s2.id = s3.request_id SET status = 16 WHERE status = 8 AND last_action_at &amp;lt; &apos;2009-11-09 11:00&apos;&lt;/p&gt;</description>
                <environment>Windows, Symfony 1.2.9</environment>
            <key id="10369">DC-202</key>
            <summary>Alias in InnerJoin-Update-Queries 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="thaberkern">Timo Haberkern</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Nov 2009 09:29:48 +0000</created>
                <updated>Mon, 16 Nov 2009 19:27:23 +0000</updated>
                    <resolved>Mon, 16 Nov 2009 19:27:23 +0000</resolved>
                            <version>1.0.13</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10685" author="jwage" created="Mon, 16 Nov 2009 19:27:23 +0000"  >&lt;p&gt;This is one unfortunate limitation/issue with DELETE/UPDATE dql queries. You cannot perform any joins or anything. This works properly in Doctrine 2 though.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-201] [PATCH] Level is oracle keyword (reopened #479)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-201</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I created this ticket in connection to the &lt;a href=&quot;http://trac.doctrine-project.org/ticket/479&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/479&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The resolution was that it&apos;s fixed in &lt;a href=&quot;http://trac.doctrine-project.org/changeset/3183/&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/3183/&lt;/a&gt; - but it seems that it is fixed only in the changelog.&lt;/p&gt;

&lt;p&gt;The LEVEL is an oracle keyword and the only way to use the NestedSet with Oracle is enabled quote identifiers. &lt;br/&gt;
We used this for about a year or more, but it is not so comfortable and this is the only reason why we are quoting identifiers.&lt;/p&gt;

&lt;p&gt;But we started to use Oracle&apos;s spatial features and I was surprised that some oracle spatial functions are not able to work on quoted objects, and I started to use synonyms and extra columns with triggers as workaround. But it is so annoying and the patch is so simple &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="10367">DC-201</key>
            <summary>[PATCH] Level is oracle keyword (reopened #479)</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="adrive">Miloslav &quot;adrive&quot; Kmet</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Nov 2009 22:42:38 +0000</created>
                <updated>Tue, 10 Nov 2009 17:01:46 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 17:01:46 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10566" author="jwage" created="Tue, 10 Nov 2009 17:01:46 +0000"  >&lt;p&gt;Thanks for the ticket and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10148" name="Level.patch" size="630" author="adrive" created="Sun, 8 Nov 2009 22:42:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-198] refreshRelated inserts records when One-to-One relationships are used and a related record is deleted</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-198</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When one-to-one relationship is used and a refreshRelated is performed after a delete a new record is inserted with NULL values.&lt;/p&gt;

&lt;p&gt;schema.yml&lt;/p&gt;

&lt;p&gt;Email:&lt;br/&gt;
  columns:&lt;br/&gt;
   user_id: integer&lt;br/&gt;
   address: string(150)&lt;br/&gt;
  relations:&lt;br/&gt;
   User:&lt;br/&gt;
    local: user_id&lt;br/&gt;
    foreign: id&lt;br/&gt;
    type: one&lt;br/&gt;
    foreignType: one&lt;br/&gt;
    foreignAlias: email&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  columns:&lt;br/&gt;
   name: string(150)&lt;/p&gt;

&lt;p&gt;Sample code&lt;/p&gt;

&lt;p&gt;Create.php - create the user/email&lt;/p&gt;

&lt;p&gt;$u = new User();&lt;br/&gt;
$u-&amp;gt;name = &apos;Test&apos;;&lt;br/&gt;
$u-&amp;gt;email-&amp;gt;address = &apos;foo@bar.com&apos;;&lt;br/&gt;
$u-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;Delete.php - remove the email&lt;/p&gt;

&lt;p&gt;$u = Doctrine_Query::create()&lt;del&gt;&amp;gt;from(&apos;User&apos;)&lt;/del&gt;&amp;gt;fetchOne();&lt;br/&gt;
$u-&amp;gt;name = &apos;Test2&apos; ;&lt;br/&gt;
$u-&amp;gt;email-&amp;gt;delete();&lt;br/&gt;
$u-&amp;gt;refreshRelated(&apos;email&apos;);&lt;br/&gt;
$u-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;The profile (of Delete.php)&lt;/p&gt;

&lt;p&gt;connect 0.005211&lt;/p&gt;

&lt;p&gt;query 0.000493&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.name AS u&lt;/em&gt;_name FROM user u&lt;br/&gt;
prepare 0.000028&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
execute 0.001086&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
Array&lt;br/&gt;
(&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; 1&lt;br/&gt;
)&lt;br/&gt;
Total time: 0.00681829452515&lt;br/&gt;
fetch 0.000024&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
fetch 0.000016&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
begin 0.000147&lt;/p&gt;

&lt;p&gt;prepare 0.000019&lt;br/&gt;
DELETE FROM email WHERE id = ?&lt;br/&gt;
execute 0.000253&lt;br/&gt;
DELETE FROM email WHERE id = ?&lt;br/&gt;
Array&lt;br/&gt;
(&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; 1&lt;br/&gt;
)&lt;br/&gt;
Total time: 0.00727772712708&lt;br/&gt;
commit 0.001120&lt;/p&gt;

&lt;p&gt;prepare 0.000021&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
execute 0.000333&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
Array&lt;br/&gt;
(&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; 1&lt;br/&gt;
)&lt;br/&gt;
Total time: 0.0087513923645&lt;br/&gt;
fetch 0.000017&lt;br/&gt;
SELECT e.id AS e_&lt;em&gt;id, e.user_id AS e&lt;/em&gt;&lt;em&gt;user_id, e.address AS e&lt;/em&gt;_address FROM email e WHERE e.user_id = ?&lt;br/&gt;
begin 0.000104&lt;/p&gt;

&lt;p&gt;prepare 0.000020&lt;br/&gt;
UPDATE user SET name = ? WHERE id = ?&lt;br/&gt;
execute 0.000291&lt;br/&gt;
UPDATE user SET name = ? WHERE id = ?&lt;br/&gt;
Array&lt;br/&gt;
(&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; Test2&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; =&amp;gt; 1&lt;br/&gt;
)&lt;br/&gt;
Total time: 0.00918316841125&lt;br/&gt;
prepare 0.000021&lt;br/&gt;
INSERT INTO email (id, user_id, address) VALUES (?, ?, ?)&lt;br/&gt;
execute 0.000193&lt;br/&gt;
INSERT INTO email (id, user_id, address) VALUES (?, ?, ?)&lt;br/&gt;
Array&lt;br/&gt;
(&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; &lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; =&amp;gt; &lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt; =&amp;gt; &lt;br/&gt;
)&lt;br/&gt;
Total time: 0.00939726829529&lt;br/&gt;
commit 0.000823&lt;/p&gt;

&lt;p&gt;a var_dump of $u-&amp;gt;toArray() after refreshRelated shows&lt;/p&gt;

&lt;p&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;1&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;name&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(7) &quot;Test2&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;
  array(3) &lt;/p&gt;
{
    [&quot;id&quot;]=&amp;gt;
    string(1) &quot;1&quot;
    [&quot;user_id&quot;]=&amp;gt;
    string(1) &quot;1&quot;
    [&quot;address&quot;]=&amp;gt;
    string(8) &quot;foo@bar.com&quot;
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;And in the database I have null values for the email record.&lt;/p&gt;

&lt;p&gt;This does not happen if I change the relationship to hasMany&lt;/p&gt;




</description>
                <environment>Mac OS X, PHP 5.2.11, MySQL 5.1.37</environment>
            <key id="10364">DC-198</key>
            <summary>refreshRelated inserts records when One-to-One relationships are used and a related record 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bicatu">Mario Bittencourt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Nov 2009 02:44:43 +0000</created>
                <updated>Thu, 19 Nov 2009 20:11:00 +0000</updated>
                    <resolved>Thu, 19 Nov 2009 20:11:00 +0000</resolved>
                            <version>1.1.5</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10569" author="jwage" created="Tue, 10 Nov 2009 17:48:23 +0000"  >&lt;p&gt;This should be fixed in 1.2 now. Can you test 1.2?&lt;/p&gt;</comment>
                    <comment id="10582" author="bicatu" created="Wed, 11 Nov 2009 11:58:42 +0000"  >&lt;p&gt;Sorry. At least in my tests this is still not solved.&lt;/p&gt;

&lt;p&gt;After I delete and call refreshRelated the object still contains the old values and if I do a save it adds a new item with NULL values to the related table.&lt;/p&gt;

&lt;p&gt;My code &lt;/p&gt;

&lt;p&gt;$f = Doctrine_Query::create()&lt;del&gt;&amp;gt;from(&apos;User&apos;)&lt;/del&gt;&amp;gt;fetchOne();&lt;br/&gt;
$f-&amp;gt;name = &apos;Test2&apos; ;&lt;br/&gt;
$f-&amp;gt;email-&amp;gt;delete();&lt;br/&gt;
$f-&amp;gt;refreshRelated(&apos;email&apos;);&lt;br/&gt;
var_dump($f-&amp;gt;toArray());   // first var_dump&lt;/p&gt;

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

&lt;p&gt;var_dump($f-&amp;gt;toArray()); // second var_dump&lt;/p&gt;

&lt;p&gt;// first var_dump&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;1&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;name&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(7) &quot;Test2&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;
  array(3) &lt;/p&gt;
{
    [&quot;id&quot;]=&amp;gt;
    string(1) &quot;1&quot;
    [&quot;user_id&quot;]=&amp;gt;
    string(1) &quot;1&quot;
    [&quot;address&quot;]=&amp;gt;
    string(8) &quot;foo@bar.com&quot;
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;// second var_dump&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;1&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;name&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(7) &quot;Test2&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;
  array(3) &lt;/p&gt;
{
    [&quot;id&quot;]=&amp;gt;
    string(1) &quot;2&quot;
    [&quot;user_id&quot;]=&amp;gt;
    string(1) &quot;1&quot;
    [&quot;address&quot;]=&amp;gt;
    string(8) &quot;foo@bar.com&quot;
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;In the database the email table contains&lt;/p&gt;

&lt;p&gt;id = 2&lt;br/&gt;
user_id = NULL&lt;br/&gt;
address = NULL&lt;/p&gt;</comment>
                    <comment id="10614" author="jwage" created="Thu, 12 Nov 2009 20:15:59 +0000"  >&lt;p&gt;When I test the code you&apos;re providing, against 1.2. I don&apos;t get the results you explain. Can you make a Doctrine test case to show the problem? Because I can&apos;t seem to reproduce it after my changes to fix the issue.&lt;/p&gt;</comment>
                    <comment id="10642" author="bicatu" created="Sun, 15 Nov 2009 15:18:21 +0000"  >&lt;p&gt;Hi,  &lt;br/&gt;
Sure I can make a test case as soon as I find out how to do that.&lt;/p&gt;

&lt;p&gt;Any urls of how to create a test case?&lt;/p&gt;</comment>
                    <comment id="10688" author="jwage" created="Mon, 16 Nov 2009 20:46:45 +0000"  >&lt;p&gt;In the documentation: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="10727" author="jwage" created="Wed, 18 Nov 2009 01:45:01 +0000"  >&lt;p&gt;Any update on this? I am still trying to produce the problem but everything is working for me in my tests. I want to get this fixed in RC1 by this friday if a issue really exists.&lt;/p&gt;</comment>
                    <comment id="10731" author="bicatu" created="Wed, 18 Nov 2009 11:54:04 +0000"  >&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;I&apos;ll be able to take another look today (at night) so I&apos;d probably will have an update by tomorrow.&lt;/p&gt;

&lt;p&gt;Regards.&lt;/p&gt;</comment>
                    <comment id="10759" author="jwage" created="Wed, 18 Nov 2009 22:14:54 +0000"  >&lt;p&gt;Any update? Can we chat in IRC or something to help try and find the problem?&lt;/p&gt;</comment>
                    <comment id="10764" author="bicatu" created="Thu, 19 Nov 2009 02:12:48 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;ve attached the test file you&apos;ve requested. I hope this helps.&lt;/p&gt;

&lt;p&gt;Tested: 419 test cases.&lt;br/&gt;
Successes: 4333 passes.&lt;br/&gt;
Failures: 2 fails.&lt;br/&gt;
Number of new Failures: 0 &lt;/p&gt;

&lt;p&gt;Doctrine_Ticket_DC198_TestCase..................................................failed&lt;/p&gt;


&lt;p&gt;Doctrine_Ticket_DC198_TestCase : method testRemoveEmail failed on line 32 &lt;br/&gt;
 Value1: 0 &lt;br/&gt;
 != &lt;br/&gt;
 Value2: 3 &lt;/p&gt;


&lt;p&gt;Doctrine_Ticket_DC198_TestCase : method testRemoveEmail failed on line 36 &lt;/p&gt;
</comment>
                    <comment id="10792" author="jwage" created="Thu, 19 Nov 2009 20:11:00 +0000"  >&lt;p&gt;Thanks. As soon as I ran the test case I saw the problem and could fix it much much faster &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; Thanks a lot!!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10173" name="DC198TestCase.php" size="2079" author="bicatu" created="Thu, 19 Nov 2009 02:12:48 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-197] [patch] default model orderBy option breaks data-load task</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-197</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;currently the default orderBy clause one can specify for models gets added to all queries, including DELETE and UPDATE.&lt;br/&gt;
This breaks data-load because it includes in the orderBy the table alias but currently only SELECT queries support aliases.&lt;/p&gt;

&lt;p&gt;For example if I have the following schema:&lt;/p&gt;

&lt;p&gt;Mytable:&lt;br/&gt;
  options: &lt;/p&gt;
{ orderBy: name ASC }
&lt;p&gt;  columns:&lt;br/&gt;
    name: &lt;/p&gt;
{ type: string(100), notnull: true }

&lt;p&gt;The data-load task does a Doctrine::getTable(&apos;Mytable&apos;)&lt;del&gt;&amp;gt;delete()&lt;/del&gt;&amp;gt;execute(); to clear the table before loading the fixtures which results in the following SQL:&lt;br/&gt;
DELETE FROM mytable ORDER BY m.name ASC&lt;/p&gt;

&lt;p&gt;which errors out as the m alias was not defined.&lt;/p&gt;

&lt;p&gt;Attached is the patch that makes only SELECT queries get the default orderBy clause from the option.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10357">DC-197</key>
            <summary>[patch] default model orderBy option breaks data-load task</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aarjona">Ariel Arjona</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 17:22:45 +0000</created>
                <updated>Tue, 10 Nov 2009 17:52:42 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 17:52:42 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10146" name="doctrine12_orderby_select.patch" size="2926" author="aarjona" created="Fri, 6 Nov 2009 17:22:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-194] Oracle dropDatabase does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-194</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Export_Oracle::dropDatabase does not work, it contains some SQL errors. Here is the patch:&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-1.1.5/lib/Doctrine/Export/Oracle.php	2009-11-03 19:33:04.000000000 +0100
+++ doctrine/Doctrine/Export/Oracle.php	2009-11-06 14:40:46.000000000 +0100
@@ -76,17 +76,19 @@
         $sql[] = &quot;BEGIN
 FOR I IN (select table_name from user_tables)
 LOOP 
-EXECUTE IMMEDIATE &apos;DROP TABLE &apos;||I.table_name||&apos; CASCADE CONSTRAINTS&apos;;
+EXECUTE IMMEDIATE &apos;DROP TABLE \&lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;||I.table_name||&apos;\&quot;&lt;/span&gt; CASCADE CONSTRAINTS&apos;;
 END LOOP;
 END;&quot;;
 
         $sql[] = &quot;BEGIN
 FOR I IN (SELECT SEQUENCE_NAME, SEQUENCE_OWNER FROM ALL_SEQUENCES WHERE SEQUENCE_OWNER &amp;lt;&amp;gt; &apos;SYS&apos;)
 LOOP 
-EXECUTE IMMEDIATE &apos;DROP SEQUENCE &apos;||I.SEQUENCE_OWNER||&apos;.&apos;||I.SEQUENCE_NAME;
+EXECUTE IMMEDIATE &apos;DROP SEQUENCE \&lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;||I.SEQUENCE_OWNER||&apos;\&quot;&lt;/span&gt;.\&lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;||I.SEQUENCE_NAME||&apos;\&quot;&lt;/span&gt;&apos;;
 END LOOP;
 END;&quot;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Oracle 10 or higher</environment>
            <key id="10353">DC-194</key>
            <summary>Oracle dropDatabase does not 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dusty_it">Igor D&apos;Astolfo</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2009 14:08:39 +0000</created>
                <updated>Thu, 12 Nov 2009 20:18:29 +0000</updated>
                    <resolved>Thu, 12 Nov 2009 20:18:29 +0000</resolved>
                            <version>1.1.4</version>
                <version>1.1.5</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-191] Doctrine_Migration-&gt;loadMigrationClassesFromDirectory fail when launched 2 times</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-191</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I need to create a Doctrine_Migration twice during a same php processus, the migrations version numbers get wrong.&lt;/p&gt;

&lt;p&gt;In Doctrine_Migration-&amp;gt;loadMigrationClassesFromDirectory method, I see :&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(self::$_migrationClassesForDirectories[$directory])) {
            $migrationClasses = (array) self::$_migrationClassesForDirectories[$directory];
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_migrationClasses = array_merge($migrationClasses, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_migrationClasses);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem is that array_merge loose the array keys. In the $this-&amp;gt;_migrationClasses context, array keys are very important because they are the version numbers.&lt;/p&gt;

&lt;p&gt;So when if (isset(self::$_migrationClassesForDirectories&lt;span class=&quot;error&quot;&gt;&amp;#91;$directory&amp;#93;&lt;/span&gt;)) is true ( ie the second time we use the Doctrine_Migration classs ) all the migrations versions get wrong.&lt;/p&gt;

&lt;p&gt;I hope my description is clear enough.&lt;/p&gt;</description>
                <environment>daily symfony 1.3 svn</environment>
            <key id="10346">DC-191</key>
            <summary>Doctrine_Migration-&gt;loadMigrationClassesFromDirectory fail when launched 2 times</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ornicar">thibault duplessis</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Nov 2009 15:14:58 +0000</created>
                <updated>Tue, 10 Nov 2009 17:19:08 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 17:19:08 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10567" author="jwage" created="Tue, 10 Nov 2009 17:19:08 +0000"  >&lt;p&gt;After looking at it, that code didn&apos;t make sense and it could never work, you are right. I removed it. Now if you call that function twice it will reset everything and reload the classes from the configured directories.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-192] Doctrine_Import_Builder Missing Relation Alias When Using classPrefix</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-192</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Import_Builder, line 383&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$alias = (isset($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt; !== $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;) ? &apos; as &apos; . $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt; : &apos;&apos;;&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;For example, if both class name and alias is &quot;User&quot; and we make use of classPrefix (i.e &quot;Model_&quot;), the generated class name will actually be &quot;Model_User&quot;. The comparison of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt; !== $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;does not cover the prefix, which lead to the missing of alias when generating models, i.e&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$this-&amp;gt;hasOne(&apos;Model_User&apos;, ...&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;instead of&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$this-&amp;gt;hasOne(&apos;Model_User as User&apos;, ...&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;Suggested fix:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$alias = (isset($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt; !== $this-&amp;gt;_classPrefix . $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;) ? &apos; as &apos; . $relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;alias&amp;#39;&amp;#93;&lt;/span&gt; : &apos;&apos;;&lt;/p&gt;&lt;/blockquote&gt; </description>
                <environment>PHP 5.2.x, Windows (All)</environment>
            <key id="10347">DC-192</key>
            <summary>Doctrine_Import_Builder Missing Relation Alias When Using classPrefix</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nktpro">Jacky Nguyen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Nov 2009 20:44:30 +0000</created>
                <updated>Tue, 10 Nov 2009 17:58:08 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 17:58:08 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-190] Fatal error while connecting after an reset of the Doctrine_Manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-190</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Manager::connection(&apos;sqlite::memory:&apos;);&lt;br/&gt;
Doctrine_Manager::resetInstance();&lt;br/&gt;
Doctrine_Manager::connection(&apos;sqlite::memory:&apos;);&lt;br/&gt;
Fatal error: Call to a member function onOpen() on a non-object in ...../Doctrine/Connection.php on line 221&lt;/p&gt;

&lt;p&gt;which is $this-&amp;gt;getAttribute(Doctrine_Core::ATTR_LISTENER)-&amp;gt;onOpen($this);&lt;/p&gt;

&lt;p&gt;The Doctrine_Core::ATTR_LISTENER attribute is not set in the connection nore in the manager... This is because Doctrine_Manager::resetInstance does remove all attributes but Doctrine_Manager::setDefaultAttributes does not allow to set the default attributes twice. &lt;/p&gt;

&lt;p&gt;This method can only run once, because it use a local static $init variable and since Doctrine_Manager is a Singleton the init value should stored within the instance.&lt;/p&gt;

&lt;p&gt;What happens :&lt;br/&gt;
1. In Doctrine_Manager::setDefaultAttributes() the Doctrine_Core::ATTR_LISTENER is set to new Doctrine_EventListener().&lt;br/&gt;
2. A connection get its attributes from the manager when not available in the connection.&lt;br/&gt;
3. When Doctrine_Manager::reset() is called the attributes are gone and should be set again...&lt;br/&gt;
4. However because the Doctrine_Manager::setDefaultAttibutes method only can run once (a check is set in a static local boolean) the listener is not recreated and thus subsequent connections will fatally fail&lt;/p&gt;


&lt;p&gt;patch by&lt;br/&gt;
A fix is simple and I have it running locally...&lt;/p&gt;

&lt;p&gt;1. add an private $_inited or $_defaultAttributesSet property to Doctrine_Manager, defaults to false;&lt;br/&gt;
2. on Doctrine_Manager::reset reset it to its default (false)&lt;br/&gt;
3. on Doctrine_Manager::setDefaultAttibutes do nothing when the property equals true, but when the property is false proceed with setting the default attributes...&lt;/p&gt;
</description>
                <environment>osx10.6.1, php5.3.0</environment>
            <key id="10342">DC-190</key>
            <summary>Fatal error while connecting after an reset of the Doctrine_Manager</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bas">Bas K</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 23:12:41 +0000</created>
                <updated>Tue, 10 Nov 2009 17:29:49 +0000</updated>
                    <resolved>Tue, 10 Nov 2009 17:29:49 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Attributes</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-187] The Unique does not work correctly when using &quot;SoftDelete&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-187</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Scenario:&lt;/p&gt;

&lt;p&gt;class User extends Doctrine_Record&lt;br/&gt;
{&lt;br/&gt;
	public function setTableDefinition()&lt;/p&gt;
	{
		$this-&amp;gt;hasColumn(&apos;username&apos;, &apos;string&apos;, 255);
		$this-&amp;gt;hasColumn(&apos;email&apos;, &apos;string&apos;, 255);

		$this-&amp;gt;unique(&apos;username&apos;, &apos;email&apos;);
	}

&lt;p&gt;	public function setUp()&lt;/p&gt;
	{	
		$this-&amp;gt;actAs(&apos;SoftDelete&apos;);
	}
&lt;p&gt;}&lt;/p&gt;




&lt;p&gt;Test:&lt;/p&gt;

&lt;p&gt;//create User&lt;br/&gt;
$user = new User();&lt;br/&gt;
$user-&amp;gt;username = &apos;Fabian&apos;;&lt;br/&gt;
$user-&amp;gt;email = &apos;fabian@test.com&apos;;&lt;br/&gt;
$user-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;...&lt;br/&gt;
...&lt;br/&gt;
// delete user&lt;br/&gt;
$user = Doctrine_Query::create()&lt;br/&gt;
		-&amp;gt;select(&apos;*&apos;)&lt;br/&gt;
		-&amp;gt;from(&apos;User&apos;)&lt;br/&gt;
		-&amp;gt;where(&quot;id=1&quot;)&lt;br/&gt;
		-&amp;gt;fetchOne();&lt;br/&gt;
$user-&amp;gt;delete();   //this mark as deleted the user (delete_at field)&lt;/p&gt;

&lt;p&gt;....&lt;br/&gt;
....&lt;/p&gt;


&lt;p&gt;//create User with same data&lt;br/&gt;
$user = new User();&lt;br/&gt;
$user-&amp;gt;username = &apos;Fabian&apos;;&lt;br/&gt;
$user-&amp;gt;email = &apos;fabian@test.com&apos;;&lt;br/&gt;
$user-&amp;gt;save();    &lt;/p&gt;

&lt;p&gt;// 	This throw error by the &quot;unique&quot;&lt;/p&gt;

</description>
                <environment>WindowsXP, WAMP 2.0</environment>
            <key id="10339">DC-187</key>
            <summary>The Unique does not work correctly when using &quot;SoftDelete&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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fbrussa">Fabian Brussa</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 20:31:03 +0000</created>
                <updated>Thu, 12 Nov 2009 20:49:19 +0000</updated>
                    <resolved>Thu, 12 Nov 2009 20:49:19 +0000</resolved>
                            <version>1.1.4</version>
                <version>1.1.5</version>
                                <fixVersion>1.2.0-BETA3</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10571" author="jwage" created="Tue, 10 Nov 2009 19:09:19 +0000"  >&lt;p&gt;I think you should add deleted_at to the array of fields to be unique by.&lt;/p&gt;</comment>
                    <comment id="10574" author="fbrussa" created="Tue, 10 Nov 2009 19:18:56 +0000"  >&lt;p&gt;Jonathan, but deleted_at is null, therefore can not be part of the array of fields .&lt;/p&gt;

&lt;p&gt;I tried adding it does not work, take all the data as different&lt;/p&gt;</comment>
                    <comment id="10575" author="jwage" created="Tue, 10 Nov 2009 19:21:36 +0000"  >&lt;p&gt;I see. If that is the case, I don&apos;t see of any way to resolve this. Do you?&lt;/p&gt;</comment>
                    <comment id="10576" author="fbrussa" created="Tue, 10 Nov 2009 19:37:14 +0000"  >&lt;p&gt;mmm,  if it is possible to know whether the class acts as SoftDelete at the time of validating the unique, could skip if is marked as deleted (deleted_at not null)&lt;/p&gt;</comment>
                    <comment id="10578" author="jwage" created="Tue, 10 Nov 2009 20:27:30 +0000"  >&lt;p&gt;It is not Doctrine, it is the database that throws the error due to the unique index.&lt;/p&gt;</comment>
                    <comment id="10589" author="fbrussa" created="Wed, 11 Nov 2009 13:19:40 +0000"  >&lt;p&gt;Jonathan, in the database is not created the unique index, only in definition of the class users with ($this-&amp;gt;unique(&apos;username&apos;, &apos;email&apos;); ) &lt;/p&gt;

&lt;p&gt;I&apos;m seeing if is possible to consider the &quot;deleted_at&quot; in then Validate Method in Doctrine_Validator_Unique&lt;/p&gt;</comment>
                    <comment id="10590" author="fbrussa" created="Wed, 11 Nov 2009 14:01:08 +0000"  >&lt;p&gt;Adding these lines in the method &quot;validate&quot;, class &quot;Doctrine_Validator_Unique&quot;,  just before a &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;$stmt  = $table-&amp;gt;getConnection()-&amp;gt;getDbh()-&amp;gt;prepare($sql);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;works fine&lt;br/&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; 
$arr = $table-&amp;gt;getTemplates();
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( array_key_exists(&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine_Template_SoftDelete&quot;&lt;/span&gt;,$arr))
{
	$fieldNameDeleteAt = $arr[&lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine_Template_SoftDelete&quot;&lt;/span&gt;]-&amp;gt;getOption(&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;); 
	$sql .= &lt;span class=&quot;code-quote&quot;&gt;&quot; AND $fieldNameDeleteAt IS NULL&quot;&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;Be okay to do this here?&lt;/p&gt;

&lt;p&gt;Prerequisite: not defined unique index in the database.&lt;/p&gt;</comment>
                    <comment id="10593" author="jwage" created="Wed, 11 Nov 2009 16:06:02 +0000"  >&lt;p&gt;I am not sure, because the unique index is always created in the database. Can you even disable it? So adding this code is useless since the index is created by default and will throw the exception.&lt;/p&gt;</comment>
                    <comment id="10594" author="jwage" created="Wed, 11 Nov 2009 16:14:12 +0000"  >&lt;p&gt;This code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;unique(&apos;username&apos;, &apos;email&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Does two things, it adds a unique validator for the columns, but it also adds a unique index in the mapping information which gets created in the database if it supports unique indexes.&lt;/p&gt;</comment>
                    <comment id="10600" author="fbrussa" created="Wed, 11 Nov 2009 20:33:51 +0000"  >&lt;p&gt;Hi Jonathan,&lt;/p&gt;

&lt;p&gt;Thanks for your swift response!&lt;/p&gt;

&lt;p&gt;I understand that the indexes are created automatically in the database and that is what I think should (or could) work differently.&lt;/p&gt;

&lt;p&gt;When creating an index for multiple fields in combination with the softdelete I would like to propose to not create the indexes in the database and depend on the doctrine Unique class to handle this. In this case the doctrine Unique class should take into account that softdelete is activated and thus only query the not deleted records to check if they are unique.&lt;/p&gt;

&lt;p&gt;I hope you see this as a solution for a common problem and are willing to take it into consideration.&lt;/p&gt;</comment>
                    <comment id="10615" author="jwage" created="Thu, 12 Nov 2009 20:49:13 +0000"  >&lt;p&gt;I would rather not implement specific hacks for individual behaviors. Instead I think we need more generic solutions.&lt;/p&gt;

&lt;p&gt;To get around this you can do the following now:&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;unique(
            array(&apos;username&apos;, &apos;email&apos;),
            array(&apos;where&apos; =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;deleted_at IS NULL&quot;&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;The 2nd argument is an array of options for the unique validator. It already accepted a &quot;where&quot; key so you can add deleted_at IS NULL to the where condition. The 3rd argument &quot;false&quot; is so that it does not create the unique index in the database.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-186] Patch to correct CLI tests</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-186</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Enclosed is a little patch to correct my CLI tests.&lt;/p&gt;

&lt;p&gt;The patch wraps test runs on the CLI in an output buffer to prevent output to the console when the unit tests are run.  This output from the CLI could be mistaken for errors, but it&apos;s expected and only &lt;em&gt;looks&lt;/em&gt; unfriendly - no errors / exceptions are thrown.&lt;/p&gt;</description>
                <environment>PHP 5.3, Darwin, Macbook</environment>
            <key id="10337">DC-186</key>
            <summary>Patch to correct CLI tests</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="danbettles">Dan Bettles</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 18:43:11 +0000</created>
                <updated>Wed, 4 Nov 2009 20:20:26 +0000</updated>
                    <resolved>Wed, 4 Nov 2009 20:20:26 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10139" name="Cli_testcase_corrections.diff" size="2233" author="danbettles" created="Wed, 4 Nov 2009 18:43:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-181] Exception thrown  - nested query in count query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-181</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;My model is:&lt;/p&gt;

&lt;p&gt;product: [ id, name]&lt;br/&gt;
product_category_ref &lt;span class=&quot;error&quot;&gt;&amp;#91;product_id, category_id&amp;#93;&lt;/span&gt;&lt;br/&gt;
product_category: &lt;span class=&quot;error&quot;&gt;&amp;#91;id, name&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;I have a query like this:&lt;br/&gt;
$page = 1;&lt;br/&gt;
$ids = array(1,2);&lt;br/&gt;
$query = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;from(&apos;Product p&apos;)&lt;br/&gt;
            -&amp;gt;innerJoin(&apos;p.Categories cat&apos;)&lt;br/&gt;
            -&amp;gt;andWhere(&apos;p.is_active = 1&apos;)&lt;br/&gt;
            -&amp;gt;andWhereIn(&apos;p.id&apos;, $ids);&lt;/p&gt;

&lt;p&gt;$pager = new Doctrine_Pager($query, $page, sfConfig::get(&apos;app_eshop_pager_limit&apos;, 5));&lt;/p&gt;

&lt;p&gt;$pager-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;throws and exception: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&lt;/p&gt;

&lt;p&gt;Stack trace:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;at ()&lt;br/&gt;
      in SF_ROOT_DIR\plugins\sfDoctrinePlugin\lib\doctrine\Doctrine\Connection.php line 1086 ...&lt;br/&gt;
            1083.         &lt;br/&gt;
            1084.         $name = &apos;Doctrine_Connection_&apos; . $this-&amp;gt;driverName . &apos;_Exception&apos;;&lt;br/&gt;
            1085.&lt;br/&gt;
            1086.         $exc  = new $name($e-&amp;gt;getMessage(), (int) $e-&amp;gt;getCode());&lt;br/&gt;
            1087.         if ( ! isset($e-&amp;gt;errorInfo) || ! is_array($e-&amp;gt;errorInfo)) 
{
            1088.             $e-&amp;gt;errorInfo = array(null, null, null, null);
            1089.         }&lt;/li&gt;
	&lt;li&gt;at Doctrine_Connection-&amp;gt;rethrowException(object(&apos;PDOException&apos;), object(&apos;Doctrine_Connection_Statement&apos;))&lt;br/&gt;
      in SF_ROOT_DIR\plugins\sfDoctrinePlugin\lib\doctrine\Doctrine\Connection\Statement.php line 253 ...&lt;br/&gt;
             250.         } catch (Doctrine_Adapter_Exception $e) 
{
             251.         }
&lt;p&gt;             252.&lt;br/&gt;
             253.         $this-&amp;gt;_conn-&amp;gt;rethrowException($e, $this);&lt;br/&gt;
             254.&lt;br/&gt;
             255.         return false;&lt;br/&gt;
             256.     }&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;at Doctrine_Connection_Statement-&amp;gt;execute(array(&apos;1&apos;, &apos;2&apos;, &apos;1&apos;, &apos;2&apos;))&lt;br/&gt;
      in SF_ROOT_DIR\plugins\sfDoctrinePlugin\lib\doctrine\Doctrine\Connection.php line 1014 ...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I found a place in Doctrine/Query.php (line 1155), changed line: &lt;/p&gt;

&lt;p&gt;$list = $this-&amp;gt;_conn-&amp;gt;execute($subquery, $this-&amp;gt;getParams($params))-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);&lt;/p&gt;

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

&lt;p&gt;$list = $this-&amp;gt;_conn-&amp;gt;execute($subquery, $params)-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);&lt;/p&gt;


&lt;p&gt;and it works ok, im not sure if that brokes anything &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;
</description>
                <environment></environment>
            <key id="10330">DC-181</key>
            <summary>Exception thrown  - nested query in 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mishal">Mishal</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 12:42:03 +0000</created>
                <updated>Thu, 5 Nov 2009 07:03:25 +0000</updated>
                    <resolved>Wed, 4 Nov 2009 20:17:19 +0000</resolved>
                                            <fixVersion>1.0.14</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10497" author="jwage" created="Wed, 4 Nov 2009 20:05:31 +0000"  >&lt;p&gt;This is the ticket and fix that caused this issue.&lt;/p&gt;</comment>
                    <comment id="10499" author="jwage" created="Wed, 4 Nov 2009 20:17:19 +0000"  >&lt;p&gt;Can you test this change? it should be better now.&lt;/p&gt;</comment>
                    <comment id="10505" author="mishal" created="Thu, 5 Nov 2009 07:03:25 +0000"  >&lt;p&gt;It works! Thanks!&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10139">DC-77</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-182] 1.0.13 limit() broke with : </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-182</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;           $q = Doctrine_Query::create()&lt;br/&gt;
              -&amp;gt;from(&apos;news n&apos;)&lt;br/&gt;
              -&amp;gt;leftJoin(&apos;n.Translation t&apos;)&lt;br/&gt;
              -&amp;gt;Where(&apos;n.published = ?&apos;, 1)&lt;br/&gt;
              -&amp;gt;limit(10)&lt;br/&gt;
              -&amp;gt;orderBy(&apos;n.id DESC&apos;);&lt;/p&gt;

&lt;p&gt;(&apos;SELECT DISTINCT n3.id FROM news n3 LEFT JOIN news_translation n4 ON n3.id = n4.id WHERE n3.published = ? ORDER BY n3.id DESC LIMIT 10&apos;, array(1, 1))&lt;/p&gt;



&lt;p&gt;The issue is just the transformation from &apos;1&apos; to array...&lt;/p&gt;


&lt;p&gt;symfony 1.2.9 with doctrine VERSION = &apos;1.0.13&apos;;&lt;/p&gt;


&lt;p&gt;The limit seem to be broken.&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&lt;/p&gt;


&lt;p&gt;I&apos;ll submit test case ASAP.&lt;/p&gt;</description>
                <environment>osx, symfony 1.2.9</environment>
            <key id="10331">DC-182</key>
            <summary>1.0.13 limit() broke with : </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sikkle">fred</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 14:52:47 +0000</created>
                <updated>Tue, 1 Dec 2009 05:59:16 +0000</updated>
                    <resolved>Tue, 1 Dec 2009 03:59:14 +0000</resolved>
                            <version>1.0.13</version>
                                <fixVersion>1.0.14</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10501" author="jwage" created="Wed, 4 Nov 2009 20:18:24 +0000"  >&lt;p&gt;Can you test this against the latest 1.0 branch in SVN? Thanks &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="10551" author="sikkle" created="Mon, 9 Nov 2009 13:35:39 +0000"  >&lt;p&gt;Work for me. Thanks for the excellent support.&lt;/p&gt;</comment>
                    <comment id="10871" author="alexf1852" created="Thu, 26 Nov 2009 07:51:41 +0000"  >&lt;p&gt;I just updated to latest from 1.0 branch and I still see a problem. Before it was an issue with the params array content being duplicated. Now there isn&apos;t any parameters being retrieved. Here&apos;s part of the exception output. Let me know if you need any additional info. BTW, I&apos;m using sf 1.2 branch. Was using Doctrine 1.0.13. Now using latest from svn 1.0 branch.&lt;/p&gt;

&lt;p&gt;&amp;lt;name&amp;gt;Doctrine_Connection_Mysql_Exception&amp;lt;/name&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;message&amp;gt;&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;? LIMIT 5&apos; at line 1&lt;br/&gt;
&amp;lt;/message&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;traces&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at () in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php line 1086&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at Doctrine_Connection-&amp;gt;rethrowException(object(&apos;PDOException&apos;), object(&apos;Doctrine_Connection_Mysql&apos;)) in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php line 1034&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at Doctrine_Connection-&amp;gt;execute(&apos;SELECT DISTINCT j5.id FROM jobeet_job j5 LEFT JOIN jobeet_category j6 ON j5.category_id = j6.id LEFT JOIN jobeet_category_affiliate j8 ON (j6.id = j8.category_id) LEFT JOIN jobeet_affiliate j7 ON j7.id = j8.affiliate_id WHERE j7.id = ? LIMIT 5&apos;, array()) in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query.php line 1155&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at Doctrine_Query-&amp;gt;getSqlQuery(array()) in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 1751&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at Doctrine_Query_Abstract-&amp;gt;getSql() in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 822&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at Doctrine_Query_Abstract-&amp;gt;getRootAlias() in SF_ROOT_DIR/lib/model/doctrine/JobeetJobTable.class.php line 41&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at JobeetJobTable-&amp;gt;addActiveJobsQuery(object(&apos;Doctrine_Query&apos;)) in SF_ROOT_DIR/lib/model/doctrine/JobeetAffiliate.class.php line 32&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at JobeetAffiliate-&amp;gt;getActiveJobs(&apos;5&apos;) in SF_ROOT_DIR/lib/model/doctrine/JobeetJobTable.class.php line 84&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at JobeetJobTable-&amp;gt;getForToken(array(&apos;token&apos; =&amp;gt; &apos;52aaf00c06a0f34522ad857412f5c4590287432f&apos;, &apos;limit&apos; =&amp;gt; &apos;5&apos;, &apos;sf_format&apos; =&amp;gt; &apos;xml&apos;)) in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/routing/sfDoctrineRoute.class.php line 122&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;br/&gt;
&#8722;&lt;br/&gt;
&amp;lt;trace&amp;gt;&lt;br/&gt;
at sfDoctrineRoute-&amp;gt;getObjectsForParameters(array(&apos;module&apos; =&amp;gt; &apos;api&apos;, &apos;action&apos; =&amp;gt; &apos;list&apos;, &apos;token&apos; =&amp;gt; &apos;52aaf00c06a0f34522ad857412f5c4590287432f&apos;, &apos;limit&apos; =&amp;gt; &apos;5&apos;, &apos;sf_format&apos; =&amp;gt; &apos;xml&apos;)) in SF_SYMFONY_LIB_DIR/routing/sfObjectRoute.class.php line 141&lt;br/&gt;
&amp;lt;/trace&amp;gt;&lt;/p&gt;</comment>
                    <comment id="10872" author="alexf1852" created="Thu, 26 Nov 2009 08:06:13 +0000"  >&lt;p&gt;From the trace output and code, it looks like the call to getSQL on line 822 (Doctrine/Query/Abstract.php) is not even getting the $params array.&lt;/p&gt;</comment>
                    <comment id="10873" author="alexf1852" created="Thu, 26 Nov 2009 08:33:26 +0000"  >&lt;p&gt;I changed line 822 in Abstract.php to the following:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;getSql($this-&amp;gt;getParams());&lt;/p&gt;

&lt;p&gt;Now all is fine. Not sure if this is the correct fix though.&lt;/p&gt;</comment>
                    <comment id="10894" author="jwage" created="Sat, 28 Nov 2009 21:59:57 +0000"  >&lt;p&gt;Any chance someone can provide a test case for this?&lt;/p&gt;</comment>
                    <comment id="10923" author="jwage" created="Mon, 30 Nov 2009 17:55:56 +0000"  >&lt;p&gt;I am still having issues reproducing this. Can someone help with reproducing it? Everything is working on my end as of right now. I&apos;ll give it another week or so before I close the ticket.&lt;/p&gt;</comment>
                    <comment id="10928" author="alexf1852" created="Mon, 30 Nov 2009 22:00:19 +0000"  >&lt;p&gt;The way I happened to find this issue was during Day 16 of the Jobeet toturial. The last item for day 16 was telling the user to implement one of the requirements from Day 2:&lt;br/&gt;
&quot;The affiliate can also limit the number of jobs to be returned, and refine his query by specifying a category.&quot;&lt;/p&gt;

&lt;p&gt;So what I did was modify my route to take a limit like below:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;apps/frontend/config/routing.yml&lt;br/&gt;
api_jobs:&lt;br/&gt;
  url:     /api/:token/jobs.:sf_format/:limit&lt;br/&gt;
  class:   sfDoctrineRoute&lt;br/&gt;
  param:   
{ module: api, action: list, limit: 0 }
&lt;p&gt;  options: &lt;/p&gt;
{ model: JobeetJob, type: list, method: getForToken }
&lt;p&gt;  requirements:&lt;br/&gt;
    sf_format: (?:xml|json|yaml)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Then I modified the JobeetAffiliate.class.php file:&lt;/p&gt;

&lt;p&gt;        public function getActiveJobs($limit = 0)&lt;br/&gt;
        {&lt;br/&gt;
                $q = Doctrine_Query::create()&lt;br/&gt;
                        -&amp;gt;select(&apos;j.*&apos;)&lt;br/&gt;
                        -&amp;gt;from(&apos;JobeetJob j&apos;)&lt;br/&gt;
                        -&amp;gt;leftJoin(&apos;j.JobeetCategory c&apos;)&lt;br/&gt;
                        -&amp;gt;leftJoin(&apos;c.JobeetAffiliates a&apos;)&lt;br/&gt;
                        &lt;del&gt;&amp;gt;where(&apos;a.id = ?&apos;, $this&lt;/del&gt;&amp;gt;getId());&lt;/p&gt;

&lt;p&gt;                if ($limit &amp;gt; 0)&lt;/p&gt;
                {
                        $q = $q-&amp;gt;limit($limit);
                }

&lt;p&gt;                $q = Doctrine::getTable(&apos;JobeetJob&apos;)-&amp;gt;addActiveJobsQuery($q);&lt;/p&gt;

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

&lt;p&gt;Then changed the JobeetJobTable.class.php class for the following method:&lt;/p&gt;

&lt;p&gt;        public function getForToken(array $parameters)&lt;br/&gt;
        {&lt;br/&gt;
                $affiliate = Doctrine::getTable(&apos;JobeetAffiliate&apos;) -&amp;gt;findOneByToken($parameters&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;token&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
                if (!$affiliate || !$affiliate-&amp;gt;getIsActive())&lt;/p&gt;
                {
                        throw new sfError404Exception(sprintf(&apos;Affiliate with token &quot;%s&quot; does not exist or is not activated.&apos;, $parameters[&apos;token&apos;]));
                }

&lt;p&gt;                return $affiliate-&amp;gt;getActiveJobs((int) $parameters&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;limit&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
        }&lt;/p&gt;


&lt;p&gt;Requesting that route with any integer for limit would cause that error. &lt;/p&gt;

&lt;p&gt;I have since moved on to restart the Jobeet tutorial with Symfony 1.4.&lt;/p&gt;</comment>
                    <comment id="10935" author="jwage" created="Tue, 1 Dec 2009 03:58:44 +0000"  >&lt;p&gt;Can you give it a try with 1.0 now?&lt;/p&gt;</comment>
                    <comment id="10936" author="jwage" created="Tue, 1 Dec 2009 03:59:14 +0000"  >&lt;p&gt;re-open if problem persists after my last change.&lt;/p&gt;</comment>
                    <comment id="10937" author="alexf1852" created="Tue, 1 Dec 2009 05:59:16 +0000"  >&lt;p&gt;This worked. Thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-179] Wrong length estimation in Doctrine_Validator-&gt;validateLength() if locale sets decimal point other than &quot;dot&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-179</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Test case:&lt;br/&gt;
1) set locale: setlocale(LC_ALL, &quot;&quot;) (on windows it sets current international control panel settings), in case of Polish locale  it changes decimal point to &apos;,&apos; (comma) &lt;br/&gt;
2) try to save value &quot;12,12&quot; of decimal type field (mysql type): &lt;/p&gt;
{ type: decimal(4), scale: 2 }
&lt;p&gt;,&lt;br/&gt;
3) it gives you validation error (length)&lt;/p&gt;

&lt;p&gt;Summary:&lt;br/&gt;
Doctrine_Validator-&amp;gt;validateLength() could not count length properly. &lt;/p&gt;

&lt;p&gt;Idea:&lt;br/&gt;
I changed dot character in explode function to proper env character:&lt;/p&gt;

&lt;p&gt;            // changes start&lt;br/&gt;
            $localeInfo = localeconv();&lt;br/&gt;
            $e = explode($localeInfo&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;mon_decimal_point&amp;quot;&amp;#93;&lt;/span&gt;, $value);&lt;br/&gt;
            // changes end&lt;/p&gt;

&lt;p&gt;It works for me.&lt;/p&gt;

&lt;p&gt;Enclosed Validator.php&lt;/p&gt;</description>
                <environment>Apache/2.2.11 (Win32) PHP/5.2.11, windows vista</environment>
            <key id="10325">DC-179</key>
            <summary>Wrong length estimation in Doctrine_Validator-&gt;validateLength() if locale sets decimal point other than &quot;dot&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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="amichalu">Adam Michalunio</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 08:02:15 +0000</created>
                <updated>Wed, 4 Nov 2009 19:50:15 +0000</updated>
                    <resolved>Wed, 4 Nov 2009 19:50:15 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10137" name="Validator.php" size="7058" author="amichalu" created="Wed, 4 Nov 2009 08:02:15 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-180] [PATCH] Unique index name for column aggregation key column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-180</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using column aggregation colum with the same name on multiple models, and exporting schema to database, I have a collisions with names in Oracle (I think others are affected too).&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
CREATE INDEX &quot;type&quot; ON &quot;nt_organism_property&quot; (&quot;type&quot;)&lt;br/&gt;
CREATE INDEX &quot;type&quot; ON &quot;nt_property&quot; (&quot;type&quot;)&lt;br/&gt;
CREATE INDEX &quot;type&quot; ON &quot;st_node&quot; (&quot;type&quot;)&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;I propose to prefix the index name with the table name&lt;/p&gt;</description>
                <environment></environment>
            <key id="10326">DC-180</key>
            <summary>[PATCH] Unique index name for column aggregation key 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="adrive">Miloslav &quot;adrive&quot; Kmet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 10:11:48 +0000</created>
                <updated>Wed, 4 Nov 2009 19:45:34 +0000</updated>
                    <resolved>Wed, 4 Nov 2009 19:45:34 +0000</resolved>
                            <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10138" name="RecordAbstract.php.patch" size="625" author="adrive" created="Wed, 4 Nov 2009 10:11:48 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-175] New hardDelete() on Soft Delete Template creates blank records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-175</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using the new hardDelete() in the SoftDelete template, the postDelete() listener is saving a blank record because it calls -&amp;gt;save() on the record, even if the record was hard deleted.&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 postDelete(Doctrine_Event $event)
    {
      $event-&amp;gt;getInvoker()-&amp;gt;save();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;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; 
    &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;save();
      }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment></environment>
            <key id="10320">DC-175</key>
            <summary>New hardDelete() on Soft Delete Template creates blank 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="weaverryan">Ryan Weaver</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Nov 2009 16:15:11 +0000</created>
                <updated>Tue, 3 Nov 2009 17:00:18 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 17:00:18 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10135" name="patch" size="442" author="weaverryan" created="Tue, 3 Nov 2009 16:15:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-178] Import Builder doesn&apos;t use default table class name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-178</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I use Symfony 1.2.9 with Doctrine 1.2 trunk.&lt;/p&gt;

&lt;p&gt;I also make use of the new Doctrine&apos;s feature to specify custom table class. For that, in the &lt;tt&gt;config/ProjectConfiguration.class.php&lt;/tt&gt; I have 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 configureDoctrine(Doctrine_Manager $manager)
   {
      ...
      $manager-&amp;gt;setAttribute(Doctrine::ATTR_TABLE_CLASS, &apos;Platform_DoctrineTable&apos;);
      ...
   }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And that works fine. But when I comment out this line and re-generate model classes, I get broken table class definitions like:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class AccountTable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; 
{

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

&lt;p&gt;Notice the lack of base class name.&lt;/p&gt;

&lt;p&gt;It seems the problem resides in &lt;tt&gt;Doctrine_Import_Builder&lt;/tt&gt;&apos;s constructor:&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 __construct()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_baseTableClassName = Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_TABLE_CLASS);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadTemplate();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So, the default value of &lt;tt&gt;$this-&amp;gt;_baseTableClassName&lt;/tt&gt; always overwrites by &lt;tt&gt;Doctrine_Core::ATTR_TABLE_CLASS&lt;/tt&gt; attribute value.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10324">DC-178</key>
            <summary>Import Builder doesn&apos;t use default table 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="esycat">Eugene Janusov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 02:23:08 +0000</created>
                <updated>Wed, 4 Nov 2009 19:52:49 +0000</updated>
                    <resolved>Wed, 4 Nov 2009 19:52:49 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                                <fixVersion>1.2.0-BETA2</fixVersion>
                                <component>Import/Export</component>
                <component>Inheritance</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10470" author="esycat" created="Wed, 4 Nov 2009 02:25:43 +0000"  >&lt;p&gt;Proposed patch attached.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10136" name="DC-178.patch" size="635" author="esycat" created="Wed, 4 Nov 2009 02:25:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-171] make it possible to force deletion when using softdelete</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-171</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;it would be nice to be able to force deleting when using softdelete. right now it seems like there is no way to still be able to do a real DELETE.&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_1/en/behaviors:core-behaviors:softdelete&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_1/en/behaviors:core-behaviors:softdelete&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;something like $record-&amp;gt;delete(true);&lt;/p&gt;

&lt;p&gt;take for example some undo feature. there might be a point where i want to purge the possibility to do an undo (like at the end of the session).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10309">DC-171</key>
            <summary>make it possible to force deletion when using softdelete</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 12:38:20 +0000</created>
                <updated>Tue, 3 Nov 2009 03:52:06 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 03:52:06 +0000</resolved>
                                            <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-172] change 6611 wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-172</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;see line 95 in branches/1.2/lib/Doctrine/Connection/UnitOfWork.php&lt;/p&gt;

&lt;p&gt; if ($ids) {&lt;br/&gt;
   $record-&amp;gt;unlinkInDb($alias, array());&lt;br/&gt;
} else if ($ids) {&lt;br/&gt;
   $record-&amp;gt;unlinkInDb($alias, array_keys($ids));&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>i think the change has a logic error</environment>
            <key id="10314">DC-172</key>
            <summary>change 6611 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 20:41:09 +0000</created>
                <updated>Mon, 2 Nov 2009 20:50:56 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 20:50:56 +0000</resolved>
                                            <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10410" author="jwage" created="Mon, 2 Nov 2009 20:50:56 +0000"  >&lt;p&gt;Thanks for catching that.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-169] replace() method does not affect Timestampable fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-169</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a Timestampable behavior on a table. If I create or edit an object of this table using the -&amp;gt;replace() method instead of -&amp;gt;save(), the Timestampable fields (created_at and updated_at by default) are not changed.&lt;/p&gt;</description>
                <environment>LAMP, symfony 1.3.0-BETA1</environment>
            <key id="10302">DC-169</key>
            <summary>replace() method does not affect Timestampable 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gregoire_m">gregoire_m</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2009 10:23:18 +0000</created>
                <updated>Tue, 3 Nov 2009 03:32:42 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 03:32:42 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Timestampable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-165] outdated symfony Yaml parser causes troubles</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-165</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;all doctrine versions use an imported and modified version of sfYaml.&lt;br/&gt;
Either that needs to be changed to an external, or bugfixes need to be ported.&lt;br/&gt;
see this ticket from symfony trac:&lt;br/&gt;
&lt;a href=&quot;http://trac.symfony-project.org/ticket/7496&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7496&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;

&lt;p&gt;I wanted to use some yaml in a fixture to populate data for the &quot;array&quot;-Fieldtype.&lt;/p&gt;

&lt;p&gt;In the fixture I used:&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;items:
  -
    name:           temp_zone_1
    fieldLabel:     Temp. Zone 1 [&#176;C]
    value:          997
    minValue:       0
    maxValue:       3000
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the resulting serialized array in the table array looked like:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;s:5:&lt;span class=&quot;code-quote&quot;&gt;&quot;items&quot;&lt;/span&gt;;a:9:{i:0;a:5:{s:4:&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;;s:11:&lt;span class=&quot;code-quote&quot;&gt;&quot;temp_zone_1&quot;&lt;/span&gt;;s:10:&lt;span class=&quot;code-quote&quot;&gt;&quot;fieldLabel&quot;&lt;/span&gt;;s:18:&lt;span class=&quot;code-quote&quot;&gt;&quot;Temp. Zone 1 [&#176;C]&quot;&lt;/span&gt;;s:5:&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;;s:3:&lt;span class=&quot;code-quote&quot;&gt;&quot;997&quot;&lt;/span&gt;;s:8:&lt;span class=&quot;code-quote&quot;&gt;&quot;minValue&quot;&lt;/span&gt;;i:0;s:8:&lt;span class=&quot;code-quote&quot;&gt;&quot;maxValue&quot;&lt;/span&gt;;s:4:&lt;span class=&quot;code-quote&quot;&gt;&quot;3000&quot;&lt;/span&gt;;}...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There you can easily see, that &quot;value&quot; is now a string, &quot;minValue&quot; an integer (why?) and maxValue another string. This went awfully wrong somewhere.&lt;/p&gt;

&lt;p&gt;= Workaround and/or solution =&lt;br/&gt;
I took the current parser from `lib/yaml/sfYamlParser.php` and copied it into the existing Parser in `lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/YamlSf/Parser.php`. That fixed the problem.&lt;/p&gt;

&lt;p&gt;== Additional Information ==&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; used Version in Symfony&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;10832 2008-08-13&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class=&apos;confluenceTh&apos;&gt; used Version in sfDoctrinePlugin&lt;/th&gt;
&lt;th class=&apos;confluenceTh&apos;&gt;8869 2008-05-09&lt;/th&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;HTH,&lt;br/&gt;
Michael&lt;/p&gt;

&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="10287">DC-165</key>
            <summary>outdated symfony Yaml parser causes troubles</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fabianlange">Fabian Lange</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Oct 2009 18:45:26 +0000</created>
                <updated>Tue, 3 Nov 2009 01:10:35 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 01:10:35 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>File Parser</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-163] Validator throws out a data type which the schema processing has accepted</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-163</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine accepts &apos;char&apos; in the (yml) schema, and creates the database and model.&lt;br/&gt;
Then an attempt to save a record raises a Doctrine_Validator_Exception, which turns out to contain no validation message, but just the cryptic&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;_errors:protected&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
        (&lt;br/&gt;
            &lt;span class=&quot;error&quot;&gt;&amp;#91;nickname&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
                (&lt;br/&gt;
                    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; type&lt;br/&gt;
                )&lt;/p&gt;

&lt;p&gt;        )&lt;/p&gt;

&lt;p&gt;    &lt;span class=&quot;error&quot;&gt;&amp;#91;_validators:protected&amp;#93;&lt;/span&gt; =&amp;gt; Array&lt;br/&gt;
        (&lt;br/&gt;
        ) &lt;/p&gt;

&lt;p&gt;Only by looking at the source did I discover that what this means is that the validator does not accept the column type &apos;char&apos; - because it&apos;s not hard-coded in Doctrine_Validator::isValidType. &lt;/p&gt;

&lt;p&gt;I&apos;ve vacillated over whether to classify this as &apos;Major&apos; or Minor&apos;: once I&apos;ve realised what&apos;s going on, it&apos;s easy to work round; but it is a show-stopper for a Doctrine novice.&lt;/p&gt;</description>
                <environment>Fedora 10, symfony 1.2, postgresql 8.4.1.  I have been unable to find any information as to which version of Doctrine I have: it came with symfony 1.2</environment>
            <key id="10284">DC-163</key>
            <summary>Validator throws out a data type which the schema processing has accepted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="colin fine">Colin Fine</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Oct 2009 11:26:46 +0000</created>
                <updated>Tue, 3 Nov 2009 04:35:14 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 04:35:14 +0000</resolved>
                                            <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10440" author="jwage" created="Tue, 3 Nov 2009 04:35:14 +0000"  >&lt;p&gt;This is already fixed in the Doctrine 1.2 branch which comes with symfony 1.3&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-159] No use of Offset in the Limit / Offset Documentation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-159</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There is no mentioning how to use the offset funktion in the &quot;LIMIT and OFFSET clauses&quot; chapter in the Doctrine 1.1 Documentation.&lt;/p&gt;

&lt;p&gt;Some Example should feature:&lt;/p&gt;

&lt;p&gt;-&amp;gt;limit(12) &lt;br/&gt;
-&amp;gt;offset(3)&lt;/p&gt;

&lt;p&gt;to show how to use it.&lt;/p&gt;</description>
                <environment>any</environment>
            <key id="10274">DC-159</key>
            <summary>No use of Offset in the Limit / Offset Documentation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicam">Pascal Helfenstein</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Oct 2009 09:26:09 +0000</created>
                <updated>Fri, 30 Oct 2009 16:33:53 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 16:25:27 +0000</resolved>
                                            <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10359" author="jwage" created="Fri, 30 Oct 2009 16:25:27 +0000"  >&lt;p&gt;Enhanced this for the 1.2 documentation since 1.1 end of life is approaching.&lt;/p&gt;</comment>
                    <comment id="10360" author="nicam" created="Fri, 30 Oct 2009 16:33:53 +0000"  >&lt;p&gt;thanks &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-158] Postgresql Import does not recognize all parts of a composite primary key as primary keys</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-158</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If a PostgreSQL table has a composite primary key, Doctrine import (&quot;generate-models-db&quot;) will only mark the first column of the composite key as primary. This is due to a bug in Doctrine_Import_Pgsql.&lt;/p&gt;

&lt;p&gt;I have attached a short patch against the current 1.1 branch (revision 6580). The version 1.2 seems to have the same problem.&lt;br/&gt;
I have tested the patch with PostgreSQL 8.3.8.&lt;/p&gt;</description>
                <environment>Doctrine 1.1 from current SVN with PostgreSQL 8.3.8</environment>
            <key id="10264">DC-158</key>
            <summary>Postgresql Import does not recognize all parts of a composite primary key as primary keys</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mbreit">Moritz Breit</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Oct 2009 13:17:47 +0000</created>
                <updated>Tue, 3 Nov 2009 00:42:32 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 00:42:33 +0000</resolved>
                            <version>1.0.13</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10384" author="mbreit" created="Mon, 2 Nov 2009 08:58:10 +0000"  >&lt;p&gt;Small test case for this bug:&lt;/p&gt;

&lt;p&gt;Database 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.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 testa (
  id bigint NOT NULL,
  CONSTRAINT testa_pkey PRIMARY KEY (id)
);

CREATE TABLE testb (
  id bigint NOT NULL,
  CONSTRAINT testb_pkey PRIMARY KEY (id)
);

CREATE TABLE testa_testb (
  testa bigint NOT NULL,
  testb bigint NOT NULL,
  CONSTRAINT testa_testb_pkey PRIMARY KEY (testa, testb),
  CONSTRAINT fktesta FOREIGN KEY (testa) REFERENCES testa (id),
  CONSTRAINT fktestb FOREIGN KEY (testb) REFERENCES testb (id)
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is a typical many-to-many relationship with a mapping table.&lt;br/&gt;
Note that testa_testb has a composite primary key with two columns, testa and testb.&lt;/p&gt;

&lt;p&gt;Generated code before applying the patch (generateModelsFromDb):&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;BaseTestaTestb.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;abstract&lt;/span&gt; class BaseTestaTestb &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;testa_testb&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;testa&apos;, &apos;integer&apos;, 8, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 8,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;testb&apos;, &apos;integer&apos;, 8, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 8,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;code-comment&quot;&gt;// This should be &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/span&gt;             ));
    }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Generated code after applying the 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;BaseTestaTestb.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;abstract&lt;/span&gt; class BaseTestaTestb &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;testa_testb&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;testa&apos;, &apos;integer&apos;, 8, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 8,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;testb&apos;, &apos;integer&apos;, 8, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 8,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             ));
    }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10116" name="pgsql_import.patch" size="874" author="mbreit" created="Thu, 29 Oct 2009 13:17:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-151] Doctrine_Collection::loadRelated() issues with empty collection and handling with no name parameter</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-151</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When no name is passed, the list variable isnt passed to the where() method call. Also in all cases an empty $list variable isnt handled properly.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10255">DC-151</key>
            <summary>Doctrine_Collection::loadRelated() issues with empty collection and handling with no name parameter</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Oct 2009 16:46:31 +0000</created>
                <updated>Fri, 30 Oct 2009 17:04:20 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 17:04:20 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10108" name="Collection.php.patch" size="1227" author="lsmith" created="Wed, 28 Oct 2009 16:46:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-153] Some pieces of Doctrine&apos;s internal code can&apos;t work properly without a default connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-153</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For details see &lt;a href=&quot;http://groups.google.com/group/doctrine-dev/browse_thread/thread/2fdde3fc5007e2b3&quot; class=&quot;external-link&quot;&gt;thread in doctrine-dev group&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10258">DC-153</key>
            <summary>Some pieces of Doctrine&apos;s internal code can&apos;t work properly without a default 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="esycat">Eugene Janusov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Oct 2009 22:07:08 +0000</created>
                <updated>Tue, 3 Nov 2009 02:19:25 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 02:19:25 +0000</resolved>
                            <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10335" author="esycat" created="Wed, 28 Oct 2009 22:07:53 +0000"  >&lt;p&gt;&lt;del&gt;Proposed patch, v1&lt;/del&gt;&lt;br/&gt;
&lt;del&gt;Proposed patch, v2&lt;/del&gt;&lt;br/&gt;
&lt;del&gt;Proposed patch, v2.2 &#8212; without white-spaces&lt;/del&gt;&lt;br/&gt;
Proposed patch, v2.3&lt;/p&gt;</comment>
                    <comment id="10433" author="jwage" created="Tue, 3 Nov 2009 00:31:40 +0000"  >&lt;p&gt;I think it is a requirement that you always have a default connection. Why don&apos;t you?&lt;/p&gt;</comment>
                    <comment id="10434" author="esycat" created="Tue, 3 Nov 2009 01:01:12 +0000"  >&lt;p&gt;Why it should be a requirement?&lt;/p&gt;

&lt;p&gt;We use several connections to different databases and with different privileges, and we would like to enforce our developers to always specify a particular connection.&lt;/p&gt;

&lt;p&gt;In anyway, it&apos;s obviously a bug, because currently Doctrine can use wrong connection.&lt;/p&gt;</comment>
                    <comment id="10437" author="esycat" created="Tue, 3 Nov 2009 02:10:19 +0000"  >&lt;p&gt;I&apos;ve missed one line change in v2.2.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10130" name="DC-153.v2.3.patch" size="5744" author="esycat" created="Tue, 3 Nov 2009 02:10:32 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-152] isModified deep isn&apos;t working when only deep objects are modified</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-152</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Record::isModified(true) isn&apos;t working when only a subobject is modified (it returns false).&lt;br/&gt;
The attached patch corrects the problem.&lt;/p&gt;</description>
                <environment>linux, apache, php 5.3</environment>
            <key id="10256">DC-152</key>
            <summary>isModified deep isn&apos;t working when only deep objects are 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rodlima">Rodolfo Schulz de Lima</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Oct 2009 17:06:07 +0000</created>
                <updated>Mon, 2 Nov 2009 23:45:13 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:45:13 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.1.5</fixVersion>
                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10109" name="doctrine_ismodified_deep.diff" size="544" author="rodlima" created="Wed, 28 Oct 2009 17:06:07 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-140] _createLimitSubquery generates a query with error ORA-00904</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-140</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I create a limited query with Oracle sometimes it generates an invalid query, giving ORA-00904 errror.&lt;/p&gt;

&lt;p&gt;A simple DQL query like this: &lt;br/&gt;
$q = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;select(&quot;$i.nome, $s.denominazione&quot;)&lt;br/&gt;
            -&amp;gt;from(&quot;Istituto $i&quot;)&lt;br/&gt;
            -&amp;gt;leftJoin(&quot;$i.Sedi $s&quot;);&lt;/p&gt;

&lt;p&gt;creates this intermediate sql: &lt;br/&gt;
SELECT&lt;br/&gt;
 &quot;i&quot;.&quot;id&quot; AS &quot;i__id&quot;,&lt;br/&gt;
 &quot;i&quot;.&quot;nome&quot; AS &quot;i__nome&quot;,&lt;br/&gt;
 &quot;s&quot;.&quot;id&quot; AS &quot;s__id&quot;, &lt;br/&gt;
&quot;s&quot;.&quot;denominazione&quot; AS &quot;s__denominazione&quot; &lt;br/&gt;
FROM &quot;istituto&quot; &quot;i&quot; &lt;br/&gt;
LEFT JOIN &quot;sede&quot; &quot;s&quot; ON &quot;i&quot;.&quot;id&quot; = &quot;s&quot;.&quot;id_istituto&quot;&lt;/p&gt;

&lt;p&gt;that passed to Doctrine_Pager generates this query:&lt;br/&gt;
SELECT &quot;i&quot;.&quot;id&quot; AS &quot;i__id&quot;, &lt;br/&gt;
&quot;i&quot;.&quot;nome&quot; AS &quot;i__nome&quot;, &lt;br/&gt;
&quot;s&quot;.&quot;id&quot; AS &quot;s__id&quot;, &lt;br/&gt;
&quot;s&quot;.&quot;denominazione&quot; AS &quot;s__denominazione&quot; &lt;br/&gt;
FROM &quot;istituto&quot; &quot;i&quot; &lt;br/&gt;
LEFT JOIN &quot;sede&quot;&lt;br/&gt;
 &quot;s&quot; ON &quot;i&quot;.&quot;id&quot; = &quot;s&quot;.&quot;id_istituto&quot; &lt;/p&gt;

&lt;p&gt;WHERE &quot;i&quot;.&quot;id&quot; IN (SELECT a.&quot;id&quot; FROM (SELECT DISTINCT &quot;i2&quot;.&quot;id&quot; FROM &quot;istituto&quot; &quot;i&quot;) a WHERE ROWNUM &amp;lt;= 10)&lt;/p&gt;

&lt;p&gt;The problem is in &quot;i2&quot; referenced in the inner SELECT statement. This inner query hasn&apos;t been correctly parsed, while the column has been aliased,  the table name has an incorrect alias.&lt;/p&gt;

&lt;p&gt;The problem is that the injected sql code necessary to pagination has some space missing inside the parenthesis, thus the tokenizer misses to alias the table name.&lt;br/&gt;
Here it follows a simple patch:&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;--- Oracle.php  2009-10-26 17:04:17.000000000 +0100
+++ Oracle-orig.php     2009-09-25 19:12:10.000000000 +0200
@@ -103,13 +103,13 @@
                 $column = $column === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; ? &apos;*&apos; : $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($column);
                 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset &amp;gt; 0) {
                     $min = $offset + 1;
+                    $query = &apos;SELECT b.&apos;.$column.&apos; FROM ( &apos;.
+                                 &apos;SELECT a.*, ROWNUM AS doctrine_rownum FROM ( &apos;
+                                   . $query . &apos; ) a &apos;.
+                              &apos; ) b &apos;.
-                    $query = &apos;SELECT b.&apos;.$column.&apos; FROM (&apos;.
-                                 &apos;SELECT a.*, ROWNUM AS doctrine_rownum FROM (&apos;
-                                   . $query . &apos;) a &apos;.
-                              &apos;) b &apos;.
                               &apos;WHERE doctrine_rownum BETWEEN &apos; . $min .  &apos; AND &apos; . $max;
                 } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
+                    $query = &apos;SELECT a.&apos;.$column.&apos; FROM ( &apos; . $query .&apos; ) a WHERE ROWNUM &amp;lt;= &apos; . $max;
-                    $query = &apos;SELECT a.&apos;.$column.&apos; FROM (&apos; . $query .&apos;) a WHERE ROWNUM &amp;lt;= &apos; . $max;
                 }
             }
         }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Oracle database 10 or higher</environment>
            <key id="10235">DC-140</key>
            <summary>_createLimitSubquery generates a query with error ORA-00904</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dusty_it">Igor D&apos;Astolfo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Oct 2009 16:07:17 +0000</created>
                <updated>Wed, 18 Nov 2009 01:44:06 +0000</updated>
                    <resolved>Wed, 18 Nov 2009 01:44:06 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10425" author="jwage" created="Mon, 2 Nov 2009 23:02:55 +0000"  >&lt;p&gt;This is already fixed in all versions. 1.0, 1.1 and 1.2&lt;/p&gt;</comment>
                    <comment id="10447" author="dusty_it" created="Tue, 3 Nov 2009 09:02:56 +0000"  >&lt;p&gt;Sorry, maybe I didn&apos;t explain well the bug, but it still exist in version 1.1.4 and I think also in 1.2.0&lt;br/&gt;
Maybe you were thinking to a previous bug that gave ORA-00904, but this is a different one.&lt;/p&gt;

&lt;p&gt;It shows up only when using _createLimitSubquery, the same query without limit works fine. In the first post I described the problem, I traced the Doctrine_Query::parseSelect function, when it parses a query modified by the _createLimitSubquery it aliases the field name but not the table name in the inner subquery:&lt;/p&gt;

&lt;p&gt;SELECT &quot;i&quot;.&quot;id&quot; AS &quot;i__id&quot;, &lt;br/&gt;
&quot;i&quot;.&quot;nome&quot; AS &quot;i__nome&quot;, &lt;br/&gt;
&quot;s&quot;.&quot;id&quot; AS &quot;s__id&quot;, &lt;br/&gt;
&quot;s&quot;.&quot;denominazione&quot; AS &quot;s__denominazione&quot; &lt;br/&gt;
FROM &quot;istituto&quot; &quot;i&quot; &lt;br/&gt;
LEFT JOIN &quot;sede&quot;&lt;br/&gt;
 &quot;s&quot; ON &quot;i&quot;.&quot;id&quot; = &quot;s&quot;.&quot;id_istituto&quot; &lt;br/&gt;
WHERE &quot;i&quot;.&quot;id&quot; IN (SELECT a.&quot;id&quot; FROM (SELECT DISTINCT &lt;font color=&quot;red&quot;&gt; &quot;i2&quot;.&quot;id&quot;&lt;/font&gt;  FROM &lt;font color=&quot;red&quot;&gt; &quot;istituto&quot; &quot;i&quot;&lt;/font&gt; ) a WHERE ROWNUM &amp;lt;= 10)&lt;/p&gt;

&lt;p&gt;if you look in the subuery (the last line), you&apos;ll see that the field name is &quot;i2&quot;.&quot;id&quot;, but the table name is &quot;i&quot; (FROM &quot;istituto&quot; &quot;i&quot; means FROM &quot;istituto&quot; AS &quot;i&quot;), so Oracle gives error since the query references an &quot;i2&quot; table that isn&apos;t defined anywhere.&lt;/p&gt;

&lt;p&gt;I also found why Doctrine_Query::parseSelect doesn&apos;t parse correctly the table alias, it&apos;s because the tokenization does not split the parenthesis after the table name, so the table name pass unchanged. My patch adds a blank after the end of the subquery in the Doctrine_Connection_Oracle::_createLimitSubquery, so the parenthesis does not interfere anymore with the parseSelect.&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;</comment>
                    <comment id="10458" author="jwage" created="Tue, 3 Nov 2009 17:06:56 +0000"  >&lt;p&gt;I understand, but what I am telling you is that your patch is already applied. When I look at the code in 1.0, 1.1, and 1.2. The changes you&apos;ve made in your patch already exist. So someone must have fixed this bug already. Please make sure your Doctrine libs are up to date.&lt;/p&gt;</comment>
                    <comment id="10526" author="dusty_it" created="Fri, 6 Nov 2009 14:03:25 +0000"  >&lt;p&gt;Sorry... I made a mistake with the diff, inverted the original and the patched version :|&lt;br/&gt;
I updated the patch, now you could apply it correctly.&lt;/p&gt;</comment>
                    <comment id="10725" author="jwage" created="Wed, 18 Nov 2009 01:24:49 +0000"  >&lt;p&gt;Ok. Now I see the patch, but I don&apos;t understand. This is the SQL that is being passed to Oracle. Oracle has a problem without the extra spacing that you&apos;ve added?&lt;/p&gt;</comment>
                    <comment id="10726" author="jwage" created="Wed, 18 Nov 2009 01:26:50 +0000"  >&lt;p&gt;Ok. I understand now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-143] php warnings and fatal errors when &quot;package&quot; attribute value is without &quot;.&quot; (file config/doctrine/schema.yml)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-143</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;h2&gt;&lt;a name=&quot;BugN1&quot;&gt;&lt;/a&gt;Bug N1&lt;/h2&gt;

&lt;p&gt;When i define &lt;tt&gt;&quot;package: user&quot;&lt;/tt&gt; (to store my Comment, Photo and etc. models in 1 directory lib/models/doctrine/user/) and run &lt;tt&gt;&quot;doctrine:build-all-reload --no-confirmation&quot;&lt;/tt&gt; task, it creates unnecessary to me Plugin* models in plugin/ folder and task dies with fatal error:&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;red&quot;&gt;&lt;br/&gt;
PHP Fatal error:  Class &apos;PluginCommentTable&apos; not found in /home/username/www/sfpro/dev/playground/lib/model/doctrine/user/CommentTable.class.php on line 4&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;here is my schema.yml:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Comment:
  tableName: comment
  &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: user
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    message: varchar(255)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h2&gt;&lt;a name=&quot;BugN2&quot;&gt;&lt;/a&gt;Bug N2&lt;/h2&gt;

&lt;p&gt;ok, i have changed &quot;package&quot; value to &quot;user.sometext&quot; and runned  &lt;tt&gt;&quot;doctrine:build-all-reload --no-confirmation&quot;&lt;/tt&gt; task - it creates all models without errors, but does not create subfolders &quot;user/sometext&quot;&lt;/p&gt;

&lt;p&gt;here is my schema.yml&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Comment:
  tableName: comment
  &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: user.sometext
  package_custom_path: lib/model/doctrine/user/plugin
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    message: varchar(255)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a name=&quot;BugN3&quot;&gt;&lt;/a&gt;Bug N3&lt;/h3&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Comment:
  tableName: comment
  &lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: user
  package_custom_path: lib/model/doctrine/user/plugin
  columns:
    id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    message: varchar(255)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;when i run symfony task &lt;tt&gt;&quot;doctrine:build-all-reload --no-confirmation&quot;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;i got php warning:&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;red&quot;&gt;&lt;br/&gt;
PHP Warning:  file_get_contents(/home/username/www/sfpro/dev/playground/lib/model/doctrine//base/BaseComment.class.php): failed to open stream: No such file or directory in /usr/lib/symfony/1.3-svn/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildModelTask.class.php on line 78&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;warning message shows &quot;//&quot; where i should have &quot;user&quot; value&lt;/p&gt;</description>
                <environment>Linux (Fedora 10), symfony 1.3 Beta1, php 5.2.8</environment>
            <key id="10238">DC-143</key>
            <summary>php warnings and fatal errors when &quot;package&quot; attribute value is without &quot;.&quot; (file config/doctrine/schema.yml)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fruit">Ilya Sabelnikov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Oct 2009 20:53:26 +0000</created>
                <updated>Wed, 30 Mar 2011 15:29:06 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:21:18 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10429" author="jwage" created="Mon, 2 Nov 2009 23:21:18 +0000"  >&lt;p&gt;Packages should work now with Symfony 1.3 and Doctrine 1.2. Though, I would still not recommend using it since packages are for symfony plugins.&lt;/p&gt;</comment>
                    <comment id="15640" author="emgillis" created="Wed, 30 Mar 2011 15:27:25 +0000"  >&lt;p&gt;note on &quot;Bug N2&quot;:&lt;br/&gt;
When you have the &quot;.&quot; in the package name (i.e. &quot;user.sometext&quot; in this example), symfony does generate &quot;lib/model/doctrine/packages/user/sometext&quot; with a &quot;PluginYourClassName&quot; set of files in it. The &quot;packages&quot; folder gets generated here because symfony uses it for plugins (as Jonathan mentions in his comment.&lt;/p&gt;

&lt;p&gt;I would like to see that Symfony supports syntax for the products they supposedly support. IMO, if they are using doctrine, they should allow the dull syntax of doctrine, which includes packages. If that conflicts with Symfony&apos;s &quot;plugin&quot; format, then they should redesign the plugins. Unfortunately, we may not see that, or see a complete overhaul as they push out both Symfony2 and Doctrine2.0&lt;/p&gt;</comment>
                    <comment id="15641" author="emgillis" created="Wed, 30 Mar 2011 15:29:06 +0000"  >&lt;p&gt;need to proof before posting, eep! &quot;dull syntax&quot; should say &quot;full syntax&quot; &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-137] Doctrine_Record_Generator does not autoload classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-137</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the versionable behavior creates dynamic classes and does not autoload the models that are defined.  Removing the false flag from  if ($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;generateFiles&amp;#39;&amp;#93;&lt;/span&gt; === false &amp;amp;&amp;amp; class_exists($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt;. false )) { line will fix the issue&lt;/p&gt;</description>
                <environment>CentOS 5.3, PHP 5.2.5</environment>
            <key id="10231">DC-137</key>
            <summary>Doctrine_Record_Generator does not autoload 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bvoelsch">Brian Voelschow</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2009 21:49:16 +0000</created>
                <updated>Wed, 2 Dec 2009 16:55:14 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:23:32 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10291" author="jwage" created="Sat, 24 Oct 2009 01:03:12 +0000"  >&lt;p&gt;Hmm. I remember once upon a time this was this way for a reason. Can you show some code for what you&apos;re doing so I can test this myself. Are you writing the generated files to disk somewhere?&lt;/p&gt;</comment>
                    <comment id="10328" author="bvoelsch" created="Wed, 28 Oct 2009 14:56:33 +0000"  >&lt;p&gt;Jonathan,&lt;br/&gt;
  I wrote a model class so we can access the version history and display it in an application.  The code that we are using is just trying to save versions when we have database delegation.  We enabled the delegation code in our X_Doctrine_Record class.  When debugging the calls we noticed that the correct model does not get loaded, but the generated model did.  We need the model that we created so that our delegation will work and save the version to the master DB.&lt;/p&gt;

&lt;p&gt;Steps to Reproduce:&lt;br/&gt;
1. Add versionable behavior to an existing model&lt;br/&gt;
2. Create a model for the version table&lt;br/&gt;
3. Try to save an object.  Error returned - If you do not allow saves on your slave connection&lt;/p&gt;</comment>
                    <comment id="10329" author="jwage" created="Wed, 28 Oct 2009 15:24:40 +0000"  >&lt;p&gt;I see. The part where you create your own model class is not how this is intended to work. It is intended that you let Doctrine generate the model class for you.&lt;/p&gt;</comment>
                    <comment id="10330" author="bvoelsch" created="Wed, 28 Oct 2009 15:37:24 +0000"  >&lt;p&gt;Understood that this is not how the code is intended to work, but without having a model there is no way to get the complete history.  The only way right now to get the complete history of a record would be to loop through the version records after getting the max version from the original record.&lt;/p&gt;</comment>
                    <comment id="10331" author="jwage" created="Wed, 28 Oct 2009 15:40:25 +0000"  >&lt;p&gt;I&apos;m failing to understand. The behavior generates a model for you named ModelNameVersion and ModelName hasMany ModelNameVersion, no?&lt;/p&gt;</comment>
                    <comment id="10332" author="bvoelsch" created="Wed, 28 Oct 2009 15:48:23 +0000"  >&lt;p&gt;The relationship was not created.  We are adding it and going to some testing.  Get back to you&lt;/p&gt;</comment>
                    <comment id="10333" author="bvoelsch" created="Wed, 28 Oct 2009 17:38:38 +0000"  >&lt;p&gt;The relationship worked on the generated class, but there is still an issue.  Without creating a model for the version table, there is no way to use our delegation code.  This still causes the problem of saving to the slave. or reading from the master.&lt;/p&gt;</comment>
                    <comment id="10334" author="jwage" created="Wed, 28 Oct 2009 17:42:35 +0000"  >&lt;p&gt;Hmm. The model does exist though. It is called &quot;ModelNameVersion&quot; and it is auto generated for you by Doctrine_Record_Generator. It also has options to write the generated model to a path somewhere.&lt;/p&gt;</comment>
                    <comment id="10336" author="bvoelsch" created="Wed, 28 Oct 2009 22:09:27 +0000"  >&lt;p&gt;Without autoloading the class by removing the false flag in the generator code, the saved model will never get loaded.  Another issue is that when trying to use the saved generated class, we get an error that it cannot find the id field that it created.  The id field does not exist in the table.&lt;/p&gt;</comment>
                    <comment id="10430" author="jwage" created="Mon, 2 Nov 2009 23:23:32 +0000"  >&lt;p&gt;We&apos;ll give this change a try. If it causes some issues for people we may have to revert it. I remember that false argument being there for a reason but I can&apos;t remember and none of our tests pass without it.&lt;/p&gt;</comment>
                    <comment id="10453" author="bvoelsch" created="Tue, 3 Nov 2009 16:00:33 +0000"  >&lt;p&gt;If your tests are not passing then there must be a reason for it to be set to false.  I think a configuration option here would be a better solution.  Similar to the Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES setting.&lt;/p&gt;</comment>
                    <comment id="10806" author="jazzslider" created="Fri, 20 Nov 2009 22:00:24 +0000"  >&lt;p&gt;For what it&apos;s worth, I&apos;m running r6785 of the &lt;a href=&quot;http://svn.doctrine-project.org/tags/1.2.0-BETA3&quot; class=&quot;external-link&quot;&gt;http://svn.doctrine-project.org/tags/1.2.0-BETA3&lt;/a&gt; tag, and the absence of the false argument is causing me some annoying issues.&lt;/p&gt;

&lt;p&gt;Based on the documentation/parameters/etc., I&apos;m assuming both of the following use cases are supposed to be possible:&lt;/p&gt;

&lt;p&gt;A. The ModelNameVersion class is generated on-the-fly as necessary, and never stored in the filesystem.&lt;br/&gt;
B. The ModelNameVersion class is generated once, stored in the filesystem, and subsequently autoloaded from there.&lt;/p&gt;

&lt;p&gt;Now, from what I can tell, both use cases work correctly even without the false argument on line 159; however, in case A, a PHP warning can be generated if one of the registered autoloaders doesn&apos;t check to see if the file exists before including it.  This appears to be the case with Zend_Loader_Autoloader_Resource, for instance; my guess is that it&apos;s designed that way such that non-existing files produce the same warnings you&apos;d get if you tried to include them manually ...but it doesn&apos;t play nice with Doctrine&apos;s expectations here (and heck, it may well be a bug on their part to write it that way).&lt;/p&gt;

&lt;p&gt;These warnings don&apos;t appear to affect any functionality ...the line 159 conditional still turns up false, allowing the class to be generated on the fly.  All the same, I&apos;d prefer not to have to turn off E_WARNING on my development machine just to avoid seeing these.  Since Doctrine can&apos;t really guarantee that all of the autoloaders registered with SPL are properly &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; avoiding such blind includes, it may make more sense to leave the false argument in place and avoid the warnings.&lt;/p&gt;

&lt;p&gt;Of course, I don&apos;t know what effect that would have on use case B; my guess is that it&apos;d break, since that&apos;s what this issue was originally about &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;  Is there another solution available that satisfies both use cases without raising any errors?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
Adam&lt;/p&gt;</comment>
                    <comment id="10971" author="ace" created="Wed, 2 Dec 2009 16:32:37 +0000"  >&lt;p&gt;Hi !&lt;/p&gt;

&lt;p&gt;I&apos;m using Zend Framework and Doctrine and I got warnings with Doctrine_Template_Searchable that was trying to load the Index classes of the Searchable behaviour.&lt;br/&gt;
And as you said, with the false argument of get_class() Zend_Framework failed...&lt;/p&gt;

&lt;p&gt;I tried with 1.9.6 of Zend_Framework and it still failed, although they seem to say in your external reference (&lt;span class=&quot;error&quot;&gt;&amp;#91;ZF-8364&amp;#93;&lt;/span&gt; Zend_Loader_Autoloader_Resource::autoload() should return false if no match is found) that it would be fixed in release 1.9.6...&lt;/p&gt;

&lt;p&gt;Here it is... it was just to point it out &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="10972" author="jwage" created="Wed, 2 Dec 2009 16:55:14 +0000"  >&lt;p&gt;Doesn&apos;t the autoloader have an option to check if the file exists before trying to include it?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-138] WHERE LIKE doesn&apos;t work on JOIN SELECTs.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-138</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;WHERE LIKE doesn&apos;t work on JOIN SELECTs.&lt;br/&gt;
Params are not passed to the query.&lt;/p&gt;

&lt;p&gt;Reproduce 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 addSearchTerm(Doctrine_Query $query, array $fields)
	{
		$phrase = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRequest()-&amp;gt;getPost(&apos;query&apos;);
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(!empty($phrase) &amp;amp;&amp;amp; !empty($fields))
		{
			$phrase = &apos;%&apos;. $phrase .&apos;%&apos;;
			$searchString = array();
			$searchParams = array();
			foreach($fields As $field)
			{
				$searchString[] = &lt;span class=&quot;code-quote&quot;&gt;&quot;$field LIKE ?&quot;&lt;/span&gt;;
				$searchParams[] = $phrase;
			} 
			$searchString = implode(&apos; OR &apos;, $searchString);
			
			$query-&amp;gt;andWhere($searchString, $searchParams);
		}	
	}

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addSearchTerm($query, array(
			&apos;username&apos;,
			&apos;email&apos;,
			&apos;last_login_ip&apos;,
			&apos;Data.title&apos;,
			&apos;Data.first_name&apos;,
			&apos;Data.last_name&apos;,
			&apos;Data.company&apos;,
			&apos;Roles.name&apos;
		));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result attached as screenshot.&lt;/p&gt;

&lt;p&gt;Query produced is correct, however &apos;?&apos; are not replaced with params from the array.&lt;/p&gt;

&lt;p&gt;Error message is:&lt;br/&gt;
Doctrine_Connection_Mysql_Exception: 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;? OR `c8`.`email` LIKE ? OR `c8`.`last_login_ip` LIKE ? OR `c9`.`title` LIKE ? O&apos; at line 1&lt;/p&gt;

&lt;p&gt;Query passed to MySQL by Doctrine:&lt;br/&gt;
SELECT DISTINCT `c8`.`id` FROM `core_users` `c8` LEFT JOIN `core_users_data` `c9` ON `c8`.`id` = `c9`.`id_user` LEFT JOIN `core_users_roles` `c11` ON (`c8`.`id` = `c11`.`id_user`) LEFT JOIN `core_roles` `c10` ON `c10`.`id` = `c11`.`id_role` LEFT JOIN `core_users_roles` `c13` ON (`c8`.`id` = `c13`.`id_user`) LEFT JOIN `core_roles` `c12` ON `c12`.`id` = `c13`.`id_role` LEFT JOIN `core_users_roles` `c14` ON `c12`.`id` = `c14`.`id_role` WHERE (`c8`.`username` LIKE ? OR `c8`.`email` LIKE ? OR `c8`.`last_login_ip` LIKE ? OR `c9`.`title` LIKE ? OR `c9`.`first_name` LIKE ? OR `c9`.`last_name` LIKE ? OR `c9`.`company` LIKE ? OR `c10`.`name` LIKE ?) ORDER BY `c8`.`username` ASC, `c14`.`position` LIMIT 20&lt;/p&gt;</description>
                <environment>SVN 1.2 branch</environment>
            <key id="10232">DC-138</key>
            <summary>WHERE LIKE doesn&apos;t work on JOIN SELECTs.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mg">Marcin Gil</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Oct 2009 10:33:55 +0000</created>
                <updated>Wed, 18 Nov 2009 22:07:55 +0000</updated>
                    <resolved>Wed, 18 Nov 2009 22:07:55 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10689" author="jwage" created="Mon, 16 Nov 2009 20:49:13 +0000"  >&lt;p&gt;Something else is wrong, this is not a bug in Doctrine. The params are not replaced by Doctrine, they are simply passed to PDO and PDO replaces the values internally. If you have more information, i.e. a failing test case you can re-open the issue.&lt;/p&gt;</comment>
                    <comment id="10702" author="mg" created="Tue, 17 Nov 2009 08:25:45 +0000"  >&lt;p&gt;More information:&lt;/p&gt;

&lt;p&gt;Last working revision was 6394 - after this the functionality is broken.&lt;/p&gt;</comment>
                    <comment id="10703" author="mg" created="Tue, 17 Nov 2009 08:26:39 +0000"  >&lt;p&gt;Last working revision was 6394 - after this the functionality is broken.&lt;/p&gt;</comment>
                    <comment id="10706" author="mg" created="Tue, 17 Nov 2009 08:37:10 +0000"  >&lt;p&gt;I attach test case later.&lt;/p&gt;</comment>
                    <comment id="10707" author="mg" created="Tue, 17 Nov 2009 08:51:24 +0000"  >&lt;p&gt;It seems this is the same problem as brought up here:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-241&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-241&lt;/a&gt;&lt;/p&gt;
</comment>
                    <comment id="10712" author="jwage" created="Tue, 17 Nov 2009 18:25:19 +0000"  >&lt;p&gt;Are you sure that revision is right?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6394&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6394&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6395&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6395&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Those two revisions are unrelated to the code that is in question here. Take a look.&lt;/p&gt;</comment>
                    <comment id="10714" author="jwage" created="Tue, 17 Nov 2009 18:27:59 +0000"  >&lt;p&gt;Can you try the patch in the comments here?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-241&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-241&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="10716" author="mh" created="Tue, 17 Nov 2009 18:43:28 +0000"  >&lt;p&gt;Actually, the revision with changed a lot in Doctrine_Query was that one: &lt;a href=&quot;http://trac.doctrine-project.org/changeset/6396&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6396&lt;/a&gt;&lt;br/&gt;
But seems like that wasn&apos;t the one which causes the problem, sorry.&lt;br/&gt;
I will investigate further.&lt;/p&gt;</comment>
                    <comment id="10756" author="jwage" created="Wed, 18 Nov 2009 22:07:55 +0000"  >&lt;p&gt;I think this should be fixed now &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="10097" name="screen.png" size="22873" author="mg" created="Sat, 24 Oct 2009 10:33:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-135] Nested i18n versionable behaviour</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-135</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sorry to bring this up again (&lt;a href=&quot;http://trac.doctrine-project.org/ticket/1708&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1708&lt;/a&gt;), but the current ALPHA 3 works perfectly on MySQL and fails on PostgreSQL. I tried the simple wiki example on a fresh project. I posted it already on google groups, but it seems this is the right place for that: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/32208d921dffb8b3/63eb7337015f4415?show_docid=63eb7337015f4415&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/32208d921dffb8b3/63eb7337015f4415?show_docid=63eb7337015f4415&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the generated postgresql sql file:&lt;/p&gt;

&lt;p&gt;CREATE TABLE wiki_translation_version (id BIGINT, lang CHAR(2), title VARCHAR(255), content TEXT, version BIGINT, PRIMARY KEY(id, lang, version));&lt;br/&gt;
CREATE TABLE wiki_translation_index (id BIGINT, lang CHAR(2), keyword VARCHAR(200), field VARCHAR(50), position BIGINT, PRIMARY KEY(id, lang, keyword, field, position));&lt;br/&gt;
CREATE TABLE wiki_translation (id BIGINT, title VARCHAR(255), content TEXT, lang CHAR(2), version BIGINT, slug VARCHAR(255), PRIMARY KEY(id, lang));&lt;br/&gt;
CREATE TABLE wiki (id BIGSERIAL, created_at TIMESTAMP NOT NULL, updated_at TIMESTAMP NOT NULL, PRIMARY KEY(id));&lt;br/&gt;
CREATE UNIQUE INDEX sluggable ON wiki_translation (slug);&lt;br/&gt;
ALTER TABLE wiki_translation_version ADD CONSTRAINT wiki_translation_version_id_wiki_translation_id FOREIGN KEY (id) REFERENCES wiki_translation(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;&lt;br/&gt;
ALTER TABLE wiki_translation_index ADD CONSTRAINT wiki_translation_index_id_wiki_translation_id FOREIGN KEY (id) REFERENCES wiki_translation(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;&lt;br/&gt;
ALTER TABLE wiki_translation ADD CONSTRAINT wiki_translation_id_wiki_id FOREIGN KEY (id) REFERENCES wiki(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;&lt;/p&gt;

&lt;p&gt;The error is:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42830&amp;#93;&lt;/span&gt;: Invalid foreign key: 7 FEHLER:  in Tabelle &#187;wiki_translation&#171;, auf die verwiesen wird, gibt es keinen Unique Constraint, der auf die angegebenen Schl&#252;ssel passt. Failing Query: ALTER TABLE wiki_translation_version ADD CONSTRAINT wiki_translation_version_id_wiki_translation_id FOREIGN KEY (id) REFERENCES wiki_translation(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE&lt;/p&gt;

&lt;p&gt;It is in german but it means something like: there is no unique constraint in table &apos;wiki_translation&apos; matching the given key.&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;</description>
                <environment></environment>
            <key id="10228">DC-135</key>
            <summary>Nested i18n versionable 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="7">Can&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="michael.piecko">Michael Piecko</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2009 13:25:45 +0000</created>
                <updated>Sun, 13 Dec 2009 15:37:50 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 21:31:34 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="10292" author="jwage" created="Sat, 24 Oct 2009 01:04:41 +0000"  >&lt;p&gt;hmm...I am not really sure what is wrong with that SQL on pgsql. Any ideas?&lt;/p&gt;</comment>
                    <comment id="10293" author="michael.piecko" created="Sat, 24 Oct 2009 10:18:34 +0000"  >&lt;p&gt;Ok, i spend some days on this, but i don&apos;t know if this is the real issue or how to solve it:&lt;/p&gt;

&lt;p&gt;The table wiki_translation has a two column primary key (constraint) with (id, lang), so all ALTER commands which references this table (1st and 2nd in my post above) need to reference BOTH of them, because just (id) is not unique in the translation table (that makes sense). So what i did is to change the first two ALTER commands (which references the translation table) to:&lt;/p&gt;

&lt;p&gt;... FOREIGN KEY (id, lang) REFERENCES wiki_translation(id, lang) ...&lt;/p&gt;

&lt;p&gt;This works on pgsql. But i don&apos;t know why MySQL obviously has no problems with it ... :o(&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;
</comment>
                    <comment id="10311" author="jwage" created="Tue, 27 Oct 2009 15:54:31 +0000"  >&lt;p&gt;Ok I think I know the issue. I will try and commit a patch for it this week.&lt;/p&gt;</comment>
                    <comment id="10312" author="michael.piecko" created="Tue, 27 Oct 2009 15:56:59 +0000"  >&lt;p&gt;Great to hear that. I&apos;ll be there to test it ;o)&lt;/p&gt;

&lt;p&gt;Thx a lot,&lt;br/&gt;
Michael&lt;/p&gt;</comment>
                    <comment id="10416" author="jwage" created="Mon, 2 Nov 2009 21:31:25 +0000"  >&lt;p&gt;Ok I was wrong. This can&apos;t be fixed. I gave it a good solid try but I can&apos;t fix it without completely breaking BC. Users would not be able to upgrade easily and it is a huge change. It will have to remain broken until someone can figure out something that works and is BC.&lt;/p&gt;</comment>
                    <comment id="10417" author="michael.piecko" created="Mon, 2 Nov 2009 22:00:45 +0000"  >&lt;p&gt;Well, that&apos;s the way life goes ... :o(&lt;br/&gt;
But it should be mentioned, that nesting these behaviours WORKS on mysql, but in this case not on pgsql.&lt;/p&gt;

&lt;p&gt;Thanks a lot,&lt;br/&gt;
Michael&lt;/p&gt;</comment>
                    <comment id="11153" author="ornicar" created="Wed, 9 Dec 2009 22:04:26 +0000"  >&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;This really shall appear on the documentation.&lt;/p&gt;

&lt;p&gt;Right here : &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/behaviors#nesting-behaviors&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/behaviors#nesting-behaviors&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The documentation suggests it is possible, but it&apos;s not.&lt;/p&gt;</comment>
                    <comment id="11181" author="reaper" created="Sun, 13 Dec 2009 15:37:50 +0000"  >&lt;p&gt;So will this be fixed in 2.0?  &lt;/p&gt;

&lt;p&gt;Versioning with i18n is a MUST HAVE for a project I&apos;m currently working on and MySQL isn&apos;t an option.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-141] Invalid fix [6568] for DC-132</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-141</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Changeset &lt;span class=&quot;error&quot;&gt;&amp;#91;6568&amp;#93;&lt;/span&gt; looks incorrect, it always binds parameters as if they were positional &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; thus not by name :MYPARAM. Therefore for queries with named parameters a PDO exception will be thrown.&lt;/p&gt;

&lt;p&gt;Btw, I wanted to reopen Jira ticket &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-132&quot; title=&quot;LOB mode not used for BLOB fields that are specified as a file handle&quot;&gt;&lt;del&gt;DC-132&lt;/del&gt;&lt;/a&gt; for this, but how do I do that?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10236">DC-141</key>
            <summary>Invalid fix [6568] for DC-132</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dennis.verspuij">Dennis Verspuij</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Oct 2009 17:17:48 +0000</created>
                <updated>Fri, 30 Oct 2009 16:57:30 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 16:57:30 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-131] &quot;Fatal error: [] operator not supported for strings&quot; when use Apc Cache Driver with Doctrine 1.2.0 ALPHA 3</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-131</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Fatal error: [] operator not supported for strings in /opt/httpd/lib/php/Doctrine/Cache/Driver.php on line 244 &lt;/p&gt;

&lt;p&gt;The fetch function return a string, not a array&lt;/p&gt;

&lt;p&gt;I offer following modification :&lt;/p&gt;

&lt;p&gt;File: Doctrine/Cache/Apc.php&lt;/p&gt;

&lt;p&gt;    public function fetch($id, $testCacheValidity = true) &lt;/p&gt;
    {
        $results = apc_fetch($this-&amp;gt;_getKey($id));
        //$results = (array) $results;  // Drop this line
        //return $results[0]; // Drop this line
        return $results;  // Add this line
    }</description>
                <environment>PHP 5.3  with APC 3.1.3p1 module, Apache 2.2.13, GNU/linux 2.6.27.7-smp  -  i686 Intel Pentium 4 CPU 3.20GHZ</environment>
            <key id="10222">DC-131</key>
            <summary>&quot;Fatal error: [] operator not supported for strings&quot; when use Apc Cache Driver with Doctrine 1.2.0 ALPHA 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="olivier.sieffert">Olivier Sieffert</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Oct 2009 09:10:44 +0000</created>
                <updated>Fri, 23 Oct 2009 17:10:17 +0000</updated>
                    <resolved>Fri, 23 Oct 2009 17:10:17 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-132] LOB mode not used for BLOB fields that are specified as a file handle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-132</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;PDO provides us with the (highly desirable) possibility of providing the contents for a blob file through a filehandle resource, so the data can be read directly from a file or another stream source. When retrieving blob data from the database, I already get such file handle back. However, when creating of updating a record with a blob field using a filehandle, this fails. It fails because of two issues:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Doctrine_Validator::isValidType() rejects the resource handle, because blob fields are only checked using is_string().&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;$sth-&amp;gt;execute($params) is used for executing a query after preparing it. The $params are provided straight away to the statement handle, without differentiating between field types by means of explicit bindings. An explicit binding with Doctrine::PARAM_PDO would be needed to allow for field data upload using a filehandle.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I have already been going over the code and I could not find a very good spot for handling this. What functionally should happen is that:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;a blob field&lt;/li&gt;
	&lt;li&gt;for which a stream resource is set&lt;/li&gt;
	&lt;li&gt;should not be rejected as a valid blob type field and&lt;/li&gt;
	&lt;li&gt;should be bound as a param to the prepared insert/update query&lt;/li&gt;
	&lt;li&gt;using the data type Doctrine::PARAM_LOB&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In the attached patch, I have updated the code in a way that makes this feature work. What I did feels like a hack, but I couldn&apos;t find a good way to implement this cleanly. The type of field that we are handling (blob or not?), the data that we are handling (resource or not?) and the spot where we can use bindParam() are not really tightly interconnected (or maybe they are and I overlooked it).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10224">DC-132</key>
            <summary>LOB mode not used for BLOB fields that are specified as a file handle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2009 02:13:46 +0000</created>
                <updated>Sat, 24 Oct 2009 00:55:13 +0000</updated>
                    <resolved>Sat, 24 Oct 2009 00:55:13 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10091" name="doctrine-1.2-work-around-for-blob-field-type.diff" size="1454" author="mmakaay" created="Fri, 23 Oct 2009 02:13:46 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-128] search is using default connection for query not the indexed table&apos;s connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-128</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using two databases with two connections, one of these only in one component of the project.&lt;/p&gt;

&lt;p&gt;I used Doctrine_Manager::bindComponent to set the connection for the tables of the second database, and left the main database&apos;s connection as default. &lt;/p&gt;

&lt;p&gt;The bug happens when I&apos;m using search() in a searchable table of the second database. Doctrine_Search::search function uses the default connection when queries the index table, instead of the connection bound to the searchable table.&lt;/p&gt;

&lt;p&gt;I attached a patch, which works for me.&lt;/p&gt;
</description>
                <environment>Doctrine 1.1 revision 6546</environment>
            <key id="10218">DC-128</key>
            <summary>search is using default connection for query not the indexed table&apos;s 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="karmankertesz">Karman Kertesz</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Oct 2009 08:39:37 +0000</created>
                <updated>Mon, 2 Nov 2009 23:41:17 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:41:17 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10088" name="d_search.patch" size="461" author="karmankertesz" created="Wed, 21 Oct 2009 08:39:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-126] Doctrine_Migration_Diff breaks on inherited class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-126</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This ticket is a duplicate of this one &lt;a href=&quot;http://trac.symfony-project.org/ticket/7272&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7272&lt;/a&gt; but it&apos;s more a Doctrine bug than a symfony one.&lt;/p&gt;

&lt;p&gt;When trying to make a diff on schema with inheritance, the task breaks when trying to load a model inherited from an other one.  I think this is because the inherited model might be loaded &lt;b&gt;before&lt;/b&gt; his ancestor. &lt;/p&gt;</description>
                <environment>php 5.3 / symfony 1.3</environment>
            <key id="10215">DC-126</key>
            <summary>Doctrine_Migration_Diff breaks on inherited 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="futurecat">Marc Weistroff</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Oct 2009 18:18:09 +0000</created>
                <updated>Mon, 29 Mar 2010 13:29:07 +0000</updated>
                    <resolved>Mon, 7 Dec 2009 21:32:04 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10267" author="jwage" created="Tue, 20 Oct 2009 18:39:04 +0000"  >&lt;p&gt;test case? any code to duplicate?&lt;/p&gt;</comment>
                    <comment id="10269" author="futurecat" created="Tue, 20 Oct 2009 18:47:24 +0000"  >&lt;p&gt;First a patch which is more a proof of concept...&lt;br/&gt;
It&apos;s getting late here and will code the test case tomorrow &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="10275" author="futurecat" created="Wed, 21 Oct 2009 08:23:30 +0000"  >&lt;p&gt;I&apos;m having difficulties to prove it with the Doctrine Sandbox... Because it works fine in this case... :&apos;(&lt;br/&gt;
I past the error log, it might be helpful:&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;stlto28:www marc$ php symfony doctrine:generate-migrations-diff
&amp;gt;&amp;gt; doctrine  generating migration diff
&amp;gt;&amp;gt; file+     /private/var/folders/vu/vuQEAsRN...-Tmp-/doctrine_schema_IRajfY.yml
PHP Fatal error:  Class &apos;ToPrfxuvmcCmsContent&apos; not found in /private/var/folders/vu/vuQEAsRNGECmKgHPU7Y1vk+++TI/-Tmp-/toprfx_doctrine_tmp_dirs/ToPrfxuvmcCmsArticle.php on line 15
PHP Stack trace:
PHP   1. {main}() /myProject/symfony:0
PHP   2. include() /myProject/symfony:14
PHP   3. sfSymfonyCommandApplication-&amp;gt;run() /myProject/lib/vendor/symfony/lib/command/cli.php:20
PHP   4. sfTask-&amp;gt;runFromCLI() /myProject/lib/vendor/symfony/lib/command/sfSymfonyCommandApplication.class.php:76
PHP   5. sfBaseTask-&amp;gt;doRun() /myProject/lib/vendor/symfony/lib/task/sfTask.class.php:97
PHP   6. sfDoctrineGenerateMigrationsDiffTask-&amp;gt;execute() /myProject/lib/vendor/symfony/lib/task/sfBaseTask.class.php:67
PHP   7. sfDoctrineBaseTask-&amp;gt;callDoctrineCli() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineGenerateMigrationsDiffTask.class.php:65
PHP   8. Doctrine_Cli-&amp;gt;run() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBaseTask.class.php:64
PHP   9. Doctrine_Cli-&amp;gt;_run() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cli.php:148
PHP  10. Doctrine_Task_GenerateMigrationsDiff-&amp;gt;execute() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cli.php:210
PHP  11. Doctrine_Migration_Diff-&amp;gt;generateMigrationClasses() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Task/GenerateMigrationsDiff.php:48
PHP  12. Doctrine_Migration_Builder-&amp;gt;generateMigrationsFromDiff() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php:111
PHP  13. Doctrine_Migration_Diff-&amp;gt;generateChanges() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Builder.php:147
PHP  14. Doctrine_Migration_Diff-&amp;gt;_diff() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php:99
PHP  15. Doctrine_Core::loadModels() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php:125
PHP  16. require_once() /myProject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php:649
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                    <comment id="10276" author="futurecat" created="Wed, 21 Oct 2009 12:39:42 +0000"  >&lt;p&gt;I tryed to reproduce the failing case in a doctrine sandbox but the task is executed just fine... So I tried with a Symfony sandbox and it failed. &lt;br/&gt;
I guess there is some kind of autoloading incompatibility somewhere. &lt;/p&gt;

&lt;p&gt;I uploaded a sandbox on symfony&apos;s trac with the failing schema. The ticket is viewable here &lt;a href=&quot;http://trac.symfony-project.org/ticket/7272&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7272&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanx&lt;/p&gt;</comment>
                    <comment id="10754" author="jwage" created="Wed, 18 Nov 2009 22:03:22 +0000"  >&lt;p&gt;This issue cannot be reproduced and no new information has been given.&lt;/p&gt;</comment>
                    <comment id="10979" author="agilbert" created="Wed, 2 Dec 2009 20:01:46 +0000"  >&lt;p&gt;I am having this problem as well.&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;&amp;gt;&amp;gt; doctrine  generating migration diff&lt;br/&gt;
&amp;gt;&amp;gt; file+     /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/&lt;del&gt;Tmp&lt;/del&gt;/doctrine_schema_87129.yml&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;ToPrfxpkContextCMSSlot&apos; not found in /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/&lt;del&gt;Tmp&lt;/del&gt;/toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 14&lt;/p&gt;
{/code}

&lt;p&gt;The most recent activity on this issue seems to be in the symfony Trac, where Jon said work would be continued in here, but this ticket is also closed. I don&apos;t know Jira as well, is there a way to re-open this ticket? Is there an active clone of it somewhere?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                    <comment id="11050" author="boutell" created="Mon, 7 Dec 2009 18:40:40 +0000"  >&lt;p&gt;Reproducible test case:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Remove your toprfx_doctrine_tmp_dirs etc. from your tmp folder, leftover classes from earlier crashes can cause unrelated errors, see separate ticket&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;svn co &lt;a href=&quot;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&quot; class=&quot;external-link&quot;&gt;http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3&lt;/a&gt; cmstest13&lt;br/&gt;
cd cmstest13&lt;br/&gt;
Create config/doctrine/schema.yml and add a trivial table so another bug won&apos;t be triggered (I opened a separate ticket on that):&lt;/p&gt;

&lt;p&gt;Frog:&lt;br/&gt;
  columns:&lt;br/&gt;
    name: string&lt;/p&gt;

&lt;p&gt;./symfony doctrine:build --all&lt;br/&gt;
./symfony doctrine:generate-migrations-diff&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;ToPrfxpkContextCMSSlot&apos; not found in /private/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/&lt;del&gt;Tmp&lt;/del&gt;/toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 15&lt;/p&gt;

&lt;p&gt;Note that pkContextCMSButtonSlot inherits from pkContextCMSSlot using Doctrine column aggregation inheritance. It appears that the autoloader just isn&apos;t trying to resolve inheritance relationships between classes in the toprfx_doctrine_tmp_dirs folder.&lt;/p&gt;</comment>
                    <comment id="11721" author="pulse00" created="Sun, 14 Feb 2010 15:23:20 +0000"  >&lt;p&gt;i&apos;ve created a patch which fixes the issue, it&apos;s attached to the corresponding symfony ticket:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.symfony-project.org/ticket/7272&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/7272&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It modifies the core autoloading code and i&apos;m not really familiar with the doctrine autoloading code, so please let me know if this&lt;br/&gt;
approach can be approved.&lt;/p&gt;</comment>
                    <comment id="12490" author="jwage" created="Mon, 29 Mar 2010 13:20:57 +0000"  >&lt;p&gt;Hi, the patch cannot be committed. It is a blatant hack and cannot be applied. I have a solution I will commit soon though.&lt;/p&gt;</comment>
                    <comment id="12491" author="jwage" created="Mon, 29 Mar 2010 13:29:07 +0000"  >&lt;p&gt;This should be fixed now: &lt;a href=&quot;http://trac.symfony-project.org/changeset/28871&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/changeset/28871&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-124] Doctrine_Inflector uses tabs in the class definition</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-124</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description></description>
                <environment></environment>
            <key id="10213">DC-124</key>
            <summary>Doctrine_Inflector uses tabs in the class 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Oct 2009 13:37:33 +0000</created>
                <updated>Wed, 21 Oct 2009 14:35:29 +0000</updated>
                    <resolved>Tue, 20 Oct 2009 15:01:51 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10278" author="lsmith" created="Wed, 21 Oct 2009 14:35:29 +0000"  >&lt;p&gt;actually it seems a lot of files have tabs in them and a fair bit of trailing whitespace. i am fairly pedantic with that kind of stuff in my own code, so i have showing of whitespace characters enabled. should i open tickets for all of those? or maybe you can just do a search and replace? i might still have commit access .. so i could do this myself ..&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-127] Allow a class prefix to be specified when calling Doctrine_Core::loadModels()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-127</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine allows you to generate class names such as Blog_Model_Post in Post.php, but Doctrine::loadModels() is not able to load these models conservatively, as the class name and file name differ.&lt;/p&gt;

&lt;p&gt;I suggest adding a third parameter to Doctrine_Core::loadModels() to specify a class prefix, for 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;Doctrine_Core::loadModels(&apos;/modules/blog/models&apos;, Doctrine_Core::MODEL_LOADING_CONSERVATIVE, &apos;Blog_Model_&apos;);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Code changes (I think) would be something like this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&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 loadModels($directory, $modelLoading = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $classPrefix = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
{
...
	$className = $e[0];
	
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($classPrefix) {
		$className = $classPrefix . $className;
	}
...
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Since the argument is optional, this change shouldn&apos;t break any existing code.&lt;/p&gt;

&lt;p&gt;NB: This is &lt;b&gt;not&lt;/b&gt; PEAR-style file/class naming.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10216">DC-127</key>
            <summary>Allow a class prefix to be specified when calling Doctrine_Core::loadModels()</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="darkangel">Glen Ainscow</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Oct 2009 19:41:15 +0000</created>
                <updated>Mon, 2 Nov 2009 23:34:51 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:34:51 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-125] Searchable: batchUpdateIndex has a memory leak</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-125</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;batchUpdateIndex leaks memory when indexing a table. It holds onto a copy of every row it indexes in memory. I&apos;ve attached a patch that fixes this issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10214">DC-125</key>
            <summary>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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jmazzi">Justin Mazzi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Oct 2009 15:45:40 +0000</created>
                <updated>Tue, 20 Oct 2009 17:45:59 +0000</updated>
                    <resolved>Tue, 20 Oct 2009 17:45:59 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.0.13</fixVersion>
                <fixVersion>1.1.5</fixVersion>
                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10086" name="doctrine.searchable-memory.patch" size="473" author="jmazzi" created="Tue, 20 Oct 2009 15:45:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-119] [PATCH] fix timestamp format in documentation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-119</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description></description>
                <environment></environment>
            <key id="10208">DC-119</key>
            <summary>[PATCH] fix timestamp format in documentation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Oct 2009 13:51:46 +0000</created>
                <updated>Mon, 19 Oct 2009 20:49:35 +0000</updated>
                    <resolved>Mon, 19 Oct 2009 20:49:35 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10253" author="guilhermeblanco" created="Mon, 19 Oct 2009 20:49:35 +0000"  >&lt;p&gt;Fixed! Thanks for the heads up!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10081" name="doc_fix_timestamp_format.patch" size="2773" author="gimler" created="Mon, 19 Oct 2009 13:51:46 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-116] getParent() works as getRoot() in NestedSet behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-116</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is current version of getParent()&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 getParent()
    {
        $baseAlias = $this-&amp;gt;_tree-&amp;gt;getBaseAlias();
        $q = $this-&amp;gt;_tree-&amp;gt;getBaseQuery();
        $q-&amp;gt;addWhere(&quot;$baseAlias.lft &amp;lt; ? AND $baseAlias.rgt &amp;gt; ?&quot;, array($this-&amp;gt;getLeftValue(), $this-&amp;gt;getRightValue()))
                -&amp;gt;addOrderBy(&quot;$baseAlias.rgt asc&quot;);
        $q = $this-&amp;gt;_tree-&amp;gt;returnQueryWithRootId($q, $this-&amp;gt;getRootValue());
        $result = $q-&amp;gt;execute();
        if (count($result) &amp;lt;= 0) {
            return false;
        }
               
        if ($result instanceof Doctrine_Collection) {
            $parent = $result-&amp;gt;getFirst();
        } else if (is_array($result)) {
            $parent = array_shift($result);
        }
        
        return $parent;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;As you can see, this method does not have level limit in where clause. If tree have more than 2 levels in depth, method will return root node of the tree, not parent.&lt;/p&gt;

&lt;p&gt;My fix is use level limit:&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 getParent()
    {
        $baseAlias = $this-&amp;gt;_tree-&amp;gt;getBaseAlias();
        $q = $this-&amp;gt;_tree-&amp;gt;getBaseQuery();
        $q-&amp;gt;addWhere(&quot;$baseAlias.lft &amp;lt; ? AND $baseAlias.rgt &amp;gt; ?&quot;, array($this-&amp;gt;getLeftValue(), $this-&amp;gt;getRightValue()))
                -&amp;gt;addOrderBy(&quot;$baseAlias.rgt asc&quot;);
        $q-&amp;gt;addWhere(&quot;$baseAlias.level &amp;gt;= ?&quot;, $this-&amp;gt;record[&apos;level&apos;] - 1);
        $q = $this-&amp;gt;_tree-&amp;gt;returnQueryWithRootId($q, $this-&amp;gt;getRootValue());
        $result = $q-&amp;gt;execute();
        if (count($result) &amp;lt;= 0) {
            return false;
        }
               
        if ($result instanceof Doctrine_Collection) {
            $parent = $result-&amp;gt;getFirst();
        } else if (is_array($result)) {
            $parent = array_shift($result);
        }
        
        return $parent;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;PS. Sorry for my english.&lt;/p&gt;</description>
                <environment>Windows&lt;br/&gt;
PHP 5.3.0</environment>
            <key id="10204">DC-116</key>
            <summary>getParent() works as getRoot() in NestedSet 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="antik">Vjatseslav Maleev</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Oct 2009 15:22:07 +0000</created>
                <updated>Mon, 2 Nov 2009 22:48:37 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 22:48:37 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.0.13</fixVersion>
                <fixVersion>1.1.5</fixVersion>
                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-112] Improve result cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-112</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We need better control for setting the hash/key for resultset cache entries. Then provide a way to clear these cache entries.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/ticket/2042&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2042&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;$temp = Doctrine_Query::create() 
-&amp;gt;from(&apos;Profile p&apos;) 
-&amp;gt;where(&apos;p.id=?&apos;, $o) 
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) 
-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;product_cache&apos;) &lt;span class=&quot;code-comment&quot;&gt;// custom tag 
&lt;/span&gt;-&amp;gt;execute(); 

$temp = Doctrine_Query::create() 
-&amp;gt;from(&apos;Model m&apos;) 
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) 
-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;product_cache&apos;) &lt;span class=&quot;code-comment&quot;&gt;// custom tag 
&lt;/span&gt;-&amp;gt;execute(); 

$temp = Doctrine_Query::create() 
-&amp;gt;from(&apos;News n&apos;) 
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) 
-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;news_cache&apos;) &lt;span class=&quot;code-comment&quot;&gt;// custom tag 
&lt;/span&gt;-&amp;gt;execute(); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and now&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;$conn  = Doctrine_Manager::getConnection(&apos;sqlite_cache_connection&apos;); 
$cacheDriver = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Cache_Db(array(&apos;connection&apos; =&amp;gt; $conn, 
&apos;tableName&apos; =&amp;gt; &apos;cache&apos;)); 

$cacheDriver-&amp;gt;deleteByTag(&apos;product_cache&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10199">DC-112</key>
            <summary>Improve result cache</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Oct 2009 22:57:52 +0000</created>
                <updated>Fri, 23 Oct 2009 17:12:13 +0000</updated>
                    <resolved>Fri, 23 Oct 2009 17:12:13 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10242" author="wtfzdotnet" created="Thu, 15 Oct 2009 23:12:24 +0000"  >&lt;p&gt;Would an use case as followed be also considered?&lt;/p&gt;

&lt;p&gt;$temp = Doctrine_Query::create() &lt;br/&gt;
-&amp;gt;from(&apos;Model m&apos;) &lt;br/&gt;
-&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY) &lt;br/&gt;
-&amp;gt;useResultCache(true, 3600,array(&apos;product_cache&apos;, &apos;product_clean&apos;)) // custom array with tags&lt;br/&gt;
-&amp;gt;execute(); &lt;/p&gt;

&lt;p&gt;So multiple tags could be used as &quot;labels&quot; for an cache instance?&lt;/p&gt;</comment>
                    <comment id="10243" author="jwage" created="Thu, 15 Oct 2009 23:35:46 +0000"  >&lt;p&gt;Not really. The cache drivers only have the ability to store key =&amp;gt; value pairs so we&apos;re limited on what we can provide in Doctrine natively.&lt;/p&gt;</comment>
                    <comment id="10244" author="adrive" created="Sat, 17 Oct 2009 14:40:03 +0000"  >&lt;p&gt;I think, that each driver should store also cache metadata (that&apos;s the behaviour of symfony&apos;s cache system)..&lt;/p&gt;

&lt;p&gt;In the cache should be sotred also the cache_info key that should be an array of cached keys each index of an array should be the tag name and each tagname should contain multiple cached_keys.&lt;/p&gt;

&lt;p&gt;{{{&lt;br/&gt;
$cacheInfo = array(&lt;br/&gt;
  &apos;product_cache&apos; =&amp;gt; array(&apos;sql_1_key&apos;,  &apos;sql_1_key_paged&apos;, &apos;sql_2_key&apos;, &apos;etc&apos; ,&apos;etc&apos;),&lt;br/&gt;
  &apos;brands_cache&apos; =&amp;gt;&#160;array(&apos;sq_1_key&apos;, &apos;sql_3_key&apos;)&lt;br/&gt;
);&lt;br/&gt;
}}}&lt;/p&gt;

&lt;p&gt;The deleteByTag method should also be able to compare the tag against regular expression...&lt;/p&gt;</comment>
                    <comment id="10246" author="jwage" created="Sun, 18 Oct 2009 02:26:05 +0000"  >&lt;p&gt;Please remember we are limited by what the cache drivers can do. We can only store key =&amp;gt; value pairs and can only select and delete one key at a time. No deleting by regular expression or anything like that. All your above suggestions are great idealistically but are impossibly to implement so we need to keep that in mind.&lt;/p&gt;</comment>
                    <comment id="10250" author="adrive" created="Mon, 19 Oct 2009 19:33:05 +0000"  >&lt;p&gt;Jon, have you ever seen the sf*Cache classes?&lt;/p&gt;

&lt;p&gt;Please, look at &lt;a href=&quot;http://trac.symfony-project.org/browser/branches/1.2/lib/cache/sfMemcacheCache.class.php&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/browser/branches/1.2/lib/cache/sfMemcacheCache.class.php&lt;/a&gt; especially on methods set, setCacheInfo, removePattern. I know that the drivers doesn&apos;t have functions for regexp searching. Therefor I am suggesting to store also the cache info as symfony does. &lt;/p&gt;

&lt;p&gt;I will create some patches in a few days...&lt;/p&gt;</comment>
                    <comment id="10268" author="jwage" created="Tue, 20 Oct 2009 18:44:06 +0000"  >&lt;p&gt;Ok. I understand now. i think we can implement something similar where we just maintain our own list/index of all the keys we&apos;ve cached so that we can perform regex deletions. I have some patches that I will commit today because I want to release alpha3 asap.&lt;/p&gt;</comment>
                    <comment id="10271" author="jwage" created="Tue, 20 Oct 2009 19:28:54 +0000"  >&lt;p&gt;I committed some changes that now allow you to delete by regular expressions. We need to test this asap so that I can release alpha3 tomorrow morning.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10187">DDC-47</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-108] new Doctrine_Expression(&apos;NOW()&apos;) - now dont work</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-108</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I always use this counstructions for get mysql current time:&lt;/p&gt;

&lt;p&gt;example:&lt;br/&gt;
$us = Doctrine::getTable ( &quot;Users&quot; )-&amp;gt;find ( 1 );&lt;br/&gt;
$us-&amp;gt;currentlogin = new Doctrine_Expression(&apos;NOW()&apos;);&lt;br/&gt;
$us-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;but after update to new version this DONT work!&lt;/p&gt;</description>
                <environment></environment>
            <key id="10186">DC-108</key>
            <summary>new Doctrine_Expression(&apos;NOW()&apos;) - now dont 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="madcat">MadCat</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Oct 2009 15:25:10 +0000</created>
                <updated>Wed, 14 Oct 2009 20:18:38 +0000</updated>
                    <resolved>Wed, 14 Oct 2009 20:18:38 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.0.13</fixVersion>
                <fixVersion>1.1.5</fixVersion>
                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-105] notnull: false is ignored for integers with the mssql export</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-105</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The following yml schema will result in a table with the integer field marked as not null&lt;/p&gt;

&lt;p&gt;MyTable:&lt;br/&gt;
  columns:&lt;br/&gt;
    intfield:&lt;br/&gt;
      type: integer&lt;br/&gt;
      notnull: false&lt;/p&gt;

&lt;p&gt;I have traced this back to line 244 in the getIntegerDeclaration function in lib/Doctrine/DataDict/Mssql.php&lt;/p&gt;

&lt;p&gt;$notnull  = (isset($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;)  &amp;amp;&amp;amp; $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;)  ? &apos; NOT NULL&apos; : &apos;&apos;;&lt;/p&gt;

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

&lt;p&gt;$notnull  = (isset($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;)  &amp;amp;&amp;amp; $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;)  ? &apos; NOT NULL&apos; : &apos; NULL&apos;;&lt;/p&gt;

&lt;p&gt;This fixes the issue for us and hasn&apos;t created any problems thus far.&lt;/p&gt;</description>
                <environment>Windows XP Professional SP3, SQL Server Express 2008</environment>
            <key id="10183">DC-105</key>
            <summary>notnull: false is ignored for integers with the mssql export</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="uncleringo">Rich Birch</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Oct 2009 11:25:18 +0000</created>
                <updated>Wed, 14 Oct 2009 20:14:15 +0000</updated>
                    <resolved>Wed, 14 Oct 2009 20:14:15 +0000</resolved>
                            <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-102] Fix issue with model builder and class prefix files still prefixing table class files</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-102</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description></description>
                <environment></environment>
            <key id="10176">DC-102</key>
            <summary>Fix issue with model builder and class prefix files still prefixing table class files</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Oct 2009 18:41:24 +0000</created>
                <updated>Mon, 12 Oct 2009 18:42:37 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 18:42:37 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-99] Formatting Foreign Key contraint with cross databases</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-99</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This patch change the sign . to _ into the name of foreignKey because the name isn&apos;t valid with dot in the name.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10171">DC-99</key>
            <summary>Formatting Foreign Key contraint with cross databases</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Oct 2009 21:14:28 +0000</created>
                <updated>Mon, 12 Oct 2009 19:12:54 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 19:12:54 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10067" name="foreignkeycontraintname.patch" size="1837" author="garfield-fr" created="Sun, 11 Oct 2009 21:14:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-101] Length of ForeignKey name in constraint parameter</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-101</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If the name of ForeignKey constraint is too long, the sql insert failed on this.&lt;/p&gt;

&lt;p&gt;I tested with this:&lt;br/&gt;
ALTER TABLE article_i18n_index ADD CONSTRAINT article_i18n_index_id_article_i18n_id FOREIGN KEY (id) REFERENCES article_i18n(id) ON UPDATE CASCADE ON DELETE CASCADE;&lt;/p&gt;

&lt;p&gt;The article_i18n_index_id_article_i18n_id &amp;lt;-- this is too long&lt;/p&gt;

&lt;p&gt;MySql 5.086&lt;br/&gt;
Doctrine 1.2 (last)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10173">DC-101</key>
            <summary>Length of ForeignKey name in constraint parameter</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Oct 2009 13:36:38 +0000</created>
                <updated>Mon, 12 Oct 2009 21:04:01 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 21:04:01 +0000</resolved>
                            <version>1.2.0-ALPHA3</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-100] Patch to solve php fatal error bug in Class Table Inheritance code</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-100</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Although I know the Class Table Inheritance code is unsupported it is somehow working good enough for me to use this feature anyway.&lt;/p&gt;

&lt;p&gt;There is however a bug in the code when not defining column values on the parent object, which the attached small patch solves.&lt;/p&gt;

&lt;p&gt;Could this be added before the 1.2 release ? Thanks&lt;/p&gt;</description>
                <environment>php</environment>
            <key id="10172">DC-100</key>
            <summary>Patch to solve php fatal error bug in Class Table Inheritance code</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="mvantellingen">Michael van Tellingen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Oct 2009 07:30:42 +0000</created>
                <updated>Mon, 12 Oct 2009 19:01:49 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 19:01:49 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10068" name="doctrine.1.2alpha2-citr.patch" size="655" author="mvantellingen" created="Mon, 12 Oct 2009 07:30:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-96] Add support for the SET datatype</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-96</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Similar to the ENUM datatype, MySQL also invented the SET datatype. Emulation should be easily doable just like its currently done for ENUM.&lt;br/&gt;
&lt;a href=&quot;http://dev.mysql.com/tech-resources/articles/mysql-set-datatype.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/tech-resources/articles/mysql-set-datatype.html&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10164">DC-96</key>
            <summary>Add support for the SET datatype</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Oct 2009 12:50:10 +0000</created>
                <updated>Tue, 3 Nov 2009 05:19:34 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 05:19:34 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-95] support PEAR file/class naming conventions when generating model classes with a base class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-95</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Currently its not possible to generate base classes that are compatible with the PEAR file/class naming conventions&lt;br/&gt;
user -&amp;gt; user.php&lt;br/&gt;
base_user -&amp;gt; base/user.php&lt;/p&gt;

&lt;p&gt;The following settings do not give the desired results&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160;baseClassPrefix: &quot;base_&quot;&lt;br/&gt;
 &#160; &#160; &#160; &#160; baseClassesDirectory: &quot;base&quot;&lt;/p&gt;

&lt;p&gt;This seems like a very surprising, yet critical omission, which forces a symfony style autoloader instead of the Doctrine native autoloader.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10163">DC-95</key>
            <summary>support PEAR file/class naming conventions when generating model classes with a base class</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Oct 2009 12:01:06 +0000</created>
                <updated>Mon, 16 Nov 2009 18:01:24 +0000</updated>
                    <resolved>Fri, 9 Oct 2009 19:07:49 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10666" author="localheinz" created="Mon, 16 Nov 2009 17:01:47 +0000"  >&lt;p&gt;I got it to work using the following options&lt;/p&gt;

&lt;p&gt;  baseClassPrefix = &quot;Base_&quot;&lt;br/&gt;
  baseClassesDirectory = &lt;br/&gt;
  baseClassName = &quot;Default_Model_Base_Abstract&quot;&lt;br/&gt;
  classPrefix = &quot;Default_Model_&quot;&lt;br/&gt;
  classPrefixFiles = FALSE&lt;br/&gt;
  pearStyle = TRUE&lt;/p&gt;

&lt;p&gt;However, I have not been able to generate tables from the models generated.&lt;/p&gt;</comment>
                    <comment id="10668" author="jwage" created="Mon, 16 Nov 2009 17:07:25 +0000"  >&lt;p&gt;Are you using the generateTableClasses = TRUE option?&lt;/p&gt;</comment>
                    <comment id="10669" author="jwage" created="Mon, 16 Nov 2009 17:09:49 +0000"  >&lt;p&gt;Oh sorry, you said &quot;generate tables from the models generated&quot;....Misunderstood, that you meant Table classes. You are using the zend autoloader right?&lt;/p&gt;</comment>
                    <comment id="10672" author="localheinz" created="Mon, 16 Nov 2009 17:57:15 +0000"  >&lt;p&gt;Yes, I&apos;m using the Zend autoloader. Or, at least this is what I would like to do, generate model classes that are prefixed by &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;Default_Model_&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and keep working with the models as I have been prior to attempting to use the options&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;classPrefix = &quot;Default_Model_&quot;
pearStyle = TRUE
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At first, I made an attempt with &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;generateTableClasses = FALSE&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but then, switched to &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;generateTableClasses = TRUE&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then I just turned off the file not found warnings using&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;Zend_Loader_Autoloader::getInstance()-&amp;gt;suppressNotFoundWarnings(TRUE);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;although this can&apos;t be the cure, I believe.&lt;/p&gt;

&lt;p&gt;However, tables were not generated, only after extending &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_Export&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and adjusting&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 exportSchema($directory = null)
    {
        $classPrefix = &apos;Default_Model_&apos;;
        if ($directory !== null) {
            $models = Doctrine_Core::filterInvalidModels(Doctrine_Core::loadModels($directory, NULL, $classPrefix));
        } else {
            $models = Doctrine_Core::getLoadedModels();
        }

        $this-&amp;gt;exportClasses($models);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but this resulted in translation (I18n) tables generated as such&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;content
default__model__content__translation&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10673" author="jwage" created="Mon, 16 Nov 2009 18:01:24 +0000"  >&lt;p&gt;The prefix won&apos;t allow you to work with things like you did before, without the prefix The prefix is only for generation. You must still type the full name everywhere in your code. Make sure you are doing the following 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;$manager = Doctrine_Manager::getInstance();
$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_PEAR);

Doctrine_Core::setModelsDirectory(&apos;models&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-91] Adjust file structure to make Doctrine more compatible with existing autoloaders via svn:externals</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-91</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Doctrine.php class makes it very hard to pull in Doctrine via svn:externals in combination with an existing autoloader. The problem is the Doctrine.php this means you usually end up with something like Doctrine/Doctrine.php locally, which means you need to use the Doctrine autoloader or add another include path.&lt;/p&gt;

&lt;p&gt;One solution is to simply do two externals:&lt;br/&gt;
&lt;a href=&quot;http://svn.doctrine-project.org/branches/1.2/lib/&quot; class=&quot;external-link&quot;&gt;http://svn.doctrine-project.org/branches/1.2/lib/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://svn.doctrine-project.org/branches/1.2/lib/Doctrine&quot; class=&quot;external-link&quot;&gt;http://svn.doctrine-project.org/branches/1.2/lib/Doctrine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then including Doctrine.php manually.&lt;br/&gt;
The issue is of course that I cannot just do an external on the file because those only work on local repos. Svn also does not support sparse checkouts for externals.&lt;/p&gt;

&lt;p&gt;I see 2 solutions:&lt;br/&gt;
1) Simple solution would be to provide a directory with just Doctrine.php via a separate url&lt;br/&gt;
2) Move the code in Doctrine.php to Doctrine/Core.php and just extend that class from Doctrine.php for BC&lt;/p&gt;</description>
                <environment></environment>
            <key id="10159">DC-91</key>
            <summary>Adjust file structure to make Doctrine more compatible with existing autoloaders via svn:externals</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Oct 2009 13:43:37 +0000</created>
                <updated>Mon, 12 Oct 2009 18:45:31 +0000</updated>
                    <resolved>Mon, 12 Oct 2009 18:45:31 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10201" author="lsmith" created="Sun, 11 Oct 2009 09:00:50 +0000"  >&lt;p&gt;It might make sense to document inside the ticket what approach you took ..&lt;/p&gt;</comment>
                    <comment id="10204" author="lsmith" created="Mon, 12 Oct 2009 11:39:15 +0000"  >&lt;p&gt;It seems you forgot to set the ticket ID in your commits. If the following change is the reason for this ticket being marked as &quot;fixed&quot;, then it didnt really solve my issue. the issue is simply one of not being able to checkout Doctrine in a way that is compatible with the pear naming convention without having to add Doctrine to the include path. the solution is to either kill Doctrine.php or to at least provide Doctrine.php as an external without any addition subdirectories .. maybe put Doctrine.php into Doctrine/Doctrine/Doctrine.php via an inter repository file only external.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;Added Doctrine::setPath()&lt;br/&gt;
128	&lt;br/&gt;
129	Now you can specify the path to your Doctrine libraries if Doctrine.php is&lt;br/&gt;
130	outside of the location of your libraries.&lt;br/&gt;
131	&lt;br/&gt;
132	So if `Doctrine.php` is located at `/path/to/Doctrine.php` and the actual&lt;br/&gt;
133	libraries are at `/path/to/the/doctrine/libs` you would need to do the&lt;br/&gt;
134	following.&lt;br/&gt;
135	&lt;br/&gt;
136	    &lt;span class=&quot;error&quot;&gt;&amp;#91;php&amp;#93;&lt;/span&gt;&lt;br/&gt;
137	    Doctrine::setPath(&apos;/path/to/the/doctrine/libs&apos;);&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-90] Proposal: add Doctrine_Record::setColumnOption() method (diff included)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-90</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We are generating our entity classes from the database. By doing so, we get a nicely separated set of base record classes and derived record classes where we can implement our logic. The case is, that we want to add validators to about every field there is. The only way that we can do that right now, is by overriding the setUp() method, calling parent::setUp() and providing new column definitions using addColumn(). By doing so, we do have to include the options that were so nicely automatically determined from the database. If we now update our schema in the db and regenerate the base record classes, we might have to manually update addColumn() calls in derived records.&lt;/p&gt;

&lt;p&gt;To make it possible to fully separate the automatic and manual code, we were looking for a method to tweak an already existing table, but we couldn&apos;t find such method. Therefore, we implemented one ourselves.&lt;/p&gt;

&lt;p&gt;A practial usage example. This is what we had to write in the derived class (not a validator example, but the idea is the same of course: tweak or add a column option):&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;// Override the &lt;span class=&quot;code-quote&quot;&gt;&quot;info&quot;&lt;/span&gt; column definition. We want &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; field to be
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;// an object field, so we can store a serialized object in it.
&lt;/span&gt;    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;info&apos;, &apos;object&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(
      &apos;type&apos; =&amp;gt; &apos;object&apos;,
      &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
      &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
      &apos;notnull&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;false&lt;/span&gt;,
    ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is what we write now:&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;setColumnOption(&apos;info&apos;, &apos;type&apos;, &apos;object&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Please, consider adding the proposed change from the attached diff file. Of course, also let me know if there is a better way to handle this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10157">DC-90</key>
            <summary>Proposal: add Doctrine_Record::setColumnOption() method (diff included)</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Oct 2009 09:06:14 +0000</created>
                <updated>Fri, 9 Oct 2009 19:42:06 +0000</updated>
                    <resolved>Fri, 9 Oct 2009 19:42:06 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10186" author="mmakaay" created="Thu, 8 Oct 2009 09:10:42 +0000"  >&lt;p&gt;Diff for adding a setColumnOption() method to Doctrine_Record.&lt;/p&gt;</comment>
                    <comment id="10188" author="mmakaay" created="Thu, 8 Oct 2009 14:20:52 +0000"  >&lt;p&gt;A collegue added another method for batch-setting options in an easy way. It would be nice if this one could also be 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;    /**
     * setColumnOptions
     * sets options &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; existing column definitions
     *
     * @param array $options          array of arrays with
     *                                ($name, $option, $value) combinations
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setColumnOptions($options) {
      foreach($options as $optionset)
      {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;setColumnOption($optionset[0], $optionset[1], $optionset[2]);
      }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Example end-product 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;class Address &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; BaseAddress
{
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
  {
    parent::setTableDefinition();
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setColumnOptions(array(
      array(&apos;kind_of_address&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 10)),
      array(&apos;street&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 45)),
      array(&apos;street_short&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 24)),
      array(&apos;housenumber&apos;, &apos;Yoda_Doctrine_Validator_Housenumber&apos;, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;),
      array(&apos;housenumber_extension&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(0, 25)),
      array(&apos;postcode&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 6)),
      array(&apos;postcode&apos;, &apos;Yoda_Doctrine_Validator_Postcode&apos;, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;),
      array(&apos;city&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 24)),
      array(&apos;province&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 25)),
      array(&apos;country&apos;, &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 25)),
      array(&apos;status&apos;,  &apos;Yoda_Doctrine_Validator_StringLength&apos;, array(3, 30)),
    ));
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                <outwardlinks description="relates to">
                            <issuelink>
            <issuekey id="10112">DC-63</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10065" name="setColumnOption.diff" size="1796" author="mmakaay" created="Thu, 8 Oct 2009 09:10:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-87] Import / export does not take into account the connection to the database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-87</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The mechanism of imports and exports does not include connection to the database. This creates many problems when we have multiple connections to the database and want to use a command to generate. (generateYamlFromDb or generateYamlFromModels or generateModelsFromDb or generateModelsFromYaml and other related methods)&lt;/p&gt;


&lt;p&gt;Possible solution: &lt;/p&gt;

&lt;p&gt;The file Doctrine/Import.php between lines 384 and 385 insert:&lt;br/&gt;
$definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;connection&amp;#39;&amp;#93;&lt;/span&gt; = $connection-&amp;gt;getName();&lt;br/&gt;
$definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;connectionClassName&amp;#39;&amp;#93;&lt;/span&gt; = $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;The file Doctrine/Export/Schema.php between lines 71 and 72 insert line:&lt;br/&gt;
$table&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;connection&amp;#39;&amp;#93;&lt;/span&gt; = $recordTable-&amp;gt;getConnection()-&amp;gt;getName();&lt;/p&gt;</description>
                <environment>Environment does not matter, the problem occurs in the Doctrine code. he problem occurs in any environment.</environment>
            <key id="10152">DC-87</key>
            <summary>Import / export does not take into account the connection to 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="krzysztofu">Krzysztof Ustowski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Oct 2009 19:59:42 +0000</created>
                <updated>Fri, 30 Oct 2009 16:14:56 +0000</updated>
                    <resolved>Fri, 30 Oct 2009 16:14:56 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Connection</component>
                <component>Import/Export</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-86] NOW() doesn&apos;t work in Sqlite driver</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-86</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem is concerned about sqlite driver. Currently in every occurence of &quot;NOW()&quot; in where clause PDO substitutes result of PHP time() function. Here is a cause:&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;dbh-&amp;gt;sqliteCreateFunction(&apos;now&apos;, &apos;time&apos;, 0);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Unfortunatelly, sqlite expects a datetime value rather then integer timestamp. &lt;/p&gt;

&lt;p&gt;In result, every occurence of &apos;now()&apos; in where clause is treated as &apos;0&apos;.&lt;/p&gt;

&lt;p&gt;I have prepared a testcase and patch.&lt;/p&gt;</description>
                <environment>sqlite</environment>
            <key id="10150">DC-86</key>
            <summary>NOW() doesn&apos;t work in Sqlite driver</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Oct 2009 14:49:25 +0000</created>
                <updated>Tue, 13 Oct 2009 04:45:17 +0000</updated>
                    <resolved>Tue, 13 Oct 2009 04:45:17 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10063" name="DC86.patch" size="1588" author="j.debowczyk" created="Wed, 7 Oct 2009 14:56:03 +0000" />
                    <attachment id="10062" name="DC86TestCase.php" size="2732" author="j.debowczyk" created="Wed, 7 Oct 2009 14:51:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-79] Unexpected exception type when saving a relation with an invalid model in it</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-79</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When creating two related models and saving the main one to the database, both models get stored in the database. That is expected behavior. Now, when one of the two models has a validation problem and I call save() on it - without first linking it to the other model - I get a Doctrine_Validator_Exception. That is expected behavior. Now (patience, we&apos;re getting to the bug now), when one or both of the models has a validation problem and I link them prior to saving them, I don&apos;t get a Doctrine_Validator_Exception, but instead a database level exception Doctrine_Connection_Pgsql_Exception. That is unexpected behavior.&lt;/p&gt;

&lt;p&gt;One wouldn&apos;t notice this issue when doing code like:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
    $object-&amp;gt;save();
  } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
    &lt;span class=&quot;code-comment&quot;&gt;// .. handle the exception
&lt;/span&gt;  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, code like we are using it in our project more often looks 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;try&lt;/span&gt; {
    $object-&amp;gt;save();
  } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Doctrine_Validator_Exception $e) {
    &lt;span class=&quot;code-comment&quot;&gt;// .. handle the validation exception
&lt;/span&gt;  } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (One_Of_Our_Exception $e) {
    &lt;span class=&quot;code-comment&quot;&gt;// .. handle our exception
&lt;/span&gt;  } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
    &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e; &lt;span class=&quot;code-comment&quot;&gt;// unexpected exception, re-&lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; and pray 
&lt;/span&gt;  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the attachment you find a test.yml and a test.php that I used for figuring out the behavior. Here&apos;s the output from running the test script:&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;1. OK, got expected exception
2. OK, record A saved
3. OK, got expected exception
4. OK, record B saved
5. OK, record A saved with a linked record B
6. Error: unexpected exception was thrown.
   Type: Doctrine_Connection_Pgsql_Exception
   Message: SQLSTATE[23502]: Not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; violation: 7 ERROR:  &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; value in column &lt;span class=&quot;code-quote&quot;&gt;&quot;b_id&quot;&lt;/span&gt; violates not-&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; constraint
7. Error: unexpected exception was thrown.
   Type: Doctrine_Connection_Pgsql_Exception
   Message: SQLSTATE[23502]: Not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; violation: 7 ERROR:  &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; value in column &lt;span class=&quot;code-quote&quot;&gt;&quot;a_id&quot;&lt;/span&gt; violates not-&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; constraint
8. Error: unexpected exception was thrown.
   Type: Doctrine_Connection_Pgsql_Exception
   Message: SQLSTATE[23502]: Not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; violation: 7 ERROR:  &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; value in column &lt;span class=&quot;code-quote&quot;&gt;&quot;a_id&quot;&lt;/span&gt; violates not-&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; constraint
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Inspecting the Connection/UnitOfWork.php code, I see that saveGraph() calls $isValid = $this-&amp;gt;insert($record). Now, when insert() sees that the record is invalid, it returns a false value. Somewhat later this results in calling $conn-&amp;gt;transaction-&amp;gt;addInvalid($record) to register the problem. At the end of the code block, I find (around line 126):&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;// save the MANY-TO-MANY associations
&lt;/span&gt;                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;saveAssociations($record);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is the point where things break. Even when an associated record does not validate, saveAssociations() will be called, resulting in a db level error about a reference id not being set (logical, since the related record was not saved and did not get an id assigned to it).&lt;/p&gt;

&lt;p&gt;In my opinion, this shouldn&apos;t happen, but I&apos;m only using Doctrine for one day, so if I am missing some important piece of knowledge or documentation here, then please let me know.&lt;/p&gt;</description>
                <environment>Ubuntu Linux, PostgreSQL 8.3, PHP 5.2.6</environment>
            <key id="10141">DC-79</key>
            <summary>Unexpected exception type when saving a relation with an invalid model in it</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Oct 2009 19:42:27 +0000</created>
                <updated>Fri, 9 Oct 2009 21:15:56 +0000</updated>
                    <resolved>Fri, 9 Oct 2009 21:15:56 +0000</resolved>
                            <version>1.1.4</version>
                <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Connection</component>
                <component>Record</component>
                <component>Relations</component>
                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10172" author="mmakaay" created="Sun, 4 Oct 2009 20:32:42 +0000"  >&lt;p&gt;Note: I have tested some more and like expected, I got the correct exception when loading an existing A-&amp;gt;B relation, breaking B and calling A-&amp;gt;save(). In that case, storing the AB relation won&apos;t fail, because B already has an id. Saving the relation is successful and in the end, the validation exception is thrown as expected.&lt;/p&gt;

&lt;p&gt;Test code for this extra 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;$at = Doctrine::getTable(&apos;A&apos;);
$a = $at-&amp;gt;find(1); 

$a-&amp;gt;Bs[0]-&amp;gt;field = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

$a-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10057" name="test.php" size="2024" author="mmakaay" created="Sun, 4 Oct 2009 19:42:27 +0000" />
                    <attachment id="10056" name="test.yml" size="595" author="mmakaay" created="Sun, 4 Oct 2009 19:42:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-84] Migration automation methods break with tables and fks on the same migration class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-84</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Currently if within a single migration class one uses the automation methods $this-&amp;gt;table() and $this-&amp;gt;foreignKey() the process will fail when moving down because the system will execute the down direction in the same order as the up direction. For example:&lt;/p&gt;

&lt;p&gt;public function migrate($direction) {&lt;br/&gt;
  $this-&amp;gt;table($direction, &apos;mytable&apos;, ...);&lt;br/&gt;
  $this-&amp;gt;table($direction, &apos;myrelatedtable&apos;, ... );&lt;br/&gt;
  $this-&amp;gt;foreignKey($direction, &apos;mytable&apos;, &apos;myfkname&apos;, ...);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Going up, everything is fine. The tables are created and the FK is applied. Going down, however will error out since by the time the FK is going to be removed the table it belons to is gone.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10146">DC-84</key>
            <summary>Migration automation methods break with tables and fks on the same migration 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aarjona">Ariel Arjona</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Oct 2009 21:51:08 +0000</created>
                <updated>Tue, 13 Oct 2009 03:44:14 +0000</updated>
                    <resolved>Tue, 13 Oct 2009 03:44:14 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10181" author="jwage" created="Wed, 7 Oct 2009 19:08:54 +0000"  >&lt;p&gt;Hmm. Would this fix the problem? I am unsure if this would cause any other problems.&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: lib/Doctrine/Migration.php
===================================================================
--- lib/Doctrine/Migration.php	(revision 6437)
+++ lib/Doctrine/Migration.php	(working copy)
@@ -499,6 +499,9 @@
 
             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($migration-&amp;gt;getNumChanges() &amp;gt; 0) {
                 $changes = $migration-&amp;gt;getChanges();
+                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($direction == &apos;down&apos;) {
+                    $changes = array_reverse($changes);
+                }
                 foreach ($changes as $value) {
                     list($type, $change) = $value;
                     $funcName = &apos;process&apos; . Doctrine_Inflector::classify($type);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10182" author="aarjona" created="Wed, 7 Oct 2009 20:33:04 +0000"  >&lt;p&gt;That would work but it would have to check if there&apos;s a migrate() method otherwise it would reverse regular down() methods:&lt;/p&gt;

&lt;p&gt;if ($direction == &apos;down&apos; &amp;amp;&amp;amp; method_exists($migration, &apos;migrate&apos;))&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-77] Query-Parameters are not correctly Replaced if you count() a Limited Query with a Many-to-Many join</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-77</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The same issue is already was already mentioned in the Trac-Ticket-System (&lt;a href=&quot;http://trac.doctrine-project.org/ticket/1579&quot; class=&quot;external-link&quot;&gt;#1579&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I was able to reproduce this issue with the following schema:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;sfGuardUser:
  tableName: user
  columns:
    id:
      name: user_id as id
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    username:
      name: user_login as username
      type: string(25)
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  relations:
    Permissions:
      class: sfGuardPermission
      local: user_id
      foreign: role_id
      refClass: sfGuardUserPermission
      foreignAlias: Users

sfGuardUserPermission:
  tableName: user_role
  columns:
    user_id:
      type: integer(4)
      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;
    permission_id:
      name: role_id as permission_id
      type: integer(4)
      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;
  relations:
    sfGuardUser:
      local: user_id
    sfGuardPermission:
      local: permission_id

sfGuardPermission:
  tableName: role
  columns:
    id:
      name: role_id as id
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    name:
      name: role_token as name
      type: string(255)
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: &apos;&apos;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      unique: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The failing Query looks like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Query::create()-&amp;gt;
       from(&apos;sfGuardUser u&apos;)-&amp;gt;
       leftJoin(&apos;u.Permissions p&apos;)-&amp;gt;
       where(&apos;u.username LIKE ?&apos;, array(3, &apos;%a%&apos;))-&amp;gt;
       limit(10)-&amp;gt;
       count();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And that&apos;s the resulting Error:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Connection_Mysql_Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version 
&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the right syntax to use near &apos;? LIMIT 10&apos; at line 1 in 
/home/mkr/Projects/doctrine_count/Doctrine-1.0.12-Sandbox/lib/Doctrine/Connection.php on line 1086
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, the Where-Parameter is not replaced correctly, The SQL-Query is executed in Line 1153 of Query.php, but $params does not contain the Query-Parameters, as it should be.&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;Query.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-comment&quot;&gt;// mysql doesn&apos;t support LIMIT in subqueries
&lt;/span&gt;$list = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;execute($subquery, $params)-&amp;gt;fetchAll(Doctrine::FETCH_COLUMN);
$subquery = implode(&apos;, &apos;, array_map(array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn, &apos;quote&apos;), $list));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can also check my Post in the &lt;a href=&quot;http://forum.symfony-project.org/index.php/m/86165/#msg_86165&quot; class=&quot;external-link&quot;&gt;symfony-forum&lt;/a&gt; for details&lt;/p&gt;


</description>
                <environment>Doctrine 1.0.12 Sandbox, Apache 2.2, MySQL 5.0.75, php 5.2.6</environment>
            <key id="10139">DC-77</key>
            <summary>Query-Parameters are not correctly Replaced if you count() a Limited Query with a Many-to-Many 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="matthias.krauser">Matthias Krauser</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Oct 2009 15:15:15 +0000</created>
                <updated>Sun, 22 Nov 2009 13:45:28 +0000</updated>
                    <resolved>Fri, 23 Oct 2009 18:10:41 +0000</resolved>
                            <version>1.0.12</version>
                                <fixVersion>1.0.13</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10500" author="jwage" created="Wed, 4 Nov 2009 20:17:52 +0000"  >&lt;p&gt;Can you retest this issue on the latest 1.0 svn version? Thanks &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="10559" author="phennim" created="Tue, 10 Nov 2009 10:18:45 +0000"  >&lt;p&gt;The fix for this issue causes double params to be inserted for a subquery.&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;select(&apos;p.*&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;Product p&apos;)&lt;br/&gt;
      -&amp;gt;innerJoin(&apos;p.Categories c&apos;)&lt;br/&gt;
      -&amp;gt;whereIn(&apos;c.id&apos;, array(29, 30))&lt;br/&gt;
      -&amp;gt;limit(9)&lt;br/&gt;
      -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;Generates this subquery:&lt;br/&gt;
Doctrine_Connection-&amp;gt;execute(&apos;SELECT DISTINCT p2.id FROM product p2 INNER JOIN category c2 ON (p2.id = c2.product_id) INNER JOIN menu m2 ON m2.id = c2.menu_id WHERE m2.id IN (?, ?) LIMIT 9&apos;, array(29, 30, 29, 30));&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&lt;/p&gt;


&lt;p&gt;Changeset that introduced the issue:&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/changeset/6563&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/6563&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;The $params passed to getParams are the same as in $this-&amp;gt;_params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;where&amp;#39;&amp;#93;&lt;/span&gt;... so array_merge doubles them up.&lt;/p&gt;

&lt;p&gt;Doctrine_Query_Abstract::getParams()&lt;br/&gt;
public function getParams($params = array())&lt;br/&gt;
{&lt;br/&gt;
    return array_merge((array) $params, $this-&amp;gt;_params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;join&amp;#39;&amp;#93;&lt;/span&gt;, $this-&amp;gt;_params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;set&amp;#39;&amp;#93;&lt;/span&gt;, $this-&amp;gt;_params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;where&amp;#39;&amp;#93;&lt;/span&gt;, $this-&amp;gt;_params&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;having&amp;#39;&amp;#93;&lt;/span&gt;);&lt;br/&gt;
}&lt;/p&gt;</comment>
                    <comment id="10560" author="phennim" created="Tue, 10 Nov 2009 10:23:20 +0000"  >&lt;p&gt;&lt;b&gt;sigh&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;It&apos;s true.. I&apos;m not that bright.&lt;/p&gt;</comment>
                    <comment id="10818" author="matthias.krauser" created="Sun, 22 Nov 2009 13:45:28 +0000"  >&lt;p&gt;@Jonathan:&lt;/p&gt;

&lt;p&gt;&amp;gt; Can you retest this issue on the latest 1.0 svn version? Thanks &lt;/p&gt;

&lt;p&gt;I was able to run my original test without any errors (SVN-Revision: 6791). &lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10330">DC-181</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-82] Conditional unique validator and index </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-82</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine currently doesn&apos;t support conditional unique keys. One commonly happening situation is when we have a model with a column (eg. named &quot;deleted&quot;) indicates whether the record was deleted and should no longer be treated as active. If we have an unique index on a &quot;name&quot; column, the index should contain only records with deleted = false. It also concerns an unique validation.&lt;/p&gt;

&lt;p&gt;I have prepared a patch for Doctrine_Validator_Unique and Doctrine_Export_Pgsql (Postgresql natively supports conditional indexes).&lt;/p&gt;

&lt;p&gt;Example of usage:&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;hasColumn(&apos;id&apos;, &apos;integer&apos;, 4, 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;, &apos;sequence&apos; =&amp;gt; &apos;model_id_seq&apos;));
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 128, array(&apos;notnull&apos;, &apos;unique&apos; =&amp;gt; array(&apos;where&apos; =&amp;gt; &apos;deleted = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&apos;)));
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;deleted&apos;, &apos;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&apos;, 1, array(&apos;notnull&apos;, &apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;));
  $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;index(&apos;model_unique_name&apos;, array(&apos;fields&apos; =&amp;gt; array(&apos;name&apos;), &apos;where&apos; =&amp;gt; &apos;deleted = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&apos;, &apos;type&apos; =&amp;gt; &apos;unique&apos; ));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10144">DC-82</key>
            <summary>Conditional unique validator and index </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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Oct 2009 15:48:18 +0000</created>
                <updated>Tue, 13 Oct 2009 04:56:59 +0000</updated>
                    <resolved>Tue, 13 Oct 2009 04:56:59 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10058" name="conditional_unique.patch" size="1534" author="j.debowczyk" created="Tue, 6 Oct 2009 15:48:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-76] [PATCH] The interface Doctrine_Record_Listener_Interface does not define all the required methods to create custom listeners.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-76</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Doctrine_Record_Listener_Interface is no longer up to date with the code base. The code base expects the listener to implement a getOption method which is not available on my listener models... See the patch file.&lt;/p&gt;</description>
                <environment>within sfDoctrinePlugin</environment>
            <key id="10134">DC-76</key>
            <summary>[PATCH] The interface Doctrine_Record_Listener_Interface does not define all the required methods to create custom listeners.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="marijn">Marijn Huizendveld</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Oct 2009 21:49:12 +0000</created>
                <updated>Fri, 9 Oct 2009 21:10:01 +0000</updated>
                    <resolved>Fri, 9 Oct 2009 21:10:01 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10160" author="marijn" created="Thu, 1 Oct 2009 21:54:52 +0000"  >&lt;p&gt;I&apos;ve taken the liberty to remove the `public` keyword from the `interface` definition which seemed a bit redundant given the fact that it is an interface... Sorry for that :-$&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10054" name="patch_doctrine_record_listener_interface.diff" size="1786" author="marijn" created="Thu, 1 Oct 2009 21:49:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-74] Condition of STATE_PROXY should be checked dynamically, not as a static state value</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-74</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This issue is continuation of issue #2488 from Trac. I have prepared Test case showing that the problem is seriously. Below original content.&lt;/p&gt;


&lt;p&gt;A record gets STATE_PROXY state at hydration when its properties are not fully loaded. Here is a condition (placed in Doctrine_Record::hydrate()):&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; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;isModified() &amp;amp;&amp;amp; count($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_values) &amp;lt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getColumnCount()) {
   $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_state = self::STATE_PROXY;
}

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

&lt;p&gt;But at first setting a column value (whatever if the column value was loaded or not), the record gets STATE_DIRTY and &quot;forgets&quot; its proxy state.&lt;/p&gt;

&lt;p&gt;In effect a call to any not loaded column of the record causes returning null value. It should, of course, load remaining column values and change record state from STATE_PROXY to STATE_DIRTY. It doesn&apos;t load because current record state is already STATE_DIRTY.&lt;/p&gt;

&lt;p&gt;I&apos;m attaching a patch, which fixes Doctrine_Record::load() in the described situation.&lt;/p&gt;

&lt;p&gt;In my opinion usage of STATE_PROXY must be rethinked. STATE_PROXY can mean:&lt;br/&gt;
1. STATE_CLEAN + not fully loaded columns (proxy)&lt;br/&gt;
2. STATE_DIRTY + not fully loaded columns (proxy)&lt;/p&gt;

&lt;p&gt;Currently it only points the first situation so there is not way to identify the second situation (and it is silently ignored).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10128">DC-74</key>
            <summary>Condition of STATE_PROXY should be checked dynamically, not as a static state 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Sep 2009 16:10:07 +0000</created>
                <updated>Mon, 2 Nov 2009 22:34:10 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 22:34:10 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10148" author="j.debowczyk" created="Wed, 30 Sep 2009 16:31:33 +0000"  >&lt;p&gt;I&apos;m including a patch.&lt;/p&gt;

&lt;p&gt;I think that the patch needs a little explanation. To solve the problem I see 2 solutions:&lt;br/&gt;
1. create new state, eg. STATE_PROXY_MODIFIED being activated when a proxy record gets modified&lt;br/&gt;
2. transform existing conditions to check proxy state dynamically using new Doctrine_Record::isInProxyState() method&lt;/p&gt;

&lt;p&gt;I chosen the second as a less invasive way. A record is in proxy state when it has any not loaded properties - this must be found out by the method. But... currently there is no way to find this. Doctrine_Null object in $record-&amp;gt;_data means that property is not loaded yet OR it has null value. &lt;br/&gt;
In the patch I divided real null value (simply stored as null in _data) from unknown (not loaded) value (stored as Doctrine_Null). &lt;/p&gt;</comment>
                    <comment id="10213" author="jwage" created="Tue, 13 Oct 2009 03:51:13 +0000"  >&lt;p&gt;When I tried this patch, it broke the test suite. Can you try your patch again?&lt;/p&gt;</comment>
                    <comment id="10260" author="j.debowczyk" created="Tue, 20 Oct 2009 14:48:21 +0000"  >&lt;p&gt;It breaks 2 test cases. &lt;/p&gt;

&lt;p&gt;The first is Doctrine_Ticket_1449_TestCase. I have appended following code to prepareData() in the 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;        $document-&amp;gt;Attachments-&amp;gt;getFirst()-&amp;gt;getTable()-&amp;gt;clear();
        $document-&amp;gt;getTable()-&amp;gt;clear();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and added &quot;a.document_id&quot; column to select:&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;        $document = Doctrine_Query::create()
            -&amp;gt;select(&apos;d.id, d.name, a.id, a.document_id&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and the test passes. IMHO problem is in the test, what I noticed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-73&quot; title=&quot;TestCase framework normally uses identityMap for records created in prepareData() what can cause side effects&quot;&gt;&lt;del&gt;DC-73&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The second is Doctrine_Relation_OrderBy_TestCase. Currently there are identical queries asserted for lazy load $user-&amp;gt;ChildrenUsers  and $user-&amp;gt;ParentUser. IMHO second query in the test (line 93) is wrong. Could you check this?&lt;/p&gt;</comment>
                    <comment id="10261" author="j.debowczyk" created="Tue, 20 Oct 2009 14:53:50 +0000"  >&lt;p&gt;I&apos;m including the patch adapted to Doctrine-1.2.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10084" name="DC74-1.2.diff" size="6205" author="j.debowczyk" created="Tue, 20 Oct 2009 14:54:21 +0000" />
                    <attachment id="10051" name="DC74.patch" size="6222" author="j.debowczyk" created="Wed, 30 Sep 2009 16:31:33 +0000" />
                    <attachment id="10050" name="DC74TestCase.php" size="2890" author="j.debowczyk" created="Wed, 30 Sep 2009 16:12:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-72] DQL Auto generated column aliases cause &quot;ORA-00972: identifier is too long&quot; on Oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-72</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have an existing Oracle DB that has some tables with column names that have 28-30 characters (30 characters is the maximum identifier&lt;br/&gt;
length with Oracle).&lt;/p&gt;

&lt;p&gt;I have created a YAML schema for the tables I want to query via DQL in this database and generated the models.&lt;/p&gt;

&lt;p&gt;When I run a DQL that selects some of the columns whose names are 28-30 characters in length, I receive an &quot;ORA-00972: identifier is too long&quot; error from Oracle.&lt;/p&gt;

&lt;p&gt;After some investigation, I found that Doctrine_Query is auto generating aliases for these columns that are more than 30 characters in length. In a nutshell, it appears that Doctrine_Query generates the alias by taking a single character for the table alias, plus two underscores, plus the column name (for example, t__alongerthanusualtablecolumnx).&lt;/p&gt;

&lt;p&gt;If the original column name was 28-30 characters in length, then the additional 3 characters exceed the 30 character identifier limit. If more tables are joined in the query, you can end up with longer table aliases (t0, t1, ... t10, etc) and the problem will affect tables with column names less than 28 characters in length as well.&lt;/p&gt;

&lt;p&gt;I worked around this problem by patching Doctrine_Query and Doctrine_Hydrator to use the numerical column indexes from the table definition instead of the column name when auto generating aliases.&lt;/p&gt;

&lt;p&gt;Attached is a patch for my workaround.  I doubt it&apos;s the best way to fix this, but it should help to exemplify what is happening.&lt;/p&gt;

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

&lt;p&gt;Jamie&lt;/p&gt;</description>
                <environment>Doctrine 1.1.4, Oracle 10.2.0.4, PHP 5.2.10</environment>
            <key id="10125">DC-72</key>
            <summary>DQL Auto generated column aliases cause &quot;ORA-00972: identifier is too long&quot; on Oracle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="jaugust">James Augustine</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Sep 2009 12:31:17 +0000</created>
                <updated>Thu, 18 Nov 2010 10:38:02 +0000</updated>
                    <resolved>Mon, 16 Nov 2009 19:07:04 +0000</resolved>
                            <version>1.1.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10680" author="jwage" created="Mon, 16 Nov 2009 19:07:04 +0000"  >&lt;p&gt;This issue has been fixed in D2.&lt;/p&gt;</comment>
                    <comment id="14779" author="ogurbuz" created="Thu, 18 Nov 2010 10:36:55 +0000"  >&lt;p&gt;After patching, i can observer an unexpected behaviour of doctrine.&lt;/p&gt;

&lt;p&gt;    $q = Doctrine_Query::create()&lt;br/&gt;
			-&amp;gt;select(&apos;locale AS l&apos;) // Giving an Alias&lt;br/&gt;
			-&amp;gt;distinct()&lt;br/&gt;
			-&amp;gt;from(&apos;Translation&apos;)&lt;/p&gt;

&lt;p&gt;Before Patching:&lt;br/&gt;
string(70) &quot;SELECT DISTINCT t.locale AS t__0 FROM TRANSLATION t WHERE t.cotrid = ?&quot; &lt;br/&gt;
array(2) { &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;l&quot;]=&amp;gt; string(5) &quot;de_DE&quot; }
&lt;p&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;l&quot;]=&amp;gt; string(5) &quot;en_GB&quot; }
&lt;p&gt; } &lt;/p&gt;

&lt;p&gt;After Patching:&lt;br/&gt;
string(70) &quot;SELECT DISTINCT t.locale AS t__0 FROM TRANSLATION t WHERE t.cotrid = ?&quot; &lt;br/&gt;
array(2) { &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;trasId&quot;]=&amp;gt; string(5) &quot;de_DE&quot; }
&lt;p&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt; array(1) &lt;/p&gt;
{ [&quot;trasId&quot;]=&amp;gt; string(5) &quot;en_GB&quot; }
&lt;p&gt; } &lt;/p&gt;

&lt;p&gt;After Patching its not possible to access the value by my alias &quot;l&quot;.&lt;/p&gt;

&lt;p&gt;How can we fix this!?&lt;/p&gt;
</comment>
                    <comment id="14780" author="ogurbuz" created="Thu, 18 Nov 2010 10:38:02 +0000"  >&lt;p&gt;We have to use Doctrine 1.1.4 or 1.1.5. I think in the above fix it making no difference using 1.1.4 or 1.1.5&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10046" name="doctrine_fix.diff" size="5261" author="jaugust" created="Wed, 30 Sep 2009 12:31:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-68] When exporting model to SQL, Doctrine generates erroneous constraint name for table name with schema</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-68</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For example, for a foreign key from user.group_id -&amp;gt; group.id in a schema &quot;main&quot; - with explicite specified the schema name in the table names (main.user, main.group) - Doctrine generates a constraint name &quot;main.user_group_id_main.group_id&quot;. Unfortunately, &quot;.&quot; is reserved char and is illegal in a constraint name.&lt;/p&gt;</description>
                <environment>pgsql</environment>
            <key id="10119">DC-68</key>
            <summary>When exporting model to SQL, Doctrine generates erroneous constraint name for table name with schema</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Sep 2009 13:09:18 +0000</created>
                <updated>Tue, 13 Oct 2009 03:51:55 +0000</updated>
                    <resolved>Tue, 13 Oct 2009 03:51:55 +0000</resolved>
                            <version>1.1.4</version>
                                <fixVersion>1.2.0-ALPHA3</fixVersion>
                                <component>Connection</component>
                <component>Import/Export</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10137" author="j.debowczyk" created="Mon, 28 Sep 2009 13:12:53 +0000"  >&lt;p&gt;TestCase&lt;/p&gt;</comment>
                    <comment id="10138" author="j.debowczyk" created="Mon, 28 Sep 2009 13:15:04 +0000"  >&lt;p&gt;Patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10044" name="DC68TestCase.php" size="2566" author="j.debowczyk" created="Mon, 28 Sep 2009 13:12:53 +0000" />
                    <attachment id="10045" name="Doctrine_Connection.diff" size="912" author="j.debowczyk" created="Mon, 28 Sep 2009 13:15:04 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-65] Add documentation for Doctrine::ATTR_HYDRATE_OVERWRITE</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-65</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Maybe this sould be added somewhere in docs (since there&apos;s nothing about that in 1.1&apos;s)&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-&amp;gt;setAttribute(Doctrine::ATTR_HYDRATE_OVERWRITE, &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="10116">DC-65</key>
            <summary>Add documentation for Doctrine::ATTR_HYDRATE_OVERWRITE</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Sep 2009 16:49:06 +0000</created>
                <updated>Tue, 3 Nov 2009 20:14:55 +0000</updated>
                    <resolved>Tue, 3 Nov 2009 20:14:55 +0000</resolved>
                                            <fixVersion>1.2.0-BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-62] decimal fields are rounded to 6 decimal places on save()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-62</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Decimal fields with high precision are rounded down to 6 decimal places prior to inserting into database on Doctrine_Record-&amp;gt;save()&lt;/p&gt;

&lt;p&gt;For example,&lt;br/&gt;
if you define a column to represent decimal numbers with 12 digits following the decimal:&lt;/p&gt;

&lt;p&gt;MySet:&lt;br/&gt;
  columns:&lt;br/&gt;
    p_value: &lt;/p&gt;
{ type: decimal(18), scale: 12 }


&lt;p&gt;Then create a new doctrine record object and save:&lt;/p&gt;

&lt;p&gt;$record = new MySet();&lt;br/&gt;
$record&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;p_value&amp;#39;&amp;#93;&lt;/span&gt; = 5.012345678912;&lt;br/&gt;
$record-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;The value in the database at this point has been rounded down to 6 decimal places:&lt;br/&gt;
value = 5.012346000000&lt;/p&gt;


&lt;p&gt;print_r($record-&amp;gt;toArray()) shows the correct value to 12 decimal places&lt;/p&gt;</description>
                <environment>db engine: MySQL 5.0.75 and SQLite&lt;br/&gt;
php ini: precision = 12&lt;br/&gt;
</environment>
            <key id="10111">DC-62</key>
            <summary>decimal fields are rounded to 6 decimal places on 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bradyo">brady</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Sep 2009 01:04:37 +0000</created>
                <updated>Wed, 14 Apr 2010 17:03:42 +0000</updated>
                    <resolved>Wed, 18 Nov 2009 01:15:52 +0000</resolved>
                            <version>1.0.13</version>
                <version>1.1.4</version>
                <version>1.2.0-BETA2</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10609" author="bradyo" created="Thu, 12 Nov 2009 19:37:06 +0000"  >&lt;p&gt;I found that retrieving from the database gives the correct precision, so the rounding problem only occurs on saving. I&apos;ve tested doctrine versions 1.0.13 (through symfony), 1.1.4, and 1.2 alpha2 - all have this problem.&lt;/p&gt;


&lt;p&gt;//require_once(&apos;lib/vendor/Doctrine-1.2.0/lib/Doctrine.php&apos;);&lt;br/&gt;
require_once(&apos;lib/vendor/Doctrine-1.1.4/Doctrine.php&apos;);&lt;br/&gt;
spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));&lt;/p&gt;

&lt;p&gt;class TestRecord extends Doctrine_Record&lt;br/&gt;
{&lt;br/&gt;
    public function setTableDefinition()&lt;/p&gt;
    {
        $this-&amp;gt;setTableName(&apos;test&apos;);
        $this-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;notnull&apos; =&amp;gt; false,
             &apos;primary&apos; =&amp;gt; true,
             &apos;autoincrement&apos; =&amp;gt; true,
             ));
				$this-&amp;gt;hasColumn(&apos;test_field&apos;, &apos;decimal&apos;, 18, array(
             &apos;scale&apos; =&amp;gt; 12,
             ));
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;$pdo = new PDO(&apos;sqlite:testdb.db&apos;);&lt;br/&gt;
//$pdo = new PDO(&apos;mysql:host=localhost;dbname=testdb&apos;, &apos;root&apos;, &apos;pass&apos;);&lt;br/&gt;
$conn = Doctrine_Manager::connection($pdo);&lt;/p&gt;

&lt;p&gt;// test retreival of value (first row has 12.891841075016 inserted manually)&lt;br/&gt;
$q = Doctrine_Query::create()-&amp;gt;from(&apos;TestRecord&apos;)&lt;br/&gt;
	-&amp;gt;where(&apos;id = ?&apos;, 1);&lt;br/&gt;
$record = $q-&amp;gt;fetchOne();&lt;br/&gt;
echo &apos;retrieved value = &apos;, $record&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;test_field&amp;#39;&amp;#93;&lt;/span&gt;, &quot;\n&quot;;&lt;br/&gt;
// outputs 12.891841075016 (OK)&lt;/p&gt;

&lt;p&gt;// test save of high precision decimal&lt;br/&gt;
$test = new TestRecord();&lt;br/&gt;
$test&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;test_field&amp;#39;&amp;#93;&lt;/span&gt; = 12.891841075016;&lt;br/&gt;
$test-&amp;gt;save();&lt;br/&gt;
// database shows 12.891841000000 (rounded incorrectly)&lt;/p&gt;</comment>
                    <comment id="10723" author="jwage" created="Wed, 18 Nov 2009 01:15:52 +0000"  >&lt;p&gt;This is a problem with mysql. In Doctrine decimal won&apos;t store that value properly. If you change it to float, it works properly. I had to make a change in Doctrine so that Doctrine float maps to mysql float, double to double and decimal to decimal. Update Doctrine 1.2 from SVN and change your schema type to be &apos;float&apos; instead of &apos;decimal&apos;. It should work properly then.&lt;/p&gt;</comment>
                    <comment id="12668" author="jek" created="Wed, 14 Apr 2010 17:03:42 +0000"  >&lt;p&gt;Seems another issue is generated by the fix to this ticket. For a schema like:&lt;/p&gt;

&lt;p&gt;Data:&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type:        integer(5)&lt;br/&gt;
      primary:  true&lt;br/&gt;
    value:&lt;br/&gt;
      type:        double&lt;/p&gt;

&lt;p&gt;and a MySQL database the generated column type for value is DOUBLE(18,2), which obviously isn&apos;t what was intended. Actually it means that storing values like &quot;1.234567&quot; or &quot;12 345 678 901 234 567 890&quot; doesn&apos;t work like one expects when working with double precision floats.&lt;/p&gt;

&lt;p&gt;Maybe I oversee something but I think there isn&apos;t a way to just use plain doubles.&lt;/p&gt;

&lt;p&gt;A possible fix could be to check for a explicitly set scale or length (line 233 and 237 of DataDict/Mysql.php):&lt;/p&gt;

&lt;p&gt;if (!empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;) || !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt;)) {&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;br/&gt;
} else {&lt;br/&gt;
  return &apos;DOUBLE&apos;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;This way there is a fallback to the version before rev 6750.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-59] Setting MYSQL_ATTR_USE_BUFFERED_QUERY forces a connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-59</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Ticket reference: &lt;a href=&quot;http://trac.doctrine-project.org/ticket/2449&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2449&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To set this PDO attribute, one needs to use: $masterConn-&amp;gt;getDbh()-&amp;gt;setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);&lt;/p&gt;

&lt;p&gt;Forcing a call to getDbh() forces the connection to be established. This isn&apos;t desirable from a performance point of view.&lt;/p&gt;

&lt;p&gt;The normal mode of operation: $masterConn-&amp;gt;setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);&lt;/p&gt;

&lt;p&gt;can&apos;t be used because PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is equal to 1000, and is &amp;gt; than the arbitrary constant check that doctrine has used (doctrine constants are 100-172). Doctrine then calls parent::setAttribute() on Configurable.php&lt;/p&gt;

&lt;p&gt;The overuse of setAttribute seems to be at fault here. It seems dangerous to mix the constant space between the PDO constants and Doctrine ones. The quick fix is to add a &amp;gt; 100 &amp;amp;&amp;amp; &amp;lt; 1000 in the conditional, which will fix these MySQL constants, but there are PDO constants all over the place. I&apos;m attaching a simple patch to reserve 100-999 for Doctrine, and move 1000+ back into PDO space.&lt;/p&gt;

&lt;p&gt;Here&apos;s a dump of the PDO constants in my PHP 5.2.4:&lt;/p&gt;

&lt;p&gt;Array (&lt;/p&gt;

&lt;p&gt;    &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_BOOL&amp;#93;&lt;/span&gt; =&amp;gt; 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_NULL&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_INT&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_STR&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_LOB&amp;#93;&lt;/span&gt; =&amp;gt; 3 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_STMT&amp;#93;&lt;/span&gt; =&amp;gt; 4 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_INPUT_OUTPUT&amp;#93;&lt;/span&gt; =&amp;gt; -2147483648 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_ALLOC&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_FREE&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_EXEC_PRE&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_EXEC_POST&amp;#93;&lt;/span&gt; =&amp;gt; 3 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_FETCH_PRE&amp;#93;&lt;/span&gt; =&amp;gt; 4 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_FETCH_POST&amp;#93;&lt;/span&gt; =&amp;gt; 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;PARAM_EVT_NORMALIZE&amp;#93;&lt;/span&gt; =&amp;gt; 6 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_LAZY&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ASSOC&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_NUM&amp;#93;&lt;/span&gt; =&amp;gt; 3 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_BOTH&amp;#93;&lt;/span&gt; =&amp;gt; 4 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_OBJ&amp;#93;&lt;/span&gt; =&amp;gt; 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_BOUND&amp;#93;&lt;/span&gt; =&amp;gt; 6 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_COLUMN&amp;#93;&lt;/span&gt; =&amp;gt; 7 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_CLASS&amp;#93;&lt;/span&gt; =&amp;gt; 8 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_INTO&amp;#93;&lt;/span&gt; =&amp;gt; 9 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_FUNC&amp;#93;&lt;/span&gt; =&amp;gt; 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_GROUP&amp;#93;&lt;/span&gt; =&amp;gt; 65536 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_UNIQUE&amp;#93;&lt;/span&gt; =&amp;gt; 196608 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_KEY_PAIR&amp;#93;&lt;/span&gt; =&amp;gt; 12 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_CLASSTYPE&amp;#93;&lt;/span&gt; =&amp;gt; 262144 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_SERIALIZE&amp;#93;&lt;/span&gt; =&amp;gt; 524288 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_PROPS_LATE&amp;#93;&lt;/span&gt; =&amp;gt; 1048576 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_NAMED&amp;#93;&lt;/span&gt; =&amp;gt; 11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_AUTOCOMMIT&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_PREFETCH&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_TIMEOUT&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_ERRMODE&amp;#93;&lt;/span&gt; =&amp;gt; 3 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_SERVER_VERSION&amp;#93;&lt;/span&gt; =&amp;gt; 4 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_CLIENT_VERSION&amp;#93;&lt;/span&gt; =&amp;gt; 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_SERVER_INFO&amp;#93;&lt;/span&gt; =&amp;gt; 6 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_CONNECTION_STATUS&amp;#93;&lt;/span&gt; =&amp;gt; 7 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_CASE&amp;#93;&lt;/span&gt; =&amp;gt; 8 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_CURSOR_NAME&amp;#93;&lt;/span&gt; =&amp;gt; 9 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_CURSOR&amp;#93;&lt;/span&gt; =&amp;gt; 10 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_ORACLE_NULLS&amp;#93;&lt;/span&gt; =&amp;gt; 11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_PERSISTENT&amp;#93;&lt;/span&gt; =&amp;gt; 12 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_STATEMENT_CLASS&amp;#93;&lt;/span&gt; =&amp;gt; 13 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_FETCH_TABLE_NAMES&amp;#93;&lt;/span&gt; =&amp;gt; 14 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_FETCH_CATALOG_NAMES&amp;#93;&lt;/span&gt; =&amp;gt; 15 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_DRIVER_NAME&amp;#93;&lt;/span&gt; =&amp;gt; 16 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_STRINGIFY_FETCHES&amp;#93;&lt;/span&gt; =&amp;gt; 17 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_MAX_COLUMN_LEN&amp;#93;&lt;/span&gt; =&amp;gt; 18 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_EMULATE_PREPARES&amp;#93;&lt;/span&gt; =&amp;gt; 20 &lt;span class=&quot;error&quot;&gt;&amp;#91;ATTR_DEFAULT_FETCH_MODE&amp;#93;&lt;/span&gt; =&amp;gt; 19 &lt;span class=&quot;error&quot;&gt;&amp;#91;ERRMODE_SILENT&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;ERRMODE_WARNING&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;ERRMODE_EXCEPTION&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;CASE_NATURAL&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;CASE_LOWER&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;CASE_UPPER&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;NULL_NATURAL&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;NULL_EMPTY_STRING&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;NULL_TO_STRING&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;ERR_NONE&amp;#93;&lt;/span&gt; =&amp;gt; 00000 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ORI_NEXT&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ORI_PRIOR&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ORI_FIRST&amp;#93;&lt;/span&gt; =&amp;gt; 2 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ORI_LAST&amp;#93;&lt;/span&gt; =&amp;gt; 3 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ORI_ABS&amp;#93;&lt;/span&gt; =&amp;gt; 4 &lt;span class=&quot;error&quot;&gt;&amp;#91;FETCH_ORI_REL&amp;#93;&lt;/span&gt; =&amp;gt; 5 &lt;span class=&quot;error&quot;&gt;&amp;#91;CURSOR_FWDONLY&amp;#93;&lt;/span&gt; =&amp;gt; 0 &lt;span class=&quot;error&quot;&gt;&amp;#91;CURSOR_SCROLL&amp;#93;&lt;/span&gt; =&amp;gt; 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_USE_BUFFERED_QUERY&amp;#93;&lt;/span&gt; =&amp;gt; 1000 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_LOCAL_INFILE&amp;#93;&lt;/span&gt; =&amp;gt; 1001 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_INIT_COMMAND&amp;#93;&lt;/span&gt; =&amp;gt; 1002 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_READ_DEFAULT_FILE&amp;#93;&lt;/span&gt; =&amp;gt; 1003 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_READ_DEFAULT_GROUP&amp;#93;&lt;/span&gt; =&amp;gt; 1004 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_MAX_BUFFER_SIZE&amp;#93;&lt;/span&gt; =&amp;gt; 1005 &lt;span class=&quot;error&quot;&gt;&amp;#91;MYSQL_ATTR_DIRECT_QUERY&amp;#93;&lt;/span&gt; =&amp;gt; 1006&lt;/p&gt;

&lt;p&gt;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10108">DC-59</key>
            <summary>Setting MYSQL_ATTR_USE_BUFFERED_QUERY forces a 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="guilhermeblanco">Guilherme Blanco</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 19:22:28 +0000</created>
                <updated>Thu, 24 Sep 2009 19:25:51 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 19:25:51 +0000</resolved>
                                            <fixVersion>1.0.12</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10114" author="guilhermeblanco" created="Thu, 24 Sep 2009 19:25:51 +0000"  >&lt;p&gt;In r6406 this issue as fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-56] Geographical behavior does not calculate distance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-56</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>

&lt;p&gt;If the fields name of the latitude or longitude invoker aren&apos;t &apos;latitude&apos; or &apos;longitude&apos;, then the getDistanceQuery doesn&apos;t not work.&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;milesSql = sprintf($sql, $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;longitude&apos;), &apos;1.1515&apos;, &apos;miles&apos;);
...
$kilometersSql = sprintf($sql, $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;latitude&apos;), $invoker-&amp;gt;get(&apos;longitude&apos;), &apos;1.1515 * 1.609344&apos;, &apos;kilometers&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Replacing latitude by $latName (previously defined line 74 and 75) resolved this problem.&lt;/p&gt;

&lt;p&gt;Here&apos;s the 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;
milesSql = sprintf($sql, $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($longName), &apos;1.1515&apos;, &apos;miles&apos;);
...
$kilometersSql = sprintf($sql, $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($latName), $invoker-&amp;gt;get($longName), &apos;1.1515 * 1.609344&apos;, &apos;kilometers&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10105">DC-56</key>
            <summary>Geographical behavior does not calculate distance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 17:16:41 +0000</created>
                <updated>Mon, 1 Mar 2010 16:12:04 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 17:39:22 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11898" author="jwage" created="Mon, 1 Mar 2010 16:12:04 +0000"  >&lt;p&gt;This is fixed already in the latest 1.2 version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-52] generated models don&apos;t call parent setUp() method</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-52</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>

&lt;p&gt;When Doctrine Importer is used to generate models from a database, the setUp() methods of the generated models do not always call their parent setUp(). This may not be important when generated models extend Doctrine_Record directly, but it is is important when a baseClassName is specified to generateModelsFromDb() and the custom base class provides a setUp() method.&lt;/p&gt;

&lt;p&gt;The attached patch causes parent::setUp() to be called whenever a setUp() method is created in a generated model.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10101">DC-52</key>
            <summary>generated models don&apos;t call parent setUp() method</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 16:48:45 +0000</created>
                <updated>Thu, 24 Sep 2009 16:48:53 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 16:48:53 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-57] isValueModified returns true for timestamps that appear different but are equal</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-57</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record::isValueModified compares timestamps as strings and values that are equal such as 2009-09-02 00:00:00 and 2009-09-02 are treated as modified.&lt;/p&gt;

&lt;p&gt;The code should do a second compare on the strtotime value if the strings appear to be unequal.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10106">DC-57</key>
            <summary>isValueModified returns true for timestamps that appear different but are equal</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 17:45:36 +0000</created>
                <updated>Mon, 15 Feb 2010 11:20:45 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 17:55:00 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                <fixVersion>1.2.0-ALPHA2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11727" author="oweitman" created="Mon, 15 Feb 2010 11:20:45 +0000"  >&lt;p&gt;Problem is with date-values before Fri, 13 Dec 1901 20:45:54 GMT&lt;br/&gt;
and after Tue, 19 Jan 2038 03:14:07 GMT. &lt;br/&gt;
For these values  strtotime reports false and the field is not updated.&lt;/p&gt;

&lt;p&gt;This is my first use of this issue-system, i dont find a button to reopen this issue. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-53] Type &quot;double&quot; issue with ValidateLenght</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-53</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;LenghtValidator? doesn&apos;t check by the same way the &quot;double&quot; type.&lt;/p&gt;

&lt;p&gt;Validator.php (line: 95)&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;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($type == &apos;decimal&apos; $type == &apos;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&apos;) { By:
&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;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($type == &apos;decimal&apos; || $type == &apos;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&apos; || $type == &apos;&lt;span class=&quot;code-object&quot;&gt;double&lt;/span&gt;&apos;) { 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10102">DC-53</key>
            <summary>Type &quot;double&quot; issue with ValidateLenght</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 16:50:18 +0000</created>
                <updated>Thu, 24 Sep 2009 16:50:27 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 16:50:27 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-48] Duplication of join conditions in query when using Doctrine_Pager (or count() and limit() query methods)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-48</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using count() method of some query and then executing this query with limit(), in generated sql appeared duplucated join conditions, what causes&lt;br/&gt;
&lt;tt&gt;Doctrine_Connection_Mysql_Exception: SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens in /home/test/doctrine/database/doctrine/lib/Doctrine/Connection.php on line 1084&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Query should have at least one join with &quot;WITH&quot; clause.&lt;br/&gt;
Same problem when using PostgreSQL.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://trac.doctrine-project.org/ticket/2372&quot; class=&quot;external-link&quot;&gt;Ticket in TRAC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Attached php script that reproduces error and dump of test db&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-28&quot; class=&quot;external-link&quot;&gt;Similar problem?&lt;/a&gt;&lt;/p&gt;</description>
                <environment>latest doctrine 1.1 revision, linux x64, mysql 5.1.37/PostgeSQL 8.4, php 5.2.10</environment>
            <key id="10096">DC-48</key>
            <summary>Duplication of join conditions in query when using Doctrine_Pager (or count() and limit() query methods)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="corristo">Nicholas Kasyanov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Sep 2009 07:51:14 +0000</created>
                <updated>Thu, 24 Sep 2009 19:15:58 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 19:15:58 +0000</resolved>
                            <version>1.1.4</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10100" author="corristo" created="Tue, 22 Sep 2009 08:13:40 +0000"  >&lt;p&gt;doctrine testcase attached&lt;/p&gt;</comment>
                    <comment id="10113" author="guilhermeblanco" created="Thu, 24 Sep 2009 19:15:58 +0000"  >&lt;p&gt;This issue was fixed. It&apos;s the same patch as the one in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-28&quot; title=&quot;Duplicate join condition when using nestedSet &quot;&gt;&lt;del&gt;DC-28&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10035" name="DC48TestCase.php" size="2954" author="corristo" created="Tue, 22 Sep 2009 08:13:40 +0000" />
                    <attachment id="10034" name="dump.sql" size="639" author="corristo" created="Tue, 22 Sep 2009 07:51:14 +0000" />
                    <attachment id="10033" name="test.php" size="1412" author="corristo" created="Tue, 22 Sep 2009 07:51:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-54] Unique Validator fails with PK column aliased</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-54</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>

&lt;p&gt;Similar to  &lt;a href=&quot;http://trac.doctrine-project.org/ticket/2046&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2046&lt;/a&gt;, Doctrine_Validator_Unique can fail when the PK for the table is aliased.&lt;/p&gt;

&lt;p&gt;The error occurs in the following scenario:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;A record has a column with the unique validator (unique:true) and a PK column aliased to a different name&lt;/li&gt;
	&lt;li&gt;All validation is turned on&lt;/li&gt;
	&lt;li&gt;An instance of that record is loaded from the database.&lt;/li&gt;
	&lt;li&gt;The unique field value is modified and isValid is called on the record&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The validator will attempt to get the PK value from the record by using the column name rather than the field name, resulting in an &apos;Unknown record property&apos; exception.&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a patch that offers a resolution for this issue by using the table&apos;s getFieldName method with the column name.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10103">DC-54</key>
            <summary>Unique Validator fails with PK column aliased</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2009 16:51:16 +0000</created>
                <updated>Thu, 24 Sep 2009 16:51:27 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 16:51:27 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.1.4</version>
                                <fixVersion>1.0.12</fixVersion>
                <fixVersion>1.1.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-46] Unexpected behavior with whereIn() and empty array</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-46</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;See trac #2064 ( &lt;a href=&quot;http://trac.doctrine-project.org/ticket/2064&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2064&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;Jwage wrote &quot;This is expected behavior. We cannot and will not add a fake invalid condition to the where string. I think we need to make it throw an exception if you try and pass an empty array.&quot;&lt;/p&gt;

&lt;p&gt;I agree that an exception should be thrown.&lt;/p&gt;

&lt;p&gt;But AFAIK this hasn&apos;t been implemented yet.&lt;/p&gt;

&lt;p&gt;The issue is quite urgent in my opinion. Example:&lt;/p&gt;

&lt;p&gt;I had a query where I absolutely had to restrict the result set to allowed objects (IDs) only. I used a whereIn() condition for this restriction.&lt;/p&gt;

&lt;p&gt;Problem is: when the user wasn&apos;t assigned to any groups, the id-array was empty, and Doctrine removed the WHERE ... IN completely! That resulted in a result set containing all records!&lt;/p&gt;

&lt;p&gt;I would expect&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;either to return no records (correct behavior could be to add &quot;0=1&quot; as a replacement for &quot;... IN ()&quot; expression)&lt;/li&gt;
	&lt;li&gt;or let the database decide (= submitting the query with an empty list which would result - at least for MySQL - in a database exception)&lt;/li&gt;
	&lt;li&gt;or Doctrine could throw an exception&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Would IMO be way better (as its IMO a more expected behavior) than simply not adding the &quot;... IN ()&quot; to the query.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="10093">DC-46</key>
            <summary>Unexpected behavior with whereIn() and empty array</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="sebu">Sebastian Busch</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Sep 2009 19:39:56 +0000</created>
                <updated>Tue, 5 Oct 2010 05:02:27 +0000</updated>
                    <resolved>Thu, 24 Sep 2009 18:49:50 +0000</resolved>
                            <version>1.0.12</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="10111" author="guilhermeblanco" created="Thu, 24 Sep 2009 18:49:50 +0000"  >&lt;p&gt;In r6404 this issue was fixed&lt;/p&gt;</comment>
                    <comment id="10963" author="tim703" created="Wed, 2 Dec 2009 00:51:31 +0000"  >&lt;p&gt;Throwing an exception is an improvement, but I think it is not the right solution:  &lt;/p&gt;

&lt;p&gt;As before the fix, you have to write an extra test for emptyness of the whereIn array, only to save execution of one query and proceed as if the query would give an empty result.&lt;/p&gt;

&lt;p&gt;There is nothing &quot;fake&quot; in a false statement and &quot;x is in the empty array&quot; is false no matter what x is. &lt;/p&gt;

&lt;p&gt;Tim Richter&lt;/p&gt;</comment>
                    <comment id="14527" author="gregoire_m" created="Tue, 5 Oct 2010 03:38:51 +0000"  >&lt;p&gt;Actually, the exception is never thrown, since there&apos;s a test in the andWhereIn() method, before the _processWhereIn() method is called...&lt;/p&gt;</comment>
                    <comment id="14528" author="jeanmonod" created="Tue, 5 Oct 2010 05:02:27 +0000"  >&lt;p&gt;Gregoire_m: This ticket have been reopen here: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-727&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-727&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-569] Duplicate unique indexes on PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-569</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Generated by doctrine-cli SQL is:&lt;/p&gt;

&lt;p&gt;&amp;#8211; this is ok&lt;br/&gt;
CREATE TABLE &quot;image&quot; (&quot;id&quot; BIGSERIAL, &quot;alt&quot; VARCHAR(255), &quot;title&quot; VARCHAR(500), &quot;filename&quot; VARCHAR(255), &quot;width&quot; BIGINT, &quot;height&quot; BIGINT, &quot;slug&quot; VARCHAR(255), &quot;createdat&quot; TIMESTAMP NOT NULL, &quot;updatedat&quot; TIMESTAMP NOT NULL, PRIMARY KEY(&quot;id&quot;));&lt;br/&gt;
CREATE TABLE &quot;news&quot; (&quot;id&quot; BIGSERIAL, &quot;title&quot; VARCHAR(255), &quot;leadmarkup&quot; VARCHAR(500), &quot;leadhtml&quot; VARCHAR(600), &quot;bodymarkup&quot; TEXT, &quot;bodyhtml&quot; TEXT, &quot;slug&quot; VARCHAR(255), &quot;createdat&quot; TIMESTAMP NOT NULL, &quot;updatedat&quot; TIMESTAMP NOT NULL, PRIMARY KEY(&quot;id&quot;));&lt;br/&gt;
CREATE TABLE &quot;snippet&quot; (&quot;id&quot; BIGSERIAL, &quot;name&quot; VARCHAR(255), &quot;bodymarkup&quot; TEXT, &quot;bodyhtml&quot; TEXT, &quot;slug&quot; VARCHAR(255), &quot;createdat&quot; TIMESTAMP NOT NULL, &quot;updatedat&quot; TIMESTAMP NOT NULL, PRIMARY KEY(&quot;id&quot;));&lt;br/&gt;
&amp;#8211; this causes error&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable&quot; ON &quot;image&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable&quot; ON &quot;news&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable&quot; ON &quot;snippet&quot; (&quot;slug&quot;);&lt;/p&gt;

&lt;p&gt;After importing this to PostgreSQL, I get &apos;index already exists&apos; error.&lt;/p&gt;

&lt;p&gt;On PostgreSQL unique indexes names must not be the same.&lt;br/&gt;
I think the correct form should be:&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable-image&quot; ON &quot;image&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable-news&quot; ON &quot;news&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable-snippet&quot; ON &quot;snippet&quot; (&quot;slug&quot;);&lt;/p&gt;

&lt;p&gt;Schema file attached.&lt;/p&gt;</description>
                <environment>Window, Ubuntu, PostgreSQL 8.3, PHP 5.3</environment>
            <key id="11049">DC-569</key>
            <summary>Duplicate unique indexes 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Mar 2010 10:37:19 +0000</created>
                <updated>Mon, 15 Mar 2010 15:32:01 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:32:01 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Cli</component>
                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12223" author="jwage" created="Mon, 15 Mar 2010 15:32:01 +0000"  >&lt;p&gt;This was fixed here &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7372&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/7372&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10454" name="schema.yml" size="837" author="admirau" created="Sat, 13 Mar 2010 10:37:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-568] Make it possible to use microtime as the version value when using Versionable</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-568</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This patch basically makes it possible to pass in a custom auditlog listener as well as providing a new listener that uses microtime to generate the version value&apos;s instead of incrementing an integer value starting at 1. This should provide a much better handling for concurrent inserts and should also be faster, since for all but the first version a complex select is necessary in the current implementation.&lt;/p&gt;

&lt;p&gt;Open question is if the accuracy multiplier should be an option or not. Also is there any reason why the column definition doesnt default to an unsigned, not that it matters all that much?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11047">DC-568</key>
            <summary>Make it possible to use microtime as the version value when using Versionable</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Mar 2010 06:55:28 +0000</created>
                <updated>Mon, 15 Mar 2010 10:47:56 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:47:56 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12184" author="jwage" created="Mon, 15 Mar 2010 10:47:56 +0000"  >&lt;p&gt;Thanks to Lukas this is fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10451" name="Listener.php.patch" size="946" author="lsmith" created="Sat, 13 Mar 2010 06:55:28 +0000" />
                    <attachment id="10453" name="Microtime.php" size="2075" author="lsmith" created="Sat, 13 Mar 2010 06:55:28 +0000" />
                    <attachment id="10452" name="Versionable.php.patch" size="1081" author="lsmith" created="Sat, 13 Mar 2010 06:55:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-567] RawSql: getCountSqlQuery does not work correctly with PostgreSQL (patch provided)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-567</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Dears,&lt;/p&gt;

&lt;p&gt;Line 309 in Doctrine_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 = &apos;SELECT COUNT( DISTINCT &apos;.implode(&apos;,&apos;,$fields).&apos;) as num_results&apos;;

        $string = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getInheritanceCondition($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRootAlias());
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($string)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;][] = $string;
        }

        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]))?    &apos; FROM &apos;     . implode(&apos; &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]))?   &apos; WHERE &apos;    . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]))? &apos; GROUP BY &apos; . implode(&apos;, &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]))?  &apos; HAVING &apos;   . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]) : &apos;&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;produces with PostgreSQL: Undefined function: 7 ERROR: function count(bigint, integer) does not exist&lt;/p&gt;

&lt;p&gt;but&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 = &apos;SELECT COUNT(*) as num_results FROM (SELECT DISTINCT &apos;.implode(&apos;, &apos;,$fields);

        $string = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getInheritanceCondition($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRootAlias());
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($string)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;][] = $string;
        }

        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]))?    &apos; FROM &apos;     . implode(&apos; &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]))?   &apos; WHERE &apos;    . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]))? &apos; GROUP BY &apos; . implode(&apos;, &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]))?  &apos; HAVING &apos;   . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]) : &apos;&apos;;

        $q .= &apos;) as results&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;works and should work with every database server.&lt;/p&gt;

&lt;p&gt;Continue your great work &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;Regards,&lt;/p&gt;

&lt;p&gt;Rapha&#235;l Dehousse&lt;/p&gt;</description>
                <environment></environment>
            <key id="11046">DC-567</key>
            <summary>RawSql: getCountSqlQuery does not work correctly with PostgreSQL (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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rdehouss">Rapha&#235;l Dehousse</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Mar 2010 15:58:29 +0000</created>
                <updated>Mon, 15 Mar 2010 10:33:14 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:33:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12182" author="jwage" created="Mon, 15 Mar 2010 10:25:24 +0000"  >&lt;p&gt;Hi, it would be really helpful if all suggested changes are supplied as a patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-566] Misleading documentation on autoloading models</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-566</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I think the following lines in &quot;Introduction to Models&quot; on conservative loading (&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/introduction-to-models#autoloading-models&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/introduction-to-models#autoloading-models&lt;/a&gt;) are misleading.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;When we use the Doctrine_Core::loadModels() functionality all found classes will be cached internally so the autoloader can require them later.&lt;/p&gt;

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

&lt;p&gt;Instantiating the class above triggers a call to Doctrine_Core::autoload() and the class that was found in the call to Doctrine_Core::loadModels() will be required and made available.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It&apos;s not enough to register &lt;tt&gt;Doctrine_Core::autoload()&lt;/tt&gt; as autoload callback, because it does not care about the model classes. I think you should mention that &lt;tt&gt;Doctrine::modelsAutload&lt;/tt&gt; is the right callback method for dealing with model class autoloading.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11043">DC-566</key>
            <summary>Misleading documentation on autoloading models</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="b00gizm">Pascal Cremer</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Mar 2010 11:39:51 +0000</created>
                <updated>Mon, 15 Mar 2010 15:56:13 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:56:13 +0000</resolved>
                            <version>1.2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12225" author="jwage" created="Mon, 15 Mar 2010 15:56:13 +0000"  >&lt;p&gt;I changed the docs to reference modelsAutoload() instead of autoload()&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-564] Postgresql: listSequences: relname badly &quot;formatted&quot; (patch provided)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-564</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Dears,&lt;/p&gt;

&lt;p&gt;Let&apos;s say you create your database first. If you have a serial/bigserial, a sequence is automaticaly created. It&apos;s called for example: &apos;id_seq&apos;&lt;br/&gt;
During the cretion of the model, the sequence name is, so, called id_seq.&lt;/p&gt;

&lt;p&gt;But in Doctrine_Formatter, line 233, you have getSequenceName that format Doctrine_Core::ATTR_SEQNAME_FORMAT that comes from Doctrine_Manager line 143, you have Doctrine_Core::ATTR_SEQNAME_FORMAT =&amp;gt; &quot;%s_seq&quot;, so, the sequence name will wrongly be id_seq_seq.&lt;/p&gt;

&lt;p&gt;This could be avoid if the sequence_name would not contain the &quot;_seq&quot; suffix coming from the import. WDYT?&lt;/p&gt;

&lt;p&gt;This could be possible thanks to a change in Doctrine_Import_Pgsql, line 50:&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;&apos;listSequences&apos; =&amp;gt; &quot;SELECT
        rtrim(relname, &apos;_seq&apos;)
    FROM
        pg_class
    WHERE relkind = &apos;S&apos; AND relnamespace IN
        (SELECT oid FROM pg_namespace
        WHERE nspname NOT LIKE &apos;pg_%&apos; AND nspname != &apos;information_schema&apos;)&quot;,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So, rtrim(relname, &apos;_seq&apos;) in place of relname only.&lt;br/&gt;
I&apos;m not sure rtrim is the best solution but you got what I meant.&lt;/p&gt;

&lt;p&gt;Voil&#224; my 2 cents.&lt;/p&gt;

&lt;p&gt;Hope it will help&lt;/p&gt;

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

&lt;p&gt;Rapha&#235;l Dehousse&lt;/p&gt;</description>
                <environment></environment>
            <key id="11035">DC-564</key>
            <summary>Postgresql: listSequences: relname badly &quot;formatted&quot; (patch provided)</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rdehouss">Rapha&#235;l Dehousse</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Mar 2010 16:41:51 +0000</created>
                <updated>Mon, 15 Mar 2010 15:13:01 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:13:01 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12217" author="rdehouss" created="Mon, 15 Mar 2010 14:44:21 +0000"  >&lt;p&gt;Here is a patch to apply in the doctrine lib directory&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10475" name="DC-564_Doctrine_Import_Pgsql.php.patch" size="894" author="rdehouss" created="Mon, 15 Mar 2010 14:44:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-563] Import/Pgsql: listTableRelations: bad use of strpos search composite foreign keys (patch provided)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-563</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Dears,&lt;/p&gt;

&lt;p&gt;First, I would like to thank you for your great work.&lt;/p&gt;

&lt;p&gt;Second, the bug:&lt;/p&gt;

&lt;p&gt;Line ~279 in the function listTableRelations, there is a mistake in the use of strpos : strpos(&apos;,&apos;, $values&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;) and strpos(&apos;,&apos;, $values&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;), it should be strpos($values&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, &apos;,&apos;) and strpos($values&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;, &apos;,&apos;) &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;With this code, strpos always returns false and so, the composite foreign keys are not skipped as desired.&lt;/p&gt;

&lt;p&gt;Continue your great job&lt;/p&gt;

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

&lt;p&gt;Rapha&#235;l Dehousse&lt;/p&gt;</description>
                <environment></environment>
            <key id="11029">DC-563</key>
            <summary>Import/Pgsql: listTableRelations: bad use of strpos search composite foreign keys (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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rdehouss">Rapha&#235;l Dehousse</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Mar 2010 09:05:11 +0000</created>
                <updated>Mon, 15 Mar 2010 14:36:59 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:36:59 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12189" author="rdehouss" created="Mon, 15 Mar 2010 11:22:09 +0000"  >&lt;p&gt;The fix you did does not fix the problem&lt;/p&gt;

&lt;p&gt;The problem is the order of the parameter in strpos&lt;/p&gt;

&lt;p&gt;I will create a patch this avond and attach it here&lt;/p&gt;</comment>
                    <comment id="12191" author="jwage" created="Mon, 15 Mar 2010 11:24:11 +0000"  >&lt;p&gt;I see, that is why patches are always preferred. it is impossible to copy and paste changes out of a comment &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; Patches should always be attached!&lt;/p&gt;</comment>
                    <comment id="12213" author="rdehouss" created="Mon, 15 Mar 2010 14:31:42 +0000"  >&lt;p&gt;Here is a patch.&lt;/p&gt;

&lt;p&gt;You can apply it on the last revision of the branch 1.2&lt;/p&gt;

&lt;p&gt;The patch is to apply on the file Doctrine/Import/Pgsql.php&lt;/p&gt;</comment>
                    <comment id="12214" author="rdehouss" created="Mon, 15 Mar 2010 14:32:06 +0000"  >&lt;p&gt;Here is the patch as promised &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="12216" author="jwage" created="Mon, 15 Mar 2010 14:36:59 +0000"  >&lt;p&gt;Thanks for the patch &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="10474" name="DC-563_Doctrine_Import_Pgsql.php.patch" size="827" author="rdehouss" created="Mon, 15 Mar 2010 14:31:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-556] Index name error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-556</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;At this moment, if you have more than one table that is sluggable, it get an error cause tries to set the very same name to ALL sluggable indexes. Here is a fix:&lt;/p&gt;

&lt;p&gt;#55: &apos;indexName&apos;     =&amp;gt;  null &lt;/p&gt;

&lt;p&gt;#74: if($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;indexName&amp;#39;&amp;#93;&lt;/span&gt; === null) &lt;br/&gt;
#75:   $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;indexName&amp;#39;&amp;#93;&lt;/span&gt; = $this-&amp;gt;getTable()- &amp;gt;getTableName().&apos;_sluggable&apos;; &lt;/p&gt;</description>
                <environment></environment>
            <key id="11011">DC-556</key>
            <summary>Index name 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sid.gbf">Sid GBF</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2010 14:40:40 +0000</created>
                <updated>Mon, 15 Mar 2010 15:29:45 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:29:45 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Sluggable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12180" author="sid.gbf" created="Mon, 15 Mar 2010 10:11:08 +0000"  >&lt;p&gt;Fixing some typos&lt;/p&gt;</comment>
                    <comment id="12222" author="jwage" created="Mon, 15 Mar 2010 15:29:45 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10468" name="sluggable.diff" size="978" author="sid.gbf" created="Mon, 15 Mar 2010 10:11:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-555] infinite recursion happens when saving models with circular reference</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-555</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After upgrading symfony from 1.2 to 1.4, my website began to have problems saving some models.  After some research, I found that it was caused by infinite recursion. Let&apos;s say Model A has many B (B belongs to A). Each A also points to one of the B objects it owns. So it&apos;s a circular reference. Some ppl might argue that it&apos;s not a good pratice to have circular reference in the data model, I agree. But it worked fine in Doctrine 1.0, so I prefer not to change it.  In Doctrine 1.2.1, it seems that when A and its related B are both modified (dirty), if I try to save A, Doctrine will try to save B due to cascade update, and when saving B, it will again try to save its related A ...&lt;/p&gt;

&lt;p&gt;I compared the source code of Doctrine_Connection_UnitOfWork between 1.0 and 1.2.1, and found out that in Doctrine 1.2.1, the model is no longer locked when saveRelatedLocalKeys is invoked. I don&apos;t understand this change. After I changed the line &quot;$this-&amp;gt;saveRelatedLocalKeys($record);&quot; to&lt;/p&gt;

&lt;p&gt;$record-&amp;gt;state($record-&amp;gt;exists() ? Doctrine_Record::STATE_LOCKED : Doctrine_Record::STATE_TLOCKED);&lt;br/&gt;
$this-&amp;gt;saveRelatedLocalKeys($record);&lt;br/&gt;
$record-&amp;gt;state($state);&lt;/p&gt;

&lt;p&gt;my website returned to normal again. And so far i haven&apos;t found any problem caused by my change&lt;/p&gt;

&lt;p&gt;So I hope someone can look into this and let me know if my change is safe. Or if I&apos;m wrong, is there any way I can get around the infinite recursion problem without changing my database schema? Thanks.&lt;/p&gt;</description>
                <environment>linux, symfony 1.4</environment>
            <key id="11010">DC-555</key>
            <summary>infinite recursion happens when saving models with circular reference</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jing">Jing Z</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2010 10:40:31 +0000</created>
                <updated>Mon, 15 Mar 2010 16:09:54 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 16:09:54 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12228" author="jwage" created="Mon, 15 Mar 2010 16:09:54 +0000"  >&lt;p&gt;Thanks for the issue and patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10435" name="UnitOfWork.php" size="34843" author="jing" created="Tue, 9 Mar 2010 10:40:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-550] Cannot update record from one large integer to another large integer (severe problem for 32bit systems, due to the low upper limit of the int data type)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-550</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;From what I understand, doctrine mostly stores integers as strings. To check whether an integer has been modified, the following code in Doctrine_Record is used:&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;    protected function _isValueModified($type, $old, $new)
    {
        if ($new instanceof Doctrine_Expression) {
            return true;
        }

        if ($type == &apos;boolean&apos; &amp;amp;&amp;amp; (is_bool($old) || is_numeric($old)) &amp;amp;&amp;amp; (is_bool($new) || is_numeric($new)) &amp;amp;&amp;amp; $old == $new) {
            return false;
        } else if (in_array($type, array(&apos;decimal&apos;, &apos;float&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($new)) {
            return $old * 100 != $new * 100;
        } else if (in_array($type, array(&apos;integer&apos;, &apos;int&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($new)) {
            return (int) $old !== (int) $new;  # &amp;lt;--- ********** THIS LINE CASTS STRING TO INT **********
        } else if ($type == &apos;timestamp&apos; || $type == &apos;date&apos;) {
            return strtotime($old) !== strtotime($new);
        } else {
            return $old !== $new;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On the line indicated above an integer, stored as a string, is cast to a PHP integer data type, and compared with the existing value of the field currently stored in the database.  For values that fall within the int type range, this works fine.  However, when changing a value falling above the range, which on 32bit systems is 2147483647, to another value falling above the range, these casts cause the code to evaluate both as 2147483647 and hence the field is not added to the _IsModified() array, and the value is not updated.&lt;/p&gt;

&lt;p&gt;Bearing in mind that validation to confirm whether these strings are in numeric format should already have occurred by this point in the process, is there any need to cast the strings at all?  Thus, is the following a possible solution?&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;            return $old !== $new;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This seems to work fine for me in my limited trials although, admittedly, there may be some consequences about which I am not aware.&lt;/p&gt;

&lt;p&gt;Note that this issue is not so evident on 64bit systems, where the upper limit is much higher.&lt;/p&gt;</description>
                <environment>Symfony 1.4 from &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; Windows XP Pro SP2, 32bit Processor, PHP 5.2.8, MySQL </environment>
            <key id="11003">DC-550</key>
            <summary>Cannot update record from one large integer to another large integer (severe problem for 32bit systems, due to the low upper limit of the int data type)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hal">hal</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Mar 2010 07:18:03 +0000</created>
                <updated>Mon, 15 Mar 2010 14:14:20 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:14:20 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12061" author="hal" created="Tue, 9 Mar 2010 14:40:56 +0000"  >&lt;p&gt;Patch for described problem (untested)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10437" name="Record.php.patch" size="667" author="hal" created="Tue, 9 Mar 2010 14:40:56 +0000" />
                    <attachment id="10436" name="Record.php.patch" size="667" author="hal" created="Tue, 9 Mar 2010 14:39:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-545] MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-545</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve two issues with saving records with SQL Server.&lt;/p&gt;

&lt;p&gt;Firstly, SQL Server does not allow NULL or DEFAULT values to be used against identity columns. When inserting a record without any modified fields, Doctrine_Record_UnitOfWork::processSingleInsert sets all fields to NULL - including the identity columns. This causes this error:&lt;/p&gt;

&lt;p&gt;&quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 339 &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;DEFAULT or NULL are not allowed as explicit identity values&quot;&lt;/p&gt;

&lt;p&gt;Ideally identity columns could be excluded but that would break tables that consist of those columns. Instead I&apos;ve patched Doctrine_Connnection_MSSQL to, in this &apos;blank insert&apos; circumstance only, insert default values and then update the inserted row with null values as necessary (the latter may be unnecessary but I wanted to preserve the original behaviour).&lt;/p&gt;

&lt;p&gt;Secondly, there exists a bug in (as I understand it) Microsoft&apos;s ODBC driver &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, that causes all bound parameters within a sub-select to be cast as strings before being interpreted by SQL Server. This results in the following error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22018&amp;#93;&lt;/span&gt;: Invalid character value for cast specification: 206&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;http://bugs.php.net/36561&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/36561&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using SQL Server through ODBC all Doctrine queries that use sub-selects are failing, for example the query generated by a Doctrine_Table-&amp;gt;find()&lt;/p&gt;

&lt;p&gt;SELECT * FROM (SELECT TOP 1 * FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__name&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;model&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;To combat this I&apos;ve extended the Doctrine_Connection_Common execute() method in Doctrine_Connection_Mssql to replace bound parameters so they&apos;re inline instead. This has its drawbacks, like reduced protection against SQL injection, but since the alternative is the majority of my queries failing I don&apos;t see a better option.&lt;/p&gt;

&lt;p&gt;I realise this second issue isn&apos;t a Doctrine concern per se, but I thought I&apos;d bring it up since I imagine anyone using SQL server will be experiencing it.&lt;/p&gt;

&lt;p&gt;A patch against 1.2.1 is attached. This patch also incorporates the latest patch in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-289&lt;/a&gt;, which has now been committed to trunk; my additions are at the bottom of the file.&lt;/p&gt;</description>
                <environment>PHP 5.3.1&lt;br/&gt;
Windows XP&lt;br/&gt;
Microsoft SQL Server 2008</environment>
            <key id="10994">DC-545</key>
            <summary>MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Mar 2010 09:08:19 +0000</created>
                <updated>Mon, 15 Mar 2010 10:46:14 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:46:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12042" author="craigmarvelley" created="Fri, 5 Mar 2010 11:58:55 +0000"  >&lt;p&gt;Updated original ticket as another issue I found is closely linked and involved refactoring of my original patch.&lt;/p&gt;</comment>
                    <comment id="12043" author="craigmarvelley" created="Fri, 5 Mar 2010 11:59:36 +0000"  >&lt;p&gt;Updated patch&lt;/p&gt;</comment>
                    <comment id="12081" author="jwage" created="Thu, 11 Mar 2010 10:50:47 +0000"  >&lt;p&gt;Hi, I tried applying your patch to Doctrine 1.2 latest SVN to give it a test and it did not apply cleanly. Please re-open if you can provide an updated patch.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12086" author="craigmarvelley" created="Thu, 11 Mar 2010 12:08:06 +0000"  >&lt;p&gt;Updated patch that should apply cleanly.&lt;/p&gt;</comment>
                    <comment id="12087" author="craigmarvelley" created="Thu, 11 Mar 2010 12:09:03 +0000"  >&lt;p&gt;Hi, thanks for looking at this. I&apos;ve updated the patch against 1.2 HEAD, hopefully that&apos;ll apply for you.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10443" name="Doctrine_Connection_MSSQL.patch" size="3420" author="craigmarvelley" created="Thu, 11 Mar 2010 12:08:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-535] Fixtures loaded in the wrong order</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-535</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I can&apos;t no more load my fixtures,&lt;br/&gt;
it&apos;s seem that Doctrine connection-&amp;gt;unitOfWork-&amp;gt;buildFlushTree() screw up the Model relation ordering, because some of my fixtures are loaded to soon (and I have a constrain fail).&lt;br/&gt;
There is nothing strange about my fixtures / models, I even don&apos;t change anything for days (and that worked perfectly fine yesterday).  &lt;/p&gt;

&lt;p&gt;I&apos;ve tried to use &lt;/p&gt;

&lt;p&gt;doctrine &lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/tags/1.2.1/lib/&quot; class=&quot;external-link&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/tags/1.2.1/lib/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;instead of &lt;/p&gt;

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

&lt;p&gt;in my lib/vendor/symfony/plugins/sfDoctrinePlugin/lib/vendor svn:externals, and the problem disapear.&lt;/p&gt;

&lt;p&gt;Perhaps a bug as been introduced in the 1.2 branche ?&lt;/p&gt;</description>
                <environment>Bunch of unix systems (MacOS, Ubuntu), symfony version 1.4.4-DEV</environment>
            <key id="10980">DC-535</key>
            <summary>Fixtures loaded in the wrong order</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dalexandre">Damien ALEXANDRE</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Mar 2010 10:22:03 +0000</created>
                <updated>Tue, 2 Mar 2010 13:01:19 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:01:19 +0000</resolved>
                            <version>1.2.1</version>
                                                <component>Connection</component>
                <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11949" author="jwage" created="Tue, 2 Mar 2010 10:34:40 +0000"  >&lt;p&gt;Can you identify which changeset caused the problem?&lt;/p&gt;</comment>
                    <comment id="11954" author="xavier" created="Tue, 2 Mar 2010 10:59:17 +0000"  >&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;It is obvously the changeset &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7284&quot; class=&quot;external-link&quot;&gt;7284&lt;/a&gt; which broke the fixtures loading. It just works fine with the revision 7283 and doesn&apos;t after.&lt;/p&gt;

&lt;p&gt;cheers + thanks !&lt;/p&gt;</comment>
                    <comment id="11955" author="jwage" created="Tue, 2 Mar 2010 11:08:42 +0000"  >&lt;p&gt;I reverted the change. Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10002">
                <name>Dependency</name>
                                                <inwardlinks description="is required for">
                            <issuelink>
            <issuekey id="10645">DC-376</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-528] CLONE -isValueModified returns true for timestamps that appear different but are equal</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-528</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is a copy of DC57: &lt;/p&gt;

&lt;p&gt;&quot;Doctrine_Record::isValueModified compares timestamps as strings and values that are equal such as 2009-09-02 00:00:00 and 2009-09-02 are treated as modified.&lt;/p&gt;

&lt;p&gt;The code should do a second compare on the strtotime value if the strings appear to be unequal.&quot; &lt;/p&gt;

&lt;p&gt;The changes made with this ticket causes problems with old timestamps because of strtotimes behaviour with dates before beginning of unix-period. I attached a diff for the original testcase to demonstrate the problem. &lt;/p&gt;</description>
                <environment></environment>
            <key id="10968">DC-528</key>
            <summary>CLONE -isValueModified returns true for timestamps that appear different but are equal</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="floriank">Florian Klucke</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Feb 2010 09:24:38 +0000</created>
                <updated>Tue, 2 Mar 2010 13:26:59 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:26:59 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.1</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10397" name="DC57TestCase.diff" size="670" author="floriank" created="Fri, 26 Feb 2010 09:28:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-522] Can not use charset and collate in a table basis when using global charset and collate in Doctrine_Manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-522</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Can not use charset and collate in a table basis when using global charset and collate in Doctrine_Manager.&lt;/p&gt;


&lt;p&gt;When using + symfony:&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;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)
  {
    $manager-&amp;gt;setCharset(&apos;utf8&apos;);
    $manager-&amp;gt;setCollate(&apos;utf8_bin&apos;);
  }

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


&lt;p&gt;And some schema like,&lt;/p&gt;


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

PageIndex:
  tableName:                           t_page_index
  columns:
    id:                                { type: integer  , length: 20 , 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;                                                  }
    title:                             { type: string   , length: 200                   , notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;                                                        }
  options:
    collate:                           utf8_general_ci
    

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


&lt;p&gt;When generating the database, the table will have as collate utf8_bin, not being possible overwriting it at a table level.&lt;/p&gt;


&lt;p&gt;This is because:&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;Table.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 __construct($name, Doctrine_Connection $conn, $initDefinition = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn = $conn;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;] = $name;
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setParent($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn);           
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;addTable($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parser = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Relation_Parser($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($initDefinition) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initDefinition();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initIdentifier();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record-&amp;gt;setUp();

            &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; tree, set up tree
&lt;/span&gt;            &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;isTree()) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTree()-&amp;gt;setUp();
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;tableName&apos;])) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(Doctrine_Inflector::tableize($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]));
            }
        }
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_filters[]  = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Filter_Standard();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_repository = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Table_Repository($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($charset = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;charset&apos;] = $charset;
        }
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($collate = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;collate&apos;] = $collate;
        }

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;construct();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;Here the charset and the collate are overwritten (in the last lines of the method) by the global values.&lt;/p&gt;

&lt;p&gt;A fix could be something like:&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;Table.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 __construct($name, Doctrine_Connection $conn, $initDefinition = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn = $conn;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;] = $name;
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setParent($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn);           
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;addTable($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parser = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Relation_Parser($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($charset = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;charset&apos;] = $charset;
        }
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($collate = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;collate&apos;] = $collate;
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($initDefinition) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initDefinition();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initIdentifier();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record-&amp;gt;setUp();

            &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; tree, set up tree
&lt;/span&gt;            &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;isTree()) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTree()-&amp;gt;setUp();
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;tableName&apos;])) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(Doctrine_Inflector::tableize($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]));
            }
        }
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_filters[]  = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Filter_Standard();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_repository = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Table_Repository($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);

        

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;construct();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;Now the initDefinition method is called after the setup of the global charset and collate. Then if found a collate option in the table then that collate will be used.&lt;/p&gt;
</description>
                <environment>Wamp 2.0, Windows XP PS2.</environment>
            <key id="10951">DC-522</key>
            <summary>Can not use charset and collate in a table basis when using global charset and collate in Doctrine_Manager</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathan.nieto">Jonathan Nieto</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Feb 2010 19:47:16 +0000</created>
                <updated>Mon, 15 Mar 2010 14:18:56 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:18:56 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11976" author="jwage" created="Tue, 2 Mar 2010 13:28:38 +0000"  >&lt;p&gt;Can you provide your changes as a patch?&lt;/p&gt;</comment>
                    <comment id="12065" author="jonathan.nieto" created="Tue, 9 Mar 2010 18:02:43 +0000"  >&lt;p&gt;Patch done!.&lt;/p&gt;</comment>
                    <comment id="12209" author="jwage" created="Mon, 15 Mar 2010 14:18:56 +0000"  >&lt;p&gt;Thanks again for another issue and patch &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="10439" name="Doctrine_Table___construct.txt" size="1259" author="jonathan.nieto" created="Tue, 9 Mar 2010 18:02:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-518] Generated *Table.class.php should contain a getInstance() method</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-518</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using the symfony framework but assume that the following only affects the classes that were auto generated by Doctrine.&lt;/p&gt;

&lt;p&gt;When doctrine generates the model classes for e.g. the sql table &quot;manage_users&quot; it generates:&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; 
  lib/model/doctrine/ManageUsers.class.php                           &amp;lt;- extends Doctrine_Table
  lib/model/doctrine/ManageUsersTable.class.php                 &amp;lt;- extends BaseManageUsers
  lib/model/doctrine/base/BaseManageUsers.class.php       &amp;lt;- extends sfDoctrineRecord
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;As far as I understand the ManageUsersTable class is supposed to be autoloaded by Doctrine (cf. ATTR_AUTOLOAD_TABLE_CLASSES) and injected into&lt;br/&gt;
the class returned by Doctrine::getTable(&apos;ManageUsers&apos;).&lt;/p&gt;

&lt;p&gt;The first problem is that it is hard to figure out for newbies how to access methods in this class because they try all means to instanciate it or looking for static methods but eventually fail &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;The second problem is that using it this way, the IDE auto completion feature has no chance to figure out that the returned object offers methods defined in ManageUsersTable.class.php, it can only know that the results is an instance of Doctrine_Table.&lt;/p&gt;

&lt;p&gt;The third problem is that one has to repeatingly write Doctrine::getTable(&quot;ManageUser&quot;) in the source code which is quite error prone - or did you notice that I missed an &quot;s&quot; in the example just given &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; The IDE has again no chance to spot this.&lt;/p&gt;

&lt;p&gt;A simple solution to all problems would be an auto generated getInstance method 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; 
 class ManageUsersTable extends Doctrine_Table {
    /** Returns an instance of this class.
     *
     * @return ManageUsersTable
     */
    public static function getInstance() {
        return Doctrine::getTable(&apos;ManageUsers&apos;);
    }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;This way one could write ManageUs&amp;lt;AUTOCOMPLETION&amp;gt;::getInstance()-&amp;gt;get&amp;lt;AUTOCOMPLETION&amp;gt;(); and there would be far less typo bugs!&lt;/p&gt;

&lt;p&gt;bye,&lt;/p&gt;

&lt;p&gt;&lt;del&gt;christian&lt;/del&gt;&lt;/p&gt;</description>
                <environment>Symfony 1.3 with Doctrine 1.2 on Debian 5.0 Linux</environment>
            <key id="10939">DC-518</key>
            <summary>Generated *Table.class.php should contain a getInstance() method</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lathspell">Christian Hammers</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Feb 2010 05:31:24 +0000</created>
                <updated>Mon, 15 Mar 2010 17:07:54 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:07:54 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-513] Complex HAVING clause generates incorrect SQL in Doctrine_Query::getCountSqlQuery() and Doctrine_Query::getLimitSubquery() [patch included]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-513</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I created a DQL query with a complex having clause, such as:&lt;/p&gt;

&lt;p&gt;Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;Record r&apos;)&lt;br/&gt;
-&amp;gt;addSelect(&apos;r.*&apos;)&lt;br/&gt;
-&amp;gt;addSelect(&apos;((ACOS(SIN( ... AS miles&apos;) // Determines miles from lat/longs&lt;br/&gt;
-&amp;gt;having(&apos;(r.location IS NULL) OR (miles &amp;lt;= r.location)&apos;);&lt;/p&gt;

&lt;p&gt;The query works fine when executed by itself. However, when passed to Doctrine_Query::getCountSqlQuery(), it strips the r.location from the select fields, however this field remains in the having clause, and SQL errors out saying that it can&apos;t find the field. Then, when it is passed to Doctrine_Query::buildSqlQuery(true) by Doctrine_Pager-&amp;gt;execute() (true designates to use getLimitSubquery()), getLimitSubquery() does the same thing and doesn&apos;t include these fields in the subquery.&lt;/p&gt;

&lt;p&gt;I built a patch that I am using for my application to get around this. What it does is it searches for anything matching `&lt;span class=&quot;error&quot;&gt;&amp;#91;a-z0-9_&amp;#93;&lt;/span&gt;&lt;ins&gt;`.`&lt;span class=&quot;error&quot;&gt;&amp;#91;a-z0-9_&amp;#93;&lt;/span&gt;&lt;/ins&gt;` in getCountSqlQuery() and getLimitSubquery() in the HAVING clause (for instance, would match `r`.`location`) and adds the field to the select query. This is a patch for Doctrine-1.2.1, and I haven&apos;t tested it extensively, so I&apos;m not sure if it breaks anything, however in the quick testing I have done it seems to be working OK.&lt;/p&gt;

&lt;p&gt;I greatly appreciate all the work the Doctrine team has done for this amazing ORM - keep up the good work! If I can be of any other assistance, please let me know.&lt;/p&gt;</description>
                <environment>php 5.3.0</environment>
            <key id="10928">DC-513</key>
            <summary>Complex HAVING clause generates incorrect SQL in Doctrine_Query::getCountSqlQuery() and Doctrine_Query::getLimitSubquery() [patch included]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="cocoloco">Dave Kozma</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Feb 2010 18:08:40 +0000</created>
                <updated>Thu, 11 Mar 2010 10:37:37 +0000</updated>
                    <resolved>Thu, 11 Mar 2010 10:37:37 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Pager</component>
                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12079" author="jwage" created="Thu, 11 Mar 2010 10:37:37 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10380" name="Query.patch" size="1123" author="cocoloco" created="Sun, 21 Feb 2010 18:08:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-512] Wrong sorting of migration files</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-512</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I name migration files just as 1.php, 2.php, ..., 10.php, then sorting goes wrong and they will be read in this order: 1.php, 10.php, 2.php, ....&lt;/p&gt;

&lt;p&gt;I fixed it just by replacing&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;ksort($classesToLoad);
&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;ksort($classesToLoad, SORT_NUMERIC);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10922">DC-512</key>
            <summary>Wrong sorting of migration files</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="elnur">Elnur Abdurrakhimov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Feb 2010 04:32:11 +0000</created>
                <updated>Tue, 2 Mar 2010 11:57:03 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 11:57:03 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10376" name="patch-migration-sort.diff" size="460" author="elnur" created="Sat, 20 Feb 2010 04:32:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-510] setColumnOption(s) doesn&apos;t update _identifier when setting column as primary (symfony 1.4.2)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-510</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;class PlgSlide extends BasePlgSlide&lt;br/&gt;
{&lt;br/&gt;
  public function setTableDefinition() &lt;/p&gt;
{
    parent::setTableDefinition();
    $this-&amp;gt;setColumnOptions(&apos;domain_id&apos;, array(&apos;primary&apos; =&amp;gt; true));
  }
&lt;p&gt;...&lt;br/&gt;
doesn&apos;t work, domain_id field is not added as part of identifier for PlgSlide table records&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;class PlgSlide extends BasePlgSlide&lt;br/&gt;
{&lt;br/&gt;
  public function setTableDefinition() &lt;/p&gt;
{
    parent::setTableDefinition();
    $this-&amp;gt;hasColumn(&apos;domain_id&apos;, &apos;integer&apos;, 4, array(
             .... other field option options here
             &apos;primary&apos; =&amp;gt; true
           ));
   }
&lt;p&gt;do work as expected.&lt;/p&gt;

&lt;p&gt;I&apos;ve made some investigation and found code fragment at Table.php, in function setColumn, line 1373:&lt;br/&gt;
           if (isset($options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;br/&gt;
...&lt;br/&gt;
                $this-&amp;gt;_identifier = (array) $this-&amp;gt;_identifier;&lt;/p&gt;

&lt;p&gt;but no such functionality for setColumnOption function, Table.php, line 1235&lt;/p&gt;</description>
                <environment>symfony 1.4.2</environment>
            <key id="10916">DC-510</key>
            <summary>setColumnOption(s) doesn&apos;t update _identifier when setting column as primary (symfony 1.4.2)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="wayfarer">Vladimir Droznik</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Feb 2010 12:33:46 +0000</created>
                <updated>Tue, 2 Mar 2010 13:46:32 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:46:32 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-507] Expected an error thrown for a column with float type and notnull validation. Tested in Symfony 1.4</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-507</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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;./config/doctrine/schema.yml&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 $units = &apos;[column, module, unit]&apos;; ?&amp;gt;

PaperSize:
  columns:
    x_unit:   { type: &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt;, values: &amp;lt;?= $units ?&amp;gt; }
    y_unit:   { type: &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt;, values: &amp;lt;?= $units ?&amp;gt; }
    x_cells:  { type: integer, unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    y_cells:  { type: integer, unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    x_inch:   { type: &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;, unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    y_inch:   { type: &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;, unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    width:    { type: &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;, notnull: &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;, range: [0.0001, 24] }
    height:   { type: &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;, notnull: &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;, range: [0.0001, 24] }
&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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;./test/unit/model/PaperSizeTest.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$ps = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PaperSize();
$ps-&amp;gt;x_cells = 8;
$ps-&amp;gt;height = 14;

&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
	$ps-&amp;gt;save();
	$t-&amp;gt;fail($ps-&amp;gt;width); # &amp;lt;-- fails, save succeeds.
} &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
	$t-&amp;gt;pass(); 
}
$t-&amp;gt;is($ps-&amp;gt;width, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);  # &amp;lt;-- fails with &apos;0.00&apos;
$t-&amp;gt;is($ps-&amp;gt;x_inch, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I overloaded the save method to calculate some things: (although from my debugging, none of the if statements are called. But here for reference).&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;./lib/model/doctrine/PaperSize.class.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class PaperSize &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; BasePaperSize
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function save(Doctrine_Connection $conn = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
	{			
		&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;x_cells &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;width &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_inch) {
			$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_cells = (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;width / $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_inch);
		} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &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;width &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_cells &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_inch) {
			$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;width = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_cells * $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_inch;
		} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &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;x_inch &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_cells &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;width) {
			$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_inch = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;width / $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;x_cells;
		}
		
		&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;y_cells &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;height &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_inch) {
			$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_cells = (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;height / $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_inch);
		} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &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;height &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_cells &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_inch) {
			$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;height = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_cells * $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_inch;
		} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &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;y_inch &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_cells &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;height) {
			$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_inch = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;height / $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;y_cells;
		}
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::save($conn);
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Running the test in lime through Symfony 1.4. Using the latest 1.4.3 DEV trunk and Doctrine plugin in that repo. On mysql on a Mac OS X.</environment>
            <key id="10910">DC-507</key>
            <summary>Expected an error thrown for a column with float type and notnull validation. Tested in 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ibolmo">Olmo Maldonado</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Feb 2010 13:06:37 +0000</created>
                <updated>Tue, 2 Mar 2010 14:15:05 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 14:05:26 +0000</resolved>
                                                            <component>Record</component>
                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11981" author="jwage" created="Tue, 2 Mar 2010 13:52:04 +0000"  >&lt;p&gt;Hi, can you provide your test as a Doctrine unit test case? You can read about it here: &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="11985" author="ibolmo" created="Tue, 2 Mar 2010 14:05:26 +0000"  >&lt;p&gt;Sorry the problem was that Symfony 1.4 by default turns off validation.&lt;/p&gt;

&lt;p&gt;You helped me resolve this online (I&apos;m ibolmo) by adding to the database.yml:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;      attributes:
        validate: all
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-504] toArray not using lazy loading</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-504</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When selecting specific fields in a doctrine query, and calling toArray, the resulting arrays ignore the selected fields and load all values from the database record.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$phones = Doctrine_Query::create()
        -&amp;gt;select(&apos;ph.phone_type&apos;)
        -&amp;gt;from(&apos;Phone ph&apos;)
        -&amp;gt;orderBy(&apos;ph.phone_type&apos;)
        -&amp;gt;limit(2)
        -&amp;gt;execute()
        -&amp;gt;toArray();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above query when dumped returns...&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; Array
        (
            [id] =&amp;gt; 1
            [status] =&amp;gt; 
            [phone_type] =&amp;gt; business
            [number] =&amp;gt; 8003041538
            [current_status_id] =&amp;gt; 1
            [created_at] =&amp;gt; 2010-01-08 15:08:34
            [updated_at] =&amp;gt; 2010-01-08 15:08:34
        )

    [1] =&amp;gt; Array
        (
            [id] =&amp;gt; 2
            [status] =&amp;gt; 
            [phone_type] =&amp;gt; business
            [number] =&amp;gt; 2052052055
            [current_status_id] =&amp;gt; 1
            [created_at] =&amp;gt; 2010-02-14 13:07:12
            [updated_at] =&amp;gt; 2010-02-14 13:07:12
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 9.10, PHP 5.2, Zend Framework 9.6</environment>
            <key id="10904">DC-504</key>
            <summary>toArray not using lazy loading</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="davidma7685">David Ash</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2010 11:51:10 +0000</created>
                <updated>Wed, 10 Mar 2010 18:53:01 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 14:13:09 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11742" author="davidma7685" created="Tue, 16 Feb 2010 12:07:03 +0000"  >&lt;p&gt;After a quick test, using -&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY) returns the expected results, but toArray does not.&lt;/p&gt;</comment>
                    <comment id="12078" author="xborns" created="Wed, 10 Mar 2010 18:53:01 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Using the latest SVN from the 1.2 branch, this code returns null values for the fields that are not part of the select call. For 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;Doctrine_Query::create()
                -&amp;gt;select(&apos;venue_id, extended_name&apos;)
                -&amp;gt;from(&apos;Model_Venue v&apos;)
                -&amp;gt;execute()
                -&amp;gt;toArray();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will return 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;
array
 0 =&amp;gt; 
    array
      &apos;venue_id&apos; =&amp;gt; string &apos;160&apos; (length=3)
      &apos;number&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;venue&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;extended_name&apos; =&amp;gt; string &apos;&lt;span class=&quot;code-object&quot;&gt;Long&lt;/span&gt; Venue Name 160&apos; 
  1 =&amp;gt; 
    array
      &apos;venue_id&apos; =&amp;gt; string &apos;161&apos; (length=3)
      &apos;number&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;venue&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;extended_name&apos; =&amp;gt; string &apos;&lt;span class=&quot;code-object&quot;&gt;Long&lt;/span&gt; Venue Name 161&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I believe it should not include the `number` and `venue` columns within the array? The correct SQL query is returned only giving me the venue_id and extended_name columns.  Not sure if that is a bug/feature since I did not find it within the documentation. &lt;/p&gt;

&lt;p&gt;I am running a MS SQL 2005 server,  PHP 5.3.1 w/ pdo_mssql Apache 2.2.14. Thanks.&lt;/p&gt;

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

<item>
            <title>[DC-505] Doctrine_Cache_Db can be much faster</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-505</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Each  Doctrine_Cache_Db-&amp;gt;_doFetch() invocation costs about 50 ms on my PC(depending on the data of course). By using built-in pack() function performance can be increased 700x times. Each invocation now costs about 0.07 ms. The change is very considerable for pages with multiple queries.&lt;/p&gt;</description>
                <environment>Intel(R) Pentium(R) 4 CPU 3.20GHz, Redhat</environment>
            <key id="10905">DC-505</key>
            <summary>Doctrine_Cache_Db can be much faster</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vadik56">vadik56</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2010 13:19:50 +0000</created>
                <updated>Mon, 15 Mar 2010 17:22:58 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:22:58 +0000</resolved>
                            <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>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12251" author="jwage" created="Mon, 15 Mar 2010 17:22:58 +0000"  >&lt;p&gt;Thanks for the issue and patch! &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="10371" name="doctrine_cache_speedup.diff" size="490" author="vadik56" created="Tue, 16 Feb 2010 13:19:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-503] Migrations task generates wrong diff for long table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-503</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With the attached schema, a migrations diff is generated after an initial setup of the project, although&lt;br/&gt;
there are no differences at all. The two models are exactly identical, the only difference is the&lt;br/&gt;
lenght of their table names. A diff is detected for model &quot;Institute&quot;, but not for the one called &quot;Institut&quot;.&lt;/p&gt;

&lt;p&gt;The reason is in the generation of the foreign keys (Doctrine_Connection line 1624), which&lt;br/&gt;
generates an abbreviated foreign key name for names longer than 64 characters. This&lt;br/&gt;
is true in the &quot;to&quot; models of the migration, but not in the &quot;from&quot; models.&lt;/p&gt;
</description>
                <environment>All</environment>
            <key id="10902">DC-503</key>
            <summary>Migrations task generates wrong diff for long table 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pulse00">Robert Gruendler</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2010 05:02:38 +0000</created>
                <updated>Mon, 15 Mar 2010 12:10:01 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:10:01 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11732" author="pulse00" created="Tue, 16 Feb 2010 06:54:34 +0000"  >&lt;p&gt;I couldn&apos;t find a way to alter the max_identifier_length property of Doctrine_Connection, so i&apos;ve created a patch&lt;br/&gt;
that introduces an ATTR_MAX_IDENTIFIER_LENGTH Connection attribute. If set, the maxLength is taken from&lt;br/&gt;
the attribute, if not set, it defaults to 64 like now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10370" name="0001-migrations-fix.patch" size="2876" author="pulse00" created="Tue, 16 Feb 2010 06:52:31 +0000" />
                    <attachment id="10369" name="1266313871_version1.php" size="1567" author="pulse00" created="Tue, 16 Feb 2010 05:02:38 +0000" />
                    <attachment id="10368" name="schema.yml" size="517" author="pulse00" created="Tue, 16 Feb 2010 05:02:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-506] Doctrine_Adapter_Statement_Oracle missing fetch statement in fetchAll()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-506</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It looks like the developer changed their mind on how to set the flags halfway through coding, as the $flags variable is not used.  Critically, if the default FETCH_BOTH is specified, then no fetch is performed.  I also did some testing with the OCI_BOTH constant, and could not get it to return the desired results (only enumerated results were returned).  I also tried replacing OCI_BOTH with OCI_NUM + OCI_ASSOC with the same results.&lt;/p&gt;

&lt;p&gt;I guess this should either throw an exception (not supported) or be fixed to return the appropriate results.&lt;/p&gt;

&lt;p&gt;Line 361 in v1.2&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $flags = OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC;

        $&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; = $fetchStyle &amp;amp; Doctrine::FETCH_COLUMN;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($fetchStyle == Doctrine::FETCH_BOTH) {
            $flags = OCI_BOTH;
            $numberOfRows = @oci_fetch_all($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;statement, $data, $skip, $maxrows, OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC + OCI_RETURN_LOBS);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($fetchStyle == Doctrine::FETCH_ASSOC) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Linux RHEL5 (discovered in Symfony, but crosschecked with Doctrine 1.x source)</environment>
            <key id="10909">DC-506</key>
            <summary>Doctrine_Adapter_Statement_Oracle missing fetch statement in fetchAll()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beornharris">Beorn Harris</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Feb 2010 09:52:06 +0000</created>
                <updated>Tue, 2 Mar 2010 13:57:32 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:57:32 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.0.13</version>
                <version>1.0.14</version>
                <version>1.1.4</version>
                <version>1.1.5</version>
                <version>1.1.6</version>
                <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>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-500] Duplicate Index for foreign key(MySQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-500</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If an index with the same as the foreign key field exists and is not an array, and it is not the last in the list, adds it twice&lt;/p&gt;


&lt;p&gt;SUGGESTION SOLUTION:&lt;/p&gt;

&lt;p&gt;Doctrine/Export/Mysql.php (136): $found = $found || ($local == $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fields&amp;#39;&amp;#93;&lt;/span&gt;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="10896">DC-500</key>
            <summary>Duplicate Index for foreign key(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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="valgard">Sven P&#246;che</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Feb 2010 12:01:18 +0000</created>
                <updated>Tue, 2 Mar 2010 12:03:42 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:03:42 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-493] method bracketExplode when tablename contains &quot;Join&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-493</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;br/&gt;
I&apos;m using Symfony 1.4.1 with Doctrine (I imagine that the doctrine&apos;s version is 1.2.1), and I have a strange behavior because my table name is &quot;piece_jointe&quot;, so it contains &quot;JOIN&quot; keyword inside.&lt;br/&gt;
In Doctrine_Query_Tokenizer class, the method bracketExplode explode string with a regular expression &quot;#(JOIN)#i&quot;, so the table name is exploded and nothing works after that.&lt;/p&gt;

&lt;p&gt;do you think it&apos;s possible to write a better regular expression to avoid this behavior ? Maybe add spaces after JOIN : &quot;#(JOIN )#i but if there is a line break... or &quot;#(JOIN&lt;span class=&quot;error&quot;&gt;&amp;#91;\s \n&amp;#93;&lt;/span&gt;)#i&quot;&lt;br/&gt;
For now, I&apos;ll rename the table !&lt;/p&gt;

&lt;p&gt;Thanks a lot,&lt;br/&gt;
best regards&lt;br/&gt;
Etienne&lt;/p&gt;</description>
                <environment>Windows 7 / Linux Ubuntu, Apapche 2.2, PHP 5.3</environment>
            <key id="10865">DC-493</key>
            <summary>method bracketExplode when tablename contains &quot;Join&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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="evoilliot">Etienne VOILLIOT</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Feb 2010 09:52:25 +0000</created>
                <updated>Mon, 15 Mar 2010 17:31:44 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:31:44 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10361" name="bracketExplode.gif" size="18956" author="evoilliot" created="Thu, 11 Feb 2010 09:52:25 +0000" />
                    <attachment id="10362" name="ScreenHunter_01 Feb. 11 15.48.gif" size="11979" author="evoilliot" created="Thu, 11 Feb 2010 09:52:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-487] Worng docs: @return docs of some methods in Doctrine_Query_Abstract class are worng.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-487</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;@return docs of getSqlQueryPart should be mixed.&lt;br/&gt;
@return docs of setSqlQueryPart, addSqlQueryPart, removeSqlQueryPart, removeDqlQueryPart, copySubqueryInfo, useResultCache, useQueryCache, expireResultCache, expireQueryCache, setResultCacheLifeSpan and setQueryCacheLifeSpan should be Doctrine_Query.&lt;/p&gt;

&lt;p&gt;This issue is also reported in the user ml. &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/ee5d40f03242af8b&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/ee5d40f03242af8b&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10856">DC-487</key>
            <summary>Worng docs: @return docs of some methods in Doctrine_Query_Abstract class are worng.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="mugeso">TANAKA Koichi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Feb 2010 02:02:04 +0000</created>
                <updated>Mon, 15 Mar 2010 17:39:15 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:39:15 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10360" name="docfix.diff" size="4940" author="mugeso" created="Wed, 10 Feb 2010 03:13:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-488] Cannot parse table name including &apos;join&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-488</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Cannot parse table name including &apos;join&apos;.&lt;/p&gt;

&lt;p&gt;$q = new Doctrine_Query();&lt;br/&gt;
$q-&amp;gt;from(&apos;MyJoinProblem&apos;);&lt;/p&gt;

&lt;p&gt;In above code, I want to query like &apos;SELECT m.id AS m__id FROM MyJoinProplem m&apos;.&lt;br/&gt;
But, Doctrine try to find &apos;My&apos; table and &apos;Problem&apos; table.&lt;br/&gt;
Table name is &apos;MyJoinProblem&apos;.&lt;/p&gt;</description>
                <environment>php 2.3.11, Windows 7 64bits</environment>
            <key id="10855">DC-488</key>
            <summary>Cannot parse table name including &apos;join&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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="gilchris">Chang-gun Lee</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Feb 2010 01:45:38 +0000</created>
                <updated>Mon, 15 Mar 2010 17:35:30 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:35:30 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10359" name="9998TestCase.php" size="2198" author="gilchris" created="Wed, 10 Feb 2010 01:45:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-482] $data passed to foreach is wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-482</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Calling a query that doesn&apos;t use all tablecols gives php warnings such as:&lt;/p&gt;


&lt;p&gt;Errorcode: 	E_WARNING &lt;span class=&quot;error&quot;&gt;&amp;#91;php warning&amp;#93;&lt;/span&gt; (2)&lt;br/&gt;
Message: 	Invalid argument supplied for foreach()&lt;br/&gt;
File: 	Record.php&lt;br/&gt;
Line: 	1151&lt;/p&gt;

&lt;p&gt;--------------------------------------------------------------&lt;br/&gt;
$data = empty($data) ? $this-&amp;gt;getTable()-&amp;gt;find($id, Doctrine_Core::HYDRATE_ARRAY) : $data;           &lt;br/&gt;
foreach ($data as $field =&amp;gt; $value) {&lt;br/&gt;
--------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;$data is empty but not an array.&lt;/p&gt;</description>
                <environment>Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 (xampp 1.7.3)</environment>
            <key id="10848">DC-482</key>
            <summary>$data passed to foreach is 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="xsign">Florian Wolf</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Feb 2010 17:30:51 +0000</created>
                <updated>Mon, 15 Mar 2010 17:45:10 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:45:10 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-472] In the relatedExists method of the Doctrine_Record class the exception is incorrectly thrown imho</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-472</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using the result of a:&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;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$q = Doctrine::createQuery()
        -&amp;gt;from(&apos;User u&apos;)
        -&amp;gt;leftJoin(&apos;Role r&apos;);

$users = $q-&amp;gt;execute();

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


&lt;p&gt;now if we want to iterate and know if exists the according role for each user&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;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
foreach ($users as $user)
{
  $role_name = $user-&amp;gt;relatedExists(&apos;Role&apos;) ? $user-&amp;gt;getRole()-&amp;gt;getName() : &apos;&apos;;
}

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


&lt;p&gt;the exception in the relatedExists method will be thrown:&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;test.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 relatedExists($name)
    {
        $newReference = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        &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;hasReference($name)) {
            $newReference = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        }

        $reference = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $reference &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Record) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Exception(
                &apos;You can only call relatedExists() on a relationship that &apos;.
                &apos;returns an instance of Doctrine_Record&apos;
            );
        }
        $exists = $reference-&amp;gt;exists();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($newReference) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;clearRelated($name);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $exists;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;because the according role record does not exist for some users ( a user just could have one record).&lt;/p&gt;

&lt;p&gt;it could be better this way:&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;test.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 relatedExists($name)
    {
        $newReference = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        &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;hasReference($name)) {
            $newReference = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        }

        $reference = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $reference &amp;amp;&amp;amp; ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;hasRelation($name)) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Exception(
                &apos;You can only call relatedExists() on a relationship that &apos;.
                &apos;returns an instance of Doctrine_Record&apos;
            );
        }

        $exists = $reference ? $reference-&amp;gt;exists() : &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($newReference) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;clearRelated($name);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $exists;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;With this change, this method can be used to check newly created user objects or some retrieved from the db (left join with role) smoothly.&lt;/p&gt;</description>
                <environment>Windows XP, WAMP 2.0, PHP 5.2.11</environment>
            <key id="10824">DC-472</key>
            <summary>In the relatedExists method of the Doctrine_Record class the exception is incorrectly thrown imho</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathan.nieto">Jonathan Nieto</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 22:52:15 +0000</created>
                <updated>Mon, 15 Mar 2010 14:16:38 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:16:38 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11964" author="jwage" created="Tue, 2 Mar 2010 12:14:55 +0000"  >&lt;p&gt;Hi, I was able to copy and paste your change out of the comment, but when I apply it and run the tests. It seems to break something, which I expected. Your changes allows collections through now and it calls a method that doesn&apos;t exist on Doctrine_Collection. Give your change a try and run the tests, maybe you can provide a more complete patch and we can include it for 1.2.2 release. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12064" author="jonathan.nieto" created="Tue, 9 Mar 2010 17:38:14 +0000"  >&lt;p&gt;Hi, I just made the patch and ran it against the tests. No errors arose.&lt;/p&gt;

&lt;p&gt;I have the following explanation for the patch:&lt;/p&gt;

&lt;p&gt;The main difference with the previous relatedExists is when checking a relation not serialized in the database but that already exists in the current record. Then the current related exists will return true and the previous relatedExists will return false because that object does not exist in the database.&lt;/p&gt;

&lt;p&gt;Take in count that there are two states of the object:&lt;br/&gt;
1.- When retrieve with findOne without any relation&lt;br/&gt;
2.- When retrieve leftJoin or innerJoin with a relation&lt;/p&gt;</comment>
                    <comment id="12208" author="jwage" created="Mon, 15 Mar 2010 14:16:38 +0000"  >&lt;p&gt;Thanks for the issue and patch! &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="10438" name="Doctrine_Record_relatedExists.txt" size="1299" author="jonathan.nieto" created="Tue, 9 Mar 2010 17:38:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-474] Export: exportClassesSql does pollute classes tables with new all-NULL records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-474</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine/Export.php&lt;br/&gt;
in&lt;br/&gt;
    public function exportClassesSql(array $classes)&lt;br/&gt;
(around line 1245):&lt;/p&gt;

&lt;p&gt;there is:&lt;br/&gt;
            $record = new $name();&lt;br/&gt;
            $table  = $record-&amp;gt;getTable();&lt;/p&gt;

&lt;p&gt;This does cause the instance of new record to be added to table&apos;s repository, which leads to unexpected results when $connection-&amp;gt;flush(); is used.&lt;br/&gt;
(like throwing exception because save of record with NULL &quot;notnull&quot; column is not valid, if validation is allowed)&lt;/p&gt;

&lt;p&gt;I did replace those two lines with:&lt;br/&gt;
            $table = $this-&amp;gt;conn-&amp;gt;getTable( $name );&lt;/p&gt;

&lt;p&gt;And it works for me well.&lt;/p&gt;

&lt;p&gt;Although this is not equivalent, because the original code while fetching the $table, it also makes sure the desired class &quot;$name&quot; can be instantiated, my code doesn&apos;t care about that. (as I&apos;m trying to do TDD with my new project, I don&apos;t care about this, because that&apos;s the very first unit test I write for every new class anyway, so I&apos;m pretty sure all my model classes are ok)&lt;/p&gt;

&lt;p&gt;EDIT: maybe my solution is also bound to certain connection, but at that stage of export execution it&apos;s the desired connection anyway? I&apos;m working with single connection right now, so it WFM this way.&lt;/p&gt;

&lt;p&gt;In case the instantiation is not a bug, but a desired feature, is it possible to find that record in repository and evict it right away after $table is fetched?&lt;br/&gt;
I do believe that ExportClassesSql should not effectively create new records in tables, because that&apos;s beyond what the name of method suggests.&lt;br/&gt;
Also the documentation of the function doesn&apos;t cover this side-effect of execution.&lt;/p&gt;</description>
                <environment>PHP 5.3</environment>
            <key id="10826">DC-474</key>
            <summary>Export: exportClassesSql does pollute classes tables with new all-NULL 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ped">Peter Helcmanovsky</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 13:38:51 +0000</created>
                <updated>Wed, 3 Feb 2010 14:38:23 +0000</updated>
                    <resolved>Wed, 3 Feb 2010 14:38:23 +0000</resolved>
                            <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11580" author="ped" created="Tue, 2 Feb 2010 16:29:17 +0000"  >&lt;p&gt;Been said on IRC at #doctrine-dev that the instance of class can be important for the table to export all it&apos;s record metadata correctly.&lt;/p&gt;

&lt;p&gt;So my &quot;fix&quot; shouldn&apos;t be correct.&lt;/p&gt;

&lt;p&gt;Still I think the export process should not change table repository, or it should be well documented behaviour.&lt;/p&gt;</comment>
                    <comment id="11592" author="ped" created="Wed, 3 Feb 2010 13:01:25 +0000"  >&lt;p&gt;FIX proposal #2:&lt;/p&gt;

&lt;p&gt;At the end of foreach 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;            ...
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($table-&amp;gt;getAttribute(Doctrine_Core::ATTR_EXPORT) &amp;amp; Doctrine_Core::EXPORT_PLUGINS) {
                $sql = array_merge($sql, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;exportGeneratorsSql($table));
            }
            
            &lt;span class=&quot;code-comment&quot;&gt;//here comes the FIX
&lt;/span&gt;
            &lt;span class=&quot;code-comment&quot;&gt;//remove dummy $record from repository to not pollute it during export
&lt;/span&gt;            $table-&amp;gt;getRepository()-&amp;gt;evict( $record-&amp;gt;getOid() );
            unset( $record );

            &lt;span class=&quot;code-comment&quot;&gt;//end of FIX
&lt;/span&gt;        }
        
        $sql = array_unique($sql);
        ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I honestly believe this will not have any side-effect, but I didn&apos;t run Doctrine unit tests to verify.&lt;br/&gt;
What I can say for sure it does solve failures in my app unit tests (which were caused by polluted tables after running export DB schema).&lt;/p&gt;</comment>
                    <comment id="11598" author="guilhermeblanco" created="Wed, 3 Feb 2010 14:38:23 +0000"  >&lt;p&gt;In r7103 this patch was applied!!! Thanks a lot for you time testing and preparing a good fix for it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-468] Project directories that have underscores (ie my_project) in the name get replaced with slashes (my/project) when generating models</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-468</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a project name that contains an underscore.  When I run the doctrine CLI to create the models from the yaml file, something string replaces all underscores with slashes.&lt;/p&gt;

&lt;p&gt;So where I would be expecting the models to be generated in &apos;my_project/application/models&apos;, it is instead being generated in &apos;my/project/application/models&apos;&lt;/p&gt;
</description>
                <environment>Ubuntu Hardy</environment>
            <key id="10818">DC-468</key>
            <summary>Project directories that have underscores (ie my_project) in the name get replaced with slashes (my/project) when generating models</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rfan">Robert Fan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 07:35:14 +0000</created>
                <updated>Mon, 15 Mar 2010 17:49:38 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:49:38 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12257" author="jwage" created="Mon, 15 Mar 2010 17:49:38 +0000"  >&lt;p&gt;This should already be fixed in the latest 1.2 in SVN and will be in 1.2.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-469] getAccessors and getMutators shows notices if they are not set</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-469</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It&apos;s a very minor problem I know that. However when I try to use getAccessors() or getMutators() functions, if nothing is set on the table definitions, it throws some notices on the php (on error_reporting all) that such an index does not exists. As there is no such index to be found it returns null instead of expected array (empty if there is no mutators for that table)&lt;/p&gt;

&lt;p&gt;public function getAccessors()&lt;br/&gt;
{&lt;br/&gt;
        $componentName = $this-&amp;gt;_table-&amp;gt;getComponentName();&lt;br/&gt;
        if (!isset(self::$_customAccessors&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentName&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
            return array();
        }
&lt;p&gt;        return self::$_customAccessors&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentName&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;such a code solves the problem and not notices is thrown and empty array is returned if there is no accessors. Same kind of an improvement is required for getMutators too&lt;/p&gt;

&lt;p&gt;I know that this is a minor issue however I wanted to inform you.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10819">DC-469</key>
            <summary>getAccessors and getMutators shows notices if they are not 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="radalin">roy simkes</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 13:05:55 +0000</created>
                <updated>Mon, 15 Mar 2010 17:48:56 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:48:56 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-813] Add ability to register a custom hydrator as a class instance instead of a class name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-813</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Currently its only possible to register a custom hydrator as a string name. However in order to inject additional attributes it would be beneficial to be able to register an instance of the custom hydrator class.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/data-hydrators#writing-hydration-method&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/data-hydrators#writing-hydration-method&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So instead of:&lt;br/&gt;
$manager-&amp;gt;registerHydrator(&apos;my_hydrator&apos;, &apos;Doctrine_Hydrator_MyHydrator&apos;);&lt;/p&gt;

&lt;p&gt;One could do:&lt;br/&gt;
$manager-&amp;gt;registerHydrator(&apos;my_hydrator&apos;,  new Doctrine_Hydrator_MyHydrator());&lt;/p&gt;</description>
                <environment></environment>
            <key id="11743">DC-813</key>
            <summary>Add ability to register a custom hydrator as a class instance instead of a class name</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Aug 2010 08:11:59 +0000</created>
                <updated>Wed, 11 Aug 2010 14:50:23 +0000</updated>
                    <resolved>Wed, 11 Aug 2010 14:50:23 +0000</resolved>
                            <version>1.2.2</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13875" author="lsmith" created="Mon, 9 Aug 2010 08:13:32 +0000"  >&lt;p&gt;patch with tests is in the works&lt;/p&gt;</comment>
                    <comment id="13877" author="lsmith" created="Mon, 9 Aug 2010 13:56:55 +0000"  >&lt;p&gt;patch&lt;/p&gt;</comment>
                    <comment id="13878" author="lsmith" created="Mon, 9 Aug 2010 13:57:12 +0000"  >&lt;p&gt;tests&lt;/p&gt;</comment>
                    <comment id="13918" author="guilhermeblanco" created="Wed, 11 Aug 2010 14:50:23 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10731" name="DC-813.diff" size="3095" author="lsmith" created="Mon, 9 Aug 2010 13:56:55 +0000" />
                    <attachment id="10732" name="DC-813_test.diff" size="1974" author="lsmith" created="Mon, 9 Aug 2010 13:57:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-274] Doctrine_Parser_Yml: hardcoded require calls for sfYaml</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-274</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Doctrine_Parser_Yml the requires calls to sfYaml are hardcoded:&lt;br/&gt;
if ( ! class_exists(&apos;sfYaml&apos;, false)) {&lt;br/&gt;
    require_once dirname(_&lt;em&gt;FILE&lt;/em&gt;_) . &apos;/../../vendor/sfYaml/sfYaml.php&apos;;&lt;br/&gt;
    require_once dirname(_&lt;em&gt;FILE&lt;/em&gt;_) . &apos;/../../vendor/sfYaml/sfYamlDumper.php&apos;;&lt;br/&gt;
    require_once dirname(_&lt;em&gt;FILE&lt;/em&gt;_) . &apos;/../../vendor/sfYaml/sfYamlInline.php&apos;;&lt;br/&gt;
    require_once dirname(_&lt;em&gt;FILE&lt;/em&gt;_) . &apos;/../../vendor/sfYaml/sfYamlParser.php&apos;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;This causes issues when one has already included sfYaml elsewhere. Either one needs to include the code for sfYaml twice or one needs to always load sfYaml before Doctrine parses any yaml files.&lt;/p&gt;

&lt;p&gt;A better approach to handling the fact that sfYaml does not adhere to the standard naming convention is to do these require calls inside the autoloader, but only using &quot;include&quot; in order to allow a fallback autoloader to also be able to load the code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10485">DC-274</key>
            <summary>Doctrine_Parser_Yml: hardcoded require calls for sfYaml</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Nov 2009 11:32:27 +0000</created>
                <updated>Mon, 23 Nov 2009 22:58:39 +0000</updated>
                    <resolved>Mon, 23 Nov 2009 22:58:39 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10824" author="jwage" created="Mon, 23 Nov 2009 22:58:39 +0000"  >&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-275] Mysql Schema Manager does not correctly detect Decimal + bug fix from me</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-275</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Mysql Schema Manager does not correctly detect Decimal. Lost decimal scale!&lt;/p&gt;

&lt;p&gt;bug in file Doctrine/DataDict/Mysql.php&lt;/p&gt;

&lt;p&gt;on line 263&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($field[&apos;length&apos;])) {
            $length = $field[&apos;length&apos;];
            $decimal = &apos;&apos;;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            $length = strtok(&apos;(), &apos;);
            $decimal = strtok(&apos;(), &apos;) ? strtok(&apos;(), &apos;):&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;    &lt;span class=&quot;code-comment&quot;&gt;// &amp;lt;--- here strtok call 2 times! (line 263)
&lt;/span&gt;        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;must be like that&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($field[&apos;length&apos;])) {
            $length = $field[&apos;length&apos;];
            $decimal = &apos;&apos;;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            $length = strtok(&apos;(), &apos;);
            $decimal = strtok(&apos;(), &apos;);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $decimal ) { &lt;span class=&quot;code-comment&quot;&gt;// or &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; === $decimal
&lt;/span&gt;                $decimal = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Please fix it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10486">DC-275</key>
            <summary>Mysql Schema Manager does not correctly detect Decimal + bug fix from me</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="setor">Sergei Kuznetsov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Nov 2009 12:51:25 +0000</created>
                <updated>Wed, 25 Nov 2009 08:57:17 +0000</updated>
                    <resolved>Tue, 24 Nov 2009 21:15:22 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                <fixVersion>1.2.0</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10812" author="setor" created="Sat, 21 Nov 2009 12:54:42 +0000"  >&lt;p&gt;Code formating fix&lt;/p&gt;</comment>
                    <comment id="10850" author="jwage" created="Tue, 24 Nov 2009 21:07:06 +0000"  >&lt;p&gt;Sorry I don&apos;t understand your change at all &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; Can you explain what you&apos;re doing? I am confused by this whole block of 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;            $length = strtok(&apos;(), &apos;);
            $decimal = strtok(&apos;(), &apos;) ? strtok(&apos;(), &apos;):&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Won&apos;t that always have the same result? Shouldn&apos;t it 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;            $length = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
            $decimal = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10851" author="jwage" created="Tue, 24 Nov 2009 21:13:34 +0000"  >&lt;p&gt;Nevermind after testing that won&apos;t work. Can you explain to me what you&apos;re change is doing?&lt;/p&gt;</comment>
                    <comment id="10852" author="jwage" created="Tue, 24 Nov 2009 21:15:22 +0000"  >&lt;p&gt;Ok I think I understand now. Can you comment and confirm what the change is doing.&lt;/p&gt;</comment>
                    <comment id="10861" author="setor" created="Wed, 25 Nov 2009 08:57:17 +0000"  >&lt;p&gt;Ok, see:&lt;/p&gt;

&lt;p&gt;original 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;$decimal = strtok(&apos;(), &apos;) ? strtok(&apos;(), &apos;):&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;    &lt;span class=&quot;code-comment&quot;&gt;// &amp;lt;--- here strtok call 2 times! (line 263)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;strtok call 2 times and after two call $decimal always === false&lt;/p&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;$decimal = strtok(&apos;(), &apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;now strtok call 1 times and $decimal have valid value!&lt;/p&gt;

&lt;p&gt;and this code check strtok return result&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; ( ! $decimal ) { &lt;span class=&quot;code-comment&quot;&gt;// or &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; === $decimal
&lt;/span&gt;                $decimal = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
            } 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-270] Implement Doctrine::PORTABILITY_RTRIM for Pgsql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-270</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Data returned using Postgres driver is padded with spaces for char columns (like &quot;A    &quot; where length is 5).&lt;/p&gt;

&lt;p&gt;Setting portability to any of the levels doesn&apos;t change it, because it seems that this functionality is not implemented.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10474">DC-270</key>
            <summary>Implement Doctrine::PORTABILITY_RTRIM for 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="juokaz">Juozas Kaziukenas</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Nov 2009 05:05:54 +0000</created>
                <updated>Wed, 3 Mar 2010 13:27:40 +0000</updated>
                    <resolved>Wed, 3 Mar 2010 13:27:40 +0000</resolved>
                            <version>1.2.0-BETA3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10995" author="juokaz" created="Thu, 3 Dec 2009 20:52:28 +0000"  >&lt;p&gt;One of the solutions is to rtrim in hydation stage, because:&lt;/p&gt;

&lt;p&gt;Sql -&amp;gt; Query -&amp;gt; Hydrator -&amp;gt; Record&lt;/p&gt;

&lt;p&gt;Because Hydrators are calling PDOStatement::fetch() inside them, in hydrators post-filters should happen also. Because we want to rtrim data coming from query, we don&apos;t want to put this logic inside Record classes because user should have ability to set data in any way he wants.&lt;/p&gt;

&lt;p&gt;So my patch applies rtrim function to all fields returned by query.&lt;/p&gt;

&lt;p&gt;There are some possible issues, like binary columns types or things like that, but those can be dealt with when something is approved .&lt;/p&gt;</comment>
                    <comment id="11227" author="osvi" created="Fri, 18 Dec 2009 13:27:28 +0000"  >&lt;p&gt;When will this patch be applied?&lt;/p&gt;</comment>
                    <comment id="12013" author="guilhermeblanco" created="Wed, 3 Mar 2010 13:27:40 +0000"  >&lt;p&gt;In r7307 this issue was fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10209" name="rtrim2.patch" size="637" author="juokaz" created="Thu, 3 Dec 2009 20:52:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-271] Doctrine_Record link many many</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-271</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When saving the generated user form of sfGuardDoctrinePlugin 3.0.0 with a related many many object(s), such as groups or permissions, is/are selected, the script dies in Doctrine_Record line 2501 of R6780. Apparently public property access of the relation does not return a Doctrine_Collection object .&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_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 link($alias, $ids, $now = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
            &lt;span class=&quot;code-comment&quot;&gt;//... some code
&lt;/span&gt;            foreach ($records as $record) {
                &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;$alias &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Record) {
                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$alias = $record;
                } &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;$alias-&amp;gt;add($record); &lt;span class=&quot;code-comment&quot;&gt;//fails 