<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 01:25:53 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+AND+resolution+%3D+Unresolved+AND+fixVersion+%3D+%221.2.2%22+ORDER+BY+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+AND+resolution+%3D+Unresolved+AND+fixVersion+%3D+%221.2.2%22+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="10" total="10"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-674] NULL Dates are translated to &apos;0000-00-00&apos; after upgrading to 1.2.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-674</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Once the upgrade was done from Doctrine 1.2.1 to 1.2.2 we discovered that date related issues started to appear.&lt;br/&gt;
With dates that are persisted in DB as NULL are translated to &quot;0000-00-00&quot; when retrieved from DB. This has occurred in multiple places and is quite worrying as there is a lot of dates in our project. This means that everywhere in our codebase where we check a datevalue in our Models is NULL we need also to check for the string literal &quot;0000-00-00&quot;.&lt;/p&gt;
</description>
                <environment>Zend Framework, Ubuntu 9.10, MySQL </environment>
            <key id="11343">DC-674</key>
            <summary>NULL Dates are translated to &apos;0000-00-00&apos; after upgrading to 1.2.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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="villeit">Ville It&#228;maa</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 May 2010 07:59:54 +0000</created>
                <updated>Wed, 6 Oct 2010 06:29:40 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12895" author="jwage" created="Mon, 10 May 2010 12:19:21 +0000"  >&lt;p&gt;Are you able to reproduce this in a test case?&lt;/p&gt;</comment>
                    <comment id="12909" author="villeit" created="Tue, 11 May 2010 04:54:06 +0000"  >&lt;p&gt;We reverted to Doctrine 1.2.1 after realising the bug to confirm it was Doctrine 1.2.2 that was the cause for the problem. And as a result the records with NULL dates in the DB became NULL in the Models.&lt;br/&gt;
But when using Doctrine 1.2.2, the NULL dates became &apos;0000-00-00&apos; in the Models.&lt;br/&gt;
I don&apos;t have any other way to reproduce this error.&lt;/p&gt;</comment>
                    <comment id="12912" author="jwage" created="Tue, 11 May 2010 08:06:09 +0000"  >&lt;p&gt;Were you able to identity which changeset it was? You can read about creating test cases here &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So far I am not able to reproduce the error you described.&lt;/p&gt;</comment>
                    <comment id="13212" author="jwage" created="Tue, 8 Jun 2010 16:54:48 +0000"  >&lt;p&gt;I&apos;d like to fix this. Did you ever figure out which changeset introduced the issue? I&apos;ve been trying to figure it out myself.&lt;/p&gt;</comment>
                    <comment id="14535" author="hroland" created="Wed, 6 Oct 2010 06:29:30 +0000"  >&lt;p&gt;With 1.2.3 this works for me fine with both TIMESTAMP and DATE fields.&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;YAML

        date_of_birth:
            type: date

BASE MODEL

        $this-&amp;gt;hasColumn(&apos;date_of_birth&apos;, &apos;date&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;date&apos;,

             // try these two
             // &apos;notnull&apos; =&amp;gt; false,
             // &apos;default&apos; =&amp;gt; null
         ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

        exported_at:
            type: timestamp(25)
            notnull: false
            default: null

            # in this model I have everything to make sure it accepts and defaults to NULL

BASE MODEL

        $this-&amp;gt;hasColumn(&apos;exported_at&apos;, &apos;timestamp&apos;, 25, array(
             &apos;type&apos; =&amp;gt; &apos;timestamp&apos;,
             &apos;notnull&apos; =&amp;gt; false,
             &apos;length&apos; =&amp;gt; &apos;25&apos;,
             ));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You may try adding these to your YAML and (base) models&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;
YAML

    fieldname:
         . . .
        notnull: false
        default: null

BASE MODEL

        $this-&amp;gt;hasColumn(&apos;fieldname&apos;, . . .
             . . .
             &apos;notnull&apos; =&amp;gt; false, // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
             // &apos;default&apos; =&amp;gt; null, // &amp;lt;&amp;lt;&amp;lt; maybe, probably not needed
             ));

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

&lt;p&gt;I hope it helps.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-651] [PATCH] Doctrine_Record::option(&apos;orderBy&apos;, ...) of join&apos;s right side being applied to refTable in m2m relationship</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-651</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using the &lt;tt&gt;Doctrine_Record::option(&apos;orderBy&apos;, ...)&lt;/tt&gt; feature on a table definition, where that table is the target of a many-to-many join, the specified orderBy columns are applied to the relation table&apos;s alias. So for example, given the following definitions:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record {
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;uid&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;option(&apos;orderBy&apos;, &apos;uid&apos;);
  }

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

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

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

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

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

&lt;p&gt;the following queries:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$query = Doctrine_Query::create()
  -&amp;gt;select(&apos;u.*&apos;)
  -&amp;gt;from(&apos;User u&apos;)
  -&amp;gt;leftJoin(&apos;u.groups g WITH g.gid=?&apos;, 1);
echo $query-&amp;gt;getSqlQuery() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-799] Doctrine_Query::parseFunctionExpression() produces unexpected results if the expression contains a function</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-799</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When &lt;em&gt;Doctrine_Query::parseFunctionExpression()&lt;/em&gt; is called with the following parameter and &lt;em&gt;$this-&amp;gt;_conn-&amp;gt;expression&lt;/em&gt; is of type &lt;em&gt;Doctrine_Expression_MySql&lt;/em&gt;:&lt;/p&gt;

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

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

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

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

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

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

&lt;p&gt;This example is a result of calling addGroupby(&quot;DATE_FORMAT(datefield,&apos;%Y-%m-%d&apos;),someotherfield&quot;) on a Doctrine_Query object.&lt;/p&gt;</description>
                <environment>Mac OS X, LINUX</environment>
            <key id="11686">DC-799</key>
            <summary>Doctrine_Query::parseFunctionExpression() produces unexpected results if the expression contains a function</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="hglattergotz">Henning Glatter-Gotz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Jul 2010 16:42:17 +0000</created>
                <updated>Tue, 27 Jul 2010 16:42:17 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-795] Can&apos;t mix Soft and Hard deletes. Fix with patch provided.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-795</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I reported this bug on the symfony site, but after investigation i have found that it is actually a doctrine SoftDelete issue. &lt;a href=&quot;http://trac.symfony-project.org/ticket/8898&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8898&lt;/a&gt;&lt;/p&gt;

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

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

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

&lt;p&gt;The fix I have is the following, not sure what this would do to other things or not as I am not overly familiar with Doctrine internals...&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Index: Doctrine/Template/Listener/SoftDelete.php
===================================================================
--- Doctrine/Template/Listener/SoftDelete.php	(revision 12962)
+++ Doctrine/Template/Listener/SoftDelete.php	(working copy)
@@ -95,6 +95,7 @@
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function postDelete(Doctrine_Event $event)
     {
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;hardDelete&apos;]) {
+            $event-&amp;gt;getInvoker()-&amp;gt;clearRelated();
             $event-&amp;gt;getInvoker()-&amp;gt;save();
         }
     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This works even if the relations have been marked as SoftDelete.&lt;/p&gt;</description>
                <environment>Mac</environment>
            <key id="11661">DC-795</key>
            <summary>Can&apos;t mix Soft and Hard deletes. Fix with patch provided.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="johnwards">John Wards</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 08:45:26 +0000</created>
                <updated>Wed, 21 Jul 2010 14:47:10 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13636" author="johnwards" created="Wed, 21 Jul 2010 08:50:28 +0000"  >&lt;p&gt;Formatting&lt;/p&gt;</comment>
                    <comment id="13642" author="jwage" created="Wed, 21 Jul 2010 13:46:26 +0000"  >&lt;p&gt;Does this patch pass the test suite?&lt;/p&gt;</comment>
                    <comment id="13643" author="johnwards" created="Wed, 21 Jul 2010 14:32:02 +0000"  >&lt;p&gt;I have run the test suite and got the same 8 failures with and without the patch. &lt;/p&gt;

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

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

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

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

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

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

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

&lt;p&gt;But having the type be different depending on the database operation? Not sure I like that.&lt;/p&gt;</description>
                <environment>Ubuntu9.10, PHP 5.2.6, Symfony 1.4.1, Postgres8.4</environment>
            <key id="11557">DC-769</key>
            <summary>Variable type different for return value from Doctrine_Record-&gt;toArray() depending on whether the object is from a select, or a save.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Jun 2010 00:55:48 +0000</created>
                <updated>Tue, 24 Aug 2010 12:55:48 +0000</updated>
                                    <version>1.2.1</version>
                                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14050" author="jwage" created="Tue, 24 Aug 2010 12:02:06 +0000"  >&lt;p&gt;Can you provide a test case so that we can see if we can come up with a patch?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-753] doctrine generate-migrations-diff throws &quot;No php or yml files found at path&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-753</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am trying to generate migrations from the CLI but I get the error mentioned in the title. I did some searching and this seems to &lt;b&gt;have been&lt;/b&gt; a known problem and was fixed, however, I&apos;m getting it and the path is correct, and there is even a schema.yml file I just generated, also through CLI.&lt;/p&gt;

&lt;p&gt;Here is the error:&lt;/p&gt;

&lt;p&gt;D:\wamp\www\project\src\administrator\components\com_project\doctrine&amp;gt;php doctrine generate-migrations-diff&lt;br/&gt;
No php or yml files found at path: &quot;D:\wamp\www\project\src\administrator\components\com_project\doctrine\schema&quot;&lt;/p&gt;

&lt;p&gt;And here is what I have in my CLI file:&lt;/p&gt;

&lt;p&gt;	require_once(&apos;../../../../libraries/doctrine/lib/Doctrine.php&apos;);&lt;/p&gt;

&lt;p&gt;	spl_autoload_register(array(&apos;Doctrine&apos;,&apos;autoload&apos;));&lt;/p&gt;

&lt;p&gt;	Doctrine_Manager::connection(&apos;mysql://root@localhost/project&apos;,&apos;default&apos;);&lt;/p&gt;

&lt;p&gt;	//Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine::ATTR_TBLNAME_FORMAT, &apos;jos_project_%s&apos;);&lt;br/&gt;
	Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);&lt;br/&gt;
	Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER, true);&lt;br/&gt;
	Doctrine::loadModels(&apos;models/generated&apos;);&lt;br/&gt;
	Doctrine::loadModels(&apos;models&apos;);&lt;/p&gt;

&lt;p&gt;	$cli = new Doctrine_Cli(array(&lt;br/&gt;
		&apos;data_fixtures_path&apos;  =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;fixtures&apos;,&lt;br/&gt;
		&apos;models_path&apos;         =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;models&apos;,&lt;br/&gt;
		&apos;migrations_path&apos;     =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;migrations&apos;,&lt;br/&gt;
		&apos;sql_path&apos;            =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;sql&apos;,&lt;br/&gt;
		&apos;yaml_schema_path&apos;    =&amp;gt;  dirname(_&lt;em&gt;FILE&lt;/em&gt;_).DIRECTORY_SEPARATOR.&apos;schema&apos;&lt;br/&gt;
	));&lt;/p&gt;

&lt;p&gt;	$cli-&amp;gt;run($_SERVER&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;argv&amp;#39;&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;I find this very weird because earlier today I was able to make a migration the same way but with Symfony&apos;s CLI, however, that is another project.&lt;/p&gt;

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

&lt;p&gt;David&lt;/p&gt;</description>
                <environment>WIndows 7 x64, WAMP, PHP 5.2.11 &amp;amp; 5.3</environment>
            <key id="11524">DC-753</key>
            <summary>doctrine generate-migrations-diff throws &quot;No php or yml files found at path&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dukeofgaming">David Vega</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Jun 2010 05:12:50 +0000</created>
                <updated>Thu, 27 Jan 2011 13:07:37 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15194" author="saldanha" created="Thu, 27 Jan 2011 13:07:37 +0000"  >&lt;p&gt;I have the same problem, using symfony 1.4 latest sources. After reading about 20 (long) pages about similar issues, I&apos;ve come up with a solution.&lt;/p&gt;

&lt;p&gt;The problem appears when the project still don&apos;t have any Models defined. Im my case, they were all new projects in the plugin activation stage. Curiously, the behaviour were random, as in some projects I could activate my Contacts plugin (the first), and in others I couldn&apos;t.&lt;/p&gt;

&lt;p&gt;After much consideration, the problem was that the var $extension in /doctrine/Doctrine/Migration/Diff.php was empty, and that was because the algorithm only considered the first entry of the directory. If it was a file, its extension was used. If not, the algorithm descended until it found a file as the first entry. BUT it never considered second (and following) entries, so as my first entry was the &apos;base&apos; directory, and it was empty, no extension was ever found. This probably will not happen if the project have some models defined.&lt;/p&gt;

&lt;p&gt;And so, I came up with a solution. In doctrine/Doctrine/Migration/Diff.php, enclose this code in the _getItemExtension method (near line 350, in my copy) with a loop, such as:&lt;br/&gt;
      $idx = 0;&lt;br/&gt;
      while (strlen($extension) == 0) {&lt;br/&gt;
          if (isset($files&lt;span class=&quot;error&quot;&gt;&amp;#91;$idx&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
              if (is_dir($files&lt;span class=&quot;error&quot;&gt;&amp;#91;$idx&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
                  $extension = $this-&amp;gt;_getItemExtension($files[$idx]);
              }
&lt;p&gt; else &lt;/p&gt;
{
                  $pathInfo = pathinfo($files[$idx]);
                  $extension = $pathInfo[&apos;extension&apos;];
              }
&lt;p&gt;              $idx++;&lt;br/&gt;
          }&lt;br/&gt;
          else break; // no more entries to seek&lt;br/&gt;
      }&lt;/p&gt;

&lt;p&gt;Now it keep looking in every folder until it finds a file WITH an extension, and stops when all the tree is searched.&lt;/p&gt;

&lt;p&gt;Hope that helps someone.&lt;/p&gt;

&lt;p&gt;best regards.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-740] issue with multiple connection handling</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-740</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve found an issue where doctrine will use the wrong connection for tables under certain conditions.&lt;/p&gt;

&lt;p&gt;In a template, I&apos;m doing a $sf_user-&amp;gt;hasCredential() - which is causing this to be run in sfGuardSecurityUser,&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user = Doctrine::getTable(&apos;sfGuardUser&apos;)-&amp;gt;find($id);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When this execute, the calls find themselves to Doctrine_Manager::getConnectionForComponent($componentName)&lt;/p&gt;

&lt;p&gt;This method calls Doctrine_Core::modelsAutoload($componentName);,  which fails to load the class, and returns false (no checking is done to see if it should return true).&lt;/p&gt;

&lt;p&gt;As this fails to include the sfGuardUser classes wher the component binding goes on, the getTAble call will use the default connection, then create the table fails to use the correct connection&lt;/p&gt;

&lt;p&gt;Doctrine_Core::getTable()&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($componentName)-&amp;gt;getTable($componentName);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the binding is done &lt;b&gt;after&lt;/b&gt; the call to getConectionForComponent, as it&apos;s getTable that will ultimately cause the autoloader to pull in the table classes.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11502">DC-740</key>
            <summary>issue with multiple connection handling</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pookey">Ian P. Christian</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 07:14:23 +0000</created>
                <updated>Tue, 16 Nov 2010 03:08:32 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>6</watches>
                        <comments>
                    <comment id="13336" author="jwage" created="Wed, 16 Jun 2010 08:03:16 +0000"  >&lt;p&gt;Hmm, why is the autoloading of sfGuardUser failing? I don&apos;t understand that part. If it is failing do you get a cannot load class error?&lt;/p&gt;</comment>
                    <comment id="13339" author="pookey" created="Wed, 16 Jun 2010 08:46:34 +0000"  >&lt;p&gt;The reason no autoload error is throw, is because symfony&apos;s autoloader loads the class for you, but it does it at the getTable() call, which as seen below from Doctrine_Core::getTable(), it&apos;s proxied though the connection - which is created &lt;b&gt;before&lt;/b&gt; the gable is instanced, which of when the file is actaully loaded.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($componentName)-&amp;gt;getTable($componentName);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13342" author="pookey" created="Wed, 16 Jun 2010 10:00:05 +0000"  >&lt;p&gt;Just to expand on this...&lt;/p&gt;

&lt;p&gt;This obviously gets called when a call to getTable is made:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getConnectionForComponent($componentName)
    {
        Doctrine_Core::modelsAutoload($componentName);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_bound[$componentName])) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getConnection($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_bound[$componentName]);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getCurrentConnection();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The autoload fails, as you can see from the code...&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function modelsAutoload($className)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (class_exists($className, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) || interface_exists($className, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! self::$_modelsDirectory) {
            $loadedModels = self::$_loadedModelFiles;

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($loadedModels[$className]) &amp;amp;&amp;amp; file_exists($loadedModels[$className])) {
                require $loadedModels[$className];

                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            $class = self::$_modelsDirectory . DIRECTORY_SEPARATOR . str_replace(&apos;_&apos;, DIRECTORY_SEPARATOR, $className) . &apos;.php&apos;;

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (file_exists($class)) {
                require $class;

                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
            }
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$_modelsDirectory is never set, and $_loadedModelFiles is an empty array.   The $_modelsDirectory, even if set, wouldn&apos;t handle loading for plugins, which put their models in places like lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUser.class.php.&lt;/p&gt;</comment>
                    <comment id="13346" author="pookey" created="Wed, 16 Jun 2010 11:34:48 +0000"  >&lt;p&gt;This was not a problem before r7668 (at least, not for most use cases)....&lt;/p&gt;

&lt;p&gt;It used to be that null was passed as the first arg in the D_Query::create() method call, causing the query to figure out itself which connection to use, which was done after the component was bound, so that&apos;s fine!&lt;/p&gt;

&lt;p&gt;However, the code below is how it is in the current head&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function createQuery($alias = &apos;&apos;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($alias)) {
            $alias = &apos; &apos; . trim($alias);
        }

        $class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_QUERY_CLASS);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Query::create($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn, $class)
            -&amp;gt;from($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getComponentName() . $alias);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here , the connection of the table (as explained above is previously set incorerctly) is passed to the query.&lt;/p&gt;</comment>
                    <comment id="13347" author="pookey" created="Wed, 16 Jun 2010 12:43:49 +0000"  >&lt;p&gt;I&apos;ve found a work around to this, not sure if it&apos;s a desirable fix though...&lt;/p&gt;

&lt;p&gt;In the project configuration class, I&apos;ve added this to the setup()&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher-&amp;gt;connect(&apos;doctrine.configure&apos;, array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;, &apos;doctrineBinder&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;and the following method is also added, were I&apos;m manually doing my bindings...&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function doctrineBinder(sfEvent $event)
  {
    $manager = Doctrine_Manager::getInstance();
    $manager-&amp;gt;bindComponent(&apos;sfGuardUser&apos;, &apos;nosp&apos;);
    $manager-&amp;gt;bindComponent(&apos;Incident&apos;, &apos;nosp&apos;);
    $manager-&amp;gt;bindComponent(&apos;ServiceIp&apos;, &apos;ip&apos;);

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

&lt;p&gt;The overhead here isn&apos;t really that high (it just sets an element in the array)  - I&apos;d also wonder if a bindComponents($array); should be added to simplify this call, but that&apos;s another method.&lt;/p&gt;</comment>
                    <comment id="13523" author="pluk77" created="Tue, 6 Jul 2010 10:41:36 +0000"  >&lt;p&gt;After a long and hard look at the sfDoctrinePlugin and Doctrine code I can to the same conclusion. The Doctrine autoload is not working in sfDoctrinePlugin. I think this is more a &lt;a href=&quot;http://trac.symfony-project.org/ticket/7689&quot; class=&quot;external-link&quot;&gt;sfDoctrinePlugin bug&lt;/a&gt; than a Doctrine bug.&lt;/p&gt;

&lt;p&gt;Instead of manual binding, a better way is the actually make sure the intended flow of the code is working like it should be.&lt;/p&gt;

&lt;p&gt;To be able to use sfDoctrineGuard with multiple connections you need to ensure that the connection name is added to the Schema of sfDoctrineGuard. Once this is done, rebuilding the model will put a bindComponent in the class files.&lt;/p&gt;

&lt;p&gt;This works fine if the autoload is working like it should.&lt;/p&gt;

&lt;p&gt;To get the autoload to work, you can extend the autoload function of Doctrine_Core in Doctrine:&lt;/p&gt;

&lt;p&gt;The Doctrine.php file is empty by default, so its easy to add your code to it (until the problem is fixed without having to edit Doctrine code)&lt;/p&gt;

&lt;p&gt;lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine.php:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
class Doctrine extends Doctrine_Core
{
  public static function modelsAutoload($className)
  {
    sfAutoload::getInstance()-&amp;gt;autoload($className);

    parent::modelsAutoload($className);
  }
  
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="13525" author="pluk77" created="Tue, 6 Jul 2010 11:17:54 +0000"  >&lt;p&gt;Sorry... the above does not work.&lt;/p&gt;

&lt;p&gt;Doctrine_Core-&amp;gt;autoload() is called and not Doctrine-&amp;gt;autoload().&lt;/p&gt;

&lt;p&gt;sfAutoload::getInstance()-&amp;gt;autoload($className);&lt;/p&gt;

&lt;p&gt;can be added to Doctrine_Core line 1133&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;public static function modelsAutoload($className)
    {
        if (class_exists($className, false) || interface_exists($className, false)) {
            return false;
        }

        sfAutoload::getInstance()-&amp;gt;autoload($className);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13526" author="pluk77" created="Tue, 6 Jul 2010 11:26:04 +0000"  >&lt;p&gt;Oh, and to make sfDoctrineGuard work properly, you might have to ensure the sfBasicSecurityUser is bound to the correct model.&lt;/p&gt;

&lt;p&gt;You can do this in plugins\sfDoctrineGuardPlugin\lib\user\sfGuardSecurityUser.class.php or in apps\xxxxx\lib\myUser.class.php&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;sfGuardUser&apos;, &apos;connectionName&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                    <comment id="13532" author="pluk77" created="Wed, 7 Jul 2010 06:05:39 +0000"  >&lt;p&gt;The patch to Doctrine_Core&lt;/p&gt;

&lt;p&gt;This is a hack that only works when used in sfDoctrinePlugin / Symfony&lt;/p&gt;

&lt;p&gt;Not intended as the final patch to fix this bug but as a work around to make multiple connections usable.&lt;/p&gt;</comment>
                    <comment id="13542" author="pookey" created="Thu, 8 Jul 2010 05:57:47 +0000"  >&lt;p&gt;This effects migrations too it seems:&lt;/p&gt;

&lt;p&gt;Even doing this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    $manager = Doctrine_Manager::getInstance();                                                          
    $manager-&amp;gt;bindComponent(&apos;ChangeRequest&apos;, &apos;nosp&apos;);                                                    
    $manager-&amp;gt;bindComponent(&apos;change_request&apos;, &apos;nosp&apos;);                                                   
class Addstatetochangerequest &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Migration_Base                                            
{                                                                                                        
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()                                                                                   
  {                                                                                                      
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addColumn(&apos;change_request&apos;, &apos;change_state&apos;, &apos;&lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt;&apos;, array(&apos;values&apos; =&amp;gt; array(&apos;draft&apos;, &apos;submitted&apos;, &apos;approved&apos;, &apos;rejected&apos;, &apos;closed&apos;)));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This results in:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
# ./symfony doctrine:migrate
&amp;gt;&amp;gt; doctrine  Migrating from version 0 to 1
                                                                                                                                                                                    
  The following errors occurred:                                                                                                                                                    
                                                                                                                                                                                    
   - SQLSTATE[42S02]: Base table or view not found: 1146 Table &apos;nosp_test_radius2.change_request&apos; doesn&apos;t exist. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;ALTER TABLE change_request ADD change_state TEXT&quot;&lt;/span&gt;  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The database attempted to be used there is not the correct one.&lt;/p&gt;
</comment>
                    <comment id="14465" author="pluk77" created="Mon, 27 Sep 2010 03:03:15 +0000"  >&lt;p&gt;second required patch to make Symfony work with 2 concurrent databases&lt;/p&gt;</comment>
                    <comment id="14592" author="zhekanax" created="Thu, 21 Oct 2010 14:30:47 +0000"  >&lt;h5&gt;&lt;a name=&quot;Anotherbadwaytogetitworkinginsymfony%3A&quot;&gt;&lt;/a&gt;Another bad way to get it working in symfony:&lt;/h5&gt;
&lt;p&gt;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;ProjectConfiguration.class.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function configureDoctrine(Doctrine_Manager $manager)
  {
    $files = sfFinder::type(&apos;file&apos;)
      -&amp;gt;maxdepth(0)
      -&amp;gt;not_name(&apos;*Table.class.php&apos;)
      -&amp;gt;name(&apos;*.class.php&apos;)
      -&amp;gt;in(sfConfig::get(&apos;sf_lib_dir&apos;) . &apos;/model/doctrine&apos;);

    foreach ($files as $file) {
      $class_name = str_replace(&apos;.class.php&apos;, &apos;&apos;, basename($file));
      Doctrine_Core::loadModel($class_name, $file);
    }
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14744" author="ddebree" created="Tue, 16 Nov 2010 03:08:32 +0000"  >&lt;p&gt;I found that if I changed the getTable function inside the Core.php file it seemed to work. Basically it forces the autoloader to load the object file, and when it does this it runs the bound connection statement to bind a table to a connection. &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Core.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
     * Get the Doctrine_Table object &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the passed model
     *
     * @param string $componentName
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Table
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; function getTable($componentName)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!class_exists($componentName)) {
            &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $componentName();
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($componentName)-&amp;gt;getTable($componentName);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10689" name="doctrine_core.patch" size="758" author="pluk77" created="Wed, 7 Jul 2010 06:05:39 +0000" />
                    <attachment id="10814" name="doctrine_manager.patch" size="1560" author="pluk77" created="Mon, 27 Sep 2010 03:03:15 +0000" />
                </attachments>
            <subtasks>
            <subtask id="11178">DC-618</subtask>
        </subtasks>
        </item>

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

&lt;p&gt;Now suppose you have a schema like this, with a &lt;b&gt;string&lt;/b&gt; primary column.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Client:
  columns:
    serial:    { type: string(50), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    name:      { type: string(36), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That&apos;s fine, but causes problems with MySQL where the column is created with a default value of &quot;&quot; (empty string) and not &amp;lt;none&amp;gt;.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE client (serial VARCHAR(50), name VARCHAR(36) NOT NULL, PRIMARY KEY(serial)) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note that the 2nd column is well defined and has &amp;lt;none&amp;gt; as default value (as seen from phpMyAdmin).&lt;/p&gt;

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

&lt;p&gt;After that the SQL code is like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE client (serial VARCHAR(50) NOT NULL, name VARCHAR(36) NOT NULL, PRIMARY KEY(serial)) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3.1, WinXP-SP3, Doctrine 1.2.2, MySQL 5.1.41</environment>
            <key id="11422">DC-708</key>
            <summary>Wrong definition for MySQL string primary column</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicorac">Claudio Nicora</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 May 2010 08:41:16 +0000</created>
                <updated>Mon, 12 Jul 2010 16:32:44 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13078" author="nicorac" created="Fri, 28 May 2010 09:08:46 +0000"  >&lt;p&gt;Attached a better patch where the &lt;b&gt;notnull&lt;/b&gt; attribute is removed only if the primary column type is &lt;b&gt;string&lt;/b&gt;&lt;/p&gt;</comment>
                    <comment id="13079" author="nicorac" created="Fri, 28 May 2010 09:25:01 +0000"  >&lt;p&gt;The same behaviour happens even for integer columns, so the &lt;b&gt;notnull&lt;/b&gt; attribute should never be removed, not only for string columns. New patch attached, old one removed.&lt;/p&gt;</comment>
                    <comment id="13145" author="jwage" created="Tue, 8 Jun 2010 09:58:05 +0000"  >&lt;p&gt;The patch I see currently just comments out the offending code. Is that intended? It cannot be committed if so &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="13155" author="nicorac" created="Tue, 8 Jun 2010 10:33:26 +0000"  >&lt;p&gt;My patch only removed the effect, but it&apos;s not surely the best solution.&lt;/p&gt;

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

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

<item>
            <title>[DC-1006] Custom geometric query error with orderBy</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1006</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Mi Doctrine_Query with this Geometric Query fails with orderBy , but with where works.&lt;/p&gt;

&lt;p&gt;$distance = &quot;glength(linestringfromwkb(linestring(GeomFromText(&apos;POINT( &quot;.$object-&amp;gt;getLatitude().&quot; &quot;.$object-&amp;gt;getLongitude() .&quot;)&apos;),l.point))) &quot;&lt;/p&gt;

&lt;p&gt;This works:&lt;br/&gt;
SomeObjectTable::getInstance()&lt;del&gt;&amp;gt;createQuery()&lt;/del&gt;&amp;gt;where($distance.&apos; &amp;lt; ?&apos;,0.05 )&lt;/p&gt;

&lt;p&gt;But this one fails at version 1.2.4, with older version was working.&lt;br/&gt;
SomeObjectTable::getInstance()&lt;del&gt;&amp;gt;createQuery()&lt;/del&gt;&amp;gt;where($distance.&apos; &amp;lt; ?&apos;,0.05 )-&amp;gt;orderBy($distance)&lt;/p&gt;

&lt;p&gt;Well the problem is at line 74 of OrderBy.php :&lt;br/&gt;
$componentAlias = implode(&apos;.&apos;, $e);&lt;/p&gt;



&lt;p&gt;the rendered query in the distance has some &quot;.&quot;, for example:&lt;br/&gt;
POINT( -34.470829 -58.5286102)&lt;/p&gt;

&lt;p&gt;then the after line 74 in OrderBy tries to search por &apos;58&apos; class.&lt;/p&gt;

&lt;p&gt;I manually added to DataDict in Mysql.php the POINT datatype (this fix solve me the problem in older versions of Doctrine).&lt;/p&gt;
</description>
                <environment>Symfony 1.4.11 and Doctrine 1.2.4. Ubuntu 11.04 Apache2 with mod php5. php5 version PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch </environment>
            <key id="12659">DC-1006</key>
            <summary>Custom geometric query error with orderBy</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="llazzaro">Leonardo Lazzaro</reporter>
                        <labels>
                    </labels>
                <created>Sun, 22 May 2011 19:41:17 +0000</created>
                <updated>Sun, 22 May 2011 19:41:17 +0000</updated>
                                    <version>1.2.4</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Attributes</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-803] Syntax error in MySQL migration to drop constraint (patch supplied)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-803</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a migration that adds constraints correctly. When migrating down, however, I get a syntax error&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;ErrorMessage&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  Error #1 - 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;CONSTRAINT unique_username_idx&apos; at line 1. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;ALTER TABLE conUser DROP CONSTRAINT unique_username_idx&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the down migration:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;DownMigration&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 down() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropConstraint(&apos;conUser&apos;, &apos;unique_username_idx&apos;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The SQL generated is &quot;ALTER TABLE conUser &lt;b&gt;DROP CONSTRAINT&lt;/b&gt; unique_username_idx&quot;. This post (&lt;a href=&quot;http://forums.mysql.com/read.php?98,70887,70974#msg-70974&quot; class=&quot;external-link&quot;&gt;http://forums.mysql.com/read.php?98,70887,70974#msg-70974&lt;/a&gt;) suggests that in MySQL the syntax should be &quot;ALTER TABLE conUser &lt;b&gt;DROP INDEX&lt;/b&gt; unique_username_idx&quot; as constraints are basically indexes in MySQL (unlike MSSQL and Oracle). Doctrine&apos;s lib/Doctrine/Export/MySql.php appears to have a syntax error in the dropConstraint method. I attach a patch for this, but the only change is replacing &quot;$name = &apos;CONSTRAINT &apos;&quot; with &quot;$name = &apos;INDEX &apos;&quot; in dropConstraint. The migration then runs as I would expect.&lt;/p&gt;

&lt;p&gt;Sorry if this has been fixed elsewhere, I did a search but couldn&apos;t find a similar ticket.&lt;/p&gt;</description>
                <environment>Debian, PHP 5.3.2, MySQL</environment>
            <key id="11694">DC-803</key>
            <summary>Syntax error in MySQL migration to drop constraint (patch supplied)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boxgav">Gavin Davies</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Jul 2010 11:56:23 +0000</created>
                <updated>Thu, 29 Jul 2010 11:58:16 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13729" author="boxgav" created="Thu, 29 Jul 2010 11:58:16 +0000"  >&lt;p&gt;fixing syntax&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10713" name="SyntaxFixForMySQLDropConstraintInExport.patch" size="656" author="boxgav" created="Thu, 29 Jul 2010 11:56:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>