<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 11:57:34 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+ORDER+BY+component+ASC%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+AND+resolution+%3D+Unresolved+ORDER+BY+component+ASC%2C+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="464" total="464"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-1050] Doctrine_Relation_ForeignKey ignores ATTR_COLL_KEY attribute</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1050</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Relation_ForeignKey::fetchRelatedFor() executes the following code at line 70:&lt;/p&gt;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;$related = $this-&amp;gt;getTable()&lt;del&gt;&amp;gt;getConnection()&lt;/del&gt;&amp;gt;query($dql, $id)-&amp;gt;getFirst();&lt;/p&gt;</description>
                <environment>Windows 7 64Bit&lt;br/&gt;
PHP 5.3&lt;br/&gt;
Symfony 1.4</environment>
            <key id="13506">DC-1050</key>
            <summary>Doctrine_Relation_ForeignKey ignores ATTR_COLL_KEY attribute</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fishbone">Uli Hecht</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Mar 2012 22:55:02 +0000</created>
                <updated>Wed, 7 Mar 2012 13:02:40 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Attributes</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17534" author="fishbone" created="Wed, 7 Mar 2012 13:02:40 +0000"  >&lt;p&gt;Suggested patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11167" name="ForeignKey.php.patch" size="642" author="fishbone" created="Wed, 7 Mar 2012 13:02:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-903] Make Doctrine_Record_UnknownPropertyException error more descriptive</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-903</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I have a Doctrine object and I try something like $book-&amp;gt;getNonexistantThing(), I always get an error like this:&lt;br/&gt;
PHP Fatal error:  Class &apos;Doctrine_Record_UnknownPropertyException&apos; not found in /home/jason/projects/mcif/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record/Filter/Standard.php on line 55&lt;/p&gt;

&lt;p&gt;It makes it hard to track down the source of the error. Why not have the error include the offending method call?&lt;/p&gt;</description>
                <environment>Ubuntu 10.10</environment>
            <key id="12040">DC-903</key>
            <summary>Make Doctrine_Record_UnknownPropertyException error more descriptive</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jasonswett">Jason Swett</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Oct 2010 14:46:49 +0000</created>
                <updated>Thu, 28 Oct 2010 14:46:49 +0000</updated>
                                                                    <component>Attributes</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-949] (patch)allow Native floats and double precision field types for MySQL, Oracle, Pgsql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-949</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This creates a new attribute constant Doctrine_Core::ATTR_USE_NATIVE_FLOAT and Doctrine_Core::ATTR_USE_NATIVE_DOUBLE.  This will allow the setting of attributes of use_native_float = true and use_native_double = true.  With these set to true in MySQL  of the generated sql will no longer Make FLOAT(18,2) and will make it just FLOAT that is a true floating point the same thing with DOUBLE except it is now a true double precision floating point. &lt;/p&gt;

&lt;p&gt;Proper adjustments are also made to MySQL, Oracle and Postgresql to use native floating point declarations to define both single and double precision floating point data types. &lt;/p&gt;

&lt;p&gt;I have attached a patch to fix the floating point field types. &lt;/p&gt;</description>
                <environment>Os Independent, MySQL, Oracle, Postgresql</environment>
            <key id="12214">DC-949</key>
            <summary>(patch)allow Native floats and double precision field types for MySQL, Oracle, Pgsql</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mblackmer">Max Blackmer</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Dec 2010 18:11:08 +0000</created>
                <updated>Thu, 9 Dec 2010 18:53:19 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Attributes</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14940" author="mblackmer" created="Thu, 9 Dec 2010 18:34:58 +0000"  >&lt;p&gt;Quote from MySQL Manual &quot;For maximum portability, code requiring storage of approximate numeric data values should use FLOAT or DOUBLE PRECISION with no specification of precision or number of digits&quot;  &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10890" name="doctrine-1.2-native-float.patch" size="4643" author="mblackmer" created="Thu, 9 Dec 2010 18:11:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-383] Migrations not respecting ATTR_TBLNAME_FORMAT</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-383</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using Doctrine 1.2.1 and Migrations don&apos;t appear to respect Doctrine::ATTR_TBLNAME_FORMAT when creating or dropping tables.  This means while models create/drop tables with prefixes migrations don&apos;t.  Also the migration_version table is created without the prefix too even though it was apparently fixed in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-245&quot; title=&quot;Table name prefix for table migration_version&quot;&gt;&lt;del&gt;DC-245&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I haven&apos;t tested but it also probably means other attributes like Doctrine::ATTR_IDXNAME_FORMAT and Doctrine::ATTR_SEQNAME_FORMAT are not obeyed either which makes things a little confusing knowing when to care for prefixes or not.&lt;/p&gt;</description>
                <environment>Debian 5, Apache 2, PHP 5.2.9, MySQL 5.1</environment>
            <key id="10658">DC-383</key>
            <summary>Migrations not respecting ATTR_TBLNAME_FORMAT</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Dec 2009 13:25:38 +0000</created>
                <updated>Fri, 28 May 2010 06:13:28 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Attributes</component>
                <component>Migrations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13075" author="eman" created="Fri, 28 May 2010 06:13:28 +0000"  >&lt;p&gt;Simple patch to set the table name inside constructor&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10615" name="migration_table_prefix_doctrine_1.2.patch" size="424" author="eman" created="Fri, 28 May 2010 06:13:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-388] Conservative loading not working</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-388</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Apparently, when setting  Doctrine::MODEL_LOADING_CONSERVATIVE things like Doctrine_Core::createTablesFromModels() don&apos;t work.  Have to enable aggressive model loading.  This has been confirmed on the doctrine-user mailing list.&lt;/p&gt;

&lt;p&gt;I took a brief look at the code: I may be missing something but it appears there may be a logic difference in the conservative vs. aggressive model loading method.  Aggressive loading uses require_once on all files in the model directory and tries to determine the name of the class inside the file (by doing a difference on the loaded classes).  This logic makes sense since the class and file name do not have to match.&lt;/p&gt;

&lt;p&gt;However, conservative loading just tries to calculate the class name and store it in an array for later loading by the autoloader.  This means there is a huge logic difference in behaviour between these two loading methods since the model class files actually must differ depending on case (specifically, the model class file name must follow a specific format to match the actual class name) otherwise the autoload array will never know the correct name of the class.&lt;/p&gt;

&lt;p&gt;I would also like to comment that overall, require_once is a poor choice for performance reasons, it&apos;s vastly slower than include_once, but overall the logic should better be adjusted to use plain include (if possible), for performance reasons.&lt;/p&gt;</description>
                <environment>Apache 2, MySQL 5.1, PHP 5.2.9, Debian 5</environment>
            <key id="10663">DC-388</key>
            <summary>Conservative loading not working</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Dec 2009 03:00:22 +0000</created>
                <updated>Wed, 27 Jan 2010 23:53:07 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Attributes</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;First create a column cat_id on category of integer type. Then run the following migration:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;migration.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;changeColumn(&apos;category&apos;, &apos;cat_id&apos;, &apos;integer&apos;, &apos;4&apos;, array(
             &apos;unsigned&apos; =&amp;gt; &apos;&apos;,
             &apos;primary&apos; =&amp;gt; &apos;1&apos;,
             &apos;autoincrement&apos; =&amp;gt; &apos;1&apos;,
             ));
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Instead of using type SERIAL doctrine would have to simply alter the column then add a sequence on it&apos;s own.&lt;/b&gt;&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4</environment>
            <key id="11796">DC-834</key>
            <summary>When altering an existing column PGSQL can&apos;t convert to SERIAL for autoincrement</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="webpragmatist">webPragmatist</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Aug 2010 12:36:45 +0000</created>
                <updated>Wed, 18 Aug 2010 12:36:45 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Attributes</component>
                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-852] CLONE -Fix returned type value : SQL integers to PHP integers when getting a value from the database.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-852</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;I have a request for you to improve Doctrine. When declaring a column as an integer, it seems that Doctrine returns a string when getting the value of that column. For example, if I have a &quot;status&quot; column, which can take 0, 1 or 2 as its value, Doctrine will return these values as string, which is not really logical and returning the good PHP type is the goal of an ORM. I&apos;m fond of the triple equal symbol to test a value and I did not understand why this did not work at start :&lt;/p&gt;

&lt;p&gt;// in my myModel class&lt;br/&gt;
class myModel extends Doctrine_Record&lt;br/&gt;
{&lt;br/&gt;
  const STATUS_VALIDATED = 1;&lt;/p&gt;

&lt;p&gt;  public function isValidated()&lt;/p&gt;
  {
    return self::STATUS_VALIDATED === $this-&amp;gt;getStatus();
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;That&apos;s why getStatus() gives me a string instead of an integer, whereas the column is declared as an integer in my schema. I&apos;m forced to cast myself the returned value of getStatus() in my model.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11863">DC-852</key>
            <summary>CLONE -Fix returned type value : SQL integers to PHP integers when getting a value from the database.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Sep 2010 08:19:12 +0000</created>
                <updated>Thu, 2 Sep 2010 08:11:23 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Attributes</component>
                <component>Data Fixtures</component>
                <component>Native SQL</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14214" author="enrico" created="Wed, 1 Sep 2010 11:38:05 +0000"  >&lt;p&gt;Proposal for a solution: &lt;a href=&quot;http://github.com/estahn/doctrine1/compare/master...DC-852&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/master...DC-852&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14225" author="jwage" created="Wed, 1 Sep 2010 14:46:04 +0000"  >&lt;p&gt;So if you enable this attribute you live with the fact that casting a string to an integer that is longer than php max integer will give weird results?&lt;/p&gt;</comment>
                    <comment id="14235" author="enrico" created="Thu, 2 Sep 2010 08:11:23 +0000"  >&lt;p&gt;i&apos;m far from happy with this solution. if an integer that is greater than php max int gets casted it will be casted into a value of type double. if you enable that attribute only values that could successfully casted into an integer will be casted otherwise an exception will be thrown.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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



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

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

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

<item>
            <title>[DC-418] Inherited models creating NOT NULL restrictions on their parents</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-418</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;to reproduce, create the yaml included in sample.yaml (Note the not-null columns in each subclass)&lt;/p&gt;

&lt;p&gt;if you try to save an OnlineProduct without setting copyright_year, or if you create a print_product without setting website_branding_id, then you will get a not null error.&lt;br/&gt;
Inherited tables should be able to set their own NOT NULL columns without affecting other tables in the inheritance tree (should be handled in the preSave() method? or is there another mechanism?)&lt;/p&gt;</description>
                <environment>Linux skywalker-9 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux&lt;br/&gt;
</environment>
            <key id="10713">DC-418</key>
            <summary>Inherited models creating NOT NULL restrictions on their parents</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="jlukescott">luke scott</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 18:17:58 +0000</created>
                <updated>Mon, 11 Jan 2010 18:19:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Attributes</component>
                <component>Inheritance</component>
                <component>Record</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11365" author="jlukescott" created="Mon, 11 Jan 2010 18:19:57 +0000"  >&lt;p&gt;YAML format was destroyed during copy &amp;amp; paste!&lt;br/&gt;
I&apos;m attaching the sample yaml, instead of including it in the description&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10279" name="sample.yaml" size="911" author="jlukescott" created="Mon, 11 Jan 2010 18:19:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-710] doctrine:build-model does not create phpdoc for doctrine builtin attributes (sluggable, timestampable, id)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-710</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When defining a table with actAs attributes (Timestampable, Sluggable, ...) doctrine creates columns in the database and corresponding attributes in the model classes, but the PHPDOC in the model classes does not include getters and setters for these &quot;automatic&quot; attributes.&lt;br/&gt;
 This is unconvenient when using an IDE as the getter are not present in the auto completion.&lt;/p&gt;

&lt;p&gt; The enhancement would be to add the appropriate phpdoc @property tags so that symfony can generate all the @method tags.&lt;/p&gt;

&lt;p&gt;see &lt;a href=&quot;http://trac.symfony-project.org/ticket/8711&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8711&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

&lt;p&gt;Kevin Hatry&lt;/p&gt;</description>
                <environment></environment>
            <key id="11426">DC-710</key>
            <summary>doctrine:build-model does not create phpdoc for doctrine builtin attributes (sluggable, timestampable, id)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kevinhatry">Kevin Hatry</reporter>
                        <labels>
                    </labels>
                <created>Sat, 29 May 2010 14:58:11 +0000</created>
                <updated>Tue, 8 Jun 2010 09:51:21 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Attributes</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13143" author="jwage" created="Tue, 8 Jun 2010 09:51:21 +0000"  >&lt;p&gt;I don&apos;t think this is a problem that can be patched easily, unfortunately.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-839] Version classes not built for models using package attribute</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-839</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For models using the &apos;package&apos; attribute in the schema definition, the version classes do not get created. However, the version table gets created.&lt;/p&gt;

&lt;p&gt;There is no problem during the build, but when loading fixtures, there is a fatal error: Class TaxCodeVersion not found&lt;/p&gt;

&lt;p&gt;TaxCode:&lt;br/&gt;
  package: Masters&lt;br/&gt;
  tableName: Fin_Tax_Codes&lt;br/&gt;
  actAs:&lt;br/&gt;
    Activateable: ~&lt;br/&gt;
    SoftDelete: ~&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Versionable:&lt;/li&gt;
	&lt;li&gt;tableName: fin_tax_codes_version
	&lt;ol&gt;
		&lt;li&gt;versionColumn: version&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
	&lt;li&gt;className: %CLASS%Version
	&lt;ol&gt;
		&lt;li&gt;auditLog: true&lt;br/&gt;
    Auditable: ~&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
.......&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment>PHP 5.2.3 / Symfony 1.4.6</environment>
            <key id="11819">DC-839</key>
            <summary>Version classes not built for models using package attribute</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="prasadgupte">Prasad Gupte</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Aug 2010 08:51:41 +0000</created>
                <updated>Tue, 8 Mar 2011 11:06:47 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15475" author="hetsch" created="Tue, 8 Mar 2011 11:06:47 +0000"  >&lt;p&gt;Same here,&lt;/p&gt;

&lt;p&gt;If i use this yaml file:&lt;/p&gt;


&lt;p&gt;Page:&lt;br/&gt;
  actAs: &lt;br/&gt;
    NestedSet:&lt;br/&gt;
      hasManyRoots: true&lt;br/&gt;
      rootColumnName: root_id&lt;br/&gt;
    Versionable:&lt;br/&gt;
      versionColumn: version&lt;br/&gt;
      className: %CLASS%Version&lt;br/&gt;
      auditLog: true&lt;br/&gt;
    Timestampable:&lt;br/&gt;
      created:&lt;br/&gt;
        name: created_at&lt;br/&gt;
        type: timestamp&lt;br/&gt;
        format: Y-m-d H&lt;br/&gt;
      updated:&lt;br/&gt;
        name: updated_at&lt;br/&gt;
        type: timestamp&lt;br/&gt;
        format: Y-m-d H&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;  &lt;br/&gt;
  columns:&lt;br/&gt;
    name: string(255)&lt;/p&gt;

&lt;p&gt;PageVersion and PageTranslation Models don&apos;t get generated if i use &apos;build-models-yaml&apos;. Have to create the Models manually then it works fine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-922] master-slave replication with i18n behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-922</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to use sfDoctrineMasterSlavePlugin for database replication with Symfony  1.4 and PHP 5.3. But facing problem while selecting I18n records and receiving &quot;Unknown relation alias Translation&quot; error.&lt;/p&gt;

&lt;p&gt;I&apos;ve also tried same with implementation solution given in master-slave chapter of doctrine cookbook but no success. &lt;/p&gt;

&lt;p&gt;Is anyone facing same problem with sfDoctrineMasterSlavePlugin and i18n behavio? Is there any solution of the problem?&lt;/p&gt;</description>
                <environment>php 5.3, doctrine 1.2, Symfony 1.4, mysql</environment>
            <key id="12088">DC-922</key>
            <summary>master-slave replication with i18n behavior</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="husen">husen mankada</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 02:34:37 +0000</created>
                <updated>Wed, 10 Nov 2010 02:34:37 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-371] Lazy loading - doctrine makes extra queries into db</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-371</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Just downloaded symfony 1.4&lt;/p&gt;

&lt;p&gt;First of all I have a query:&lt;/p&gt;

&lt;p&gt;                $q = \Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&apos;u.&lt;b&gt;, ur.&lt;/b&gt;&apos;)&lt;br/&gt;
                    -&amp;gt;from(&apos;UserDb u&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.RealUserDetailsDb ur&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.MockUserDetailsDb um&apos;)&lt;br/&gt;
                    -&amp;gt;where(&apos;u.id = :user_id&apos;)&lt;br/&gt;
                ;&lt;br/&gt;
                $user = $q-&amp;gt;fetchOne(array(&apos;:user_id&apos; =&amp;gt; $uid));&lt;/p&gt;

&lt;p&gt;After that I&apos;m accessing the fields of this object:&lt;/p&gt;

&lt;p&gt;                $userArray = array(&lt;br/&gt;
                    &apos;id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getId(),&lt;br/&gt;
                    &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId(),&lt;br/&gt;
                    &apos;mock_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getMockUserDetailsId(),&lt;br/&gt;
                    &apos;real_user_details&apos; =&amp;gt; array(),&lt;br/&gt;
                    &apos;mock_user_details&apos; =&amp;gt; array()&lt;br/&gt;
                );&lt;/p&gt;

&lt;p&gt;This is the actual queries into DB:&lt;/p&gt;

&lt;p&gt;NR1:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;&lt;em&gt;user_mock_id, u2.id AS u2&lt;/em&gt;&lt;em&gt;id, u2.nickname AS u2&lt;/em&gt;&lt;em&gt;nickname, u2.email AS u2&lt;/em&gt;_email FROM user u LEFT JOIN user_real u2 ON u.user_real_id = u2.id LEFT JOIN user_mock u3 ON u.user_mock_id = u3.id WHERE (u.id = :user_id)&lt;/p&gt;

&lt;p&gt;NR2:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;_user_mock_id FROM user u WHERE (u.id = &apos;1&apos;) LIMIT 1&lt;/p&gt;

&lt;p&gt;As you can see there are TWO queries however there should be only one query. The problem is that u.user_real_id is NULL in database and when I do  &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId() doctrine does not have enough intelligence to understand that these fields have been already requested in NR1. If I comment this field, everything works well. &lt;/p&gt;

&lt;p&gt;SURPRISE! &lt;br/&gt;
And now a surprise... if I modify a little bit my first query: &quot;&lt;del&gt;&amp;gt;select(&apos;u.&lt;b&gt;&apos;)&quot; instead of , &quot;&lt;/del&gt;&amp;gt;select(&apos;u.&lt;/b&gt;,  ur.*&apos;)&quot; it WON&apos;T make TWO queries. It will make ONLY ONE!&lt;/p&gt;

&lt;p&gt;As you understand this a very critical bug and of course our system won&apos;t go to production with this bug. &lt;/p&gt;

&lt;p&gt;P.S. Is it possible to turn off the lazy loading in doctrine?&lt;/p&gt;</description>
                <environment>Symfony 1.4, Doctrine Version: 1.2.0-BETA3</environment>
            <key id="10636">DC-371</key>
            <summary>Lazy loading - doctrine makes extra queries into db</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drapeko">Roman Drapeko</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Dec 2009 22:53:48 +0000</created>
                <updated>Thu, 23 Dec 2010 20:22:10 +0000</updated>
                                    <version>1.2.0-BETA3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11405" author="drapeko" created="Sun, 17 Jan 2010 16:56:01 +0000"  >&lt;p&gt;Any comments? Will it be fixed??&lt;/p&gt;</comment>
                    <comment id="11893" author="jwage" created="Mon, 1 Mar 2010 15:52:49 +0000"  >&lt;p&gt;Hi, I&apos;d like to take a look but can you make a failing test case that I can run so that I can see if I can come up with a patch that fixes your case and doesn&apos;t break anything else.&lt;/p&gt;</comment>
                    <comment id="13087" author="lukis" created="Tue, 1 Jun 2010 13:11:16 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I had similar problem but after several hours i did work it out&lt;/p&gt;

&lt;p&gt;Try to make get method in your model for getting field which has NULL value in database&lt;/p&gt;

&lt;p&gt;public function getUserRealId() &lt;/p&gt;
{

  return $this-&amp;gt;_get(&quot;user_real_id&quot;, false);

}

&lt;p&gt;by making second argument false u force doctrine not to lazy load value and extra sql query is not created&lt;/p&gt;

&lt;p&gt;regards&lt;/p&gt;</comment>
                    <comment id="13207" author="jwage" created="Tue, 8 Jun 2010 16:31:53 +0000"  >&lt;p&gt;Has anyone been able to reproduce this in a test case? I am not having much luck so far.&lt;/p&gt;</comment>
                    <comment id="15001" author="gena01" created="Thu, 23 Dec 2010 20:22:10 +0000"  >&lt;p&gt;I&apos;ve seen this a ton of times. Basically when it loads related records through the Hydrator using leftJoin() and gets NULLs back. BUT it doesn&apos;t save the fact that the related records are NULL. So when you actually do call to getRelated objects it sees that it doesn&apos;t have the value cached and runs the query again.&lt;/p&gt;

&lt;p&gt;Let me know if I should show you the problem in the Doctrine code base.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-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-659] Sluggable behavior does not check uniqueness on insert if a slug is manually set, causing SQL error/crash</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-659</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Sluggable behavior has the following code:
&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;Sluggable.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * Set the slug value automatically when a record is inserted
     *
     * @param Doctrine_Event $event
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preInsert(Doctrine_Event $event)
    {
        $record = $event-&amp;gt;getInvoker();
        $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) {
            $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;However, this can lead to problems...&lt;/p&gt;

&lt;p&gt;If the user incorrectly assigns a duplicate slug to the record then there is no uniqueness checking in doctrine and you get an uncaught SQL error looking 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;SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &apos;my-slug-en_GB&apos; for key &apos;foo_i18n_sluggable_idx&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If this kind of &quot;don&apos;t do a preInsert check if I manunally set the slug&quot; behavior is a &lt;em&gt;FEATURE&lt;/em&gt; then it would be best to have an option to allow it to be disabled. If it is a &lt;em&gt;BUG&lt;/em&gt; then I would suggest that the preInsert method should be changed to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    /**
     * Set the slug value automatically when a record is inserted
     *
     * @param Doctrine_Event $event
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preInsert(Doctrine_Event $event)
    {
        $record = $event-&amp;gt;getInvoker();
        $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) {
            $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; { &lt;span class=&quot;code-comment&quot;&gt;// Still check &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; slug uniqueness when you insert
&lt;/span&gt;            $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;C&lt;/p&gt;</description>
                <environment>symfony-1.3.4 and doctrine-1.2.2</environment>
            <key id="11307">DC-659</key>
            <summary>Sluggable behavior does not check uniqueness on insert if a slug is manually set, causing SQL error/crash</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="caponica">Christian Seaman</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 May 2010 14:22:21 +0000</created>
                <updated>Tue, 5 Oct 2010 11:14:25 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13177" author="jwage" created="Tue, 8 Jun 2010 13:38:42 +0000"  >&lt;p&gt;Can you provide your changes as a patch/diff with a test case?&lt;/p&gt;</comment>
                    <comment id="14531" author="caponica" created="Tue, 5 Oct 2010 11:14:25 +0000"  >&lt;p&gt;Hi Jonathan,&lt;/p&gt;

&lt;p&gt;I&apos;m not so hot at making patches or test cases, but it should be fairly easy if you know what you&apos;re doing...&lt;/p&gt;

&lt;p&gt;Just try to create and save two records with the same hard-coded slug and the second one will fail with an ugly MySQL crash.&lt;/p&gt;

&lt;p&gt;If you add the lines&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;        } else { // Still check for slug uniqueness when you insert
            $record-&amp;gt;$name = $this-&amp;gt;buildSlugFromSlugField($record);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to the Sluggable::preInsert() method then this problem is averted and the test cases will pass.&lt;/p&gt;

&lt;p&gt;I have been running with this modification in our production version of Doctrine since I first reported this in May and it all seems to work well.&lt;/p&gt;

&lt;p&gt;If you really need me to figure out how to make a patch and test case please re-comment on this ticket and I&apos;ll see what I can do when I have some free time.&lt;/p&gt;


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

<item>
            <title>[DC-899] Expose hardDelete method on node object when SoftDelete behavior is used</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-899</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When combining SoftDelete and NestedSet behavior, there&apos;s no way of calling hardDelete method on node object. According to documentation, to peform a delete on a nested set, delete should be called in node object, which will call delete method on the object itself.&lt;/p&gt;</description>
                <environment>MySQL</environment>
            <key id="12027">DC-899</key>
            <summary>Expose hardDelete method on node object when SoftDelete behavior is used</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fvaresi">Fernando Varesi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 10:55:52 +0000</created>
                <updated>Fri, 22 Oct 2010 10:55:52 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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


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

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

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

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

<item>
            <title>[DC-878] cannot access the version models using object-&gt;CLASSNAMEVersion in v1.2.3</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-878</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Doctrine 1.1 if I said&lt;/p&gt;

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

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

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

&lt;p&gt;Here is the exact example I tried before posting:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;
Aaaaa:
    tableName: aaaaa
    columns:
        something:
            type: integer(8)
            unsigned: false
            notnull: true
            default: 0
    actAs:
        Versionable:
            versionColumn: version
            className: %CLASS%Version
            auditLog: true
            deleteVersions: true


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


abstract class BaseAaaaa extends Doctrine_Record
{

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

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

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

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

}


class Aaaaa extends BaseAaaaa
{

}


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

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

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

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP Version 5.2.10-2ubuntu6.5 ; Suhosin Patch 0.9.7 ; Ubuntu 9.10 2.6.31-22-generic x86_64 ; Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.5 with Suhosin-Patch  ; Doctrine 1.2.3</environment>
            <key id="11969">DC-878</key>
            <summary>cannot access the version models using object-&gt;CLASSNAMEVersion in v1.2.3</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hroland">Roland Huszti</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 11:21:45 +0000</created>
                <updated>Thu, 7 Oct 2010 06:14:53 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14508" author="hroland" created="Fri, 1 Oct 2010 05:18:41 +0000"  >&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;
&amp;lt;?php

class OSS_Resource_Doctrine extends Zend_Application_Resource_ResourceAbstract
{
    /**
     * Holds the Doctrine instance
     *
     * @var
     */
    protected $_doctrine;


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


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

            require_once &apos;Doctrine.php&apos;;

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

            $manager = Doctrine_Manager::getInstance();

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

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

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

            $db_profiler = new Doctrine_Connection_Profiler();

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

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

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

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

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

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

}

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

&lt;p&gt;MODEL&lt;/p&gt;

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

{


    public function setUp()

    {

        parent::setUp();

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

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


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


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

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    actAs:
        Versionable:
            versionColumn: version
            className: %CLASS%Version    # this is the default, User -&amp;gt; UserVersion , Address -&amp;gt; AddressVersion, etc.
            auditLog: true
            deleteVersions: true
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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


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

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

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


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

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

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

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


&lt;p&gt;Interestingly enough, this error is only occuring with Zend autoloader on Windows systems, but can be easily avoided with the fix like suggested above.&lt;/p&gt;</description>
                <environment>Windows Vista/7&lt;br/&gt;
PHP 5.3.1 - 5.3.3&lt;br/&gt;
Zend autoloader&lt;br/&gt;
not occuring under Ubuntu 10.05 / MacOSX</environment>
            <key id="11883">DC-858</key>
            <summary>Custom Behaviors/Templates cause autoloader errors</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="apric">apric</reporter>
                        <labels>
                    </labels>
                <created>Sat, 4 Sep 2010 11:38:30 +0000</created>
                <updated>Sat, 4 Sep 2010 19:09:33 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14277" author="jwage" created="Sat, 4 Sep 2010 19:09:33 +0000"  >&lt;p&gt;I believe this is because the Zend autoloader does not fail silently by default. I think it can be configured to check if the file exists and not throw any errors.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-958] updating Models with Intra-Table Relations cascades strangely</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-958</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sorry for the lengthy explanation, couldn&apos;t make it more straight forward:&lt;/p&gt;

&lt;p&gt;I have a model which is similiar to a nestet set but the tree structure needs to overlap:&lt;/p&gt;

&lt;p&gt;For Model A, every Object A1 can have multiple descendant objects A2 and in turn can be a descendant of multiple objects A0.&lt;/p&gt;

&lt;p&gt;Since I saw no way to do this with Nested-Set Relations (or Equal-Nested-Sets) I have set up my Model like this:&lt;/p&gt;

&lt;p&gt;modules:&lt;br/&gt;
  columns: ..&amp;lt;do not matter&amp;gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Children:&lt;br/&gt;
      class: modules&lt;br/&gt;
      refClass: modules_required&lt;br/&gt;
    Parents:&lt;br/&gt;
      class: modules&lt;br/&gt;
      refClass: modules_required&lt;/p&gt;

&lt;p&gt;modules_required:&lt;br/&gt;
  columns: &amp;lt;do not matter here, just 2 foreign key columns&amp;gt;&lt;br/&gt;
  relations:&lt;br/&gt;
    Children:&lt;br/&gt;
    Parents:&lt;/p&gt;

&lt;p&gt;I needed to specify the Relations on both tables, to use onDelete/onUpdate CASCADE rules. Generated Models look fine, just as intended.&lt;br/&gt;
(Every Class has many Children and has many Parents...)&lt;/p&gt;

&lt;p&gt;Now the strange part:&lt;br/&gt;
    When I update an object of modules (say id=18), Doctrine issues the following queries:&lt;br/&gt;
DELETE FROM modules_required WHERE (required_id = ? AND module_id IN (?, ?, ?, ?, ?)) - (18, 25, 26, 32, 34, 35) &lt;br/&gt;
// where 25 to 35 are CHILDREN of 18&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (25, 25, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (26, 26, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (32, 32, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (34, 34, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (35, 35, 10)&lt;br/&gt;
UPDATE modules_required SET required_id = ? WHERE module_id = ? AND required_id = ? - (25, 25, 12)&lt;br/&gt;
//where 10 and 12 are PARENTS of 18&lt;br/&gt;
and somewhen, Doctrine encounters an MySQL ERROR because of the previous update marathon:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;25-25&apos; for key &apos;PRIMARY&apos; &lt;/p&gt;

&lt;p&gt;The point is: &lt;br/&gt;
1. why is Doctrine trying to create self-referencing relations, and &lt;br/&gt;
2. why is it touching the relation at all, when i only did change some text fields in the object?&lt;/p&gt;

&lt;p&gt;Is there a better way to solve my problem?&lt;/p&gt;</description>
                <environment>PHP 5.3 / symfony 1.4.9</environment>
            <key id="12323">DC-958</key>
            <summary>updating Models with Intra-Table Relations cascades strangely</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12278">DC-952</parent>
                        <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Jan 2011 11:42:09 +0000</created>
                <updated>Thu, 27 Jan 2011 04:21:44 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Nested Set</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15182" author="bigbadbassman" created="Tue, 25 Jan 2011 04:37:46 +0000"  >&lt;p&gt;forgot to add something: I have done a debug run, to see why these queries are created, when there was no data modified that related to these tables:&lt;/p&gt;

&lt;p&gt;Doctrine seems to handle my structure internally as a Nested-Set, although I have not specified an actAs: NestedSet or relations: equal: true statement in the model definition.&lt;br/&gt;
Is there a way to prevent symfony from misinterpreting this?&lt;/p&gt;

&lt;p&gt;This is not a nested set, as each object can have virtually any other object either as parent or as a child, and additionaly, parent relations can span multiple tree-levels:&lt;br/&gt;
Object 2 is parent of Object 3 and 6&lt;br/&gt;
Object 3 is parent of Object 4 and 5&lt;br/&gt;
Object 4 is parent of Object 6&lt;/p&gt;

&lt;p&gt;results in: Object 6 has parents 2 and 4 (where 4 has parent 3 and 3 has parent 2 in turn)&lt;/p&gt;

&lt;p&gt;This spanning relations seems to cause the guessed nested set to fail.&lt;/p&gt;

&lt;p&gt;I simply wanted to create an m:n Relation using a Reference table and the fact that both m and n are of the same class should not consider doctrine.&lt;/p&gt;</comment>
                    <comment id="15190" author="bigbadbassman" created="Wed, 26 Jan 2011 05:36:25 +0000"  >&lt;p&gt;related to #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-329&quot; title=&quot;Problem saving Self Referencing (Nest Relations)&quot;&gt;DC-329&lt;/a&gt;:&lt;br/&gt;
seems to be the same general problem as described there. Only in DC 1.2.3, doctrine tries to delete every child-relation for some unknown reason.&lt;/p&gt;

&lt;p&gt;also the h2aEqualable mentioned there does not work, because it does not prevent symfony from issueing the delete queries. It prevents only the UPDATE-Queries, and thus circumvents the MySQL-Error.&lt;/p&gt;

&lt;p&gt;Nevertheless, data is still corrupted after object save, thus not useable in production.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-955] Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-955</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sample schema:&lt;/p&gt;

&lt;p&gt;Blog:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;Versionable, Searchable&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
   id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;   name: string&lt;br/&gt;
   text: text&lt;/p&gt;

&lt;p&gt;When dumping data of a schema with Versionable and/or Searchable Behaviour, the dump.yml will contain all data, including the *_version and *_index tables.&lt;/p&gt;

&lt;p&gt;Trying to load the same .yml file results in Duplicate-Key constraint violations, as long as the data for the *_version and *_index tables is present.&lt;br/&gt;
The import is only successfull, when the data for these tables is discarded.&lt;br/&gt;
This leads to the issue, that one can only do a dump-load cycle, when the complete version history of a Model is discarded. Which makes dump-load for such models rather useless.&lt;/p&gt;</description>
                <environment>PHP 5.3.3 / symfony 1.4.9-dev / MySQL 5.0</environment>
            <key id="12301">DC-955</key>
            <summary>Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2011 04:38:57 +0000</created>
                <updated>Fri, 14 Jan 2011 04:42:12 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Data Fixtures</component>
                <component>Import/Export</component>
                <component>Searchable</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-992] I18n - Translated fields are not deleted when record in master table is deleted</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-992</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have used I18n behavior for my application using the following:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
{
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;products&apos;);

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

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

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

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

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

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

<item>
            <title>[DC-430] I18n and inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-430</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using i18n with inheritance, the localizables fields are overrinden by the second deriving class.&lt;br/&gt;
So, the translation table is containing only fields from one of the two descending classes.&lt;/p&gt;

&lt;p&gt;The yml is below:&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  columns:&lt;br/&gt;
    email:            string(255)&lt;br/&gt;
    ...&lt;/p&gt;

&lt;p&gt;Employer:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends:  User&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;description, company&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:      &lt;br/&gt;
    company:  string(255)     &lt;br/&gt;
    description:  text&lt;/p&gt;

&lt;p&gt;Recruiter:&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;position&amp;#93;&lt;/span&gt;&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends:  User&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
  columns:&lt;br/&gt;
    position: string(255)&lt;/p&gt;</description>
                <environment>Doctrine 1.2 with Symfony 1.4</environment>
            <key id="10734">DC-430</key>
            <summary>I18n 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jwconsulting">Julien Wadin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Jan 2010 12:55:49 +0000</created>
                <updated>Fri, 15 Jan 2010 12:55:49 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-362] Doctrine fails to create correct table structure if model is named &quot;User&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-362</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When building models and database structure from YAML schema, Doctrine ignores the behaviors and relations on models if it is named &quot;User&quot;:&lt;/p&gt;

&lt;div class=&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;...

User:  
  actAs:
    Timestampable:
    Sluggable:
      unique: true
      fields: username
      canUpdate: true
  columns:
    id:
      type: integer(4)
      primary: true
      autoincrement: true
    company_id
      type: integer(4)
    timezone_id:
      type: integer(1)
    role_id:
      type: integer(1)
    email:
      type: string(255)
    username:
      type: string(255)
      unique: true
    password:
      type: string(40)
    firstname:
      type: string(255)
    lastname:
      type: string(255)
    last_login:
      type: datetime
  relations:
    Company:
      local: company_id
      foreign: id
    Timezone:
      local: timezone_id
      foreign: id
    Role:
      local: role_id
      foreign: id

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

&lt;p&gt;This creates the following table structure:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` int(11) DEFAULT NULL,
  `timezone_id` tinyint(4) DEFAULT NULL,
  `role_id` tinyint(4) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `password` varchar(40) DEFAULT NULL,
  `firstname` varchar(255) DEFAULT NULL,
  `lastname` varchar(255) DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The table structure is both missing foreign key constraints to Company, Timezone and Role. It is also missing columns &lt;tt&gt;updated_at&lt;/tt&gt; and &lt;tt&gt;created_at&lt;/tt&gt; for Timestampable behavior. The &lt;tt&gt;slug&lt;/tt&gt; column for Sluggable behavior is missing, as well.&lt;/p&gt;

&lt;p&gt;When looking at the BaseUser::setUp() method it looks as it is supposed to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;class BaseUser extends Doctrine_Record
{

    ....

    public function setUp()
    {
        parent::setUp();
        $this-&amp;gt;hasOne(&apos;Company&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;company_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $this-&amp;gt;hasOne(&apos;Timezone&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;timezone_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $this-&amp;gt;hasOne(&apos;Role&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;role_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $sluggable0 = new Doctrine_Template_Sluggable(array(
             &apos;unique&apos; =&amp;gt; true,
             &apos;fields&apos; =&amp;gt; &apos;username&apos;,
             &apos;canUpdate&apos; =&amp;gt; true,
        ));
        $this-&amp;gt;actAs($timestampable0);
        $this-&amp;gt;actAs($sluggable0);
    }

    ....

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

&lt;p&gt;So the only area where it goes wrong, is when generating the queries for creating the model tables. I don&apos;t know if the same problem appears with other model names, but it doesn&apos;t like models named &quot;User&quot;.&lt;/p&gt;

&lt;p&gt;If I rename the model to &quot;Person&quot; and rebuild, it all works perfectly as it should.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6.2 (10C540) (Snow Leopard) with MAMP 1.8 bundle: &lt;br/&gt;
PHP Version: 5.2.10,&lt;br/&gt;
MySQL Version: 5.1.37&lt;br/&gt;
</environment>
            <key id="10623">DC-362</key>
            <summary>Doctrine fails to create correct table structure if model is named &quot;User&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="michenriksen">Michael Henriksen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Dec 2009 13:59:26 +0000</created>
                <updated>Fri, 8 Jan 2010 20:31:09 +0000</updated>
                                    <version>1.2.0-RC1</version>
                                                <component>Behaviors</component>
                <component>Query</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11201" author="michenriksen" created="Wed, 16 Dec 2009 14:04:39 +0000"  >&lt;p&gt;Forgot to mention, that it works perfectly when renaming model to something else than &quot;User&quot;&lt;/p&gt;</comment>
                    <comment id="11357" author="neographikal" created="Fri, 8 Jan 2010 20:31:09 +0000"  >&lt;p&gt;Have the same problem in 1.2.1 at PostgreSQL 8.4&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-325] doctrine  pager  class  with   sql server  stored procedure</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-325</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;i am using doctrine pager  class  for pagination in symfony   but not able to find any help  how i can i use   it&lt;/p&gt;

&lt;p&gt;i am using sql server  stored  procedures for  fetching databasae .&lt;/p&gt;

&lt;p&gt;Thnaks&lt;/p&gt;

&lt;p&gt;Khurram &lt;/p&gt;</description>
                <environment>php 5.3.0  sql server 2000  symfony 1.2.9</environment>
            <key id="10562">DC-325</key>
            <summary>doctrine  pager  class  with   sql server  stored procedure</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="alityagi2008@gmail.com">khurram Ali</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Dec 2009 04:46:11 +0000</created>
                <updated>Fri, 4 Dec 2009 04:46:11 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-648] Behavior geographical generates latitude DOUBLE(18, 2), longitude DOUBLE(18, 2) - it&apos;s not exact</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-648</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem was already described by another person at &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-385&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-385&lt;/a&gt;&lt;br/&gt;
and was fixed but now is broken again.&lt;/p&gt;

&lt;p&gt;When using the Geographical behaviour in a YML schema the latitude is stored in Mysql as a Double(18,2) instead of a Double as it was in the previous versions. It appears that all doubles in yml are defaulting to (18,2).&lt;/p&gt;</description>
                <environment>Doctrine 1.2.2</environment>
            <key id="11265">DC-648</key>
            <summary>Behavior geographical generates latitude DOUBLE(18, 2), longitude DOUBLE(18, 2) - it&apos;s not exact</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="indiekiduk">Malcolm Hall</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Apr 2010 13:20:03 +0000</created>
                <updated>Wed, 19 Jan 2011 05:26:19 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12744" author="indiekiduk" created="Sat, 24 Apr 2010 13:39:55 +0000"  >&lt;p&gt;The problem lies in DataDict/Mysql.php&lt;/p&gt;

&lt;p&gt;Previously it was:&lt;/p&gt;

&lt;p&gt;case &apos;double&apos;:&lt;br/&gt;
return &apos;DOUBLE&apos;;&lt;/p&gt;

&lt;p&gt;now it&apos;s:&lt;/p&gt;

&lt;p&gt;case &apos;double&apos;:&lt;br/&gt;
                $length = !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;) ? $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt; : 18;&lt;br/&gt;
                $scale = !empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt;) ? $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;scale&amp;#39;&amp;#93;&lt;/span&gt; : $this-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);&lt;br/&gt;
                return &apos;DOUBLE(&apos;.$length.&apos;, &apos;.$scale.&apos;)&apos;;&lt;/p&gt;

&lt;p&gt;Perhaps this could be improved so that if there is no length specified it returns just double with no length or scale instead of defaulting to 18, ATTR_DECIMAL_PLACES? I expect that most people that use the double type in yaml wouldn&apos;t want only 2 decimals.&lt;/p&gt;</comment>
                    <comment id="13181" author="jwage" created="Tue, 8 Jun 2010 13:53:29 +0000"  >&lt;p&gt;Can you provide a patch that fixes the situation for you? we&apos;ll see if that has any breakage of current tests.&lt;/p&gt;</comment>
                    <comment id="13706" author="spike008t" created="Mon, 26 Jul 2010 13:56:18 +0000"  >&lt;p&gt;I have the same trouble, and I fix it by specified directly the precision of the double into Doctrine_Template_Geographical class.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&apos;type&apos;     =&amp;gt;  &apos;double(18,8)&apos;,&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    <comment id="14681" author="janusz.slota" created="Mon, 8 Nov 2010 08:54:54 +0000"  >&lt;p&gt;You can fix it with:&lt;br/&gt;
Geographical:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;latitude:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type: float(18,8)&lt;br/&gt;
&amp;nbsp;&amp;nbsp;longitude:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type: float(18,8)&lt;/p&gt;

&lt;p&gt;instead of:&lt;br/&gt;
Geographical: ~&lt;/p&gt;</comment>
                    <comment id="15149" author="spike008t" created="Wed, 19 Jan 2011 05:26:19 +0000"  >&lt;p&gt;diff on Template/Geographical.php&lt;/p&gt;

&lt;p&gt;Hope that could help&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10913" name="patch.diff" size="1091" author="spike008t" created="Wed, 19 Jan 2011 05:26:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-630] Add Undelete functionality to SoftDelete behaviour</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-630</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Can an undelete function be added to the Doctrine ORM which will reset deleted_at fields to null and conform to cascade rules (just as the original delete did)?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11220">DC-630</key>
            <summary>Add Undelete functionality to SoftDelete behaviour</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="harryhobbes">Harry Birrell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 01:35:57 +0000</created>
                <updated>Thu, 15 Apr 2010 01:35:57 +0000</updated>
                                                                    <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-553] issue when changing the connection inside Doctrine_Query::preQuery() on a model using a behavior</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-553</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We were following:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/cookbook/1_1/en/master-and-slave-connections&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/cookbook/1_1/en/master-and-slave-connections&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;class MyQuery extends Doctrine_Query&lt;br/&gt;
{&lt;br/&gt;
    // Since php doesn&apos;t support late static binding in 5.2 we need to override&lt;br/&gt;
    // this method to instantiate a new MyQuery instead of Doctrine_Query&lt;br/&gt;
    public static function create($conn = null)&lt;/p&gt;
    {
        return new MyQuery($conn);
    }

&lt;p&gt;    public function preQuery()&lt;br/&gt;
    {&lt;br/&gt;
        // If this is a select query then set connection to one of the slaves&lt;br/&gt;
        if ($this-&amp;gt;getType() == Doctrine_Query::SELECT) &lt;/p&gt;
{
            $this-&amp;gt;_conn = Doctrine_Manager::getInstance()-&amp;gt;getConnection(&apos;slave_&apos; . rand(1, 4));
        // All other queries are writes so they need to go to the master
        }
&lt;p&gt; else &lt;/p&gt;
{
            $this-&amp;gt;_conn = Doctrine_Manager::getInstance()-&amp;gt;getConnection(&apos;master&apos;);
        }
&lt;p&gt;    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;However we are actually forcing all queries after the first access to the master to be run against the master (including selects). Note the example should probably be changed to use setConnection(). However even when using setConnection() it seems like changing the connection can cause issues when running a select on a model with a behavior (in our case we were using i18n). Therefore we believe there is some issue that is caused through the event system, because otherwise queries work just fine even when changing the connection as per the above described code.&lt;/p&gt;

&lt;p&gt;We managed to fix things, by not setting the connection explicitly and instead simply using setCurrentConnection(&apos;master&apos;), so the bug does not affect us anymore. However this seems to indicate some issues deep inside the event-behavior-template code.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11006">DC-553</key>
            <summary>issue when changing the connection inside Doctrine_Query::preQuery() on a model using a behavior</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Mar 2010 11:18:28 +0000</created>
                <updated>Mon, 19 Jul 2010 07:45:41 +0000</updated>
                                                    <fixVersion>1.2.1</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12056" author="seldaek" created="Mon, 8 Mar 2010 11:26:13 +0000"  >&lt;p&gt;In case the above post is confusing, note that doing $this-&amp;gt;_conn = masterconn worked fine for the INSERT, it just broke when doing a subsequent SELECT  of a translateable (I18n behavior) model and its Translation table with the following exception:&lt;/p&gt;

&lt;p&gt;Exception (Exception): Unknown relation alias Translation (#0)&amp;lt;/h1&amp;gt;thrown in file /Library/WebServer/Documents/liip/infocube/ext/db-doctrine/lib/Doctrine/Relation/Parser.php at line 237&lt;br/&gt;
backtrace:&lt;br/&gt;
#1 Doctrine_Relation_Parser-&amp;gt;getRelation called in file /Library/WebServer/Documents/liip/infocube/ext/db-doctrine/lib/Doctrine/Relation/Parser.php at line 235&lt;/p&gt;</comment>
                    <comment id="12230" author="jwage" created="Mon, 15 Mar 2010 16:12:31 +0000"  >&lt;p&gt;It is hard to understand the issue, can you provide a test case?&lt;/p&gt;</comment>
                    <comment id="12241" author="lsmith" created="Mon, 15 Mar 2010 16:27:01 +0000"  >&lt;p&gt;We already spend well over 2 hours together on project time to find a work around as noted above and I must admit now our motivation is not so big to dig deeper, especially since we didn&apos;t find the cause in this time and have the feeling its pretty impossible to fix without huge risks.&lt;/p&gt;

&lt;p&gt;Essentially I think all you need to do to reproduce the issue is use the cookbook code &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; and issue some write query and afterwards do a select on a model that has the translatable behavior. It then gave us the above Exception.&lt;/p&gt;

&lt;p&gt;&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; Our code worked slightly different since we did not use a random slave, instead we always used a local slave by default, but the first write and any queries thereafter would get send to the master. The code is public and the diff&apos;s show what we had to change to get things working. Note that the slave &quot;localhost&quot; connection was the default connection:&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php?r1=13118&amp;amp;r2=&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php?r1=13118&amp;amp;r2=&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php?r1=13118&amp;amp;r2=&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php?r1=13118&amp;amp;r2=&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13348" author="lsmith" created="Thu, 17 Jun 2010 05:38:01 +0000"  >&lt;p&gt;we thought we had the issue fixed but ran into another issue today. we then noticed that the issue goes away if we just copy the $tables property from the old connection to the new connection. there is a getTables() method, but there is only a addTable() method, would be nice to have a addTables() method that is faster. or maybe a switchFrom() method that accepts the old connection and does whatever it needs to.&lt;/p&gt;

&lt;p&gt;And again it would be nice to update the cookbook entry.&lt;br/&gt;
Here are our updated Doctrine_Query and Doctrine_Record classes:&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DQ.php&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php&quot; class=&quot;external-link&quot;&gt;http://fisheye.liip.ch/browse/PUB/okapi2/ext/db-doctrine/trunk/inc/DR.php&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13598" author="seldaek" created="Mon, 19 Jul 2010 07:45:41 +0000"  >&lt;p&gt;We just had another funny debugging session related to this. It turns out that the Table objects have a relation to the connection, and if you query a new model that wasn&apos;t initialized yet using -&amp;gt;from(), it works because it just gets the current connection passed. However, if you query a new model within a JOIN, then it apparently takes the connection from the related model you&apos;re joining from. In our case, the related model was already initialized but had an instance of the old (slave) connection, and so the new model was initialized using the wrong connection, and then the DQL parser exploded trying to resolve relations.&lt;/p&gt;

&lt;p&gt;Long story short, adding $table-&amp;gt;setConnection($conn); to all tables while switching to the master connection resolved it. The code is updated and you can still view it at the above URLs, or straight in the SVN repo at &lt;a href=&quot;http://svn.liip.ch/repos/public/okapi2/ext/db-doctrine/trunk/inc/DQ.php&quot; class=&quot;external-link&quot;&gt;http://svn.liip.ch/repos/public/okapi2/ext/db-doctrine/trunk/inc/DQ.php&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-485] Limit gets lost when doing self join</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-485</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;hi doctrine team,&lt;br/&gt;
today I encountered a very weird problem when I tried to do a selfjoin on a table. the goal was to list all people that have the same addresses but limit the result to 5&lt;/p&gt;

&lt;p&gt;the problem was, that the doctrine split it into 2 querys and first selected the correct address ids with the Limit 5. but in the second query the limit is lost. which gives me more than 5 results if a few people have the same address&lt;/p&gt;

&lt;p&gt;the DQL looks like this&lt;/p&gt;

&lt;p&gt;        $q = DQ::create()&lt;br/&gt;
         -&amp;gt;from(&apos;address a INNER JOIN a.shared b ON a.city = b.city AND a.street = b.street&apos;)&lt;br/&gt;
         -&amp;gt;innerJoin(&apos;b.entity e&apos;)&lt;br/&gt;
         -&amp;gt;where(&apos;a.entity_id = ? AND a.is_active = ?&apos;, array($id, $is_active))&lt;br/&gt;
         -&amp;gt;limit(5)&lt;br/&gt;
         -&amp;gt;offset(0);&lt;/p&gt;

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

&lt;p&gt;SELECT * FROM address a &lt;br/&gt;
INNER JOIN address a2 ON ((a.city = a2.city AND a.street = a2.street)) &lt;br/&gt;
INNER JOIN entity e ON a2.entity_id = e.id &lt;br/&gt;
WHERE a.id IN (&apos;5689677&apos;) AND (a.entity_id = ? AND a.is_active = ?)&lt;/p&gt;

&lt;p&gt;Problem: Limit 5 is gone&lt;/p&gt;

&lt;p&gt;expected was something like this:&lt;/p&gt;

&lt;p&gt;SELECT *&lt;br/&gt;
FROM address a&lt;br/&gt;
INNER JOIN address b ON a.city = b.city AND a.street = b.street &lt;br/&gt;
INNER JOIN entity e ON b.entity_id = e.id&lt;br/&gt;
where a.entity_id = 104294414&lt;br/&gt;
limit 5&lt;/p&gt;

&lt;p&gt;my temporary solution:&lt;/p&gt;

&lt;p&gt;        $q = new Doctrine_RawSql();&lt;br/&gt;
        $q-&amp;gt;select(&apos;&lt;/p&gt;
{b.*}
&lt;p&gt;, &lt;/p&gt;
{e.*}
&lt;p&gt;, &lt;/p&gt;
{p.*}
&lt;p&gt;&apos;);&lt;br/&gt;
        $q-&amp;gt;from(&apos;address a INNER JOIN address b ON a.city = b.city AND a.street = b.street&lt;br/&gt;
            INNER JOIN entity e ON b.entity_id = e.id&lt;br/&gt;
            INNER JOIN person p ON e.id = p.entity_id&apos;);&lt;br/&gt;
        $q-&amp;gt;where(&apos;a.entity_id = ? AND a.is_active = ?&apos;, array($id, $isActive));&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;a&apos;, &apos;address a&apos;);&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;b&apos;, &apos;a.shared b&apos;);&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;e&apos;, &apos;b.entity e&apos;);&lt;br/&gt;
        $q-&amp;gt;addComponent(&apos;p&apos;, &apos;e.person p&apos;);&lt;br/&gt;
        $q-&amp;gt;limit($limit);&lt;br/&gt;
        $q-&amp;gt;offset($offset);&lt;/p&gt;

&lt;p&gt;my schema.yml is attached, do you need anything else?&lt;/p&gt;</description>
                <environment>os x, snow leopard,</environment>
            <key id="10851">DC-485</key>
            <summary>Limit gets lost when doing self join</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicam">Pascal Helfenstein</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Feb 2010 10:53:16 +0000</created>
                <updated>Mon, 8 Feb 2010 11:06:41 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10357" name="schema.yml" size="2786" author="nicam" created="Mon, 8 Feb 2010 11:06:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
ModelFoo:
  model_id as id
  username
  password
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

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

&lt;p&gt;It should be:&lt;br/&gt;
model_foo (model_id, username, password, version)&lt;br/&gt;
model_foo_version (model_id, userrname, password, version)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11768">DC-825</key>
            <summary>Versionable does not work with column alias on primary keys [+patch]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Aug 2010 07:42:28 +0000</created>
                <updated>Wed, 25 Aug 2010 11:26:56 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13942" author="enrico" created="Fri, 13 Aug 2010 08:52:55 +0000"  >&lt;p&gt;TestCase and Fix&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-825&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-825&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13996" author="enrico" created="Wed, 18 Aug 2010 06:55:47 +0000"  >&lt;p&gt;The supplied patches are not up-to-date. Pls use &lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-825&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-825&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10738" name="0001-TestCase-for-issue-DC-825.patch" size="3855" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                    <attachment id="10739" name="0002-DC-825-fix-generation-of-the-versionable-table.patch" size="8407" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                    <attachment id="10740" name="0003-DC-825-fix-generation-of-model-classes-with-column-a.patch" size="1356" author="enrico" created="Fri, 13 Aug 2010 12:42:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-801] Multiple template implementation (setImpl)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-801</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I feel curios when looking setImpl code on Doctrine. It set like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setImpl($template, $class)
{
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_impl[$template] = $class;

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

&lt;p&gt;So how we can implement a template into seperated different doctrine record?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11691">DC-801</key>
            <summary>Multiple template implementation (setImpl)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aristondarmayuda">B. Ariston Darmayuda</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 14:19:18 +0000</created>
                <updated>Sat, 28 Apr 2012 11:56:51 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="17893" author="richhl" created="Sat, 28 Apr 2012 11:48:18 +0000"  >&lt;p&gt;As the doc says &quot;Tip The implementations for the templates can be set at manager, connection and even at the table level.&quot; it is supposed one can do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Manager::getInstance()-&amp;gt;getTable(&apos;Student&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Student&apos;);
Doctrine_Manager::getInstance()-&amp;gt;getTable(&apos;Teacher&apos;)-&amp;gt;setImpl(&apos;PersonTemplate&apos;, &apos;Teacher&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

<item>
            <title>[DC-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-758] CascadeDelete not work properly on Versionable and on the AuditLog</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-758</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
Schema:

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

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

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

&lt;p&gt;Thanks!&lt;/p&gt;</description>
                <environment>Mac OS X Snow Leopard, LAMP and Macports</environment>
            <key id="11535">DC-758</key>
            <summary>CascadeDelete not work properly on Versionable and on the AuditLog</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jaimesuez">Jaime Suez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 13:54:37 +0000</created>
                <updated>Tue, 24 Aug 2010 12:55:48 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-974] generateFile = true - problematic implementation, see symfony ticket #4522</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-974</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;see &lt;a href=&quot;http://trac.symfony-project.org/ticket/4522&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/4522&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using a behaviour with generateFile=true, som eproblematic issues occur:&lt;/p&gt;

&lt;p&gt;Let&apos;s take for example i18n:&lt;/p&gt;

&lt;p&gt;schema.yml&lt;br/&gt;
...&lt;br/&gt;
actAs:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;text&amp;#93;&lt;/span&gt;&lt;br/&gt;
      generateFiles: true&lt;br/&gt;
      generatePath: &amp;lt;?php echo sfConfig::get(&apos;sf_lib_dir&apos;) ?&amp;gt;/model/doctrine/translations&lt;/p&gt;

&lt;p&gt;1) The translation model class and it&apos;s base class are not created with generate.php (aka symfony doctrine:build --model), but every time a translation model is used. This is not the expected behaviour, because &lt;br/&gt;
  a) this makes autoloading these classes impossible.&lt;br/&gt;
  b) the APC cache always sees a new change time, and recaches the fiels. This results in a quick fragmentation of the cache with segmentation faults in the long run.&lt;br/&gt;
2) The permissions for the created files are wrong. Normal executable php scripts should not be writable by the web server (admitting that with the current implementation, this is not problem, because the files are created again for each request)&lt;br/&gt;
3) The path is hard coded. This brakes deployment by svn update, and I would prefer not to build models on a production server.&lt;/p&gt;

&lt;p&gt;Proposal:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;generate the files at build model time&lt;/li&gt;
	&lt;li&gt;hopefully find a solution with the path&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I realize that most development resources are now in the new doctrine, but this issue (especially the apc fragmentation) is a huge problem for me. If you won&apos;t fix it, let me know, then I would try to propose a patch. I checked the code, and the building and behaviour internal part of doctrine are not too well documented, and my patch would be far from perfect. &lt;/p&gt;</description>
                <environment>symfony</environment>
            <key id="12400">DC-974</key>
            <summary>generateFile = true - problematic implementation, see symfony ticket #4522</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="geg">Georg</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 08:31:49 +0000</created>
                <updated>Thu, 17 Feb 2011 08:31:49 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;The problem is pretty simple, I was trying to do a hardDelete and if it fails I would do a softDelete.&lt;br/&gt;
Example&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
    $record-&amp;gt;hardDelete();
}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($e &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Connection_Mysql_Exception &amp;amp;&amp;amp; $e-&amp;gt;getPortableCode() == Doctrine_Core::ERR_CONSTRAINT) {
        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $record-&amp;gt;delete();
        }
        &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception $e1) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e1;
        }
    }
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; $e;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

&lt;p&gt;Hope this info is enough.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13334">DC-1047</key>
            <summary>hardDelete not resetting flag if exception is thrown</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lonewolf4">Lone Wolf</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Jan 2012 11:46:54 +0000</created>
                <updated>Fri, 6 Jan 2012 11:46:54 +0000</updated>
                                                                    <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11140" name="softdelete_exception.patch" size="645" author="lonewolf4" created="Fri, 6 Jan 2012 11:46:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-746] Sluggable canUpdate overridden after subsequent updates</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-746</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When allowing the user to manually change a slug using &apos;canUpdate&apos; the slug  reverts back to it&apos;s default generated value upon subsequent saves. Pre-Update on the Sluggable Listener Template seems to incorrectly decide to regenerate the default value.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;Sluggable&apos;, array(&apos;unique&apos;=&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;fields&apos;=&amp;gt;array(&apos;title&apos;), &apos;canUpdate&apos;=&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;save();

echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;example-title&quot;&lt;/span&gt; (Correct)
&lt;/span&gt;
$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;slug = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt;;
$record-&amp;gt;save();

echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt; (Correct - First Save)
&lt;/span&gt;
$record-&amp;gt;description = &lt;span class=&quot;code-quote&quot;&gt;&quot;An example Item&quot;&lt;/span&gt;;
$record-&amp;gt;title = &lt;span class=&quot;code-quote&quot;&gt;&quot;Example Title&quot;&lt;/span&gt;;
$record-&amp;gt;slug = &lt;span class=&quot;code-quote&quot;&gt;&quot;custom-slug&quot;&lt;/span&gt;;
$record-&amp;gt;save();
echo $record-&amp;gt;slug; &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-quote&quot;&gt;&quot;example-title&quot;&lt;/span&gt; (Incorrect - Subsequent Save. Has regenerated it&apos;s &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; slug and lost the user defined one - even though we have passed the users custom one to the object prior to saving it.).&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>WAMP stack - PHP 5.3</environment>
            <key id="11511">DC-746</key>
            <summary>Sluggable canUpdate overridden after subsequent updates</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ppanther">Adam Benson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 01:09:26 +0000</created>
                <updated>Fri, 21 Jan 2011 11:41:17 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14530" author="caponica" created="Tue, 5 Oct 2010 11:09:20 +0000"  >&lt;p&gt;As far as I can see this is a problem with the logic in Sluggable::preUpdate() , I recently posted a comment about this here:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/d40c6ac733738d4a&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/d40c6ac733738d4a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In short, I think that the code should be changed from:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preUpdate(Doctrine_Event $event)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;unique&apos;]) {
            $record = $event-&amp;gt;getInvoker();
            $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name || (
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                ! array_key_exists($name, $record-&amp;gt;getModified())
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($record-&amp;gt;$name) &amp;amp;&amp;amp;
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                array_key_exists($name, $record-&amp;gt;getModified()
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To this (i.e. remove the canUpdate conditions from the first inner if):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php (modified)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preUpdate(Doctrine_Event $event)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;unique&apos;]) {
            $record = $event-&amp;gt;getInvoker();
            $name = $record-&amp;gt;getTable()-&amp;gt;getFieldName($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]);

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $record-&amp;gt;$name) { &lt;span class=&quot;code-comment&quot;&gt;// i.e. remove the other conditions - you should only build the slug from other fields &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it&apos;s empty
&lt;/span&gt;                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromFields($record);
            &lt;span class=&quot;code-comment&quot;&gt;// possibly add an &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; !canUpdate then make sure the old value is preserved&quot;&lt;/span&gt; here
&lt;/span&gt;            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($record-&amp;gt;$name) &amp;amp;&amp;amp;
                &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;canUpdate&apos;] &amp;amp;&amp;amp;
                array_key_exists($name, $record-&amp;gt;getModified()
            )) {
                $record-&amp;gt;$name = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildSlugFromSlugField($record);
            }
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have modified my local version of the Doctrine code to use this modification and it seems to (a) not have the problem you reported above and (b) generally work ok. However, I have not run the test suite against it.&lt;/p&gt;

&lt;p&gt;C&lt;/p&gt;</comment>
                    <comment id="14786" author="ppanther" created="Fri, 19 Nov 2010 02:11:29 +0000"  >&lt;p&gt;Updated affected versions&lt;/p&gt;</comment>
                    <comment id="14787" author="ppanther" created="Fri, 19 Nov 2010 02:13:54 +0000"  >&lt;p&gt;Thanks for the update Christian, perhaps you could share your fix as a patch?&lt;/p&gt;</comment>
                    <comment id="15154" author="jessovr" created="Fri, 21 Jan 2011 11:41:17 +0000"  >&lt;p&gt;Hi, I&apos;m working on a multilingue web portal with Symfony 1.4 and Doctrine 1.2.3, and man, your fix saves my life &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
I use Sluggable slaved by i18n and without your fix Sluggable simply does not do the job, instead it messes up all slugs when updating, eventually you can&apos;t retrieve object anymore based on it. I would not set it as only minor bug ?&lt;br/&gt;
thanks, anyway.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-963] Doctrine cache - Salt dissociation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-963</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine Cache store data into a persistence storage.&lt;/p&gt;

&lt;p&gt;Regarding APC, Doctrine use a share storage.&lt;br/&gt;
Doctrine is able to cache SQL from DQL, and DOM from SQL.&lt;br/&gt;
To do this, Doctrine create a DQL hash, and store the SQL result refer to the hash. &lt;/p&gt;

&lt;p&gt;I&apos;m using a server to host two Doctrine project, a preproduction &amp;amp; production Website. In some case, DQL is the same on both project, but the data model definition isn&apos;t.&lt;/p&gt;

&lt;p&gt;Preproduction convert DQL to SQL using data model definition, and store the SQL result into APC cache refer to the DQL hash.&lt;br/&gt;
Production create a DQL hash, this is the same hash as preproduction.. So production instance use the SQL refer to the preproduction.. &lt;/p&gt;

&lt;p&gt;I&apos;m not sure about the quality of this explanation... But I can add some information is needed.&lt;/p&gt;


&lt;p&gt;The solution of this problem is easy. Just add a SALT to any cache id&apos;s. It&apos;s a Doctrine_Cache problem, not only a Doctrine_Cache_APC problem..&lt;br/&gt;
For Query cache it&apos;s not really important because this cache is optional, but for result cache.. It&apos;s more critical.&lt;br/&gt;
The SALT can be define when instantiate the Doctrine_Cache object, it&apos;s just an option..&lt;/p&gt;


&lt;p&gt;$cacheDriver = new doctrine_Cache_Apc ();&lt;br/&gt;
$cacheDriver-&amp;gt;setOption (&quot;salt&quot;, &quot;domain.tld&quot;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="12351">DC-963</key>
            <summary>Doctrine cache - Salt dissociation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 05:05:19 +0000</created>
                <updated>Mon, 18 Apr 2011 10:13:28 +0000</updated>
                                                                    <component>Caching</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15219" author="armetiz" created="Thu, 3 Feb 2011 05:12:45 +0000"  >&lt;p&gt;to complete this bug, I think it&apos;s also a problem on DC 2..&lt;/p&gt;</comment>
                    <comment id="15737" author="jaikdean" created="Mon, 18 Apr 2011 10:13:28 +0000"  >&lt;p&gt;There is already an (undocumented?) option &quot;prefix&quot; that allows this.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$cacheDriver = new Doctrine_Cache_Apc(array(&apos;prefix&apos; =&amp;gt; &apos;MY UNIQUE SALT&apos;));&lt;/tt&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;I&apos;m pretty sure my usage scenario is not marginal but let me know what you think.&lt;/p&gt;</comment>
                    <comment id="12902" author="jwage" created="Mon, 10 May 2010 14:08:13 +0000"  >&lt;p&gt;This is already possible if I understand what you describe.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, 3600, &apos;key_to_store_cache_under&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now you can do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$cacheDriver-&amp;gt;delete(&apos;key_to_store_cache_under&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

&lt;p&gt;In Doctrine/Query/Abstract.php right after the line&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$cacheDriver-&amp;gt;save($hash, $cached, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getResultCacheLifeSpan());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;ve added &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!empty($GLOBALS[&apos;rcache_users_in_query&apos;])) {
                	MyCache::keepRelatedCacheKey($GLOBALS[&apos;rcache_users_in_query&apos;], $hash);
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;When a user on my system does the update, I then delete all relevant Doctrine keys with something like&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_null($cacheDriver)) $cacheDriver = Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_RESULT_CACHE);
		
		foreach($arKeys as $key) {
			$cacheDriver-&amp;gt;delete($key);			
		}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and then delete my other cache key.&lt;/p&gt;

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

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

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

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

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

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

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

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


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

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

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

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

<item>
            <title>[DC-902] Xcache Cache Driver is not documented</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-902</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Xcache Cache Driver is not documented at all. Is it working? Is it stable? Can we use it?&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12035">DC-902</key>
            <summary>Xcache Cache Driver is not documented</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="leszczu">Piotr Leszczy&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Oct 2010 14:38:59 +0000</created>
                <updated>Tue, 26 Oct 2010 14:38:59 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

<item>
            <title>[DC-390] doctrine_cache_keys bigger than 1mb</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-390</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When multiple projects using doctrine use the same memcached server the doctrine_cache_keys can get bigger then 1mb and php will be throwing warnings telling that the data is too big to be stored by memcached.&lt;/p&gt;

&lt;p&gt;I am currently using a workaround, having 1 doctrine_cache_keys per application, on the file Cache/Driver.php i added the following line to the constructor&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;$this-&amp;gt;_cacheKeyIndexKey = &apos;doctrine_cache_keys_&apos; . md5(Doctrine_Manager::getInstance()-&amp;gt;getCurrentConnection()-&amp;gt;getOption(&apos;dsn&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but if an application uses more than 1mb en keys then the notice will rise again.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10669">DC-390</key>
            <summary>doctrine_cache_keys bigger than 1mb</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="crosspad">Douglas Yau</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Dec 2009 17:49:24 +0000</created>
                <updated>Wed, 27 Jan 2010 23:33:01 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Caching</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11368" author="circlechu" created="Wed, 13 Jan 2010 13:33:10 +0000"  >&lt;p&gt;Why doctrine need to save the keys when it is timeout? I found doctrine will hold the duplicated keys in doctrine_cache_keys map. So this is why it will become more and more bigger.  So I think if I remove those duplicated key it will be better? Here is my solution&lt;br/&gt;
I add array_unique function to remove all duplicated keys in the map. This method is in the Doctrine_Cache_Driver class.&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Save a cache key in the index of cache keys&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param string $key&lt;/li&gt;
	&lt;li&gt;@return boolean True if successful and false if something went wrong.&lt;br/&gt;
     */&lt;br/&gt;
    protected function _saveKey($key)
    {
        $keys = $this-&amp;gt;fetch($this-&amp;gt;_cacheKeyIndexKey);
        $keys[] = $key;
        $keys=array_unique ($keys);
        return $this-&amp;gt;save($this-&amp;gt;_cacheKeyIndexKey, $keys, null, false);
    }&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="10795">DC-460</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;It&apos;s works.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11779">DC-829</key>
            <summary>Hydrator/RecordDriver/setLastElement And APC useResultCache</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="zaor">PIERRONT Julien</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Aug 2010 17:02:25 +0000</created>
                <updated>Mon, 16 Aug 2010 17:02:25 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

&lt;p&gt;Maybe this may help somehow:&lt;br/&gt;
&lt;a href=&quot;http://bugs.php.net/33886&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/33886&lt;/a&gt;&lt;/p&gt;
</description>
                <environment>Postgresql 8.4, Ubuntu 10.04, PHP 5.3, latest APC and Memcache, Memcached</environment>
            <key id="11735">DC-812</key>
            <summary>Postgresql and query cache</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Aug 2010 17:13:54 +0000</created>
                <updated>Fri, 6 Aug 2010 17:14:47 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

<item>
            <title>[DC-980] Moving all ALTERS queries to the end of generated sql file (task build-sql)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-980</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Actual in case of using multi database configuration and foreign keys between them.&lt;/p&gt;

&lt;p&gt;Now build-sql task generates SQL query for database by database in alphabetical order. It&apos;s ugly when we have multidatabase configuration and foreign keys between their tables. It&apos;s impossible to do &apos;import-sql&apos; without errors beucase foreign keys constrains to nonexisting tables are in next database in order. &lt;/p&gt;

&lt;p&gt;I have added some code to strings 1176-...&lt;/p&gt;</description>
                <environment></environment>
            <key id="12446">DC-980</key>
            <summary>Moving all ALTERS queries to the end of generated sql file (task build-sql)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="seremenko">Sergey Eremenko</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 06:42:03 +0000</created>
                <updated>Fri, 4 Mar 2011 06:42:03 +0000</updated>
                                                                    <component>Cli</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10951" name="Export.php" size="56058" author="seremenko" created="Fri, 4 Mar 2011 06:42:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-935] Doctrine_Task_BuildAllReload does not call generate-models-from-yaml</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-935</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Task_BuildAllReload never calls generate models-from-yaml. This does not coincide with the logic of Doctrine_Task_BuildAll and Doctrine_Task_BuildAllLoad.&lt;/p&gt;

&lt;p&gt;BuildAllReload suggests that it will be building all (everything) and then reloading the database.&lt;br/&gt;
But instead it only rebuilds the database and loads data&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine 1.2.3 - BuildAllReload.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($dispatcher = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        parent::__construct($dispatcher);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_RebuildDb($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_LoadData($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;requiredArguments);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;optionalArguments);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function execute()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;rebuildDb-&amp;gt;execute();
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;loadData-&amp;gt;execute();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Instead, I think it would be more efficient and understanding to follow the same logic as build-all and build-all-load by calling drop-db and build-all-load.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Proposed - BuildAllReload.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($dispatcher = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        parent::__construct($dispatcher);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_DropDb($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Task_BuildAllLoad($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dispatcher);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;requiredArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;requiredArguments);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments = array_merge($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;optionalArguments, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;optionalArguments);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function execute()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropDb-&amp;gt;execute();
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;setArguments($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getArguments());
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;buildAllLoad-&amp;gt;execute();
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;I attached a patch with the above changes... I got a little lost in the test area for Doctrine_CLI, so that is not included = )&lt;/p&gt;</description>
                <environment>Windows Vista 32bit, Apache 2.2.14, PHP 5.3.1</environment>
            <key id="12133">DC-935</key>
            <summary>Doctrine_Task_BuildAllReload does not call generate-models-from-yaml</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="brandonevans">Brandon Evans</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Nov 2010 20:56:31 +0000</created>
                <updated>Sun, 21 Nov 2010 21:35:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14797" author="brandonevans" created="Sun, 21 Nov 2010 21:31:14 +0000"  >&lt;p&gt;Added the proper proposed code this time and also attached patch with better naming.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10874" name="DC-935.patch" size="2461" author="brandonevans" created="Sun, 21 Nov 2010 21:31:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Windows</environment>
            <key id="11912">DC-865</key>
            <summary>Models that extend a baseclass other than Doctrine_Record treat that baseclass as if it were a model</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Sat, 11 Sep 2010 19:42:56 +0000</created>
                <updated>Sat, 11 Sep 2010 19:47:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14345" author="willf1976" created="Sat, 11 Sep 2010 19:47:56 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10791" name="DC_865_fix.patch" size="531" author="willf1976" created="Sat, 11 Sep 2010 19:47:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-981] Class prefix isn&apos;t being appended when importing data</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-981</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Configuration:&lt;/p&gt;

&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX, &apos;Foo_&apos;);&lt;/p&gt;

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

&lt;p&gt;Bar:&lt;br/&gt;
  columns:&lt;br/&gt;
    baz: int&lt;/p&gt;

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

&lt;p&gt;Bar:&lt;br/&gt;
    Bar_1:&lt;br/&gt;
      baz: 1&lt;/p&gt;

&lt;p&gt;Error on importing data: &quot;Couldn&apos;t find class Bar.&quot;&lt;/p&gt;

&lt;p&gt;Doctrine should use Foo_Bar class for Bar model instead Bar class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12447">DC-981</key>
            <summary>Class prefix isn&apos;t being appended when importing data</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="maciej.strzelecki">Maciej Strzelecki</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 08:23:40 +0000</created>
                <updated>Fri, 4 Mar 2011 08:23:40 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-357] setting &quot;Doctrine_Core::ATTR_EXPORT&quot; to &quot;Doctrine_Core::EXPORT_TABLES&quot; prevents i18n table creation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-357</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I try to prevent foreign key creation (because I am using a mix of MyISAM and InnoDB tables) using the given attribute, I notice that all the translation tables are also not getting created.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10610">DC-357</key>
            <summary>setting &quot;Doctrine_Core::ATTR_EXPORT&quot; to &quot;Doctrine_Core::EXPORT_TABLES&quot; prevents i18n table creation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Dec 2009 14:21:17 +0000</created>
                <updated>Mon, 14 Dec 2009 16:51:11 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11185" author="jwage" created="Mon, 14 Dec 2009 16:47:11 +0000"  >&lt;p&gt;You can use the bit operator with this attribute.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration#exporting&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration#exporting&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="11186" author="lsmith" created="Mon, 14 Dec 2009 16:51:11 +0000"  >&lt;p&gt;in that case the bug is bogus .. however the docs should probably make it clear that there are other export modes available, then illustrated atm.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

&lt;p&gt;So, I change the sort method to Natural Sort, to fix this issue.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04, PHP 5.3.2, Doctrine 1.2.2</environment>
            <key id="11505">DC-741</key>
            <summary>Sort of Migration Class Problem With More Than 9 Classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dollyaswin">Dolly Aswin Harahap</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 08:50:45 +0000</created>
                <updated>Tue, 24 Aug 2010 12:30:40 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13340" author="dollyaswin" created="Wed, 16 Jun 2010 08:52:22 +0000"  >&lt;p&gt;Here I attach patch to fix this issue. Please check it.&lt;/p&gt;</comment>
                    <comment id="14053" author="jwage" created="Tue, 24 Aug 2010 12:30:40 +0000"  >&lt;p&gt;I am not able to produce the error, things are always in the correct order. I added a test here: &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7683&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/7683&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can you help me with how to reproduce the error?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10661" name="DC-741.patch" size="808" author="dollyaswin" created="Wed, 16 Jun 2010 08:52:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;Doctrine executes :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
SELECT a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, 
c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent 
FROM AGENT a 
LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent 
WHERE a.ck_agent IN 
(SELECT b.ck_agent 
FROM ( SELECT a.*, ROWNUM AS doctrine_rownum 
FROM ( SELECT DISTINCT a2.ck_agent, a2.nom FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) 
a2 ) 
b 
WHERE doctrine_rownum BETWEEN 11 AND 20) 
ORDER BY a.nom
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;The problem is in function _createLimitSubquery in Doctrine_Connection_Oracle :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
                    $query= &apos;SELECT &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;b&apos;).&apos;.&apos;.$column.&apos; FROM ( &apos;.
                                 &apos;SELECT &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;a&apos;).&apos;.*, ROWNUM AS doctrine_rownum FROM ( &apos;
                                   . $query . &apos; ) &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;a&apos;) . &apos; &apos;.
                              &apos; ) &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier(&apos;b&apos;) . &apos; &apos;.
                              &apos;WHERE doctrine_rownum BETWEEN &apos; . $min .  &apos; AND &apos; . $max;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

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

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

&lt;p&gt;Doctrine executes :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
SELECT a.pk AS a__pk, a.ts AS a__ts, a.ck_agent AS a__ck_agent, a.matricule AS a__matricule, a.nom AS a__nom, 
a.prenom AS a__prenom, a.agent_maitrise AS a__agent_maitrise, c.pk AS c__pk, c.ts AS c__ts, c.ck_chantier_agent AS c__ck_chantier_agent, 
c.ek_chantier AS c__ek_chantier, c.fk_chantier AS c__fk_chantier, c.ek_agent AS c__ek_agent, c.fk_agent AS c__fk_agent 
FROM AGENT a 
LEFT JOIN CHANTIER_AGENT c ON a.ck_agent = c.ek_agent 
WHERE a.ck_agent IN (
SELECT a2.ck_agent FROM ( 
SELECT DISTINCT a2.ck_agent, a2.nom FROM AGENT a2 LEFT JOIN CHANTIER_AGENT c2 ON a2.ck_agent = c2.ek_agent ORDER BY a2.nom ) 
a2 WHERE ROWNUM &amp;lt;= 10) ORDER BY a.nom

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-1007] Cannot update a field to NULL with MSSQL connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1007</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to update a field to NULL in a MSSQL database, Doctrine generates the following request:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    UPDATE table SET fieldThatMustBeNull = , anotherField = &apos;blabla&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;therefore generating a syntax error.&lt;/p&gt;

&lt;p&gt;A fix would be to override the update method in the Doctrine_Connection_Mssql and add the following behavior:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine_Connection_Mssql&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function update(Doctrine_Table $table, array $fields, array $identifier)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (empty($fields)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        }

        $set = array();
        foreach ($fields as $fieldName =&amp;gt; $value) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($value &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Expression) {
                $set[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName)) . &apos; = &apos; . $value-&amp;gt;getSql();
                unset($fields[$fieldName]);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_null($value)) {
                $set[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName)) . &apos; = NULL&apos;;
                unset($fields[$fieldName]);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                $set[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getColumnName($fieldName)) . &apos; = ?&apos;;
            }
        }

        $params = array_merge(array_values($fields), array_values($identifier));

        $sql  = &apos;UPDATE &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteIdentifier($table-&amp;gt;getTableName())
              . &apos; SET &apos; . implode(&apos;, &apos;, $set)
              . &apos; WHERE &apos; . implode(&apos; = ? AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quoteMultipleIdentifier($table-&amp;gt;getIdentifierColumnNames()))
              . &apos; = ?&apos;;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;exec($sql, $params);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows 7 32 bits with Apache 2.2.x, PHP 5.2.17, Sql Server 2008, Symfony 1.4.11 and Doctrine 1.2.4</environment>
            <key id="12667">DC-1007</key>
            <summary>Cannot update a field to NULL with MSSQL connection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="guitio2002">guitio2002</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 May 2011 19:37:07 +0000</created>
                <updated>Wed, 25 May 2011 19:43:52 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-978] Doctrine_Connection_Mssql dies on modifyLimitSubquery every time</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-978</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Looking at the latest version of Doctrine_Connection_Mssql in git repo:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/blob/b4dc8e66a89a7e17cd195c489b18005e19ca9ea5/lib/Doctrine/Connection/Mssql.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/blob/b4dc8e66a89a7e17cd195c489b18005e19ca9ea5/lib/Doctrine/Connection/Mssql.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Doctrine_Query:getLimitSubquery() there is a call to Doctrine_Connection_Mssql::modifyLimitSubquery().&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function modifyLimitSubquery(Doctrine_Table $rootTable, $query, $limit = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $offset = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isManip = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
{
	&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;modifyLimitQuery($query, $limit, $offset, $isManip, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This in turn calls Doctrine_Connection_Mssql::modifyLimitQuery() wihtout passing the $queryOrigin parameter:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function modifyLimitQuery($query, $limit = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $offset = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isManip = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isSubQuery = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, Doctrine_Query $queryOrigin = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($limit === &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; || !($limit &amp;gt; 0)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query;
        }

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

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; &amp;amp;&amp;amp; $orderby === &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Connection_Exception(&lt;span class=&quot;code-quote&quot;&gt;&quot;OFFSET cannot be used in MSSQL without ORDER BY due to emulation reasons.&quot;&lt;/span&gt;);
        }
        
        $count = intval($limit);
        $offset = intval($offset);

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

        $orderbySql = $queryOrigin-&amp;gt;getSqlQueryPart(&apos;orderby&apos;);
        $orderbyDql = $queryOrigin-&amp;gt;getDqlPart(&apos;orderby&apos;);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderby !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
            $orders = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;parseOrderBy(implode(&apos;, &apos;, $queryOrigin-&amp;gt;getDqlPart(&apos;orderby&apos;)));

            &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; count($orders); $i++) {
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From just looking at the above code, the query chokes on the first call to a $queryOrigin method. It seems like there is a lot of missing code here which should work with the $query directly when $queryOrigin is not available...&lt;/p&gt;

&lt;p&gt;What is the point of $orderbySql and $orderbyDql variables when they are not used anywhere?&lt;/p&gt;

&lt;p&gt;This code looks like it&apos;s half way done and untested.&lt;/p&gt;</description>
                <environment>windows</environment>
            <key id="12434">DC-978</key>
            <summary>Doctrine_Connection_Mssql dies on modifyLimitSubquery every time</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="andrej.pavlovic">Andrej Pavlovic</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Feb 2011 17:14:51 +0000</created>
                <updated>Sun, 27 Feb 2011 17:17:16 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-586] Doctrine outputs invalid SQL when using Limit and Order By conditions in MSSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-586</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a Doctrine model which connects to a MSSQL database. I was trying to run the following 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;$q = Doctrine_Query::create()
    -&amp;gt;select(&apos;*&apos;)
    -&amp;gt;from(&apos;Comment c&apos;)
    -&amp;gt;innerJoin(&apos;c.RecordType&apos;)
    -&amp;gt;innerJoin(&apos;c.Department&apos;)
    -&amp;gt;limit(10)
    -&amp;gt;orderBy(&apos;c.Counter&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The code failed with a SQL Syntax exception so I took a look at the generated query and found the following (SELECT fields shortened for readabilty):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT * FROM (
	SELECT TOP 10 * FROM (
		SELECT TOP 10 [c].[counter] AS [c__counter], [c].[loanid] AS [c__loanid]... ... ...
		FROM comments c
			INNER JOIN [SystemTypes] [s] ON [c].[recordtype] = [s].[code] AND [s].[fieldname] = &apos;RecordType&apos;
			INNER JOIN [SystemTypes] [s2] ON [c].[department] = [s2].[code] AND [s2].[fieldname] = &apos;Department&apos;
		ORDER BY [c].[counter]
	) AS [inner_tbl]
	ORDER BY [inner_tbl].[counter] AS [c__counter] DESC
) AS [outer_tbl]
ORDER BY [outer_tbl].[counter] AS [c__counter] ASC
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, the ORDER BY clauses on the inner_tbl and outer_tbl segments have AS clauses which do not belong there. If you fix the ORDER BY statements the query runs just fine.&lt;/p&gt;

&lt;p&gt;So I decided to prod around the Mssql.php connection class and found 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;140 &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function modifyLimitQuery($query, $limit = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $offset = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isManip = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, $isSubQuery = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
141 {
...
169                    $field_array = explode(&apos;,&apos;, $fields_string);
170                    $field_array = array_shift($field_array);
171                    $aux2 = preg_split(&apos;/ as /&apos;, $field_array);
172                    $aux2 = explode(&apos;.&apos;, end($aux2));
173
174                    $aliases[$i] = trim(end($aux2));
...
232 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Line 171 seems to be in charge of setting up the orderBy aliases but it is looking for a lower case &apos; as &apos; string which doesn&apos;t exist in this SQL expression. Changing that to a case insensitive regular expression search seems to fix the problem:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;171                    $aux2 = preg_split(&apos;/ as /i&apos;, $field_array);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the resulting SQL with the change:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT * FROM (
	SELECT TOP 10 * FROM (
		SELECT TOP 10 [c].[counter] AS [c__counter], [c].[loanid] AS [c__loanid]... ... ...
		FROM comments c
			INNER JOIN [SystemTypes] [s] ON [c].[recordtype] = [s].[code] AND [s].[fieldname] = &apos;RecordType&apos;
			INNER JOIN [SystemTypes] [s2] ON [c].[department] = [s2].[code] AND [s2].[fieldname] = &apos;Department&apos;
		ORDER BY [c].[counter]
	) AS [inner_tbl]
	ORDER BY [inner_tbl].[c__counter] DESC
) AS [outer_tbl]
ORDER BY [outer_tbl].[c__counter] ASC]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This seems to fix the problem but I don&apos;t know if it&apos;ll create a regression. It&apos;s a start though. Anyone have any thoughts on this?&lt;/p&gt;</description>
                <environment>Windows XP&lt;br/&gt;
Apache 2.2&lt;br/&gt;
PHP 5.3&lt;br/&gt;
Doctrine 1.2.1&lt;br/&gt;
Symfony 1.4</environment>
            <key id="11089">DC-586</key>
            <summary>Doctrine outputs invalid SQL when using Limit and Order By conditions in MSSQL</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="pradador">Jose Prado</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2010 19:08:42 +0000</created>
                <updated>Thu, 18 Mar 2010 19:08:42 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

&lt;p&gt;and it works.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12066">DC-917</key>
            <summary>Doctrine take wrong connction</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vovikdrg">Volodymyr</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Nov 2010 04:45:12 +0000</created>
                <updated>Fri, 5 Nov 2010 04:45:12 +0000</updated>
                                                                    <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-881] Doctrine_Manager::parsePdoDsn() doesn&apos;t work properly [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-881</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Manager::parsePdoDsn(&apos;dblib:host=127.0.0.1:1433;dbname=foo&apos;) does not return proper results.&lt;/p&gt;

&lt;p&gt;patch and test case @ github&lt;/p&gt;</description>
                <environment></environment>
            <key id="11989">DC-881</key>
            <summary>Doctrine_Manager::parsePdoDsn() doesn&apos;t work properly [+patch]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Oct 2010 12:46:04 +0000</created>
                <updated>Fri, 8 Oct 2010 12:46:04 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-863] Connection.UnitOfWork::buildFlushTree when loading data from yml file, Incorrect ordering of tables by their relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-863</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I don&apos;t know where exactly to start, I&apos;m new here, and i&apos;m not even sure this is a bug. BUT&lt;/p&gt;

&lt;p&gt;We have a database structure with most important tables&apos; PK&apos;s as string fields, which function as FK on other tables the basic structure is:&lt;/p&gt;

&lt;p&gt;Artist&lt;br/&gt;
   -Album&lt;br/&gt;
     -Song&lt;br/&gt;
       -Comments&lt;/p&gt;

&lt;p&gt;each artist has multiple songs&lt;br/&gt;
each artist has multiple albums&lt;br/&gt;
each album has multiple songs that belong to the same artist as the album belongs to&lt;br/&gt;
each song has multiple comments&lt;/p&gt;

&lt;p&gt;thus, the UnitOfWork - builtFlushTree should generate&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;=&amp;gt;Artist&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;=&amp;gt;Album&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;=&amp;gt;Song&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;=&amp;gt;Comments&lt;/p&gt;

&lt;p&gt;but instead i get:&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; =&amp;gt; Album&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; =&amp;gt; Artist&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt; =&amp;gt; Song&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt; =&amp;gt; Lyrics&lt;/p&gt;

&lt;p&gt;which in turn generates:&lt;/p&gt;

&lt;p&gt;QLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`lyrics`.`album`, CONSTRAINT `album_artist_fk_stripped_name_artist_stripped_name` FOREIGN KEY (`artist_fk_stripped_name`) REFERENCES `artist` (`stripped_name`) ON DELETE CASCADE ON UPDATE CASC)  &lt;br/&gt;
obviously.&lt;/p&gt;

&lt;p&gt;I&apos;ve been going through symfony/doctrine code for a whole day trying to figure out why I can&apos;t load-data. in the end i get to this buildFlushTree function.&lt;br/&gt;
probably have to go deeper. but so far this is it&lt;/p&gt;

&lt;p&gt;PS. It&apos;s my decision to use string fields as PK&apos;s and FK even though it&apos;s a bad practice, but just because it is a bad practice I shouldn&apos;t be unable to work with it.&lt;/p&gt;</description>
                <environment>symfony 1.4.6, windows 7, apache2.2, php5.3.3, mySQL 5.1.49-community</environment>
            <key id="11902">DC-863</key>
            <summary>Connection.UnitOfWork::buildFlushTree when loading data from yml file, Incorrect ordering of tables by their relations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fuximus">Ochoo</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 04:36:44 +0000</created>
                <updated>Wed, 1 Dec 2010 20:31:14 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                <component>Data Fixtures</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14328" author="fuximus" created="Fri, 10 Sep 2010 20:15:39 +0000"  >&lt;p&gt;found a tiny BUG, submitting the fix.&lt;/p&gt;


&lt;p&gt;EDIT: scratch  the rest from here.&lt;/p&gt;

&lt;p&gt;&amp;lt;!-----------&lt;br/&gt;
still, fixing the bug does not resolve the issue&lt;br/&gt;
BECAUSE:&lt;br/&gt;
   the whole logic of ordering the tables is flawed! it can be proved, don&apos;t have time to do so. but trying to come up with a fix myself&lt;/p&gt;

&lt;p&gt;   instead of looping through the tables and then through each tables&apos; related tables, either have a recursive function OR implement user defined array sort function, latter of which seems like the proper and correct way to go&lt;br/&gt;
--&amp;gt;&lt;/p&gt;

</comment>
                    <comment id="14329" author="fuximus" created="Fri, 10 Sep 2010 20:18:26 +0000"  >&lt;p&gt;unfortunately i&apos;m unable to commit any changes i have made. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; just me being a newbie, any help is appreciated&lt;/p&gt;</comment>
                    <comment id="14331" author="fuximus" created="Fri, 10 Sep 2010 20:32:35 +0000"  >&lt;p&gt;on UnitOfWork.php of Doctrine ORM 1.2.3 &lt;br/&gt;
Revision 7684&lt;br/&gt;
right after the line 752:&lt;br/&gt;
          array_splice($flushList, $index, 0, $relatedClassName);&lt;br/&gt;
there should be:&lt;br/&gt;
          $index++;&lt;/p&gt;</comment>
                    <comment id="14863" author="atali" created="Mon, 29 Nov 2010 00:07:38 +0000"  >&lt;p&gt;@Ochoo: Even with your bugfix, it doesn&apos;t seem to work.&lt;/p&gt;</comment>
                    <comment id="14881" author="fuximus" created="Wed, 1 Dec 2010 20:31:14 +0000"  >&lt;p&gt;thanks atali, i haven&apos;t checked it on 1.2.3, just did and you&apos;re right. the &quot;bug fix&quot; worked on 1.2.0 but not on 1.2.3. I&apos;m gonna look into it, at least i&apos;ll try. but this is a bug right?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10782" name="schema.yml" size="6100" author="fuximus" created="Fri, 10 Sep 2010 04:36:44 +0000" />
                    <attachment id="10783" name="test.yml" size="1363" author="fuximus" created="Fri, 10 Sep 2010 04:36:44 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-998] MySQL Driver possibly subject to sql injections with PDO::quote()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-998</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Prior to 5.3.6, the MySQL PDO driver ignored the character set parameter to options. Due to MySQL&apos;s C api (and MySQLND), this is required for the proper function of mysql_real_escape_string() (the C API call). Since PDO uses the mres() C call for PDO::quote(), this means that the quoted string does not take into account the connection character set.&lt;/p&gt;

&lt;p&gt;Starting with 5.3.6, that was fixed. So now if you pass the proper character set to PDO via driver options, sql injection is impossible while using the PDO::quote() api call.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;PDO proof of concept&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$dsn = &apos;mysql:dbname=INFORMATION_SCHEMA;host=127.0.0.1;charset=GBK;&apos;;
$pdo = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; PDO($dsn, $user, $pass);
$pdo-&amp;gt;exec(&apos;SET NAMES GBK&apos;);
$string = chr(0xbf) . chr(0x27) . &apos; OR 1 = 1; /*&apos;;
$sql = &quot;SELECT TABLE_NAME
            FROM INFORMATION_SCHEMA.TABLES
            WHERE TABLE_NAME LIKE &lt;span class=&quot;code-quote&quot;&gt;&quot;.$pdo-&amp;gt;quote($string).&quot;&lt;/span&gt; LIMIT 1;&quot;;
$stmt = $pdo-&amp;gt;query($sql);
var_dump($stmt-&amp;gt;rowCount());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Expected Result: `int(0)`.&lt;br/&gt;
Actual Result: `int(1)`.&lt;/p&gt;


&lt;p&gt;There are 2 issues to fix. First, the documentation does not indicate that you can pass the `charset` option to the MySQL Driver. This should be fixed so that users are given the proper option to set character sets.&lt;/p&gt;

&lt;p&gt;Secondly, `Connection::setCharset()` should be modified for MySQL to throw an exception, since the character set is only safely setable using the DSN with PDO. This is a limitation of the driver and could be asked as a feature request for the PHP core. Either that, or a big warning should be put on the documentation of the API to indicate the unsafe character set change&lt;/p&gt;

&lt;p&gt;Note that this is the same issue reported for Doctrine2 with link: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-111&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DBAL-111&lt;/a&gt; &lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12570">DC-998</key>
            <summary>MySQL Driver possibly subject to sql injections with PDO::quote()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ircmaxell">Anthony Ferrara</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Apr 2011 13:30:02 +0000</created>
                <updated>Mon, 23 May 2011 13:43:37 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15872" author="fabpot" created="Mon, 23 May 2011 13:43:37 +0000"  >&lt;p&gt;Any news on this one? It has been &quot;fixed&quot; in Doctrine2 and must be also fixed in Doctrine1.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-960] Bug in OCI8 adapter&apos;s freeCursor function causes exception with HYDRATE_ON_DEMAND</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-960</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;oci_free_statement  should be changed to oci_cancel inside Doctrine_Adapter_Statement_Oracle::closeCursor(). Otherwise exception is thrown if HYDRATE_ON_DEMAND is used followed by foreach loop.&lt;/p&gt;

&lt;p&gt;Doctrine2 should also be affected by this bug.&lt;/p&gt;

&lt;p&gt;Change:&lt;br/&gt;
public function closeCursor()&lt;/p&gt;
    {
        $this-&amp;gt;bindParams = array();
        return oci_free_statement($this-&amp;gt;statement);
    }
&lt;p&gt;To:&lt;br/&gt;
public function closeCursor()&lt;/p&gt;
    {
        $this-&amp;gt;bindParams = array();
        return oci_cancel($this-&amp;gt;statement);
    }</description>
                <environment>doctrine, symfony, linux, hpux</environment>
            <key id="12327">DC-960</key>
            <summary>Bug in OCI8 adapter&apos;s freeCursor function causes exception with HYDRATE_ON_DEMAND</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vadik56">vadik56</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Jan 2011 10:45:34 +0000</created>
                <updated>Wed, 26 Jan 2011 10:45:34 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10918" name="closeCursor.diff" size="922" author="vadik56" created="Wed, 26 Jan 2011 10:45:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

<item>
            <title>[DC-989] Doctrine_Connection::execute() and Doctrine_Connection::exec() fail if Doctrine_Event::skipOperation() is triggered</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-989</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In order to generate SQL from migrations, an event listener was attached to the migration system to monitor for preQuery and preExec events.&lt;/p&gt;

&lt;p&gt;In an attempt to prevent the migration from additionally writing the query to the database, the skipOperation method was triggered, and supposedly allowed for n the execute() and exec() methods of Doctrine_Connection&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;eg. Doctrine_Connection::execute()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; 
$this-&amp;gt;getAttribute(Doctrine_Core::ATTR_LISTENER)-&amp;gt;preQuery($event);

if ( ! $event-&amp;gt;skipOperation) {
    $stmt = $this-&amp;gt;dbh-&amp;gt;query($query);
    $this-&amp;gt;_count++;
}
$this-&amp;gt;getAttribute(Doctrine_Core::ATTR_LISTENER)-&amp;gt;postQuery($event);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;unfortunately setting this option in the event listener breaks execution of the migration system as the $count/$stmtn variables (used in the methods) are no longer defined, triggering E_NOTICE, and the fetch* methods (eg fetchColumn) also break as they are chaining methods without testing for the return. theerfore, even if the $stmnt variable was created as initially null, the system would still throw an E_FATAL as the NULL variable doest provide the ::fetchColumn() methods (etc).&lt;/p&gt;

&lt;p&gt;Quite a serious flaw as 2 areas of code do not provide a consistent approach to how to work with events.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12486">DC-989</key>
            <summary>Doctrine_Connection::execute() and Doctrine_Connection::exec() fail if Doctrine_Event::skipOperation() is triggered</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Mar 2011 07:43:36 +0000</created>
                <updated>Tue, 22 Mar 2011 07:43:36 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-375] Doctrine_Table getTable singleton issue</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-375</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;first, i defined a table class :&lt;br/&gt;
class CohibaClientTable extends Doctrine_Table&lt;br/&gt;
{&lt;br/&gt;
    public $_pager;&lt;/p&gt;

&lt;p&gt;     public function getAbstractList($arrParam = array(), $page=1, $maxPerPage=20)&lt;br/&gt;
    {&lt;br/&gt;
        $objQuery = $this-&amp;gt;createQuery(&apos;t1&apos;)&lt;br/&gt;
            -&amp;gt;select(&apos;t1.*&apos;);&lt;/p&gt;

&lt;p&gt;        if(is_array($arrParam) &amp;amp;&amp;amp; count($arrParam)&amp;gt;0)&lt;/p&gt;
        {
            QueryAssistant::processOption($objQuery, $arrParam);  // dont set &quot;offset&quot; and &quot;limit&quot; option in it
        }

&lt;p&gt;        $this-&amp;gt;_pager = new Doctrine_Pager($objQuery, $page, $maxPerPage);&lt;/p&gt;

&lt;p&gt;        $items = $this-&amp;gt;_pager-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;        $objQuery-&amp;gt;free();&lt;br/&gt;
        return $items;&lt;br/&gt;
    }&lt;/p&gt;

&lt;p&gt;    public function getList($page=1, $maxPerPage=20)&lt;/p&gt;
    {
        $arrParam = array(
            &apos;orderBy&apos;=&amp;gt;&apos;t1.cle asc&apos;
        );

        return $this-&amp;gt;getAbstractList($arrParam, $page, $maxPerPage);
    }

&lt;p&gt;    public function getPager()&lt;/p&gt;
    {
        return $this-&amp;gt;_pager;
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;and then, in the action, invoke it like this codes:&lt;br/&gt;
1&amp;gt;&lt;br/&gt;
   $items = Doctrine::getTable(&quot;CohibaClient&quot;)-&amp;gt;getList(1, $maxPerPage);&lt;br/&gt;
    $pager = Doctrine::getTable(&quot;CohibaClient&quot;)-&amp;gt;getPager();&lt;/p&gt;

&lt;p&gt;    $this-&amp;gt;log(&quot;total records: &quot;.$pager-&amp;gt;getNumResults().&quot; total page: &quot;.$pager-&amp;gt;getLastPage().&quot;\n&quot;);&lt;br/&gt;
    $lastPage = $pager-&amp;gt;getLastPage();&lt;br/&gt;
2&amp;gt;&lt;br/&gt;
   $table = Doctrine::getTable(&quot;CohibaClient&quot;);&lt;br/&gt;
   $items = $table-&amp;gt;getList(1, $maxPerPage);&lt;br/&gt;
   $pager = $table-&amp;gt;getPager();&lt;/p&gt;

&lt;p&gt;   $this-&amp;gt;log(&quot;total records: &quot;.$pager-&amp;gt;getNumResults().&quot; total page: &quot;.$pager-&amp;gt;getLastPage().&quot;\n&quot;);&lt;br/&gt;
   $lastPage = $pager-&amp;gt;getLastPage();&lt;/p&gt;

&lt;p&gt;#2 works, but not #1, error is &quot;Fatal error: Call to a member function getNumResults() on a non-object in.... &quot; is it an issue when singleton generation?&lt;/p&gt;</description>
                <environment>symfony 1.2.9</environment>
            <key id="10644">DC-375</key>
            <summary>Doctrine_Table getTable singleton issue</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bennybi">ben bi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Dec 2009 02:46:16 +0000</created>
                <updated>Tue, 22 Dec 2009 06:59:07 +0000</updated>
                                    <version>1.0.14</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;First, I defined the following schema.yml::&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; 
  Example:
    actAs:
      I18n:
        fields: [title]
    columns:
        title: string(128)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, I prepared the following fixture &lt;a href=&quot;file::&quot; class=&quot;external-link&quot;&gt;file::&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt; 
  Example:
    Example_1:
      Translation:
        en:
          title: &quot;Title&quot;
        ja:
          title: &quot;&#38988;&#21517;&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;And I write the following code::&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
  Doctrine_Core::loadModels(&apos;models&apos;);
  $example = Doctrine_Core::getTable(&apos;Example&apos;)-&amp;gt;find(1);
  
  var_dump(
    $example-&amp;gt;Translation[&apos;en&apos;]-&amp;gt;title,
    $example-&amp;gt;Translation[&apos;ja&apos;]-&amp;gt;title
  );
  
  Doctrine_Manager::resetInstance();
  Doctrine_Manager::getInstance()-&amp;gt;openConnection(DSN, &apos;doctrine&apos;);
  
  $example2 = Doctrine_Core::getTable(&apos;Example&apos;)-&amp;gt;find(1);
  var_dump(
    $example2-&amp;gt;Translation[&apos;en&apos;]-&amp;gt;title,
    $example2-&amp;gt;Translation[&apos;ja&apos;]-&amp;gt;title
  );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-370] Doctrine serializes arrays, objects, etc. like &apos;string&apos;, which is never bigger than a TEXT, limited to 65535 characters (in MySQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-370</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine supports storing objects and arrays, and implements this via serialize().&lt;/p&gt;

&lt;p&gt;However in DataDict/Mysql they are handled like the &apos;string&apos; type, which means they are subject to the rules there that ensure nothing bigger than a &apos;TEXT&apos; is ever used to represent them.&lt;/p&gt;

&lt;p&gt;TEXT is not a great choice for objects and arrays because it&apos;s difficult to ensure they will not exceed 65,535 bytes in size.&lt;/p&gt;

&lt;p&gt;This would be most easily fixed by moving them to the next block of case statements there, used for CLOBs. The logic there already picks suitable large types (MEDIUMTEXT and LONGTEXT) as needed, and defaults to LONGTEXT which is a good choice for objects and arrays.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10635">DC-370</key>
            <summary>Doctrine serializes arrays, objects, etc. like &apos;string&apos;, which is never bigger than a TEXT, limited to 65535 characters (in MySQL)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Dec 2009 19:50:20 +0000</created>
                <updated>Fri, 29 Jan 2010 12:57:17 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11518" author="hobodave" created="Fri, 29 Jan 2010 03:37:42 +0000"  >&lt;p&gt;Array and Object data types now behave identically to clob.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7077&quot; class=&quot;external-link&quot;&gt;r7077&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="11523" author="boutell" created="Fri, 29 Jan 2010 12:57:17 +0000"  >&lt;p&gt;Thanks David!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-355] Call to a member function evictAll() if a table is retrieved, that is not existent</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-355</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;Im not quite sure it this bahaviour is wanted, but i think that this&lt;br/&gt;
should be catched:&lt;/p&gt;

&lt;p&gt;If i call Doctrine::getTable on a non existing model, the exception is&lt;br/&gt;
thrown. After them i want always to clear all Record Repositories, see&lt;br/&gt;
code:&lt;/p&gt;

&lt;p&gt;try&lt;/p&gt;
{
        $table = Doctrine::getTable(&apos;notexistent&apos;);
        }
&lt;p&gt;        catch(Exception $e)&lt;/p&gt;
{
                echo &apos;not existent&apos;.$e-&amp;gt;getMessage();
        }
&lt;p&gt;        Doctrine_Manager::connection()-&amp;gt;clear();&lt;/p&gt;

&lt;p&gt;Then I get the error message:&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function evictAll() on a non-object in /&lt;br/&gt;
core/lib/Doctrine/Doctrine/Connection.php on line 1239&lt;/p&gt;

&lt;p&gt;The problem is that the function clear doesnt check if a repository is&lt;br/&gt;
given.&lt;/p&gt;

&lt;p&gt; public function clear()&lt;br/&gt;
    {&lt;br/&gt;
        foreach ($this-&amp;gt;tables as $k =&amp;gt; $table) &lt;/p&gt;
{
            $table-&amp;gt;getRepository()-&amp;gt;evictAll();             //
getRepository delivers FALSE
            $table-&amp;gt;clear();
        }
&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;Is it normal behaviour? Or should it be checked first:&lt;/p&gt;

&lt;p&gt;if ($repository = $table-&amp;gt;getRepository())&lt;/p&gt;
{
 $repository-&amp;gt;evisctAll();

}

&lt;p&gt;best regards,&lt;br/&gt;
aNj&lt;/p&gt;</description>
                <environment>Ubuntu 8.04</environment>
            <key id="10608">DC-355</key>
            <summary>Call to a member function evictAll() if a table is retrieved, that is not existent</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="anj">aNj</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Dec 2009 18:27:17 +0000</created>
                <updated>Sat, 12 Dec 2009 18:27:17 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-280] Add pre/postHydrateResultSet() events</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-280</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Over the last several weeks I&apos;ve been working on streamlining the access control logic in the application I&apos;m working on, and I realized that Doctrine&apos;s event listeners might be able to help.  For more detailed background information take a look at &lt;a href=&quot;http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf&quot; class=&quot;external-link&quot;&gt;http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf&lt;/a&gt; ...but here&apos;s the problem in a nutshell:&lt;/p&gt;

&lt;p&gt;Since my application&apos;s access control logic is all implemented in PHP rather than in the database (i.e., I can&apos;t add access control to my queries as a simple WHERE clause), I&apos;m looking for a way to hook into the query process just after the records have been hydrated and actually modify the result set that gets returned, such that only permissible records show up in the final result set.&lt;/p&gt;

&lt;p&gt;Unfortunately, although there are several listener methods that look promising for this, none of them seem to have access to the data being returned.  For instance, if I run a custom query via Doctrine_Query::execute(), the postQuery() hook definitely runs ...but it doesn&apos;t give me access to anything but the query string itself.&lt;/p&gt;

&lt;p&gt;Since, in some instances (e.g., hydration listeners), the Doctrine_Event object is assigned arbitrary data that the listener can modify, I&apos;m wondering if the same thing couldn&apos;t be done more universally?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10495">DC-280</key>
            <summary>Add pre/postHydrateResultSet() events</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jazzslider">Adam Jensen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 23:38:02 +0000</created>
                <updated>Tue, 8 Jun 2010 16:09:38 +0000</updated>
                                                                    <component>Connection</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10829" author="jwage" created="Tue, 24 Nov 2009 00:01:06 +0000"  >&lt;p&gt;In Doctrine 1.2 you can create custom hydrators. You can extend the core hydrators to remove the data you want? I think that would work.&lt;/p&gt;</comment>
                    <comment id="10846" author="jazzslider" created="Tue, 24 Nov 2009 19:45:06 +0000"  >&lt;p&gt;Sure enough, that does the trick!&lt;/p&gt;

&lt;p&gt;There are a couple of downsides, though, that might be worth considering in terms of future development:&lt;/p&gt;

&lt;p&gt;1. It would be nice to be able to specify constructor arguments for the hydrator, so that collaborators can be injected.  In my example, the hydrator needs access to the application&apos;s access control list object; currently it&apos;s simply retrieving it from a global registry, but it would be nice for testing&apos;s sake to be able to inject it instead.&lt;br/&gt;
2. It would also be nice to be able to chain multiple hydrators together; that&apos;s one reason I was looking at listeners, since they&apos;ve got that capability already.  That approach allows you to keep distinct behavior distinct a lot more easily.&lt;/p&gt;

&lt;p&gt;Ultimately, I&apos;d still kind of like to see another listener method available ...say, preHydrateResultSet() and postHydrateResultSet()?  I think that would be a more flexible approach, even though the custom hydrator solution works quite well.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
Adam&lt;/p&gt;</comment>
                    <comment id="10847" author="jwage" created="Tue, 24 Nov 2009 19:49:31 +0000"  >&lt;p&gt;I like the idea. I&apos;ll move this to 1.3. I don&apos;t think we&apos;re gonna have a 1.3 version but if we do, it&apos;ll be there.&lt;/p&gt;</comment>
                    <comment id="12211" author="jwage" created="Mon, 15 Mar 2010 14:22:57 +0000"  >&lt;p&gt;We can include this in a 1.2.x release if you would like to provide a patch and some tests. Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

&lt;p&gt;how can i connect to mysql5.1 with php5.3, and what is the best connection to pick. mysql or mysqli.&lt;/p&gt;</description>
                <environment>windows xp, apache2.2 web server, php5.3.1, doctrine1.2.2, zend framework 1.10.3, mysql 5.1</environment>
            <key id="11323">DC-668</key>
            <summary>Call to undefined method Doctrine_Adapter_Mysqli::setAttribute() </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nadim">nadim</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 May 2010 09:31:36 +0000</created>
                <updated>Tue, 8 Jun 2010 11:57:44 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13170" author="jwage" created="Tue, 8 Jun 2010 11:57:44 +0000"  >&lt;p&gt;What is Doctrine_Adapter_Mysqli? Is this your own class?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

<item>
            <title>[DC-541] MSSQL Server: Enabling MARS prevents the saving of records.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-541</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is related to issue #540. In order to circumvent that issue, I enabled MARS (Multiple Active Result Sets) - now when attempting to save any record the following error results:&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Transaction_Exception&apos; with message &apos;Rollback failed. There is no active transaction.&apos; in C:\www\doctrine\lib\Doctrine\Transaction.php on line 319&lt;/p&gt;

&lt;p&gt;This is actually caused by the following MSSQL error:&lt;/p&gt;

&lt;p&gt;exception &apos;Doctrine_Transaction_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 3997 &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;A transaction that was started in a MARS batch is still active at the end of the batch. The transaction is rolled back. (SQLExecDirect&lt;span class=&quot;error&quot;&gt;&amp;#91;3997&amp;#93;&lt;/span&gt; at ext\pdo_odbc\odbc_driver.c:247)&apos; in C:\www\doctrine\lib\Doctrine\Transaction.php:212 Stack trace: #0 C:\www\doctrine\lib\Doctrine\Transaction.php(511): Doctrine_Transaction-&amp;gt;beginTransaction(NULL) #1 C:\www\doctrine\lib\Doctrine\Connection.php(1377): Doctrine_Transaction-&amp;gt;beginInternalTransaction(NULL) #2 C:\www\doctrine\lib\Doctrine\Connection\UnitOfWork.php(64): Doctrine_Connection-&amp;gt;beginInternalTransaction() #3 C:\www\doctrine\lib\Doctrine\Record.php(1691): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(Model)) #4 C:\www\doctrine\tools\sandbox\index.php(83): Doctrine_Record-&amp;gt;save() #5 &lt;/p&gt;
{main}

&lt;p&gt;I haven&apos;t worked out what&apos;s going on yet, but this blog post may shed some light on it:&lt;br/&gt;
&lt;a href=&quot;http://blogs.msdn.com/cbiyikoglu/archive/2006/11/21/mars-transactions-and-sql-error-3997-3988-or-3983.aspx&quot; class=&quot;external-link&quot;&gt;http://blogs.msdn.com/cbiyikoglu/archive/2006/11/21/mars-transactions-and-sql-error-3997-3988-or-3983.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a script to reproduce this issue in the sandbox (MARS is enabled in the DSN).&lt;/p&gt;</description>
                <environment>PHP 5.3.1&lt;br/&gt;
MSSQL Server 2008&lt;br/&gt;
Windows&lt;br/&gt;
PHP PDO ODBC</environment>
            <key id="10990">DC-541</key>
            <summary>MSSQL Server: Enabling MARS prevents the saving of records.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Mar 2010 13:20:00 +0000</created>
                <updated>Thu, 10 Jun 2010 04:40:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Connection</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12237" author="jwage" created="Mon, 15 Mar 2010 16:23:31 +0000"  >&lt;p&gt;We&apos;ll need some more information. We don&apos;t have a way to test against mssql currently.&lt;/p&gt;</comment>
                    <comment id="12273" author="craigmarvelley" created="Tue, 16 Mar 2010 06:59:00 +0000"  >&lt;p&gt;I&apos;ve dug a little deeper and it seems that the exception is thrown because the Doctrine_Transaction_Mssql class has overrides for the transaction begin/commit/rollback methods. When I remove these overrides and let transactions be handled through the PDO API I don&apos;t get any exceptions while transactions seem to function as normal.&lt;/p&gt;

&lt;p&gt;Why are these methods overridden? Is it perhaps only necessary for the MSSQL PDO extension, as suggested here (&lt;a href=&quot;http://trac.symfony-project.org/wiki/HowToConnectToMSSQLServer&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/wiki/HowToConnectToMSSQLServer&lt;/a&gt;), since that extension seemingly has no native transaction support (I&apos;ve never used it)? Perhaps this isn&apos;t necessary for the ODBC extension?&lt;/p&gt;</comment>
                    <comment id="12291" author="craigmarvelley" created="Tue, 16 Mar 2010 15:06:21 +0000"  >&lt;p&gt;This patch maintains the existing manual transaction functionality for MSSQL connections, but uses the native PDO API for ODBC connections.&lt;/p&gt;</comment>
                    <comment id="13188" author="jwage" created="Tue, 8 Jun 2010 14:32:50 +0000"  >&lt;p&gt;Hmm. I don&apos;t think this patch is good. It doesn&apos;t fix the problem, just hacks around it.&lt;/p&gt;</comment>
                    <comment id="13231" author="craigmarvelley" created="Tue, 8 Jun 2010 18:31:23 +0000"  >&lt;p&gt;Ok.. Do you have any recommendations for a better patch? While I agree my patch is far from elegant, it does at least allow MSSQL and ODBC to work alongside each other. As far as I can tell, the underlying issue is that Doctrine uses the same driver for two very different PDO extensions - I couldn&apos;t think of a way to resolve this issue without some kind of check as to which extension is in use.&lt;/p&gt;

&lt;p&gt;We could maybe catch the exception that&apos;s thrown in the first instance when running a manual query, and try calling the parent rollback method instead? Maybe only when the current connection is ODBC? That&apos;s essentially the same approach though, with the added overhead of an unnecessary query that we know will fail..&lt;/p&gt;

&lt;p&gt;I&apos;m very keen to find a fix that you&apos;re happy with for this since I&apos;ve been manually patching it for a while, so any feedback that would engender that would be great!&lt;/p&gt;</comment>
                    <comment id="13232" author="jwage" created="Tue, 8 Jun 2010 18:47:47 +0000"  >&lt;p&gt;I am still not sure of the exact problem/error that is happening. When isn&apos;t happening with the current code? or is something happening that should not?&lt;/p&gt;</comment>
                    <comment id="13248" author="craigmarvelley" created="Wed, 9 Jun 2010 06:58:08 +0000"  >&lt;p&gt;As far as I understand it (I&apos;m no SQL Server expert, unfortunately!) the issue is this: &lt;/p&gt;

&lt;p&gt;The Doctrine_Transaction_Mssql class is used for both the MSSQL and ODBC PDO extensions. It manages transactions by executing manual queries against the database (ROLLBACK TRANSACTION, COMMIT_TRANSACTION, etc.).&lt;/p&gt;

&lt;p&gt;This isn&apos;t compatible with the ODBC PDO extension and SQL Server when Multiple Active Record Sets is enabled; I believe MARS allows multiple transactions to co-exist, and this query-style way of managing them isn&apos;t compatible with that as transactions aren&apos;t &apos;namespaced&apos;. MARS is critical because without it there&apos;s no way of looping over more than one record set at the same time, something we take for granted in MySQL et al.&lt;/p&gt;

&lt;p&gt;From that link to the Symfony wiki I posted earlier, it appears that the query method of managing transactions is only necessary for the MSSQL PDO extension - quote:&lt;/p&gt;

&lt;p&gt;&quot;dblib doesn&apos;t support transactions so we need to add a workaround for transactions, last insert ID, and quoting&quot;&lt;/p&gt;

&lt;p&gt;This is backed up by the patch - when we let the ODBC driver handle transactions natively, everything works fine.&lt;/p&gt;

&lt;p&gt;Does that make sense?&lt;/p&gt;</comment>
                    <comment id="13250" author="jwage" created="Wed, 9 Jun 2010 12:39:06 +0000"  >&lt;p&gt;Now that I look at everything again, do we need to even be overriding those methods at all in Doctrine_Transaction_Mssql (_doRollback, _doCommit, _doBeginTransaction). We should just let the database driver handle it?&lt;/p&gt;</comment>
                    <comment id="13251" author="jwage" created="Wed, 9 Jun 2010 12:40:05 +0000"  >&lt;div class=&quot;code panel&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/Transaction/Mssql.php
===================================================================
--- lib/Doctrine/Transaction/Mssql.php	(revision 7673)
+++ lib/Doctrine/Transaction/Mssql.php	(working copy)
@@ -65,28 +65,4 @@
 
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;execute($query);
     }
-    
-    /**
-     * Performs the rollback.
-     */
-    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _doRollback()
-    {
-        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh()-&amp;gt;exec(&apos;ROLLBACK TRANSACTION&apos;);
-    }
-    
-    /**
-     * Performs the commit.
-     */
-    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _doCommit()
-    {
-        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh()-&amp;gt;exec(&apos;COMMIT TRANSACTION&apos;);
-    }
-    
-    /**
-     * Begins a database transaction.
-     */
-    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _doBeginTransaction()
-    {
-        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh()-&amp;gt;exec(&apos;BEGIN TRANSACTION&apos;);
-    }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It seems like we don&apos;t even need to do that?&lt;/p&gt;</comment>
                    <comment id="13264" author="craigmarvelley" created="Thu, 10 Jun 2010 04:40:57 +0000"  >&lt;p&gt;For ODBC, we definitely don&apos;t. That link suggests the above approach caters to the MSSQL extension. I&apos;ve not tried that one because I&apos;m on Windows and as you probably know it&apos;s not recommended; I imagine I&apos;d have way too many other problems were I to try! I didn&apos;t want to break anything for anyone using the MSSQL driver though, which led to my awkward patch.&lt;/p&gt;

&lt;p&gt;From my point of view, I&apos;d imagine the majority of people using SQL Server will be using a Windows stack, and therefore ODBC (and possibly the new SQL Server Driver for PHP PDO extension, which definitely won&apos;t need manual queries, in future) - so I&apos;d favour an approach that didn&apos;t compromise those drivers.&lt;/p&gt;

&lt;p&gt;As an aside - are there any plans afoot to support the new Microsoft endorsed driver? I imagine if you guys were to do so it would be for Doctrine 2, but do you know of any community effort to get it working in 1.2?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10422" name="index.php" size="1008" author="craigmarvelley" created="Wed, 3 Mar 2010 13:20:00 +0000" />
                    <attachment id="10484" name="mssql_transaction.patch" size="1585" author="craigmarvelley" created="Tue, 16 Mar 2010 15:06:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-841] Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery regex failing to replace all &apos;?&apos; instances [patch+]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-841</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When executing queries with WHERE statements using multiple instances of the &quot;&amp;lt;&amp;gt;&quot; operator (as well as other non &lt;tt&gt;=,(&lt;/tt&gt; symbols inbetween definitions), the method &lt;tt&gt;Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery&lt;/tt&gt; fails to identify all ? replacements.&lt;/p&gt;

&lt;p&gt;In the following piece of code I have a query (trimmed for readability and renamed for privacy) that fails to have all &quot;?&quot; symbols replaced as well as the relevant code from the method mentioned above (minus the return statement) doing a simple demonstration:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php 
$query = &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; ? AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;;

$params = array(
	&quot;&apos;param1&apos;&quot;,
	&quot;&apos;param2&apos;&quot;,
	&quot;&apos;param3&apos;&quot;
);


/**
 * Replaces bound parameters and their placeholders with explicit values.
 *
 * Workaround for http://bugs.php.net/36561
 *
 * @param string $query
 * @param array $params
 */
//protected function replaceBoundParamsWithInlineValuesInQuery($query, array $params) {

	foreach($params as $key =&amp;gt; $value) {
		if(is_null($value)) {
			$value = &apos;NULL&apos;;
		}
		else {
			//$value = $this-&amp;gt;quote($value); //REMOVED AS PRE-ADDED QUOTES TO ABOVE PARAMETER LIST
		}

		$re = &apos;/([=,\(][^\\\&apos;]*)(\?)/iU&apos;;
		
		$matches = array();
		preg_match($re,$query,$matches);
		
		var_dump($matches); //ADDED FOR DEMONSTRATION

		$query = preg_replace($re, &quot;\\1 {$value}&quot;, $query, 1);
		
		var_dump($query); //ADDED FOR DEMONSTRATION
	}

//	return $query;
//
//}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Running this code produces: &lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;array(3) {
  [0]=&amp;gt;
  string(18) &quot;([t].[field1] &amp;lt;&amp;gt; ?&quot;
  [1]=&amp;gt;
  string(17) &quot;([t].[field1] &amp;lt;&amp;gt; &quot;
  [2]=&amp;gt;
  string(1) &quot;?&quot;
}
string(108) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt;  &apos;param1&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;
array(0) {
}
string(108) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt;  &apos;param1&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;
array(0) {
}
string(108) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt;  &apos;param1&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field2] LIKE ?)&quot;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately the regex will not identify all the ? instances properly in the query when run like &lt;tt&gt;preg_match_all()&lt;/tt&gt;, which was my first idea to fix (pre-identify all ? instances, then go through and replace them).&lt;/p&gt;

&lt;p&gt;The only 3 potential solutions I can think of are:&lt;/p&gt;

&lt;p&gt;1. Pre-identify all ?&apos;s and note their position in the string, to do this using a much looser regex, then replace all the ?&apos;s found&lt;br/&gt;
2. Use a stack a loop and a switch statement to scan for eligible ? replacements. I have some sample code that shows this should work, but performance is not something I have tested.&lt;br/&gt;
3. Revert back to the previous behavior. Scanning the changelogs I really don&apos;t know where this broke, other than queries that worked prior to 1.2.3 have since broken and this method is the cause.&lt;/p&gt;</description>
                <environment>PHP 5.2.11, Apache, Microsoft SQL Server 2005</environment>
            <key id="11826">DC-841</key>
            <summary>Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery regex failing to replace all &apos;?&apos; instances [patch+]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dcousineau">Daniel Cousineau</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 18:14:54 +0000</created>
                <updated>Sat, 5 Mar 2011 17:54:59 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14072" author="dcousineau" created="Wed, 25 Aug 2010 18:18:41 +0000"  >&lt;p&gt;I am probably way over thinking a solutions, however since I have to run home and don&apos;t have time to flesh this out further at the moment, my initial idea is something like this:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php 
$query = &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field?] LIKE ? AND [t].[field3] = ?)&quot;;

$params = array(
	&quot;&apos;param1&apos;&quot;,
	&quot;param2?&quot;,
	&quot;&apos;param3&apos;&quot;
);

var_dump($query);

$stack = array();
$stringDelim = array(&quot;&apos;&quot;, &apos;&quot;&apos;);

$i = 0;
foreach( str_split($query) as $char )
{
	switch($char) {
		
		case &quot;[&quot;:
			if( !in_array(end($stack), $stringDelim) )
				array_push($stack, $char);
			
			break;
			
		case &quot;]&quot;:
			if( end($stack) == &quot;[&quot; ) {
				array_pop($stack);
			} else
				array_push($stack, $char);
				
			break;
		
		case &quot;\&quot;&quot;:
		case &quot;&apos;&quot;:
			if( end($stack) == $char )
				array_pop($stack);
			else
				array_push($stack, $char);
			
			break;
		
		case &quot;?&quot;:
			if( !in_array(end($stack), array_merge($stringDelim, array(&quot;[&quot;, &quot;]&quot;))) )
			{
				$param = array_shift($params);
				$query = substr_replace($query, $param, $i, 1);
				
				$i += strlen($param) - 1;
				var_dump($query);
			}
			
			
			break;
		
		default:
	}
	
	$i++;
}

var_dump($query);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which produces&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;string(131) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; ? AND [t].[field?] LIKE ? AND [t].[field3] = ?)&quot;
string(138) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE ? AND [t].[field3] = ?)&quot;
string(144) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE param2? AND [t].[field3] = ?)&quot;
string(151) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE param2? AND [t].[field3] = &apos;param3&apos;)&quot;
string(151) &quot;SELECT * FROM [table] AS [t] WHERE ([t].[field1] &amp;lt;&amp;gt; &apos;Testing!?&apos; AND [t].[field2] &amp;lt;&amp;gt; &apos;param1&apos; AND [t].[field?] LIKE param2? AND [t].[field3] = &apos;param3&apos;)&quot;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which is what we would expect, as well as it doesn&apos;t take into account for newly inserted data containing &apos;?&apos; symbols.&lt;/p&gt;

&lt;p&gt;But again this is just playing around with potential solutions.&lt;/p&gt;</comment>
                    <comment id="14113" author="enrico" created="Fri, 27 Aug 2010 10:54:27 +0000"  >&lt;p&gt;The patch for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-545&quot; title=&quot;MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.&quot;&gt;&lt;del&gt;DC-545&lt;/del&gt;&lt;/a&gt; broke some queries or didn&apos;t worked at all. Unfortunately there was no Test Case for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-545&quot; title=&quot;MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.&quot;&gt;&lt;del&gt;DC-545&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The patch and a Test Case can be found at: &lt;a href=&quot;http://github.com/estahn/doctrine1/compare/master...DC-841&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/master...DC-841&lt;/a&gt;&lt;/p&gt;
</comment>
                    <comment id="14233" author="enrico" created="Thu, 2 Sep 2010 08:01:50 +0000"  >&lt;p&gt;I made a mistake with github, the updated branch can be found at&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-841-2&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-841-2&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15465" author="rotoclap" created="Sat, 5 Mar 2011 17:54:59 +0000"  >&lt;p&gt;Doesn&apos;t work with :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&apos;Test&apos; &amp;lt;&amp;gt; &apos;Test !?&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The question mark is captured...&lt;/p&gt;

&lt;p&gt;This code seems working :&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;foreach($params as $key =&amp;gt; $value) {
  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(is_null($value)) {
    $value = &apos;NULL&apos;;
  }
  &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
    $value = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;quote($value);
  }

  $re = &apos;/((?:[=&amp;lt;&amp;gt;,\(]|LIKE|IS)[^\\\&apos;]*)(\?)/iuU&apos;;

  $query = preg_replace($re, &lt;span class=&quot;code-quote&quot;&gt;&quot;\\1 {$value}&quot;&lt;/span&gt;, $query, 1);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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


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

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

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

&lt;p&gt;Will result in no connection found for:&lt;/p&gt;

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

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

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

&lt;p&gt;This bug is related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-740&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-740&lt;/a&gt; &lt;/p&gt;</description>
                <environment>Symfony 1.4.x&lt;br/&gt;
sfDoctrinePlugin&lt;br/&gt;
</environment>
            <key id="11593">DC-777</key>
            <summary>getConnectionForComponent and bindComponent are case sensitive </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pluk77">Marcel Berteler</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Jul 2010 08:06:34 +0000</created>
                <updated>Wed, 7 Jul 2010 08:06:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10690" name="doctrine_manager.patch" size="1563" author="pluk77" created="Wed, 7 Jul 2010 08:06:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-773] Connection::createQuery() can use wrong connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-773</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Similar to bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-437&quot; title=&quot;Connection::query() can use wrong connection&quot;&gt;&lt;del&gt;DC-437&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-437&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-437&lt;/a&gt;)&lt;br/&gt;
When calling Connection::createQuery() object we use the default connection instead of the connection we have when calling the createQuery() method.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11577">DC-773</key>
            <summary>Connection::createQuery() can use wrong connection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lonnyk">Lonny Kapelushnik</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2010 16:37:22 +0000</created>
                <updated>Thu, 1 Jul 2010 18:13:31 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13485" author="lonnyk" created="Thu, 1 Jul 2010 18:13:31 +0000"  >&lt;p&gt;Patch and Test Case&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10686" name="DC773TestCase.php" size="4321" author="lonnyk" created="Thu, 1 Jul 2010 18:13:31 +0000" />
                    <attachment id="10685" name="DC_773.patch" size="482" author="lonnyk" created="Thu, 1 Jul 2010 18:13:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-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-894] Typo in Doctrine_Manager::getConnectionDrivers()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-894</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello.&lt;/p&gt;

&lt;p&gt;getConnectionDrivers is returning member variable &apos;_connectionsDrivers&apos; at line 809.&lt;br/&gt;
It&apos;s probably typo, I think this variable name should be &apos;_connectionDrivers&apos;.&lt;/p&gt;
</description>
                <environment>symfony 1.4 / PHP 5.2.13 / CentOS5.4</environment>
            <key id="12018">DC-894</key>
            <summary>Typo in Doctrine_Manager::getConnectionDrivers()</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="akitaka">Akitaka Kohno</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 23:59:44 +0000</created>
                <updated>Tue, 19 Oct 2010 23:59:44 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-879] MSSQL - missing function date_part() in Expression/Mssql.php [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-879</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Missing function date_part() in Expression/Mssql.php. I don&apos;t know why the set of expressions is different for each driver. This makes it hard to develop database independent.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11977">DC-879</key>
            <summary>MSSQL - missing function date_part() in Expression/Mssql.php [+patch]</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Oct 2010 04:34:09 +0000</created>
                <updated>Tue, 5 Oct 2010 04:50:00 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-861] Make sure doctrine uses the right connection when creating a query from a table object</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-861</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Line# 1036&lt;br/&gt;
When using Table::createQuery, null is specified as the connection when calling Doctrine_Query::create() which results in using the default connection while the &quot;correct&quot; connection can be know ($this-&amp;gt;getConnection())&lt;/p&gt;

&lt;p&gt;here is the fix:&lt;/p&gt;

&lt;p&gt;&amp;#8212; a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php&lt;br/&gt;
+++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php&lt;br/&gt;
@@ -1033,7 +1033,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable&lt;/p&gt;

&lt;p&gt;         $class = $this-&amp;gt;getAttribute(Doctrine_Core::ATTR_QUERY_CLASS);&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;return Doctrine_Query::create(null, $class)&lt;br/&gt;
+        return Doctrine_Query::create($this-&amp;gt;getConnection(), $class)&lt;br/&gt;
             &lt;del&gt;&amp;gt;from($this&lt;/del&gt;&amp;gt;getComponentName() . $alias);&lt;br/&gt;
     }&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>All</environment>
            <key id="11895">DC-861</key>
            <summary>Make sure doctrine uses the right connection when creating a query from a table object</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nanux">Emmanuel Delescolle</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Sep 2010 03:46:07 +0000</created>
                <updated>Wed, 8 Sep 2010 03:46:07 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-843] MSSQL - Equal-to Operator doesn&apos;t work with columns of type text in where condition [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-843</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Example:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine::getTable(&apos;Ticket_DCXXX2_Model&apos;)-&amp;gt;findByUsernameAndFoo(&apos;foo&apos;, &apos;bar&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;foo&lt;/tt&gt; is of type &quot;text&quot;. Doctrine generates &quot;&lt;tt&gt;where .... foo = &apos;bar&apos;&lt;/tt&gt;&quot;, but this will throw an mssql exception because you cant use the equal to operator in mssql for text and varchar types. Doctrine should consider this database related behavoir, shouldn&apos;t it?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11831">DC-843</key>
            <summary>MSSQL - Equal-to Operator doesn&apos;t work with columns of type text in where condition [+patch]</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="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 11:16:51 +0000</created>
                <updated>Thu, 2 Sep 2010 08:21:23 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14091" author="enrico" created="Thu, 26 Aug 2010 11:20:59 +0000"  >&lt;p&gt;TestCase added &lt;a href=&quot;http://github.com/estahn/doctrine1/compare/master...DC-843&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/master...DC-843&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14114" author="enrico" created="Fri, 27 Aug 2010 11:23:57 +0000"  >&lt;p&gt;Patch added to github (see above)&lt;/p&gt;

&lt;p&gt;commit msg: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-843&quot; title=&quot;MSSQL - Equal-to Operator doesn&amp;#39;t work with columns of type text in where condition [+patch]&quot;&gt;DC-843&lt;/a&gt; fix (TestCase need fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-841&quot; title=&quot;Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery regex failing to replace all &amp;#39;?&amp;#39; instances [patch+]&quot;&gt;DC-841&lt;/a&gt; to run successfully)&lt;/p&gt;</comment>
                    <comment id="14237" author="enrico" created="Thu, 2 Sep 2010 08:21:23 +0000"  >&lt;p&gt;I made a mistake with github, the updated branch can be found at&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-843-2&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-843-2&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-975] Treat sql server error 2601 as Doctrine_Core::ERR_ALREADY_EXISTS</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-975</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Patch attached to treat sql server error 2601 (Integrity constraint violation) as Doctrine_Core::ERR_ALREADY_EXISTS&lt;/p&gt;</description>
                <environment>Sql server</environment>
            <key id="12401">DC-975</key>
            <summary>Treat sql server error 2601 as Doctrine_Core::ERR_ALREADY_EXISTS</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ben.davies">Ben Davies</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 11:31:01 +0000</created>
                <updated>Thu, 17 Feb 2011 11:31:01 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10942" name="Doctrine_Connection_Mssql_Exception.patch" size="844" author="ben.davies" created="Thu, 17 Feb 2011 11:31:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-808] Doctrine_Connection_Statement-&gt;execute() Do not pass failing query to Doctrine_Connection-&gt;rethrowException()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-808</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When &lt;em&gt;Doctrine_Connection_Statement-&amp;gt;execute()&lt;/em&gt; fail on a query, Exception is rethrown by &lt;em&gt;Doctrine_Connection&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But the failing query is not passed to &lt;em&gt;rethrowException()&lt;/em&gt; as third parameter, which make debug very difficult.&lt;/p&gt;

&lt;p&gt;See attached patch file to correct this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11725">DC-808</key>
            <summary>Doctrine_Connection_Statement-&gt;execute() Do not pass failing query to Doctrine_Connection-&gt;rethrowException()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mars105">Alexandre Ravey</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Aug 2010 05:22:47 +0000</created>
                <updated>Thu, 5 Aug 2010 05:22:47 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10720" name="Doctrine_Connection_Statement.patch" size="433" author="mars105" created="Thu, 5 Aug 2010 05:22:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-840] MSSQL - strange behavior with multiple addWhere conditions and &quot;&gt;&quot; [+patch]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-840</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the first example below the second parameter wasn&apos;t replaced by the given value. I tracked it down and i suppose it&apos;s because of the &quot;&amp;gt;&quot; sign. It&apos;s the same for &quot;&amp;lt;&quot;. Equal-Operator (=) works fine.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $q = Doctrine_Query::create()
            -&amp;gt;select(&apos;password, modified_at&apos;)
            -&amp;gt;from(&apos;Ticket_DCXXX_Model&apos;)
            -&amp;gt;andWhere(&apos;password = ?&apos;, &apos;abc&apos;)
            -&amp;gt;andWhere(&apos;modified_at &amp;gt; ?&apos;, &apos;2010-01-01&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; [t].[id] AS [t__id], [t].[password] AS [t__password], [t].[modified_at] AS [t__modified_at]
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; [ticket__d_c_x_x_x__model] [t]
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; ([t].[password] =  &apos;abc&apos; AND [t].[modified_at] &amp;gt; ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $q = Doctrine_Query::create()
            -&amp;gt;select(&apos;password, modified_at&apos;)
            -&amp;gt;from(&apos;Ticket_DCXXX_Model&apos;)
            -&amp;gt;andWhere(&apos;modified_at &amp;gt; ?&apos;, &apos;2010-01-01&apos;)
            -&amp;gt;andWhere(&apos;password = ?&apos;, &apos;abc&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; [t].[id] AS [t__id], [t].[password] AS [t__password], [t].[modified_at] AS [t__modified_at]
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; [ticket__d_c_x_x_x__model] [t]
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; ([t].[modified_at] &amp;gt;  &apos;2010-01-01&apos; AND [t].[password] =  &apos;abc&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11823">DC-840</key>
            <summary>MSSQL - strange behavior with multiple addWhere conditions and &quot;&gt;&quot; [+patch]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 11:33:42 +0000</created>
                <updated>Fri, 27 Aug 2010 11:57:19 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14066" author="enrico" created="Wed, 25 Aug 2010 11:49:02 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/estahn/doctrine1/compare/master...DC-840&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/master...DC-840&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14117" author="enrico" created="Fri, 27 Aug 2010 11:57:19 +0000"  >&lt;p&gt;see &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-841&quot; title=&quot;Doctrine_Connection_Mssql::replaceBoundParamsWithInlineValuesInQuery regex failing to replace all &amp;#39;?&amp;#39; instances [patch+]&quot;&gt;DC-841&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;For example, here is my table :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
News:
  tableName: ne_news
  columns:
    id:           { type: integer(4), primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    author_id:    { type: integer(4), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    name:         { type: string(255) }
    description:  { type: text }
  relations:
    author: { class: sfGuardUser, onDelete: NULL, local: author_id, foreign: id, foreignAlias: sfGuardUser }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the fixture :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
SfGuardUser:
  sadmin:
    username:       admin
    password:       admin
    is_super_admin: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  author1:
    username: myname
    
News:
  News1:
    name: Test 1
    description: Description of news 1
    author: author1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;If i add a news.class.php and extends the autogenerated class it fails.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setAuthor($v)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//__log(&apos;extending setter&apos;);
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_set(&apos;author&apos;, $v);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

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

&lt;p&gt;What do you think? Is a common behavior, how can i extends my accessor?&lt;/p&gt;</description>
                <environment>Window, PHP5, Symfony</environment>
            <key id="11508">DC-743</key>
            <summary>Incompatibilty between fixture import and accessors extends</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bricef">Brice Favre</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 11:06:58 +0000</created>
                <updated>Fri, 22 Jul 2011 02:28:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Data Fixtures</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="16190" author="ryan" created="Fri, 22 Jul 2011 02:28:49 +0000"  >&lt;p&gt;this is the same issue as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-735&quot; class=&quot;external-link&quot;&gt;DC-735&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-938] Impossible to use other formats than YAML in data import</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-938</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;File Doctrine/Data/Import.php, line #80&lt;br/&gt;
if (end($e) == &apos;yml&apos;)&lt;/p&gt;

&lt;p&gt;So, if the file is a .json (for exemple), it will be impossible to load it, even if we have specified &quot;json&quot; as format parameter.&lt;br/&gt;
And it sucks.&lt;/p&gt;

&lt;p&gt;The fix would just be to change the line to :&lt;br/&gt;
if (end($e) == $this-&amp;gt;getFormat())&lt;/p&gt;</description>
                <environment></environment>
            <key id="12159">DC-938</key>
            <summary>Impossible to use other formats than YAML in data import</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="arcanis">Mael Nison</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 09:58:18 +0000</created>
                <updated>Thu, 25 Nov 2010 09:58:18 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-940] Doctrine - loading a YAML fixture with French characters, replaces the accents with junk</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-940</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;My Doctrine 1.2 is integrated inside CodeIgniter as a hook and I know that my char-set is utf8 with collation utf8_unicode_ci.&lt;/p&gt;

&lt;p&gt;I have two YAML files, one for creating the DB and its tables and one to load some test data. My data can contain French accents (&#231;&#233;&#239;&#235;...). In my schama.yml I have correctly specified the collation and char-set:&lt;/p&gt;

&lt;p&gt;options:&lt;br/&gt;
  type: INNODB&lt;br/&gt;
  charset: utf8&lt;br/&gt;
  collate: utf8_unicode_ci&lt;/p&gt;

&lt;p&gt;I double checked the settings in phpMyAdmin, everything is correct.&lt;/p&gt;

&lt;p&gt;When I run my doctrine script from commandline to load my fixture to populate one of tables, all the French accents are replaced by junk!&lt;/p&gt;

&lt;p&gt;Am I missing a setting or configuration or is there a bug in Doctrine?&lt;/p&gt;

&lt;p&gt;I appreciate any help. Cheers.&lt;/p&gt;

&lt;p&gt;P.S. Everything else works like a charm&lt;/p&gt;</description>
                <environment>MAC OS X (10.6.5)&lt;br/&gt;
MAMP 1.9.4&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="12166">DC-940</key>
            <summary>Doctrine - loading a YAML fixture with French characters, replaces the accents with junk</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="raminoacid">Ramin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Nov 2010 13:14:09 +0000</created>
                <updated>Fri, 26 Nov 2010 13:14:09 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-983] Fixtures loading is repeated for each database connections</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-983</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Bug found when working on project ma-residence.fr. Data loading was repeated twice, and in the second run, empty rows were inserted in database, resulting in major headache in development team.&lt;/p&gt;

&lt;p&gt;A same flush tree is built for each connections. It results in multiple loops of data load when there is more than one connection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12459">DC-983</key>
            <summary>Fixtures loading is repeated for each database connections</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ludovicv">Ludovic Vigouroux</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Mar 2011 08:44:04 +0000</created>
                <updated>Tue, 8 Mar 2011 09:03:51 +0000</updated>
                                                                    <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15474" author="ludovicv" created="Tue, 8 Mar 2011 09:03:51 +0000"  >&lt;p&gt;A proposition to fix it is on github &lt;a href=&quot;https://github.com/ludovig/doctrine1&quot; class=&quot;external-link&quot;&gt;https://github.com/ludovig/doctrine1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-322] Data dump fails on tables with quoted identifiers</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-322</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While dumping a table with a quoted identifier `numeric`, doctrine failed because the constructed query had an invalid alias the field:  c__`numeric`.&lt;/p&gt;

&lt;p&gt;Output:&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;`numeric`, c.alpha3 AS c_&lt;em&gt;alpha3, c.alpha2 AS c&lt;/em&gt;&lt;em&gt;alpha2 FROM country_codes c&apos; at line 1. Failing Query: &quot;SELECT c.country AS c&lt;/em&gt;&lt;em&gt;country, c.`numeric` AS c&lt;/em&gt;&lt;em&gt;`numeric`, c.alpha3 AS c&lt;/em&gt;&lt;em&gt;alpha3, c.alpha2 AS c&lt;/em&gt;_alpha2 FROM country_codes c&quot;&lt;/p&gt;

&lt;p&gt;I know that using quoted identifiers is discouraged but I think this could be easily solvable.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment>linux, apache 2, mysql 5.1, php 5.2</environment>
            <key id="10559">DC-322</key>
            <summary>Data dump fails on tables with quoted identifiers</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mtorromeo">Massimiliano Torromeo</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 16:18:33 +0000</created>
                <updated>Fri, 4 Dec 2009 17:03:56 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Data Fixtures</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10998" author="juokaz" created="Thu, 3 Dec 2009 21:24:13 +0000"  >&lt;p&gt;In which code part are you quoting that column? Because just enabling identifiers quoting would result in completely different results (at least there will be all columns quotes or none).&lt;/p&gt;</comment>
                    <comment id="11003" author="mtorromeo" created="Fri, 4 Dec 2009 08:58:44 +0000"  >&lt;p&gt;I&apos;m not using Doctrine::ATTR_QUOTE_IDENTIFIER, I generated a yaml from a preexisting db and then adapted it.&lt;/p&gt;

&lt;p&gt;It generated the following definition:&lt;br/&gt;
CountryCodes:&lt;br/&gt;
  columns:&lt;br/&gt;
    country:&lt;br/&gt;
      type: string(32)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    `numeric`:&lt;br/&gt;
      type: integer(2)&lt;br/&gt;
      unsigned: 1&lt;br/&gt;
      primary: true&lt;br/&gt;
    alpha3:&lt;br/&gt;
      type: string(3)&lt;br/&gt;
      fixed: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    alpha2:&lt;br/&gt;
      type: string(2)&lt;br/&gt;
      fixed: true&lt;br/&gt;
      notnull: true&lt;/p&gt;

&lt;p&gt;but it was with an old version of Doctrine and this is not the case anymore (I tried regenerating it). I assumed it was correct to quote one single identifier, but I now guess it wasn&apos;t.&lt;/p&gt;

&lt;p&gt;I think this can be closed as NotBug.&lt;/p&gt;

&lt;p&gt;Sorry for the trouble.&lt;br/&gt;
Regards.&lt;/p&gt;</comment>
                    <comment id="11011" author="juokaz" created="Fri, 4 Dec 2009 17:03:56 +0000"  >&lt;p&gt;However, variables cannot be quoted like that - quoting happens after actual columns are constructed, so now Doctrine needs to unquote it and do it&apos;s stuff. If you want quoting - enable that option and it will do it for you, or the best - don&apos;t use reserved words in your schema &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;This issue can be closed as Invalid.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

&lt;p&gt;if ($table-&amp;gt;hasRelation($key) &amp;amp;&amp;amp; is_array($value) &amp;amp;&amp;amp; ! $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;)) {&lt;/p&gt;

&lt;p&gt;In case of GoogleI18n, $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;) returns false.&lt;/p&gt;

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

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

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

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

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


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

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

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

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

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

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


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

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

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

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

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

<item>
            <title>[DC-862] INNER JOIN example is same as previous LEFT JOIN example</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-862</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I was reading the &quot;JOIN syntax&quot; section of the documentation. The docs first talk about how the default join type is LEFT JOIN and an example is presented. Next, INNER JOINS are discussed, but the example is the same left join example used previously. Am I misunderstanding the flow of the document?&lt;/p&gt;</description>
                <environment>&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#join-syntax&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#join-syntax&lt;/a&gt;</environment>
            <key id="11896">DC-862</key>
            <summary>INNER JOIN example is same as previous LEFT JOIN example</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="robertom@sas.upenn.edu">Roberto Mansfield</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Sep 2010 15:55:21 +0000</created>
                <updated>Wed, 8 Sep 2010 15:55:21 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-379] No description of ATTR_DEFAULT_IDENTIFIER_OPTIONS now in &quot;Chapter 4 Configuration&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-379</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the previous (1.1) documentation version there were small but useful description about how to set up primary key (&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_1/en/configuration#defaults-attributes:default-added-auto-id&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_1/en/configuration#defaults-attributes:default-added-auto-id&lt;/a&gt;)&lt;br/&gt;
Now there is nothing about ATTR_DEFAULT_IDENTIFIER_OPTIONS and it takes about 20 minutes to debug and find out where did &quot;id&quot; field added&lt;/p&gt;

&lt;p&gt;ps: message &quot;If you find a problem with the documentation or have a suggestion, please register and open a ticket. &quot; in the bottom of the docs pages is ambiguous due to it points to trac :-$&lt;/p&gt;</description>
                <environment></environment>
            <key id="10652">DC-379</key>
            <summary>No description of ATTR_DEFAULT_IDENTIFIER_OPTIONS now in &quot;Chapter 4 Configuration&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="zerkms">zerkms</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Dec 2009 02:55:04 +0000</created>
                <updated>Wed, 23 Dec 2009 02:55:04 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-348] Doctrine manual does not document that columns can be added with simple inheritance, or the semantics of accessing those columns in the parent</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-348</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Doctrine manual&apos;s section on inheritance mentions simple inheritance only briefly. The examples do not show that columns can be added, nor do they explain that the parent model class can also access those columns (very useful when you override its methods at the application level in Symfony). &lt;/p&gt;

&lt;p&gt;Both behaviors are supported (Jon suggested I take advantage of them at one point) but it&apos;s easy to miss the fact that they are available. For a long time I assumed column aggregation inheritance was the only way to add columns.&lt;/p&gt;

&lt;p&gt;I&apos;m now exploiting simple inheritance as a way to add columns to sfGuardUser rather than introducing an sfGuardUserProfile class with all of the attendant problems of trying to pretend two tables are actually one table. This is very useful.&lt;/p&gt;

&lt;p&gt;(Out of curiosity, is there an alternative way to add columns to plugin schemas at the app level in Symfony 1.3 similar to the way it&apos;s now done for Propel?)&lt;/p&gt;</description>
                <environment></environment>
            <key id="10596">DC-348</key>
            <summary>Doctrine manual does not document that columns can be added with simple inheritance, or the semantics of accessing those columns in the parent</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Dec 2009 00:23:00 +0000</created>
                <updated>Thu, 10 Dec 2009 00:23:00 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-339] Documentation unclear about linking inherited objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-339</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The (very nice) doctrine documentation fails to mention anything about how inherited objects handle relations.&lt;/p&gt;

&lt;p&gt;I.e. if I got the model: &lt;br/&gt;
Entity:&lt;br/&gt;
  columns:&lt;br/&gt;
    username: string(20)&lt;br/&gt;
    password: string(16)&lt;br/&gt;
    created_at: timestamp&lt;br/&gt;
    updated_at: timestamp&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 1&lt;/p&gt;

&lt;p&gt;Group:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 2&lt;/p&gt;

&lt;p&gt;Topic:&lt;br/&gt;
  content: string&lt;br/&gt;
  entity_id: integer&lt;br/&gt;
  relations:&lt;br/&gt;
    User:&lt;br/&gt;
       class: Entity&lt;br/&gt;
       local: entity_id&lt;br/&gt;
       foreign: id&lt;/p&gt;

&lt;p&gt;Can I then define both users and groups to link to Topic? &lt;/p&gt;


</description>
                <environment></environment>
            <key id="10583">DC-339</key>
            <summary>Documentation unclear about linking inherited objects</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tarjei">Tarjei Huse</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Dec 2009 08:57:45 +0000</created>
                <updated>Tue, 8 Dec 2009 08:57:45 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;So the documentation have to be update for this point.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11222">DC-631</key>
            <summary>Documentation </summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 05:18:30 +0000</created>
                <updated>Thu, 15 Apr 2010 05:18:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-501] Join and WITH keywords : documentation is confusing</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-501</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Your documentation makes no sense to me on the usage of the WITH keyword&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language:join-syntax#with-keyword&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language:join-syntax#with-keyword&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$q = Doctrine_Query::create()
  -&amp;gt;select(&apos;u.id, p.id&apos;)
  -&amp;gt;from(&apos;User u&apos;)
  -&amp;gt;leftJoin(&apos;u.Phonenumbers p WITH u.id = 2&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;Get Users and the phone numbers if any of the user 2 (we could indeed need that kind of query)&lt;/p&gt;


&lt;p&gt;-----------------------------------------------------------------------------------------------------------------------------------&lt;br/&gt;
I guess this kind of example query is better &lt;/p&gt;

&lt;p&gt;// Documentation&lt;br/&gt;
Get users and their mobile phone numbers if any&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$q = Doctrine_Query::create()
  -&amp;gt;select(&apos;u.id, p.id&apos;)
  -&amp;gt;from(&apos;User u&apos;)
  -&amp;gt;leftJoin(&apos;u.Phonenumbers p WITH p.type = ?&apos;, &apos;mobile&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;you can expect this SQL&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT 
u.id AS u__id, 
p.id AS p__id 
FROM User u 
LEFT JOIN Phonenumbers p ON u.id = p.user_id AND p.type = &apos;mobile&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 


&lt;p&gt;// Still in the documentation&lt;br/&gt;
Be aware that this query is different of&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$q = Doctrine_Query::create()
  -&amp;gt;select(&apos;u.id, p.id&apos;)
  -&amp;gt;from(&apos;User u&apos;)
  -&amp;gt;leftJoin(&apos;u.Phonenumbers p&apos;)
  -&amp;gt;where(&apos;p.type = ?&apos;, &apos;mobile&apos;)
;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;because you will strip away the users who do not have a mobile phone number&lt;/p&gt;

&lt;p&gt;-----------------&lt;br/&gt;
Also the second example is more confusing ...&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$q = Doctrine_Query::create()
    -&amp;gt;select(&apos;u.id&apos;)
    -&amp;gt;from(&apos;User u&apos;)
    -&amp;gt;leftJoin(&apos;u.Groups g&apos;)
    -&amp;gt;innerJoin(&apos;u.Phonenumbers p WITH u.id &amp;gt; 3&apos;)
    -&amp;gt;leftJoin(&apos;u.Email e&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Means : Get Users (who HAVE Phonenumbers (innerJoin)) with their potential (leftJoin) Groups, potential (leftJoin) Emails, and their Phonenumbers&lt;br/&gt;
but not for the Users 1, 2 and 3&lt;/p&gt;

&lt;p&gt;Not really the straight forward example we can expect in a documentation&lt;/p&gt;

&lt;p&gt;Best regards&lt;/p&gt;</description>
                <environment></environment>
            <key id="10897">DC-501</key>
            <summary>Join and WITH keywords : documentation is confusing</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="julien.b">Julien B.</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Feb 2010 12:26:37 +0000</created>
                <updated>Mon, 15 Feb 2010 12:28:15 +0000</updated>
                                    <version>1.1.6</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

&lt;p&gt;  attributes:&lt;br/&gt;
    export: tables&lt;/p&gt;</description>
                <environment></environment>
            <key id="11493">DC-736</key>
            <summary>[Documentation] Taking Advantage of Column Aggregation Inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="baxter">Jason Brumwell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 22:03:52 +0000</created>
                <updated>Mon, 14 Jun 2010 22:03:52 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-923] Documentation 1.2 #working-with-models error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-923</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In documentation&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/working-with-models/en#many-to-many-relations:creating-a-new-link&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/working-with-models/en#many-to-many-relations:creating-a-new-link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There&apos;s an error in example code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// test.php
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$user-&amp;gt;username = &apos;Some User&apos;;
$user-&amp;gt;Groups[0]-&amp;gt;username = &apos;Some Group&apos;;
$user-&amp;gt;Groups[1]-&amp;gt;username = &apos;Some Other Group&apos;;
$user-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The error is on lines:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$user-&amp;gt;Groups[0]-&amp;gt;username = 
$user-&amp;gt;Groups[1]-&amp;gt;username = 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;they shoud be:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$user-&amp;gt;Groups[0]-&amp;gt;name = 
$user-&amp;gt;Groups[1]-&amp;gt;name = 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;as there&apos;s no username column in schema.yml definition of Group object.&lt;/p&gt;</description>
                <environment>Ubuntu 10.4, LAMP</environment>
            <key id="12089">DC-923</key>
            <summary>Documentation 1.2 #working-with-models error</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="martin">Martin Babic</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2010 06:17:30 +0000</created>
                <updated>Wed, 10 Nov 2010 06:27:30 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-872] 1.2 Documentation on Aggregate Functions Error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-872</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the documentation for using aggregate values with Doctrine Query (link below), there is a code snippet that shows how to access the value of the aggregate field, which does not work.&lt;/p&gt;

&lt;p&gt;The code snippet is:&lt;/p&gt;

&lt;p&gt;//firstsnippet after header&lt;br/&gt;
$q = Doctrine_Query::create()&lt;br/&gt;
    -&amp;gt;select(&apos;u.id, COUNT(t.id) AS num_threads&apos;)&lt;br/&gt;
    -&amp;gt;from(&apos;User u, u.Threads t&apos;)&lt;br/&gt;
    -&amp;gt;where(&apos;u.id = ?&apos;, 1)&lt;br/&gt;
    -&amp;gt;groupBy(&apos;u.id&apos;);&lt;/p&gt;

&lt;p&gt;//second snippet after header&lt;br/&gt;
$users = $q-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;//fourth snippet after header&lt;br/&gt;
echo $users-&amp;gt;num_threads . &apos; threads found&apos;;&lt;/p&gt;

&lt;p&gt;The code from the last snippet for accessing the count value, $users-&amp;gt;num_threads, doesn&apos;t seem to work. What does work for me is:&lt;/p&gt;

&lt;p&gt;//access count value&lt;br/&gt;
echo $users&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;num_threads&lt;/p&gt;

&lt;p&gt;//My exact code is:&lt;br/&gt;
$query = Doctrine_Query::create()&lt;br/&gt;
		 -&amp;gt;select(&apos;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 batchCount&apos;)&lt;br/&gt;
		 -&amp;gt;from(&apos;Batch&apos;);&lt;br/&gt;
$result = $query-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;echo $result-&amp;gt;batchCount; //10&lt;br/&gt;
echo $result&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;batchCount; //3 (3 is correct, from direct MySQL command line query)&lt;/p&gt;

&lt;p&gt;It&apos;s certainly possible I&apos;m doing something wrong, or that there is a Doctrine_Core attribute I need to set. If there is a Doctrine_Core attribute to set to automatically access aggregate values from the Collection, it would be worth noting at the top of the section. &lt;/p&gt;

&lt;p&gt;Thanks, and thanks for Doctrine (so awesome).&lt;/p&gt;

&lt;p&gt;Link:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/hu#select-queries:aggregate-values&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/hu#select-queries:aggregate-values&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11946">DC-872</key>
            <summary>1.2 Documentation on Aggregate Functions Error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="isac1984">Isaac Foster</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Sep 2010 10:55:55 +0000</created>
                <updated>Tue, 21 Sep 2010 10:55:55 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-868] [Documentation] Column aggregation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-868</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The example in the documentation at &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/inheritance:column-aggregation&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/inheritance:column-aggregation&lt;/a&gt; suggests that the discriminator (in this case &apos;type&apos;) column does not need to be defined in the parent class &apos;Entity&apos;.&lt;/p&gt;

&lt;p&gt;This did not work for me, I had to declare the discriminator column as shown in the  &apos;Taking advantage of column aggregation inheritance&apos; chapter at &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/taking-advantage-of-column-aggregation-inheritance/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/taking-advantage-of-column-aggregation-inheritance/en&lt;/a&gt;. &lt;/p&gt;</description>
                <environment></environment>
            <key id="11928">DC-868</key>
            <summary>[Documentation] Column aggregation</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="metalspawn">Michael Simpson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Sep 2010 02:39:08 +0000</created>
                <updated>Thu, 16 Sep 2010 02:40:45 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-846] Provide documentation for connection options</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-846</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Provide additional information on connection options.&lt;/p&gt;

&lt;p&gt;$conn = Doctrine_Manager::connection(&apos;mysql://username:password@localhost/test&apos;, &apos;connection 1&apos;); &lt;/p&gt;

&lt;p&gt;just skims the surface. At least link to PDO docs. Also, what is the second parameter? I can look in API docs, but it would be helpful to have in the reference guide. &lt;/p&gt;

&lt;p&gt;Are there any other ways to make a connection, such as through an array of parameters?&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="11846">DC-846</key>
            <summary>Provide documentation for connection options</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ritty">Ritty</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Aug 2010 15:26:57 +0000</created>
                <updated>Sun, 29 Aug 2010 15:26:57 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

<item>
            <title>[DC-995] Doctrine deprecated in favor of Doctrine_Core - phpdoc</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-995</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/whats-new/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/whats-new/en&lt;/a&gt; clearly states that the Doctrine class is deprecated - e.g. in order to allow for proper autoloading.&lt;br/&gt;
To enable IDEs to perform proper autocomplete and to encourage programmers not to use the Doctrine class anymore, it&apos;s phpdoc block shuld by changed in order to contain a&lt;/p&gt;

&lt;p&gt;@deprecated In favor of Doctrine_Core - this class extends Doctrine_Core for BC&lt;/p&gt;</description>
                <environment>all environments</environment>
            <key id="12540">DC-995</key>
            <summary>Doctrine deprecated in favor of Doctrine_Core - phpdoc</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="grass">Pablo Grass</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Apr 2011 13:23:53 +0000</created>
                <updated>Wed, 6 Apr 2011 13:23:53 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-738] Missing reference to make code usable</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-738</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Web page documentation is missing some details on following page: // ...&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_0/pl/connections:get-connection-name&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_0/pl/connections:get-connection-name&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/pl/connections:get-connection-name&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/pl/connections:get-connection-name&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think they were just taken out of context from a page like:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/connections/en#get-connection-name&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/connections/en#get-connection-name&lt;/a&gt;&lt;br/&gt;
where a previous reference to manager .... oops, that page has no previous reference to &apos;$manager&apos; either!!!&lt;/p&gt;

&lt;p&gt;Where does the $manager variable come into this? FWIW, I tried that code to get the connection name in a Symfony/Doctrine CLI Task, and it says, &apos;using object accessor on non object&apos;. I&apos;ll keep working on what it&apos;s supposed to look like, but the last page above, and every page of documentation derived from it should be checked for the relevance and accuracy of the $manager variable.&lt;/p&gt;</description>
                <environment>Doctrine web site</environment>
            <key id="11497">DC-738</key>
            <summary>Missing reference to make code usable</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jun 2010 20:50:10 +0000</created>
                <updated>Thu, 17 Jun 2010 09:24:58 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-909] Add Some Info to Doctrine Query order by Method Documentation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-909</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is very minor, but would have saved me a few minutes. On the Doctrine Query documentation page (V1 - &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#order-by-clause&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#order-by-clause&lt;/a&gt;), it would be useful to note that multiple calls to Doctrine_Query::orderBy() do not stack, and that the later calls will over write the previous ones. I&apos;ll propose:&lt;/p&gt;

&lt;p&gt;To sort by multiple columns, you must specify them in one call to Doctrine_Query::orderBy(). If you call orderBy a second time, the column from the first call will not be included in the resulting query. &lt;/p&gt;

&lt;p&gt;&amp;lt;code&amp;gt;&lt;br/&gt;
//works as expected&lt;br/&gt;
//results in ORDER BY id ASC, userName DESC&lt;br/&gt;
$query-&amp;gt;orderBy(&apos;id ASC, userName DESC&apos;);&lt;/p&gt;

&lt;p&gt;//does not work as expected&lt;br/&gt;
//results in ORDER BY userName DESC&lt;br/&gt;
$query-&amp;gt;orderBy(&apos;id ASC&apos;)&lt;br/&gt;
            -&amp;gt;orderBy(&apos;userName DESC&apos;);&lt;br/&gt;
&amp;lt;/code&amp;gt;&lt;/p&gt;</description>
                <environment>n/a</environment>
            <key id="12051">DC-909</key>
            <summary>Add Some Info to Doctrine Query order by Method Documentation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="isac1984">Isaac Foster</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Nov 2010 14:56:20 +0000</created>
                <updated>Mon, 1 Nov 2010 14:56:20 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-906] Missing retrieval method</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-906</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This page:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/getting-started/en#getting-started&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/getting-started/en#getting-started&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;only lists svn as a way to check out the doctrine source.  It&apos;s also available via git.&lt;/p&gt;</description>
                <environment>online</environment>
            <key id="12045">DC-906</key>
            <summary>Missing retrieval method</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cwallenpoole">Christopher W. Allen-Poole</reporter>
                        <labels>
                    </labels>
                <created>Sat, 30 Oct 2010 22:06:15 +0000</created>
                <updated>Sun, 31 Oct 2010 05:19:18 +0000</updated>
                                                                    <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

<item>
            <title>[DC-786] phpdoc comment error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-786</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;in Doctrine/Core.php on line 881&lt;/p&gt;

&lt;p&gt;comment for method generateModelsFromYaml() is:&lt;br/&gt;
881: * Generate a yaml schema file from an existing directory of models&lt;/p&gt;

&lt;p&gt;should be:&lt;br/&gt;
881: * Generates models from a yaml schema file&lt;/p&gt;</description>
                <environment>n/a</environment>
            <key id="11626">DC-786</key>
            <summary>phpdoc comment error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="micamou">mike</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Jul 2010 15:19:15 +0000</created>
                <updated>Wed, 14 Jul 2010 15:19:15 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-440] doctrine migration fails with taggable extension</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-440</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When adding the Taggable behaviour to an entity, the doctrine migration fails (i&apos;m using the symfony task) with the follwing error:&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt; doctrine  Migrating from version 0 to 1&lt;/p&gt;

&lt;p&gt;  The following errors occurred:                                                                                                                                           &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails. Failing Query: &quot;DROP TABLE taggable_tag&quot;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;I have a single entity in my schema, with the Taggable behavior attached:&lt;/p&gt;

&lt;p&gt;Article:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Taggable: ~&#160;&lt;br/&gt;
  columns:&lt;br/&gt;
    title:              &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;    body:               &lt;/p&gt;
{ type: clob }

&lt;p&gt;The Version1 class which was generate by the generate-migrations-diff task looks like this:&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;br/&gt;
/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;This class has been auto-generated by the Doctrine ORM Framework&lt;br/&gt;
 */&lt;br/&gt;
class Version1 extends Doctrine_Migration_Base&lt;br/&gt;
{&lt;br/&gt;
    public function up()
    {
        $this-&amp;gt;dropTable(&apos;taggable_tag&apos;);
    }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    public function down()&lt;/p&gt;
    {
        $this-&amp;gt;createTable(&apos;taggable_tag&apos;, array(
             &apos;id&apos; =&amp;gt; 
             array(
              &apos;type&apos; =&amp;gt; &apos;integer&apos;,
              &apos;length&apos; =&amp;gt; &apos;8&apos;,
              &apos;autoincrement&apos; =&amp;gt; &apos;1&apos;,
              &apos;primary&apos; =&amp;gt; &apos;1&apos;,
             ),
             &apos;name&apos; =&amp;gt; 
             array(
              &apos;unique&apos; =&amp;gt; &apos;1&apos;,
              &apos;type&apos; =&amp;gt; &apos;string&apos;,
              &apos;length&apos; =&amp;gt; &apos;255&apos;,
             ),
             ), array(
             &apos;type&apos; =&amp;gt; &apos;&apos;,
             &apos;indexes&apos; =&amp;gt; 
             array(
             ),
             &apos;primary&apos; =&amp;gt; 
             array(
              0 =&amp;gt; &apos;id&apos;,
             ),
             &apos;collate&apos; =&amp;gt; &apos;&apos;,
             &apos;charset&apos; =&amp;gt; &apos;&apos;,
             ));
    }
&lt;p&gt;}&lt;/p&gt;</description>
                <environment>osx 10.6, apache 2, php 5.3, symfony 1.4</environment>
            <key id="10753">DC-440</key>
            <summary>doctrine migration fails with 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pulse00">Robert Gruendler</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jan 2010 19:42:50 +0000</created>
                <updated>Fri, 22 Jan 2010 11:18:02 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                                                <component>Extensions</component>
                <component>Migrations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11443" author="pulse00" created="Fri, 22 Jan 2010 11:17:38 +0000"  >&lt;p&gt;i think i found the reason for this. The sfDoctrineGenerateMigrationsDiffTask seems to build it&apos;s diff from yml schema files:&lt;/p&gt;

&lt;p&gt;protected function execute()....&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;callDoctrineCli(&apos;generate-migrations-diff&apos;, array(&lt;br/&gt;
      &apos;yaml_schema_path&apos; =&amp;gt; $this-&amp;gt;prepareSchemaFile($config&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;yaml_schema_path&amp;#39;&amp;#93;&lt;/span&gt;),&lt;br/&gt;
    ));&lt;/p&gt;


&lt;p&gt;The task does not know anything about the models in the doctrine_extensions folder, and there are no yaml files for their&lt;br/&gt;
schema, so symfony migration tasks won&apos;t work with extensions.&lt;/p&gt;

&lt;p&gt;It would be great if this would be mentioned somewhere in the docs of the extensions.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-438] Nesting Taggable and I18N</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-438</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Taggable extension doesnt work correctly when nested under I18N. &lt;br/&gt;
The  page_translation_taggable_tag table appears to be correctly created, it has 3 columns: id, lang, tag_id&lt;br/&gt;
But when you save a tag like this&lt;br/&gt;
$page-&amp;gt;Translation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;en&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;setTags(&apos;tag 1, tag2&apos;);&lt;br/&gt;
the lang column in page_translation_taggable_tag is empty&lt;br/&gt;
and this doesnt work either:&lt;br/&gt;
$page-&amp;gt;setTags(&apos;tag 1, tag2&apos;);&lt;/p&gt;

&lt;p&gt;Schema is this:&lt;br/&gt;
Page:&lt;br/&gt;
  actAs:&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields:          &lt;span class=&quot;error&quot;&gt;&amp;#91;title, contents&amp;#93;&lt;/span&gt;&lt;br/&gt;
      actAs:&lt;br/&gt;
        Taggable: ~&lt;br/&gt;
  columns:&lt;br/&gt;
    title:                &lt;/p&gt;
{type: string(255), notnull: true}
&lt;p&gt;    contents:       clob&lt;/p&gt;</description>
                <environment>PHP 5.2.6, MySQL 5.0.75, Symfony 1.3.1</environment>
            <key id="10749">DC-438</key>
            <summary>Nesting Taggable and I18N</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sorin">Sorin Neacsu</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jan 2010 09:53:48 +0000</created>
                <updated>Tue, 19 Jan 2010 09:53:48 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Extensions</component>
                <component>I18n</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-67] Taggable not working</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-67</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After enabling Taggable extension, magic methods on the tables (e.g. getPopularTags)&lt;br/&gt;
cannot be reached:&lt;/p&gt;

&lt;p&gt;Doctrine::getTable(&apos;Upload&apos;)-&amp;gt;getPopularTags();&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Table_Exception&apos; with message &apos;Unknown method Doctrine_Table::getPopularTags&apos; in C:\Users\user\www\extens.dev\lib\Doctrine\Table.php:2608 Stack trace: #0 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Table-&amp;gt;__call(&apos;getPopularTags&apos;, Array) #1 C:\Users\user\www\extens.dev\index.php(7): Doctrine_Table-&amp;gt;getPopularTags() #2 &lt;/p&gt;
{main}
&lt;p&gt; thrown in C:\Users\user\www\extens.dev\lib\Doctrine\Table.php on line 2608&lt;/p&gt;</description>
                <environment>PHP 5.2.8, Doctrine 1.2.0 Alpha1, Vista, Sandbox 1.2.0 Alpha1</environment>
            <key id="10118">DC-67</key>
            <summary>Taggable not working</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Sep 2009 10:49:57 +0000</created>
                <updated>Thu, 15 Apr 2010 14:50:14 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                                                <component>Extensions</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="10187" author="admirau" created="Thu, 8 Oct 2009 12:16:38 +0000"  >&lt;p&gt;The same with Alpha2&lt;/p&gt;</comment>
                    <comment id="10199" author="admirau" created="Sat, 10 Oct 2009 14:34:25 +0000"  >&lt;p&gt;Running the tests results in one failure:&lt;/p&gt;


&lt;p&gt;Doctrine Unit Tests&lt;br/&gt;
===================&lt;br/&gt;
Doctrine_Template_Taggable_TestCase.............................................failed&lt;/p&gt;


&lt;p&gt;Unexpected Doctrine_Connection_Sqlite_Exception thrown in &lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine_Template_Taggable_TestCase&amp;#93;&lt;/span&gt; with message [SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1 no such column: a__2] in C:\Users\user\www\extens.dev\lib\Doctrine\Connection.php on line 1067&lt;/p&gt;

&lt;p&gt;Trace&lt;br/&gt;
-------------&lt;/p&gt;

&lt;p&gt;#0 C:\Users\user\www\extens.dev\lib\Doctrine\Connection.php(1015): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Sqlite))&lt;br/&gt;
#1 C:\Users\user\www\extens.dev\lib\Doctrine\Query\Abstract.php(936): Doctrine_Connection-&amp;gt;execute(&apos;SELECT t.id AS ...&apos;, Array)&lt;br/&gt;
#2 C:\Users\user\www\extens.dev\lib\Doctrine\Query\Abstract.php(990): Doctrine_Query_Abstract-&amp;gt;_execute(Array)&lt;br/&gt;
#3 C:\Users\user\www\extens.dev\tools\sandbox\extensions\Taggable\lib\Doctrine\Template\TaggableTag.php(76): Doctrine_Query_Abstract-&amp;gt;execute(Array, 2)&lt;br/&gt;
#4 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Template_TaggableTag-&amp;gt;getPopularTagsTableProxy(Array)&lt;br/&gt;
#5 C:\Users\user\www\extens.dev\lib\Doctrine\Record.php(2569): call_user_func_array(Array, Array)&lt;br/&gt;
#6 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Record-&amp;gt;__call(&apos;getPopularTagsT...&apos;, Array)&lt;br/&gt;
#7 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: TaggableTag-&amp;gt;getPopularTagsTableProxy(Array)&lt;br/&gt;
#8 C:\Users\user\www\extens.dev\lib\Doctrine\Table.php(2605): call_user_func_array(Array, Array)&lt;br/&gt;
#9 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Table-&amp;gt;__call(&apos;getPopularTags&apos;, Array)&lt;br/&gt;
#10 C:\Users\user\www\extens.dev\tools\sandbox\extensions\Taggable\tests\Template\TaggableTestCase.php(216): Doctrine_Table-&amp;gt;getPopularTags(Array)&lt;br/&gt;
#11 C:\Users\user\www\extens.dev\tests\DoctrineTest\UnitTestCase.php(144): Doctrine_Template_Taggable_TestCase-&amp;gt;testGetPopularTags()&lt;br/&gt;
#12 C:\Users\user\www\extens.dev\tests\DoctrineTest\GroupTest.php(61): UnitTestCase-&amp;gt;run()&lt;br/&gt;
#13 C:\Users\user\www\extens.dev\tests\DoctrineTest.php(180): GroupTest-&amp;gt;run(Object(DoctrineTest_Reporter_Cli), &apos;&apos;)&lt;br/&gt;
#14 C:\Users\user\www\extens.dev\tools\sandbox\extensions\Taggable\tests\run.php(29): DoctrineTest-&amp;gt;run()&lt;br/&gt;
#15 &lt;/p&gt;
{main}



&lt;p&gt;Tested: 1 test cases.&lt;br/&gt;
Successes: 26 passes.&lt;br/&gt;
Failures: 1 fails.&lt;br/&gt;
Number of new Failures: 0 &lt;br/&gt;
Number of fixed Failures: 0 &lt;/p&gt;

&lt;p&gt;Tests ran in 1 seconds and used 15279.15625 KB of memory&lt;/p&gt;</comment>
                    <comment id="10468" author="jwage" created="Tue, 3 Nov 2009 21:52:15 +0000"  >&lt;p&gt;The tests all pass now.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/extension/Taggable/1_2-1_0/tests&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/extension/Taggable/1_2-1_0/tests&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="10471" author="admirau" created="Wed, 4 Nov 2009 08:41:14 +0000"  >&lt;p&gt;It still does not work on my environment (Windows or Ubuntu 9.10, PHP 5.3/5.2.6)&lt;br/&gt;
The test result is a bit different, but still fails:&lt;/p&gt;

&lt;p&gt;Doctrine Unit Tests&lt;br/&gt;
===================&lt;br/&gt;
Doctrine_Template_Taggable_TestCase.............................................failed&lt;/p&gt;


&lt;p&gt;Unexpected Doctrine_Record_UnknownPropertyException thrown in &lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine_Template_Taggable_TestCase&amp;#93;&lt;/span&gt; with message &lt;span class=&quot;error&quot;&gt;&amp;#91;Unknown record property / related component &amp;quot;total_num&amp;quot; on &amp;quot;TaggableTag&amp;quot;&amp;#93;&lt;/span&gt; in /home/user/doctrine12b/lib/Doctrine/Record/Filter/Standard.php on line 55&lt;/p&gt;

&lt;p&gt;Trace&lt;br/&gt;
-------------&lt;/p&gt;

&lt;p&gt;#0 /home/taat/doctrine12b/lib/Doctrine/Record.php(1359): Doctrine_Record_Filter_Standard-&amp;gt;filterGet(Object(TaggableTag), &apos;total_num&apos;)&lt;br/&gt;
#1 /home/taat/doctrine12b/lib/Doctrine/Record.php(1318): Doctrine_Record-&amp;gt;_get(&apos;total_num&apos;, true)&lt;br/&gt;
#2 /home/taat/doctrine12b/lib/Doctrine/Access.php(117): Doctrine_Record-&amp;gt;get(&apos;total_num&apos;)&lt;br/&gt;
#3 /home/taat/doctrine12b/tools/sandbox/extensions/Taggable/tests/Template/TaggableTestCase.php(217): Doctrine_Access-&amp;gt;offsetGet(&apos;total_num&apos;)&lt;br/&gt;
#4 /home/taat/doctrine12b/tests/DoctrineTest/UnitTestCase.php(144): Doctrine_Template_Taggable_TestCase-&amp;gt;testGetPopularTags()&lt;br/&gt;
#5 /home/taat/doctrine12b/tests/DoctrineTest/GroupTest.php(61): UnitTestCase-&amp;gt;run()&lt;br/&gt;
#6 /home/taat/doctrine12b/tests/DoctrineTest.php(180): GroupTest-&amp;gt;run(Object(DoctrineTest_Reporter_Cli), &apos;&apos;)&lt;br/&gt;
#7 /home/taat/doctrine12b/tools/sandbox/extensions/Taggable/tests/run.php(29): DoctrineTest-&amp;gt;run()&lt;br/&gt;
#8 &lt;/p&gt;
{main}



&lt;p&gt;Tested: 1 test cases.&lt;br/&gt;
Successes: 26 passes.&lt;br/&gt;
Failures: 1 fails.&lt;br/&gt;
Number of new Failures: 0 &lt;br/&gt;
Number of fixed Failures: 0 &lt;/p&gt;</comment>
                    <comment id="10486" author="jwage" created="Wed, 4 Nov 2009 14:23:51 +0000"  >&lt;p&gt;Did you update Doctrine? I fixed something in Doctrine 1.2 that fixes it.&lt;/p&gt;</comment>
                    <comment id="10487" author="admirau" created="Wed, 4 Nov 2009 15:07:57 +0000"  >&lt;p&gt;Yes, the results above  (&quot;total_num&quot;) I get after updating to 1.2.0-BETA1.&lt;br/&gt;
At 1.2.0-ALPHA2 it was &quot;no such column: a__2&quot; (see above comments).&lt;/p&gt;

&lt;p&gt;Do the extensions work with 2.0, or they are 1.2 specific?&lt;/p&gt;</comment>
                    <comment id="10488" author="jwage" created="Wed, 4 Nov 2009 15:10:55 +0000"  >&lt;p&gt;1.2 specific. I don&apos;t get any fails now, can you try and troubleshoot it and figure out why it fails for you? They don&apos;t fail for me anywhere.&lt;/p&gt;</comment>
                    <comment id="10492" author="admirau" created="Wed, 4 Nov 2009 18:45:41 +0000"  >&lt;p&gt;Doctrine_Template_Taggable_TestCase::testGetPopularTags()&lt;br/&gt;
line 214:&lt;br/&gt;
$test = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags(array(&apos;ArticleTaggableTest&apos;, &apos;ArticleTaggableTest2&apos;));&lt;/p&gt;

&lt;p&gt;// compare this with your results&lt;br/&gt;
echo serialize($test);&lt;br/&gt;
result:&lt;br/&gt;
C:19:&quot;Doctrine_Collection&quot;:169:{a:7:{s:4:&quot;data&quot;;a:0:{}s:6:&quot;_table&quot;;s:11:&quot;TaggableTag&quot;;s:9:&quot;_snapshot&quot;;a:0:{}s:14:&quot;referenceField&quot;;N;s:9:&quot;keyColumn&quot;;s:4:&quot;name&quot;;s:8:&quot;_locator&quot;;N;s:10:&quot;_resources&quot;;a:0:{}}}&lt;/p&gt;

&lt;p&gt;When I try to var_dump($test),&lt;br/&gt;
I get circular dependency.&lt;br/&gt;
I tried to save results of var_dump($test) to disk, by I get 1,5GB file, and still growing...&lt;/p&gt;

&lt;p&gt;Maybe this article helps somehow:&lt;br/&gt;
&lt;a href=&quot;http://www.bigroom.co.uk/blog/php-nesting-level-too-deep-recursive-dependency&quot; class=&quot;external-link&quot;&gt;http://www.bigroom.co.uk/blog/php-nesting-level-too-deep-recursive-dependency&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can I see the fix you mentioned above?&lt;/p&gt;

&lt;p&gt;I&apos;m sorry, but I do not know what else I can do.&lt;br/&gt;
Any ideas?&lt;/p&gt;</comment>
                    <comment id="10568" author="jwage" created="Tue, 10 Nov 2009 17:30:55 +0000"  >&lt;p&gt;I am not sure what to say since it is working for me on all the machines I test. I&apos;ll be happy to look if I can get something to fail so I can troubleshoot it.&lt;/p&gt;</comment>
                    <comment id="10584" author="admirau" created="Wed, 11 Nov 2009 12:19:34 +0000"  >&lt;p&gt;I&apos;ve tested on PLD Linux too.&lt;br/&gt;
The same thing.&lt;/p&gt;

&lt;p&gt;Could you provide sample server/php configuration on which the tests are passing?&lt;/p&gt;

&lt;p&gt;Can you describe the fix you&apos;ve made to correct the errors with &apos;&apos;Unknown method Doctrine_Table::getPopularTags&apos;.&lt;br/&gt;
Maybe I can manage to investigate it, but I do not know where to start.&lt;/p&gt;</comment>
                    <comment id="10592" author="admirau" created="Wed, 11 Nov 2009 14:24:04 +0000"  >&lt;p&gt;Sorry for reopening this again.&lt;/p&gt;

&lt;p&gt;After upgrading to BETA2 all Taggable tests are passing OK for me too.&lt;/p&gt;

&lt;p&gt;However, in the code I still get &apos;Unknown method BlogPostTable::getPopularTags&apos; in /tools\sandbox\lib\Doctrine\Table.php:2793&apos;&lt;br/&gt;
Isn&apos;t it a regression of the bug you&apos;ve already fixed before ALPHA2?&lt;/p&gt;


&lt;p&gt;Here is the description of how I came to this exception.&lt;/p&gt;

&lt;p&gt;At the very end of config.php:&lt;/p&gt;

&lt;p&gt;$manager-&amp;gt;registerExtension(&apos;Taggable&apos;);&lt;/p&gt;

&lt;p&gt;In the index.php:&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;require_once(&apos;config.php&apos;);&lt;/p&gt;

&lt;p&gt;$models = Doctrine_Core::loadModels(&apos;models&apos;);&lt;/p&gt;

&lt;p&gt;$post = new BlogPost();&lt;br/&gt;
$post-&amp;gt;title = &apos;This is a sample blog post&apos;;&lt;br/&gt;
$post-&amp;gt;description = &apos;Cool!&apos;;&lt;br/&gt;
$post-&amp;gt;setTags(&apos;2009, symfony, doctrine&apos;);&lt;br/&gt;
$post-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;$table = Doctrine::getTable(&apos;BlogPost&apos;);&lt;br/&gt;
echo get_class($table);     // echoes Doctrine_Collection&lt;br/&gt;
$table-&amp;gt;getPopularTags();   // this throws the exception&lt;/p&gt;

&lt;p&gt;Then in the console:&lt;br/&gt;
php doctrine.php create-db&lt;br/&gt;
php doctrine.php generate-models-yaml (BaseBlogPost, BlogPost, BlogPostTable were generated)&lt;br/&gt;
php doctrine.php generate-sql (see SQL below)&lt;br/&gt;
php doctrine.php create-tables&lt;br/&gt;
(all ok)&lt;/p&gt;

&lt;p&gt;php index.php&lt;/p&gt;

&lt;p&gt;result:&lt;/p&gt;

&lt;p&gt;BlogPostTablePHP Fatal error:  Uncaught exception &apos;Doctrine_Table_Exception&apos; with message &apos;Unknown method BlogPostTable::getPopularTags&apos; in C:\Users\user\www\extens.dev\tools\sandbox\lib\Doctrine\Table.php:2793&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Table-&amp;gt;__call(&apos;getPopularTags&apos;, Array)&lt;br/&gt;
#1 C:\Users\user\www\extens.dev\tools\sandbox\index.php(15): BlogPostTable-&amp;gt;getPopularTags()&lt;br/&gt;
#2 &lt;/p&gt;
{main}&lt;br/&gt;
  thrown in C:\Users\user\www\extens.dev\tools\sandbox\lib\Doctrine\Table.php on line 2793&lt;br/&gt;
Fatal error: Uncaught exception &apos;Doctrine_Table_Exception&apos; with message &apos;Unknown method BlogPostTable::getPopularTags&apos; in C:\Users\user\www\extens.dev\tools\sandbox\lib\Doctrine\Table.php:2793&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine_Table-&amp;gt;__call(&apos;getPopularTags&apos;, Array)&lt;br/&gt;
#1 C:\Users\user\www\extens.dev\tools\sandbox\index.php(15): BlogPostTable-&amp;gt;getPopularTags()&lt;br/&gt;
#2 {main}
&lt;p&gt;  thrown in C:\Users\user\www\extens.dev\tools\sandbox\lib\Doctrine\Table.php on line 2793&lt;/p&gt;

&lt;p&gt;And here is the generated SQL:&lt;/p&gt;

&lt;p&gt;CREATE TABLE taggable_tag (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255) UNIQUE);&lt;br/&gt;
CREATE TABLE blog_post_taggable_tag (id INTEGER, tag_id INTEGER, PRIMARY KEY(id, tag_id));&lt;br/&gt;
CREATE TABLE blog_post (id INTEGER PRIMARY KEY AUTOINCREMENT, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL);&lt;/p&gt;</comment>
                    <comment id="10616" author="jwage" created="Thu, 12 Nov 2009 20:50:21 +0000"  >&lt;p&gt;When I test your code, it is working for me. You sure you don&apos;t have some old versions of PHP or something?&lt;/p&gt;</comment>
                    <comment id="10619" author="admirau" created="Thu, 12 Nov 2009 21:33:08 +0000"  >&lt;p&gt;Everything is up to date.&lt;br/&gt;
Tested on different servers, with different operating systems, different versions PHP, different versions of Doctrine, by different people.&lt;/p&gt;

&lt;p&gt;Common thing for all these machines is that PHP (&amp;gt;5.2.10 &amp;lt;= 5.3.1) was installed from precompiled builds, not from source.&lt;/p&gt;

&lt;p&gt;The error I get now is the same error I got earlier (at the beginning of this topic), which disapperared after your fix.&lt;br/&gt;
Then appeared the second error, which was fixed in BETA2, but the previous error is back. (strange, but the tests are passing now, despite the errors in the regular code).&lt;/p&gt;

&lt;p&gt;When I find some spare time I&apos;ll try to trace the changes you&apos;ve made since the beginning of the topic.&lt;/p&gt;</comment>
                    <comment id="10733" author="admirau" created="Wed, 18 Nov 2009 14:12:11 +0000"  >&lt;p&gt;Maybe the models are generated not properly.&lt;br/&gt;
Here are my models (three) for the reproduction procedure (above):&lt;/p&gt;

&lt;p&gt;class BlogPostTable extends Doctrine_Table {}&lt;/p&gt;

&lt;p&gt;class BlogPost extends BaseBlogPost {}&lt;/p&gt;

&lt;p&gt;abstract class BaseBlogPost extends Doctrine_Record&lt;br/&gt;
{&lt;br/&gt;
    public function setTableDefinition()&lt;/p&gt;
    {
        $this-&amp;gt;setTableName(&apos;blog_post&apos;);
        $this-&amp;gt;hasColumn(&apos;title&apos;, &apos;string&apos;, 255, array(
        											   &apos;type&apos; =&amp;gt; &apos;string&apos;,
        											   &apos;notnull&apos; =&amp;gt; true,
        											   &apos;length&apos; =&amp;gt; &apos;255&apos;,
        											   ));
        $this-&amp;gt;hasColumn(&apos;description&apos;, &apos;string&apos;, 255, array(
        													 &apos;type&apos; =&amp;gt; &apos;string&apos;,
        													 &apos;notnull&apos; =&amp;gt; true,
        													 &apos;length&apos; =&amp;gt; &apos;255&apos;,
        													 ));
    }

&lt;p&gt;    public function setUp()&lt;/p&gt;
    {
        parent::setUp();
        $taggable0 = new Doctrine_Template_Taggable();
        $this-&amp;gt;actAs($taggable0);
    }
&lt;p&gt;}&lt;/p&gt;</comment>
                    <comment id="10758" author="jwage" created="Wed, 18 Nov 2009 22:11:51 +0000"  >&lt;p&gt;I have everything generated the same as you.&lt;/p&gt;</comment>
                    <comment id="10811" author="balupton" created="Sat, 21 Nov 2009 12:12:04 +0000"  >&lt;p&gt;Also getting this. Using doctrine 1.2.0-beta3 and also tried with latest SVN. Taggable is latest available.&lt;/p&gt;

&lt;p&gt;PHP 5.3.0 running on Zend Server version 5.0.0Beta2&lt;/p&gt;</comment>
                    <comment id="10832" author="admirau" created="Tue, 24 Nov 2009 07:59:51 +0000"  >&lt;p&gt;No changes after upgrade to 1.2.0-RC1.&lt;/p&gt;</comment>
                    <comment id="10848" author="admirau" created="Tue, 24 Nov 2009 20:30:36 +0000"  >&lt;p&gt;Maybe this helps somehow:&lt;/p&gt;

&lt;p&gt;// Following line throws:&lt;br/&gt;
// Doctrine_Table_Exception: Unknown method Doctrine_Table::getPopularTags in /home/user/doctrine12rc1/lib/Doctrine/Table.php on line 2799&lt;br/&gt;
$tags = Doctrine::getTable(&apos;BlogPost&apos;)-&amp;gt;getPopularTags();&lt;/p&gt;


&lt;p&gt;// This line returns collection of tags, as expected&lt;br/&gt;
$tags = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags(&apos;BlogPost&apos;);&lt;/p&gt;


&lt;p&gt;$rel = Doctrine::getTable(&apos;BlogPost&apos;)-&amp;gt;getRelations();          // is int(2)&lt;br/&gt;
$rel = Doctrine::getTable(&apos;TagableTag&apos;)-&amp;gt;getRelations();     // is int(2)&lt;/p&gt;


</comment>
                    <comment id="11202" author="wormling" created="Wed, 16 Dec 2009 16:46:38 +0000"  >&lt;p&gt;Symfony 1.3 SVN updated as of this post.&lt;/p&gt;

&lt;p&gt;Ubuntu Karmic with PHP 5.3.1&lt;/p&gt;

&lt;p&gt;I have installed Taggable in mysymfonyproject/lib/doctrine_extensions/Taggable&lt;/p&gt;

&lt;p&gt;I have two example tables defined with Taggable:&lt;/p&gt;

&lt;p&gt;Video:&lt;br/&gt;
  actAs: &lt;/p&gt;
{ Taggable: ~, Timestampable: ~ }
&lt;p&gt;  columns:&lt;br/&gt;
    id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;    content_id: &lt;/p&gt;
{ type: integer, notnull: true }
&lt;p&gt;    title: &lt;/p&gt;
{ type: string(255) }
&lt;p&gt;    description: &lt;/p&gt;
{ type: clob }
&lt;p&gt;  relations:&lt;br/&gt;
    Content: &lt;/p&gt;
{ local: content_id, foreign: id }

&lt;p&gt;Photo:&lt;br/&gt;
  actAs: &lt;/p&gt;
{ Taggable: ~, Timestampable: ~ }
&lt;p&gt;  columns:&lt;br/&gt;
    id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;    content_id: &lt;/p&gt;
{ type: integer, notnull: true }
&lt;p&gt;    title: &lt;/p&gt;
{ type: string(255) }
&lt;p&gt;    description: &lt;/p&gt;
{ type: clob }
&lt;p&gt;    uri: &lt;/p&gt;
{ type: string(255) }
&lt;p&gt;  relations:&lt;br/&gt;
    Content: &lt;/p&gt;
{ local: content_id, foreign: id }

&lt;p&gt;The following code functions and populates the database:&lt;br/&gt;
$video = new Video();&lt;br/&gt;
...&lt;br/&gt;
$video-&amp;gt;setTags(implode(&quot;, &quot;, $tags));&lt;br/&gt;
$video-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;The following code errors:&lt;br/&gt;
$tags = Doctrine::getTable(&apos;Video&apos;)-&amp;gt;getPopularTags();&lt;/p&gt;

&lt;p&gt;500 | Internal Server Error | Doctrine_Table_Exception&lt;br/&gt;
Unknown method VideoTable::getPopularTags&lt;/p&gt;

&lt;p&gt;The following code errors:&lt;br/&gt;
$tags = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags(&apos;Video&apos;);&lt;/p&gt;

&lt;p&gt;500 | Internal Server Error | Doctrine_Exception&lt;br/&gt;
Couldn&apos;t find class TagableTag&lt;/p&gt;</comment>
                    <comment id="11434" author="sorin" created="Wed, 20 Jan 2010 13:36:07 +0000"  >&lt;p&gt;Dont know if its related to this issue or not, but for some reason Doctrine::getTable(&apos;TaggableTag&apos;) throws a &quot;&lt;/p&gt;
{Doctrine_Exception}
&lt;p&gt; Couldn&apos;t find class TaggableTag&quot; exception&lt;/p&gt;

&lt;p&gt;I understand that you would normally do this:&lt;br/&gt;
Doctrine::getTable(&apos;Video&apos;)-&amp;gt;getTags() &lt;br/&gt;
but I just want plain access to the TaggableTag model and Doctrine doesnt seem to generate any model classess for TaggableTag &lt;/p&gt;</comment>
                    <comment id="11900" author="jwage" created="Mon, 1 Mar 2010 16:18:10 +0000"  >&lt;p&gt;I have tested everything everyone has provided and it is all working for me. The only thing I can suggest now is that someone creates a Doctrine failing test case so that I can run it to see the failure.&lt;/p&gt;</comment>
                    <comment id="11938" author="balupton" created="Mon, 1 Mar 2010 20:23:35 +0000"  >&lt;p&gt;Will create a test case this weekend for this and a few other problems I&apos;ve across (with fixes). Nothing more frustrating than not being able to reproduce a problem, so I feel your pain.&lt;/p&gt;</comment>
                    <comment id="11984" author="ivarne" created="Tue, 2 Mar 2010 14:04:20 +0000"  >&lt;p&gt;I think this bug i related to the bug in the documentation &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-378&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-378&lt;/a&gt; to get the popular tags you will first have to load the models you want the tags for.&lt;/p&gt;

&lt;div class=&quot;code panel&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;// load models that you want the tags from
&lt;/span&gt;Doctrine::getTable(&apos;blog&apos;);
Doctrine::getTable(&apos;products&apos;);
&lt;span class=&quot;code-comment&quot;&gt;// then you can get the tags &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the models currently loaded
&lt;/span&gt;$tags = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="12047" author="wormling" created="Sun, 7 Mar 2010 00:41:57 +0000"  >&lt;p&gt;This works for me:&lt;/p&gt;

&lt;p&gt;// load models that you want the tags from&lt;br/&gt;
Doctrine::getTable(&apos;blog&apos;);&lt;br/&gt;
Doctrine::getTable(&apos;products&apos;);&lt;br/&gt;
// then you can get the tags for the models currently loaded&lt;br/&gt;
$tags = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags();&lt;/p&gt;</comment>
                    <comment id="12541" author="balupton" created="Thu, 1 Apr 2010 07:00:29 +0000"  >&lt;p&gt;Okie... Creating test cases for this turned out to be more complicated than I can handle - myself not being that familiar with phpunit.&lt;br/&gt;
Although within the test it is written as:&lt;br/&gt;
$test = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags(array(&apos;ArticleTaggableTest&apos;, &apos;ArticleTaggableTest2&apos;));&lt;br/&gt;
Rather than:&lt;br/&gt;
$test = Doctrine::getTable(&apos;ArticleTaggableTest&apos;)-&amp;gt;getPopularTags();&lt;br/&gt;
which is what this problem is about.&lt;/p&gt;


&lt;p&gt;Although I do believe I&apos;ve nailed the source of the problem - as well as others I&apos;ve experienced.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Problems are introduced when using pear style model names. Indirectly fixed with: &lt;a href=&quot;http://pastebin.com/DKGcgAht&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/DKGcgAht&lt;/a&gt; - links to fix in Doctrine/Record/Generator.php&lt;/li&gt;
	&lt;li&gt;Problems are introduced when using custom names for the taggable field. Such as: &lt;a href=&quot;http://pastebin.com/JdhqeG38&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/JdhqeG38&lt;/a&gt; - example&lt;/li&gt;
	&lt;li&gt;Problems are introduced when using inheritance for models.  Such as: &lt;a href=&quot;http://pastebin.com/Qwuwk0z1&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/Qwuwk0z1&lt;/a&gt; - example&lt;/li&gt;
	&lt;li&gt;Problems are introduced when using taggable relations when the record has not been inserted yet. Such as: &lt;a href=&quot;http://pastebin.com/ahPpqTdK&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/ahPpqTdK&lt;/a&gt; - example&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Having either of the above causes the system to fall down. I&apos;ve applied a bunch of fixes/changes to taggable to ensure it works with my systems, such as &lt;a href=&quot;http://sos.7dots.co.uk/&quot; class=&quot;external-link&quot;&gt;http://sos.7dots.co.uk/&lt;/a&gt; (still in staging) which uses all of the above mentioned problems, not sure how to do a diff but here is the file:&lt;br/&gt;
&lt;a href=&quot;http://www.2shared.com/file/12385197/c5911e42/Taggable.html&quot; class=&quot;external-link&quot;&gt;http://www.2shared.com/file/12385197/c5911e42/Taggable.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope that helps some people. Any changes I&apos;ve made code can come under the same licence as doctrine, so no worries there.&lt;/p&gt;</comment>
                    <comment id="12672" author="admirau" created="Thu, 15 Apr 2010 11:12:28 +0000"  >&lt;p&gt;With 1.2.2 there is some progress.&lt;br/&gt;
There was still 1 test failing (CASCADE),&lt;br/&gt;
but with the version:&lt;br/&gt;
&lt;a href=&quot;http://www.2shared.com/file/12385197/c5911e42/Taggable.html&quot; class=&quot;external-link&quot;&gt;http://www.2shared.com/file/12385197/c5911e42/Taggable.html&lt;/a&gt;&lt;br/&gt;
provided by Benjamin Arthur Lupton &lt;br/&gt;
all test are passing now.&lt;/p&gt;

&lt;p&gt;But now when I run:&lt;br/&gt;
getTable(&apos;ArticleTaggableTest&apos;)-&amp;gt;getPopularTags();&lt;br/&gt;
I get: ERROR: column &quot;i2__1&quot; does not exist&lt;/p&gt;


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

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


&lt;p&gt;Seems that this just a PostgreSql issue.&lt;br/&gt;
On Mysql it runs just fine.&lt;/p&gt;</comment>
                    <comment id="12680" author="ivarne" created="Thu, 15 Apr 2010 14:28:58 +0000"  >&lt;p&gt;The last comment is concerning how the poular tags are found and rated (on PostgreSql). I think this is unrelated to the rest of this issue and should be moved to a separate issue. (also I only got junk ads when I tried to get the file you are linking to).&lt;/p&gt;</comment>
                    <comment id="12681" author="admirau" created="Thu, 15 Apr 2010 14:40:28 +0000"  >&lt;p&gt;I have created separated issue for this:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-634&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-634&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And yes, this link is quite odd...&lt;br/&gt;
There is a lot of crap,&lt;br/&gt;
however there is a small link, to download improved code:&lt;/p&gt;

&lt;p&gt;Look for: &quot;Save file to your PC: click here&quot;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

&lt;p&gt;For more details, please read the discussion here:&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/2647537/doctrine-sql-query-works-on-mysql-on-postgresql-wont&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/2647537/doctrine-sql-query-works-on-mysql-on-postgresql-wont&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Windows, Postgresql</environment>
            <key id="11227">DC-634</key>
            <summary>getPopularTags() query fails on Postgresql</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Apr 2010 14:47:56 +0000</created>
                <updated>Thu, 15 Apr 2010 14:47:56 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Extensions</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-486] Taggable extension bound to inherited class also binds to all classes, which extend the base one</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-486</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is my schema.yml:&lt;/p&gt;

&lt;p&gt;Tale:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Taggable:&lt;br/&gt;
  columns: # there are some not interesting columns&lt;/p&gt;

&lt;p&gt;FolkTale:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Tale&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: folk&lt;br/&gt;
  columns:&lt;br/&gt;
    folk_id: integer&lt;br/&gt;
  relations:&lt;br/&gt;
    Folk:&lt;br/&gt;
      class: Folk&lt;br/&gt;
      local: folk_id&lt;br/&gt;
      foreign: id&lt;br/&gt;
      type: one&lt;br/&gt;
      onDelete: CASCADE&lt;/p&gt;

&lt;p&gt;AuthoredTale:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Tale&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: authored&lt;br/&gt;
  columns:&lt;br/&gt;
    author_id: integer&lt;br/&gt;
  relations:&lt;br/&gt;
    Author:&lt;br/&gt;
      class: Author&lt;br/&gt;
      local: author_id&lt;br/&gt;
      foreign: id&lt;br/&gt;
      type: one&lt;br/&gt;
      onDelete: CASCADE&lt;/p&gt;

&lt;p&gt;When I do ./symfony doctrine:build --all  I see three *_taggable_tag table in my DB (folk_tale_taggable_tag, authored_tale_taggable_tag and tale_tag) instead of expected one tale_tag.&lt;/p&gt;</description>
                <environment>php5.2.11, symfony 1.4, Doctrine 1.2, Taggable 1.0 </environment>
            <key id="10852">DC-486</key>
            <summary>Taggable extension bound to inherited class also binds to all classes, which extend the base one</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enlightened">Alexander Panshin</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Feb 2010 12:54:40 +0000</created>
                <updated>Mon, 8 Feb 2010 12:54:40 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Extensions</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-724] Blameable relations import problem</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-724</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The import works only when i DISABLE the update relation. When i activate the update relation i get an sql error&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`clubicious`.`location`, CONSTRAINT `location_updated_by_sf_guard_user_id` FOREIGN KEY (`updated_by`) REFERENCES `sf_guard_user` (`id`))&lt;/p&gt;

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

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

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

&lt;p&gt;  location_max:&lt;br/&gt;
    name:         Max &amp;amp; Moritz&lt;br/&gt;
    CreatedBy:    gfranke&lt;br/&gt;
    UpdatedBy:    gfranke&lt;/p&gt;</description>
                <environment>symfony 1.4.5 with latest doctrine 1.2 branch with sfDoctrineGuardPlugin</environment>
            <key id="11464">DC-724</key>
            <summary>Blameable relations import problem</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2010 06:06:06 +0000</created>
                <updated>Tue, 13 Jul 2010 07:00:31 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Extensions</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13573" author="timschofield" created="Tue, 13 Jul 2010 07:00:31 +0000"  >&lt;p&gt;Same Problem with Doctrine 1.2.2 and  Zend Framework 1.10&lt;/p&gt;

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

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

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

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


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

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

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

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

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

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

<item>
            <title>[DC-936] json schema import broken</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-936</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With a valid Json file :&lt;br/&gt;
PHP Warning:  explode() expects parameter 2 to be string, object given in Doctrine/Doctrine/Import/Schema.php on line 381&lt;br/&gt;
PHP Catchable fatal error:  Object of class stdClass could not be converted to string in Doctrine/Doctrine/Import/Schema.php on line 391&lt;/p&gt;

&lt;p&gt;It&apos;s due to this line, line, in Doctrine/Parser/Json.php (#65) :&lt;br/&gt;
$json = json_decode($contents);&lt;/p&gt;

&lt;p&gt;It should be:&lt;br/&gt;
$json = json_decode($contents, true);&lt;/p&gt;

&lt;p&gt;Because casting the result as array will only affect the top-level element. You must use the second parameter of json_decode() to force every objects (including sub-objects) to be converted to indexed arrays.&lt;/p&gt;</description>
                <environment>PHP 5.3.3-1ubuntu9.1</environment>
            <key id="12135">DC-936</key>
            <summary>json schema import broken</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="arcanis">Mael Nison</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Nov 2010 09:18:25 +0000</created>
                <updated>Wed, 22 Dec 2010 11:49:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>File Parser</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14801" author="arcanis" created="Mon, 22 Nov 2010 09:23:21 +0000"  >&lt;p&gt;A try to import this file should fail.&lt;/p&gt;</comment>
                    <comment id="14995" author="fentie" created="Wed, 22 Dec 2010 11:49:56 +0000"  >&lt;p&gt;I&apos;ve submitted a pull request w/patch and unit test for this issue using the fix above. I had the same problem in my code on OS X 10.6.4, PHP 5.3.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10876" name="foobar.schema.json" size="345" author="arcanis" created="Mon, 22 Nov 2010 09:23:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-392] Let the parser ignore .* (hidden) files</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-392</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When generating models from yml files starting with a `.&apos; such as temporary files from certain editors and meta files from OS X are also parsed by the importer. I do not see any reasons too include these hidden files in parsing as they are hidden for a purpose. And there would be no point in deliberately using hidden files for your config files.&lt;/p&gt;

&lt;p&gt;Also see:&lt;br/&gt;
&lt;a href=&quot;http://blog.rajatpandit.com/2009/08/23/doctrine_parser_exception-fail-some-error-message/&quot; class=&quot;external-link&quot;&gt;http://blog.rajatpandit.com/2009/08/23/doctrine_parser_exception-fail-some-error-message/&lt;/a&gt;&lt;br/&gt;
and&lt;br/&gt;
&lt;a href=&quot;http://alessandrovermeulen.me/2010/01/01/doctrine-unable-to-parse-string-unable-to-parse-line-0/&quot; class=&quot;external-link&quot;&gt;http://alessandrovermeulen.me/2010/01/01/doctrine-unable-to-parse-string-unable-to-parse-line-0/&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10671">DC-392</key>
            <summary>Let the parser ignore .* (hidden) files</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="spockz">Alessandro Vermeulen</reporter>
                        <labels>
                    </labels>
                <created>Sat, 2 Jan 2010 21:58:09 +0000</created>
                <updated>Tue, 8 Jun 2010 15:19:18 +0000</updated>
                                    <version>1.1.6</version>
                                                <component>File Parser</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11310" author="spockz" created="Sat, 2 Jan 2010 21:58:53 +0000"  >&lt;p&gt;Added affected versions.&lt;/p&gt;</comment>
                    <comment id="13200" author="jwage" created="Tue, 8 Jun 2010 15:19:18 +0000"  >&lt;p&gt;We can include this fix in 1.2.3, does anyone have a patch? If not I&apos;ll try and hunt down the offending code and patch it. Not sure where it is off the top of my head anymore &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-1014] Geographical behaviour generates wrong INSERT statement in PostgreSQL if latitude/logitude not specified</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1014</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Added &quot;Geographical&quot; behaviour to an entity:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
ZipCode:
  actAs: [Geographical]
  columns:
    code: string
    [...]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

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

&lt;h3&gt;&lt;a name=&quot;Workaround&quot;&gt;&lt;/a&gt;Workaround&lt;/h3&gt;
&lt;p&gt; explicitly specifying &lt;b&gt;float&lt;/b&gt; type for latitude and longitude...&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
  actAs: 
    Geographical:
      latitude: {type: float}
      longitude: {type: float}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;...still generate the column correctly as &lt;b&gt;double precision&lt;/b&gt; in the database, but will not cause any error on inserting records.&lt;/p&gt;</description>
                <environment>Symphony 1.4, PostgreSQL 8.4.8</environment>
            <key id="12768">DC-1014</key>
            <summary>Geographical behaviour generates wrong INSERT statement in PostgreSQL if latitude/logitude not specified</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicus">Lorenzo Nicora</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Jul 2011 09:52:36 +0000</created>
                <updated>Fri, 1 Jul 2011 09:52:36 +0000</updated>
                                                                    <component>Geographical</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-450] ORACLE: The generate DQL with i18n behavior doesn&apos;t correct</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-450</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;My schema:&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;---
Country:
  tableName:          country
  actAs:
    SoftDelete:       ~
    Timestampable:    ~
    I18n:
      fields:         [name]
      className:      %CLASS%I18n
      tableName:      %TABLE%_i18n
      length:         5
  columns:
    id:
      type:           integer(3)
      primary:        true
      unsigned:       true
      sequence:       country
    created_at:
      type:           timestamp
    updated_at:
      type:           timestamp
    enabled_at:
      type:           timestamp
      notnull:        true
    disabled_at:
      type:           timestamp
    iso_code:
      type:           string(2)
    marc_code:
      type:           string(3)
    name:
      type:           string(255)
      notnull:        true
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;DQL query:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$country = Doctrine::getTable(&apos;Country&apos;)-&amp;gt;findOneByMarcCode(&apos;sz&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Error:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
ORA-00904: &lt;span class=&quot;code-quote&quot;&gt;&quot;C&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;NAME&quot;&lt;/span&gt;: invalid identifier : SELECT a.* FROM ( SELECT c.id AS c__id, c.created_at AS c__created_at, c.updated_at AS c__updated_at, c.enabled_at AS 
c__enabled_at, c.disabled_at AS c__disabled_at, c.iso_code AS c__iso_code, c.marc_code AS c__marc_code, c.name AS c__name, c.deleted_at AS c__deleted_at FROM
common.country c WHERE (c.marc_code = :oci_b_var_1) ) a WHERE ROWNUM &amp;lt;= 1 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;In this line, i show the field &quot;name&quot;, but this field is in table translation. The DQL above is very complicated for only simple request. Why ?&lt;/p&gt;

&lt;p&gt;Thank&apos;s&lt;/p&gt;

&lt;p&gt;Bertrand&lt;/p&gt;</description>
                <environment></environment>
            <key id="10776">DC-450</key>
            <summary>ORACLE: The generate DQL with i18n behavior doesn&apos;t 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Jan 2010 11:22:54 +0000</created>
                <updated>Thu, 18 Mar 2010 06:54:44 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12323" author="garfield-fr" created="Thu, 18 Mar 2010 06:54:44 +0000"  >&lt;p&gt;I don&apos;t have a real connection on Oracle Server. This test doesn&apos;t return the error above.&lt;/p&gt;

&lt;p&gt;Please test on real connection.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10491" name="DC450TestCase.php" size="4518" author="garfield-fr" created="Thu, 18 Mar 2010 06:53:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-443] Incorrect insert order in i18n entities</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-443</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If the schema has an entity MyMain with all its fields i18n and an entity MySecondary related to MyMain and you try to create a new MySecondary item using Symfony forms you get an error.&lt;/p&gt;

&lt;p&gt;I think the error is doctrine and in i18n because if you remove a field from the i18n behavior (&lt;tt&gt;fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;a,b,c,d&amp;#93;&lt;/span&gt;&lt;/tt&gt;, for example) all works ok.&lt;br/&gt;
I&apos;ve included a symfony project to help developpers replicate the error.&lt;/p&gt;

&lt;p&gt;My Schema&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; 
MyMain:
  actAs:
    I18n:
      fields: [a,b,c,d, e]
  columns:
    a:  { type: string(255), notnull: true }
    b:  { type: string(255), notnull: true }
    c:  string
    d:  string
    e:  string

MySecondary:
  columns:
    my_main_id:  integer
    a:        string(255)
    b:        string(255)
  relations:
    MyMain:
      local: my_main_id
      foreign: id
      foreignType: one
      cascade: [delete]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;And the form code&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;class MyMainForm extends BaseMyMainForm
{
  public function configure()
  {
    $this-&amp;gt;embedI18n(array(&apos;en&apos;, &apos;es&apos;));
  }
}

class MySecondaryForm extends BaseMySecondaryForm
{
  public function configure()
  {
    $this-&amp;gt;widgetSchema[&apos;my_main_id&apos;] = new sfWidgetFormInputHidden();
    $this-&amp;gt;embedRelation(&apos;MyMain as main_subform&apos;);
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And last the queries (and its order when you get the error)&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;INSERT INTO my_secondary (my_main_id, a, b) VALUES (?, ?, ?) - (, my_secondary[a], my_secondary[b])
INSERT INTO my_main_translation (id, lang, a, b, c, d, e) VALUES (?, ?, ?, ?, ?, ?, ?) - 
  (, en, my_secondary[main_subform][en][a], my_secondary[main_subform][en][b], my_secondary[main_subform][en][c], 
   my_secondary[main_subform][en][d], my_secondary[main_subform][en][e])
Error Doctrine_Connection_Mysql_Exception	SQLSTATE[23000]: Integrity constraint violation: 1048 Column &apos;id&apos; cannot be null 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Linux (2.6.21 kernel)&lt;br/&gt;
Apache/2.2.6&lt;br/&gt;
PHP 5.2.6&lt;br/&gt;
symfony version 1.4.1&lt;br/&gt;
doctrine 1.2</environment>
            <key id="10758">DC-443</key>
            <summary>Incorrect insert order in i18n entities</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rodrigobb">Rodrigo Borrego Bernab&#233;</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Jan 2010 11:29:13 +0000</created>
                <updated>Fri, 22 Jan 2010 11:29:13 +0000</updated>
                                                                    <component>I18n</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10308" name="i18nrelation_problem.tgz" size="27753" author="rodrigobb" created="Fri, 22 Jan 2010 11:29:13 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-412] Error defining &quot;unique&quot; constraint in a translated (i18n) column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-412</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Let&apos;s suppose we have a class &quot;Element&quot;  with columns &quot;name&quot; and &quot;description&quot;.&lt;/p&gt;

&lt;p&gt;We want to set an &quot;unique&quot; constraint in column &quot;name&quot;, and set the I18n behavior to columns name and description.&lt;/p&gt;

&lt;p&gt;In the generated translation table &quot;element_translation&quot;, doctrine sets an unique constraint in the column &quot;name&quot;. This is an error, as various languages could translate that string in the same way. I think that the &quot;unique&quot; constraint should be set to the combination of columns &quot;name&quot; and &quot;lang&quot;, so the restriction applies for a given language.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10705">DC-412</key>
            <summary>Error defining &quot;unique&quot; constraint in a translated (i18n) 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="davefx">David Mar&#237;n Carre&#241;o</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Jan 2010 08:53:18 +0000</created>
                <updated>Sun, 10 Jan 2010 21:18:56 +0000</updated>
                                                                    <component>I18n</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-372] I18n record generator assumes relation alias is the table name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-372</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Doctrine/I18n.php, method setTableDefinition, line 108:&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;        foreach($relations as $table =&amp;gt; $relation) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But the $relations array key is not a table name, but a relation alias.&lt;/p&gt;

&lt;p&gt;So currently the generator assumes the relation alias IS the table name.&lt;br/&gt;
When it&apos;s not true, the I18n table definition fails.&lt;/p&gt;</description>
                <environment>latest symfony 1.4 SVN.</environment>
            <key id="10637">DC-372</key>
            <summary>I18n record generator assumes relation alias is the table name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ornicar">thibault duplessis</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Dec 2009 14:03:24 +0000</created>
                <updated>Sun, 20 Dec 2009 14:03:24 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>I18n</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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



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

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

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

&lt;p&gt;If you want more details ask me &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; I have one working copy &quot;freezed&quot; just for this bug ( and for my work i use a system without i18n behavior :s )&lt;/p&gt;

&lt;p&gt;thx in advance&lt;/p&gt;</description>
                <environment>Symfony 1.4.0, PHP 5.2.6 &amp;amp; 5.3.1</environment>
            <key id="11703">DC-806</key>
            <summary>i8n behavior </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fmeynard">Fabien MEYNARD</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Jul 2010 13:51:36 +0000</created>
                <updated>Sat, 31 Jul 2010 13:51:36 +0000</updated>
                                                                    <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10714" name="Capture d&#8217;&#233;cran 2010-07-30 &#224; 12.43.50.png" size="208155" author="fmeynard" created="Sat, 31 Jul 2010 13:51:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-779] sf1.4 i18n form create/update item extra insert</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-779</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;config/doctrine/schema.yml:&lt;br/&gt;
JobeetCategory:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
    I18n:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary:  true&lt;br/&gt;
      autoincrement:  true&lt;br/&gt;
    num:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
      notnull:  true&lt;/p&gt;

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

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

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

&lt;p&gt;everything looks fine but as soon as I post valid data i get the following error:&lt;br/&gt;
500 | Internal Server Error | Doctrine_Connection_Mysql_Exception&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry &apos;1-nl&apos; for key &apos;PRIMARY&apos;&lt;/p&gt;

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

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

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

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


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

&lt;p&gt;I really don&apos;t know why Doctrine runs this third insert and why it is using the incorrect &quot;nl_NL&quot; instead of &quot;nl&quot;.&lt;/p&gt;</description>
                <environment>problem arises \w Symfony 1.4.6 on Mac OS X 10.6.4 with Mysql 5.1.38 and a also on Ubuntu 10.04 Lucid \w bundled Apache 2.2.14 and Mysql 5.1.41</environment>
            <key id="11600">DC-779</key>
            <summary>sf1.4 i18n form create/update item extra insert</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kuijsten">Tim</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Jul 2010 19:53:54 +0000</created>
                <updated>Thu, 14 Oct 2010 06:29:50 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>I18n</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14565" author="jpasquier" created="Thu, 14 Oct 2010 06:29:50 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

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

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

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

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

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

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

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

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

&lt;p&gt;Following example:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Problem:
  actAs:
    I18n:
      fields: [name]
      actAs:
        Sluggable: { fields: [name], uniqueBy: [lang, name], canUpdate: true }
  columns:
    name: { type: string(255), notnull: true }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

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

&lt;p&gt;Now, if we try to update the entry with the slug with the postfix, what i think is an error happens (Excerpt from Sluggable.php, lib/Doctrine/Template/Listener/Sluggable.php):&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
public function getUniqueSlug($record, $slugFromFields)
...
if ($record-&amp;gt;exists()) {
            $identifier = $record-&amp;gt;identifier();
            $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?&apos;;
            $whereParams = array_merge($whereParams, array_values($identifier));
        }

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

&lt;p&gt;So, the $record-&amp;gt;exists() check evaluates to true and $table-&amp;gt;getIdentifierColumnNames() yields the fields id and lang, so the whereString is something like&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
AND r.id != ? AND r.lang != ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Now for the problematic part:&lt;br/&gt;
uniqueBy is lang and name; so the code adds to the whereString:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
AND r.lang = ? AND r.name = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;So the resulting whereString has something like&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
r.lang != ? AND r.lang = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;which will never yield a result in my eyes, thus, the postfix is never incremented and the slug defaults to the the slug of name without postfix.&lt;/p&gt;</description>
                <environment>Symfony 1.4.5&lt;br/&gt;
Doctrine ORM</environment>
            <key id="11474">DC-728</key>
            <summary>Updating slug in I18N behaviour yields non-unique slug</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vsknight">Florian Aschenbrenner</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jun 2010 05:35:43 +0000</created>
                <updated>Tue, 5 Oct 2010 11:28:43 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>I18n</component>
                <component>Sluggable</component>
                        <due></due>
                    <votes>5</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="13408" author="rodrigobb" created="Thu, 24 Jun 2010 13:11:47 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

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

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

&lt;p&gt;Replace&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($record-&amp;gt;exists()) {
  $identifier = $record-&amp;gt;identifier();
  $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?&apos;;
  $whereParams = array_merge($whereParams, array_values($identifier));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

&lt;p&gt;So, you just need to replace this part of Sluggable::getUniqueSlug():&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable::getUniqueSlug()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;...
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($record-&amp;gt;exists()) {
            $identifier = $record-&amp;gt;identifier();
            $whereString .= &apos; AND r.&apos; . implode(&apos; != ? AND r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?&apos;;
            $whereParams = array_merge($whereParams, array_values($identifier));
        }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With this code (the 3rd line has extra brackets and OR instead of AND):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable::getUniqueSlug() (modified)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($record-&amp;gt;exists()) {
            $identifier = $record-&amp;gt;identifier();
            $whereString .= &apos; AND (r.&apos; . implode(&apos; != ? OR r.&apos;, $table-&amp;gt;getIdentifierColumnNames()) . &apos; != ?)&apos;;
            $whereParams = array_merge($whereParams, array_values($identifier));
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


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

&lt;p&gt;However, to check that it&apos;s not the same record you just need one of the key values to be different (not all of them) so the check should be something like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;... AND (p.id != &apos;2&apos; OR p.lang != &apos;en&apos;) ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;instead of:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;... AND p.id != &apos;2&apos; AND p.lang != &apos;en&apos; ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The modification to the code as stated above generates queries that look like this, which I&apos;m pretty sure is correct:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;... WHERE (p.url LIKE &apos;foo%&apos; AND (p.id != &apos;2&apos; OR p.lang != &apos;en&apos;) AND p.lang = &apos;en&apos; AND p.other_uniqueby_field = &apos;1&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


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

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

&lt;p&gt;This effectively means you can&apos;t overload a setter method and still use the data import. &lt;/p&gt;</description>
                <environment>Mac OS X 10.6</environment>
            <key id="11492">DC-735</key>
            <summary>Imported objects not converted to objects and parsed as string when a setter method exists</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kev">Kevin Dew</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 17:32:09 +0000</created>
                <updated>Fri, 22 Jul 2011 05:09:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16191" author="ryan" created="Fri, 22 Jul 2011 05:09:34 +0000"  >&lt;p&gt;added testcase here&lt;br/&gt;
&lt;a href=&quot;https://github.com/rahx/doctrine1/commit/ba5628abaa5b3d60638d833d90b1cf439504d560&quot; class=&quot;external-link&quot;&gt;https://github.com/rahx/doctrine1/commit/ba5628abaa5b3d60638d833d90b1cf439504d560&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;I guess there&apos;s a problem with getDefaultFieldDeclaration() in Doctrine_Export_Mysql, it lacks convertBooleans() call being present at Doctrine_Export.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6 Snow Leopard / Zend Server CE 5.0.3 (irrelevant)</environment>
            <key id="12026">DC-898</key>
            <summary>(PATCH) Migration fails when addColumn with type &apos;boolean&apos; used with default value, resulting in incorrect &apos;ALTER TABLE&apos; query in MySQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="argasek">Jakub Argasi&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 08:02:33 +0000</created>
                <updated>Fri, 22 Oct 2010 08:02:33 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10830" name="fix_boolean_default_mysql_column_migration.patch" size="525" author="argasek" created="Fri, 22 Oct 2010 08:02:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;There is maybe a typo. l. 194 in Doctrine/Import/Pgsql.php : typtype should be type?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>Linux and symfony1.4.9</environment>
            <key id="12014">DC-892</key>
            <summary>Typo. in Import/Pgsql.php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nippo">Nicolas Ippolito</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 04:41:23 +0000</created>
                <updated>Thu, 31 Mar 2011 06:42:50 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15644" author="leszczu" created="Thu, 31 Mar 2011 06:42:50 +0000"  >&lt;p&gt;Happens to me as well, on windows.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-871] When importing fixtures some times the fixtures will be loaded in the wrong order causing broken foreign key relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-871</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi&lt;/p&gt;

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

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

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

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

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

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

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="11935">DC-871</key>
            <summary>When importing fixtures some times the fixtures will be loaded in the wrong order causing broken foreign key relations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 22:26:01 +0000</created>
                <updated>Mon, 20 Sep 2010 22:34:45 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14426" author="willf1976" created="Mon, 20 Sep 2010 22:34:45 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10805" name="DC_871_fix.patch" size="10326" author="willf1976" created="Mon, 20 Sep 2010 22:34:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

<item>
            <title>[DC-1004] ATTR_TBLNAME_FORMAT not used when creating models from database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1004</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;if you set prefix to &quot;xyz_%s&quot; and have the model &quot;BackgroundColor&quot; it will become the table =&amp;gt; &quot;xyz_background_color&quot;&lt;br/&gt;
if you have the table &quot;xyz_background_color&quot; with unknown model and create the the model from the table, you will get =&amp;gt; &quot;XyzBackgroundColor&quot;.&lt;/p&gt;

&lt;p&gt;The fix (diff):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;368a369,370&lt;br/&gt;
&amp;gt;         $tablePrefix = $manager-&amp;gt;getAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT);&lt;br/&gt;
&amp;gt;         &lt;br/&gt;
381d382&lt;br/&gt;
&amp;lt; &lt;br/&gt;
385c386&lt;br/&gt;
&amp;lt;               $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt; = Doctrine_Inflector::classify(Doctrine_Inflector::tableize($table));&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;               $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt; = Doctrine_Inflector::classify(Doctrine_Inflector::tableize(preg_replace(sprintf(&apos;/\A%s\z/&apos;, str_replace(&apos;%s&apos;, &apos;(.*?)&apos;, $tablePrefix)), &apos;$1&apos;, $table)));&lt;br/&gt;
396c397&lt;br/&gt;
&amp;lt;                       $class = Doctrine_Inflector::classify(Doctrine_Inflector::tableize($table));&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;                       $class = Doctrine_Inflector::classify(Doctrine_Inflector::tableize(preg_replace(sprintf(&apos;/\A%s\z/&apos;, str_replace(&apos;%s&apos;, &apos;(.*?)&apos;, $tablePrefix)), &apos;$1&apos;, $table)));&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="12621">DC-1004</key>
            <summary>ATTR_TBLNAME_FORMAT not used when creating models from database</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="to-rparker">Robin Parker</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 May 2011 04:34:20 +0000</created>
                <updated>Sun, 8 May 2011 04:34:52 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15814" author="to-rparker" created="Sun, 8 May 2011 04:34:52 +0000"  >&lt;p&gt;The diff output as .diff&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10990" name="doctrine_bug_diff.diff" size="746" author="to-rparker" created="Sun, 8 May 2011 04:34:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-941] Spatial index type for mysql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-941</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using doctrine and some of mysql&apos;s spatial functions. I need to specify spatial index for my tables.&lt;br/&gt;
My declaration looks like:&lt;/p&gt;

&lt;p&gt;Geometry:&lt;br/&gt;
  tableName: geometry&lt;br/&gt;
  options:&lt;br/&gt;
    type:    MyISAM&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    id: &lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    geometry:&lt;br/&gt;
      type: geometry&lt;br/&gt;
      notnull: true&lt;br/&gt;
   indexes:&lt;br/&gt;
    geometry:&lt;br/&gt;
      fields:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;geometry&lt;br/&gt;
      type: spatial&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Exporting this definitions throws an exception: Unknown type spatial for index geometry_idx&lt;/p&gt;

</description>
                <environment></environment>
            <key id="12178">DC-941</key>
            <summary>Spatial index type for mysql</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mishal">Mishal</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Nov 2010 14:43:57 +0000</created>
                <updated>Mon, 29 Nov 2010 14:43:57 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10880" name="patch.patch" size="736" author="mishal" created="Mon, 29 Nov 2010 14:43:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;When trying to generate an ALTER TABLE statement with &lt;tt&gt;Doctrine_Core::ATTR_QUOTE_IDENTIFIER&lt;/tt&gt; enabled, the column identifier is not quoted, and a blank identifier is instead quoted, generating the following SQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ALTER TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;mytable&quot;&lt;/span&gt; MODIFY (username &quot;&quot; VARCHAR2(200))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The proper SQL to be generated should be:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ALTER TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;mytable&quot;&lt;/span&gt; MODIFY (&lt;span class=&quot;code-quote&quot;&gt;&quot;username&quot;&lt;/span&gt; VARCHAR2(200))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13001">DC-1036</key>
            <summary>Doctrine_Export_Oracle::alterTable() not properly quoting column identifier for change</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="johnkary">John Kary</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Sep 2011 16:55:12 +0000</created>
                <updated>Wed, 7 Sep 2011 18:48:09 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16447" author="johnkary" created="Wed, 7 Sep 2011 18:20:45 +0000"  >&lt;p&gt;Pull request opened with failing test case and bug fix:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/pull/40&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/pull/40&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;I am attaching a patch that checks the loaded data if there were any values actually loaded from the fixtures. &lt;/p&gt;</description>
                <environment>symfony 1.4</environment>
            <key id="13241">DC-1045</key>
            <summary>data-load with invalid filename leads to purging of all the data in the database</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="artworx">Keszeg Alexandru</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Dec 2011 16:53:21 +0000</created>
                <updated>Tue, 6 Dec 2011 16:53:21 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11124" name="diff.patch" size="413" author="artworx" created="Tue, 6 Dec 2011 16:53:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-994] Doctrine_Data_Import creates unnecessary transactions, big slowdown </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-994</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While trying to load ~25M data fixtures (one big table with relations to 4 smaller ones, sfGuard included in that, row size around 500 bytes) in Symfony i ended up waiting around 80 minutes, while waiting i looked at what could have make it so dreadfully slow. Turns out, when Doctrine_Data_Load gets UnitOfWorks it executes save() on every new record. Save makes it&apos;s own transaction - not a problem if it&apos;s nested, but when this is the main transactions, 70000 of them make quite a difference. Remember - one of the main factors of DBMS speed is transactions/second.&lt;/p&gt;

&lt;p&gt;I patched Doctrine_Data_Import to wrap everything in one transaction, and the results were great - from 80 minutes i got down to around 10. Still, not as fast as it should be but now it&apos;s usable. The time difference is notable also in smaller dumps.&lt;/p&gt;

&lt;p&gt;Patch to speed up loading times included, would be great if you add it to trunk.&lt;/p&gt;

&lt;p&gt;Please note - i have not checked this patch with any other setup or DBMS, please do so. &lt;/p&gt;

&lt;p&gt;Also i have noticed something that might be a problem in much larger loads - if wrapping in a single transaction, my total memory usage went up for about 500M higher than in 70000 transactions. At some point, about 5 minutes in the process some kind of garbage collector fired and freed around 1 gig, so perhaps on larger dumps it might be a good idea to wrap the import not in one, but more transactions (like one transaction every 10000 operations).&lt;/p&gt;</description>
                <environment>MySQL, symfony doctrine:load-data</environment>
            <key id="12537">DC-994</key>
            <summary>Doctrine_Data_Import creates unnecessary transactions, big slowdown </summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="chanibal">Krzysztof Bociurko / ChanibaL</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Apr 2011 14:29:27 +0000</created>
                <updated>Tue, 5 Apr 2011 14:29:27 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10966" name="Doctrine_Data_Import-wrap-in-transaction.patch" size="810" author="chanibal" created="Tue, 5 Apr 2011 14:29:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-368] createTablesFromModels() wants to create already existing FOREIGN KEY constraints</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-368</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you create InnoDB tables from a given model directory, the table generator wants to create a foreign key constraint that already exists.&lt;/p&gt;

&lt;p&gt;1. Doctrine_Core::generateModelsFromYaml(&apos;yaml&apos;, &apos;models&apos;);&lt;br/&gt;
2. Doctrine_Core::createTablesFromModels(&apos;models&apos;);&lt;br/&gt;
3. Running this setup twice, will print out the following error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1005 Can&apos;t create table &apos;./dev_mreiche/#sql-930_2cb7.frm&apos; (errno: 121). Failing Query: &quot;ALTER TABLE group_user ADD CONSTRAINT group_user_user_id_user_id FOREIGN KEY (user_id) REFERENCES user(id)&quot;. Failing Query: ALTER TABLE group_user ADD CONSTRAINT group_user_user_id_user_id FOREIGN KEY (user_id) REFERENCES user(id)&lt;/p&gt;</description>
                <environment>mysql  Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (i486) using readline 5.2&lt;br/&gt;
PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli) (built: Sep 20 2009 09:41:43)&lt;br/&gt;
Ubuntu 9.04&lt;br/&gt;
</environment>
            <key id="10632">DC-368</key>
            <summary>createTablesFromModels() wants to create already existing FOREIGN KEY constraints</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mreiche">Mike Reiche</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Dec 2009 13:35:19 +0000</created>
                <updated>Tue, 24 Aug 2010 04:32:21 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11228" author="mreiche" created="Fri, 18 Dec 2009 13:38:50 +0000"  >&lt;p&gt;Moved model and setup code from description to attachment.&lt;/p&gt;</comment>
                    <comment id="11636" author="m.olszewski" created="Tue, 9 Feb 2010 08:53:02 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Just a quick comment - the test case you&apos;ve provided works fine for me using 1.2.1 and also latest code from 1.2 branch... you might try that.&lt;/p&gt;

&lt;p&gt;The error above (1005) is caused by mismatch between local and foreign key definitions. So it seems somewhere along the lines you/Doctrine messed up field definitions (although I can&apos;t see it provided test case). Try using integer without length definition in YAML, like:&lt;/p&gt;

&lt;p&gt;id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
      primary: true&lt;/p&gt;

&lt;p&gt;and check if this is working.&lt;/p&gt;</comment>
                    <comment id="11886" author="ppw8bnh3jy2a" created="Mon, 1 Mar 2010 14:44:47 +0000"  >&lt;p&gt;I&apos;m having the same issue.  However, I&apos;ve tried the test case using a sqlite memory only database and i can&apos;t trigger the problem.&lt;/p&gt;

&lt;p&gt;Here&apos;s my mysql schema, for your review - which does trigger the issue using 1.2.1.&lt;/p&gt;

</comment>
                    <comment id="11887" author="ppw8bnh3jy2a" created="Mon, 1 Mar 2010 14:48:51 +0000"  >&lt;p&gt;I put some debugging statements in Doctrine/Export.php around line 1216:&lt;br/&gt;
------------&lt;br/&gt;
                      $connection-&amp;gt;exec($query);&lt;br/&gt;
                  } catch (Doctrine_Connection_Exception $e) {&lt;br/&gt;
                      // we only want to silence table already exists errors&lt;br/&gt;
+                     print_r($e-&amp;gt;getPortableCode());&lt;br/&gt;
+                     print_r(Doctrine_Core::ERR_ALREADY_EXISTS);&lt;br/&gt;
+                     print_r($e-&amp;gt;getMessage());&lt;br/&gt;
+                     echo &quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;&lt;br/&gt;
+//                                  exit;&lt;br/&gt;
+&lt;br/&gt;
+                     &lt;br/&gt;
                      if ($e-&amp;gt;getPortableCode() !== Doctrine_Core::ERR_ALREADY_EXISTS) {&lt;br/&gt;
                          $connection-&amp;gt;rollback();&lt;/p&gt;

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


&lt;p&gt;Here&apos;s the output I get:&lt;/p&gt;

&lt;p&gt;-5-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;category&apos; already exists. Failing Query: &quot;CREATE TABLE category (id BIGINT AUTO_INCREMENT, name VARCHAR(80), company_id BIGINT, INDEX company_id_idx (company_id), PRIMARY KEY(id)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;-5-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;company&apos; already exists. Failing Query: &quot;CREATE TABLE company (id BIGINT AUTO_INCREMENT, name VARCHAR(80) UNIQUE, address1 VARCHAR(80), address2 VARCHAR(80), city VARCHAR(80), state VARCHAR(10), zipcode VARCHAR(20), phone VARCHAR(20), fax VARCHAR(20), url VARCHAR(255), logo VARCHAR(255), perferedcolumn BIGINT, randomsort BIGINT, comment LONGTEXT, PRIMARY KEY(id)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;-5-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;user&apos; already exists. Failing Query: &quot;CREATE TABLE user (email VARCHAR(255), password VARCHAR(80), fullname VARCHAR(80), company_id BIGINT, cellphone VARCHAR(20), voice VARCHAR(20), voiceext VARCHAR(20), fax VARCHAR(20), comment LONGTEXT, status TINYINT(1), admin TINYINT(1), timeadded DATETIME, timechagned DATETIME, INDEX company_id_idx (company_id), PRIMARY KEY(email)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;-15-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1005 Can&apos;t create table &apos;./iprfpartners/#sql-7eeb_2d8.frm&apos; (errno: 121). Failing Query: &quot;ALTER TABLE category ADD CONSTRAINT category_company_id_company_id FOREIGN KEY (company_id) REFERENCES company(id)&quot;&lt;/p&gt;

</comment>
                    <comment id="14037" author="aristondarmayuda" created="Mon, 23 Aug 2010 16:12:37 +0000"  >&lt;p&gt;I have same problem, but this problem is face on db engine side. When we look at the last query sql like:&lt;/p&gt;

&lt;p&gt;ALTER TABLE category ADD CONSTRAINT category_company_id_company_id FOREIGN KEY (company_id) REFERENCES company(id)&lt;/p&gt;

&lt;p&gt;The first call of createTablesFromModels will create the table and add contraint which run fine because table and constraint not exist yet. Then when we execute createTablesFromModels again it will fail because it still try to create constraint which already exist on table. I&apos;m still looking on MySql section how to check the constrain if it exist or not. If the constraint not exist then we can execute the sql above, if not we need to avoid execution for sql above, this mean we cannot MODIFY the constrain (like ON UPDATE and ON DELETE mode).&lt;/p&gt;</comment>
                    <comment id="14044" author="aristondarmayuda" created="Tue, 24 Aug 2010 04:29:52 +0000"  >&lt;p&gt;I&apos;ve figure out the errorno: 121 which I thinking is that the process try re-adding existing CONSTRAINT name. The resolve that I&apos;ve found is for MySQL engine and modify some Doctrine libraries.&lt;/p&gt;

&lt;p&gt;1. I&apos;ve modify Doctrine_Export_Mysql by adding override function of:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function createForeignKeySql($table, array $definition)
{
    $tableInfo = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;execute(&apos;SHOW CREATE TABLE &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;quoteIdentifier($table));
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($tableInfo &amp;amp;&amp;amp; ($row = $tableInfo-&amp;gt;fetch()))
      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($row[&apos;Create Table&apos;] &amp;amp;&amp;amp; preg_match(&apos;/CONSTRAINT `&apos;.$definition[&apos;name&apos;].&apos;`.+/i&apos;, $row[&apos;Create Table&apos;])) &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;&apos;;
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::createForeignKeySql($table, $definition);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2. Since if CONSTRAINT already exist the createForeignKeySql return empty string, we need modify function on Doctrine_Export with:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function createForeignKey($table, array $definition)
{
    $sql = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createForeignKeySql($table, $definition);
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($sql != &apos;&apos;)
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;execute($sql);
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; -1;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now by add/modify function above I can savely run createTablesFromModels because if CONSTRAINT of a table exist on database the ALTER TABLE ... ADD CONSTRAINT will not generated. Hope this can help some of you guys.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10404" name="schema.txt" size="4059" author="ppw8bnh3jy2a" created="Mon, 1 Mar 2010 14:44:47 +0000" />
                    <attachment id="10239" name="testcase.zip" size="723" author="mreiche" created="Fri, 18 Dec 2009 13:38:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-321] Doctrine/Import/Mssql.php does not handle default values</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-321</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I generate models from sql server I notice that the default values are empty although some columns in the database do have default values.&lt;/p&gt;

&lt;p&gt;I did &apos;EXEC sp_columns @table_name = &apos;page&apos;;&apos; in sql server and I could clearly see default values in &apos;column_def&apos; so somehow the default values get lost.&lt;/p&gt;
</description>
                <environment>using odbc connection to sql server. (SQL Native Client)</environment>
            <key id="10558">DC-321</key>
            <summary>Doctrine/Import/Mssql.php does not handle default values</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aiso">aiso haikens</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 16:09:00 +0000</created>
                <updated>Thu, 3 Dec 2009 20:16:02 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;Do not know how to markup here, it&apos;s my first issue in Jira, please press &quot;edit&quot; to see the yaml code formatted &lt;/p&gt;</description>
                <environment>FreeBSD 6.1, Apache 2.2.4, PHP 5.3.2, MySQL 5.0.41</environment>
            <key id="11289">DC-655</key>
            <summary>When Export from Models to database is made some constraints may not be created</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="c0ba">Oleg Stepura</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Apr 2010 11:01:05 +0000</created>
                <updated>Fri, 11 Jun 2010 09:05:00 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12778" author="c0ba" created="Thu, 29 Apr 2010 12:57:26 +0000"  >&lt;p&gt;Also what I noticed today is that this YAML schema:&lt;/p&gt;

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

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

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

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

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

<item>
            <title>[DC-615] New sequence generation for PostgreSQL SQL code results in errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-615</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With 1.2.2 we get errors for our generated PostgreSQL code: &quot;sequence &amp;lt;sequence name&amp;gt; already exists&quot;. I tracked down the issue to the following:&lt;/p&gt;

&lt;p&gt;Doctrine_Export_Pgsql::createTableSql() has the following new code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($options[&apos;sequenceName&apos;])) {
            $sql[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createSequenceSql($options[&apos;sequenceName&apos;]);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is fine, but this CREATE SEQUENCE code is now added after the CREATE TABLE code. This does not work okay for PostgreSQL, since PostgreSQL will automatically create the index for you if it does not yet exist. If CREATE SEQUENCE is required for some reason, then it should ge before the CREATE TABLE to be useful (it could for example be useful if different increment intervals or starting numbers should be set for the sequence).&lt;/p&gt;

&lt;p&gt;I tried moving the new code up, but that did not yet give me the desired results. The issue is that Doctrine_Export::exportClassesSql() collects all the SQL in an array and finally does:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;rsort($sql);
&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $sql;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This can break any statement set in there that should be run in a specific order. For the PostgreSQL code, this will put all the CREATE TABLE calls in font of the CREATE SEQUENCE calls, resulting in the errors that we see.&lt;/p&gt;

&lt;p&gt;Suggested fix options:&lt;/p&gt;

&lt;p&gt;1) Do not sort the SQL queries, but accept them as generated by the db specific Export class (but I&apos;m only suggesting this, because I am not aware of the reason to do an rsort() in the first place).&lt;/p&gt;

&lt;p&gt;2) Change the PostgreSQL export code to make it immune to the sorting.&lt;/p&gt;

&lt;p&gt;We did the latter in our code. The CREATE SEQUENCE and CREATE TABLE are concatenated into one statement string (&quot;&amp;lt;squence&amp;gt;;&amp;lt;table&amp;gt;&quot;) that is added to the list of SQL queries. This provides us a work-around for the problem. The first solution is more clean IMO, but I lack knowledge to tell if the rsort() is here for technical or aesthetic reasons. &lt;/p&gt;</description>
                <environment></environment>
            <key id="11168">DC-615</key>
            <summary>New sequence generation for PostgreSQL SQL code results in errors</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Apr 2010 16:53:14 +0000</created>
                <updated>Sat, 22 Jan 2011 08:41:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14251" author="mmakaay" created="Fri, 3 Sep 2010 06:10:48 +0000"  >&lt;p&gt;An additional issue for the PostgreSQL sequence handling: the Doctrine code does create a sequence field in the tables. However, the sequence system seems not to be in use at all for generating new id fields. As a result, the sequences remain at their initial value of 1.&lt;/p&gt;

&lt;p&gt;We noticed this when we tried to manually insert a record in the database. Five records were already available. The manual INSERT failed, because of a duplicate index error on the id field. After a few attempts, it did work. That was because the PostgreSQL sequence had reached a value of 6, which was a non-existing id for the table at that point.&lt;/p&gt;

&lt;p&gt;I think that a choice has to be made here: either use sequences or don&apos;t:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;When id&apos;s are always generated without using the sequence features of PostgreSQL, then do not create the id fields as sequences, but make them standard primary key integer fields instead, so no unused sequence objects will be created in the database.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;When id generation makes use of sequence features, then it&apos;s okay to use sequences for id fields. When doing this, loading a new dataset into the database might require some additional attention for the sequences. After import, the sequences should be updated to represent the first free id value for the table that it is providing id values for. When data import makes use of the sequences directly for generating id&apos;s, then this would not be necessary of course.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I hope this helps in improving Doctrine.&lt;/p&gt;</comment>
                    <comment id="15158" author="mmakaay" created="Sat, 22 Jan 2011 08:41:30 +0000"  >&lt;p&gt;The issue with the duplicate id&apos;s is fixed on our system.&lt;/p&gt;

&lt;p&gt;When defining &quot;sequence: &amp;lt;something&amp;gt;&quot; in a YAML file for a field, Doctrine will generate two sequences: one as specified in the YAML data and one as autogenerated by PostgreSQL. Doctrine inserts will use one, direct inserts via SQL will use the other. By specifying an field as primary and autoincrement, a correct and single sequence will be generated.&lt;/p&gt;

&lt;p&gt;This work-around works for us. The Doctrine team will have to decide on what the expected behavior for &quot;sequence&quot; is. The current workings seem a bit off IMO.&lt;/p&gt;

&lt;p&gt;I hope this helps. Thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10541" name="PostreSQL.createTableSql.sequence.fix.diff" size="1685" author="mmakaay" created="Fri, 2 Apr 2010 16:53:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-502] sometimes not all the constraints are created for a many to many relation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-502</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;it seems that the naming is important:&lt;/p&gt;

&lt;p&gt;in a User, Group, UserGroup relation (where the UserGroup defines the many to many relation for User &amp;amp; Group) the constraints are defined well&lt;/p&gt;

&lt;p&gt;but if the tables are Order, Service, OrderService it doesn&apos;t work =&amp;gt; just one constraint is created... please find my 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;Order:
  tableName:          orders
  columns:
    name:             string(50)
  relations:
    Services:
      class:          Service
      local:          order_id
      foreign:        service_id
      refClass:       OrderService

Service:
  actAs:
    Versionable:      ~
  columns:
    name:             string(50)
  relations:
    Orders:
      class:          Order
      local:          service_id
      foreign:        order_id
      refClass:       OrderService

# WTF: it takes alphbetically the constraints building  !?
# &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; I used ZorderService instead of OrderService, Z is after S (O is before S) the constraints are defined fine!
OrderService:
  columns:
    order_id:         { type: integer, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    service_id:       { type: integer, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }

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

&lt;p&gt; ==&amp;gt; the generated SQL &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;sql&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE orders (id BIGINT AUTO_INCREMENT, name VARCHAR(50), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE order_service (order_id BIGINT, service_id BIGINT, version BIGINT, PRIMARY KEY(order_id, service_id, 
        version)) ENGINE = INNODB;
CREATE TABLE service_version (id BIGINT, name VARCHAR(50), version BIGINT, PRIMARY KEY(id, version)) ENGINE = 
        INNODB;
CREATE TABLE service (id BIGINT AUTO_INCREMENT, name VARCHAR(50), version BIGINT, PRIMARY KEY(id)) ENGINE = 
        INNODB;
ALTER TABLE order_service ADD CONSTRAINT order_service_order_id_orders_id FOREIGN KEY (order_id) REFERENCES 
        orders(id);
ALTER TABLE service_version ADD CONSTRAINT service_version_id_service_id FOREIGN KEY (id) REFERENCES service(id) 
        ON UPDATE CASCADE ON DELETE CASCADE;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;=&amp;gt;  as you can see for TABLE order_service just one constraint is defined (&lt;b&gt;order_service_order_id_orders_id&lt;/b&gt;) the other one (&lt;b&gt;order_service_service_id_service_id&lt;/b&gt;) is missing !!!&lt;/p&gt;


&lt;p&gt;However if i change the names for tables (actually i think alphabetically order) and use ZorderService instead of OrderService (lik UserGroup for User &amp;amp; Group) the two constraints are created!&lt;/p&gt;

&lt;p&gt;This also affects the &quot;getRelations()&quot; when i tried to write a behavior (it gives back just one relation):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;  foreach ($event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getRelations() as $relation)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;ps: &lt;br/&gt;
  also the same bug reported on the list: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/ad48db71b71e043b&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/ad48db71b71e043b&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;sub&gt;(edit G.X: split too long lines in SQL code)&lt;/sub&gt;&lt;/p&gt;</description>
                <environment>i tried both under linux / win; with doctrine 1.1 / 1.2.1&lt;br/&gt;
tried with sandbox / direct creating &amp;quot;bootstrap&amp;quot; =&amp;gt; same results...</environment>
            <key id="10899">DC-502</key>
            <summary>sometimes not all the constraints are created for a many to many relation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rich">Papp Richard</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Feb 2010 15:18:01 +0000</created>
                <updated>Mon, 14 Jun 2010 03:38:30 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Import/Export</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12720" author="ryba" created="Tue, 20 Apr 2010 14:36:59 +0000"  >&lt;p&gt;I seem to have a very similar issue. It is really annoying because no error feedback is given at any point...&lt;br/&gt;
In my case, one out of three many-to-many relations actually has its constraints created, the other two not.&lt;br/&gt;
However, if I take the file date/sql/schema.sql (I am working with Symfony 1.4.4) and run as an SQL query directly with my database, the constraints are created properly!&lt;/p&gt;

&lt;p&gt;So, with symfony, if I go:&lt;br/&gt;
$ symfony14 doctrine:build-model&lt;br/&gt;
$ symfony14 doctrine:build-sql&lt;br/&gt;
$ symfony14 doctrine:insert-sql&lt;br/&gt;
The model gets generated, the database gets generated, but several many-to-many constrains are missing.&lt;/p&gt;

&lt;p&gt;Then if I go:&lt;br/&gt;
$ symfony14 doctrine:build-model&lt;br/&gt;
$ symfony14 doctrine:build-sql&lt;br/&gt;
$ mysql -u user -p database &amp;lt; date/sql/schema.sql&lt;br/&gt;
The model gets generated, the database gets generated, and the constraints are in place.&lt;/p&gt;

&lt;p&gt;Hope this helps to have the problem fixed.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Piotrek&lt;/p&gt;</comment>
                    <comment id="13273" author="gx" created="Fri, 11 Jun 2010 08:47:19 +0000"  >&lt;p&gt;I do confirm this &quot;alphabetical-order exporting&quot; problem! (in 1.2 svn revision 7676)&lt;br/&gt;
(see also #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-655&quot; title=&quot;When Export from Models to database is made some constraints may not be created&quot;&gt;DC-655&lt;/a&gt;)&lt;/p&gt;


&lt;p&gt;*&lt;b&gt;Edit:&lt;/b&gt;* I have gone closer through the functions calls and used a debugger, and the problem is actually logical;&lt;br/&gt;
it happens whenever a refClass of a many-to-many relation is parsed (and exported) before one or both of the linked classes.&lt;/p&gt;

&lt;p&gt;Let&apos;s take this schema (YAML is shorter, anyways the generated PHP models are not bugged):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;---
LinkTable:
  columns:
    table1_id:
      primary: true
      type:    integer
    table2_id:
      primary: true
      type:    integer
Table1:
  relations:
    Table2:
      refClass: LinkTable
      local:    table1_id
      foreign:  table2_id
Table2:
  relations:
    Table1:
      refClass: LinkTable
      local:    table2_id
      foreign:  table1_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now if you call Doctrine_Core::createTablesFromModels() or Doctrine_Core::generateSqlFromModels(), consequent call to Doctrine_Export::exportSortedClassesSql() does a loop and calls exportClassesSql() for each model in alphabetical order; once a table has been exported, subsequent bindings of pending relations won&apos;t be &quot;retro-parsed&quot; for the export.&lt;/p&gt;

&lt;p&gt;I tried to compact the calls chain:&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;php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/* IN CLASS Doctrine_Export (or child (connection export)) */

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;exportSortedClassesSql($classes)
{
    FOREACH ($classes as $class) {
        $connection = Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($class);
        &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;        $sql =
        $connection-&amp;gt;export-&amp;gt;exportClassesSql($models = array($class))
        {
            FOREACH ($models as $name) {
                $record = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $name();
                $table = $record-&amp;gt;getTable();
                &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                $data = $table-&amp;gt;getExportableFormat()
                {
                    /* IN CLASS Doctrine_Table (or child) */
                    
                    &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parser-&amp;gt;getRelations()
                    {
                        /* IN CLASS Doctrine_Relation_Parser (or child) */
                        
                        FOREACH ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_pending as $alias =&amp;gt; $v) {
                            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRelation($alias)
                            {
                                &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                                /*
                                 * In the &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; of an &lt;span class=&quot;code-quote&quot;&gt;&quot;association relation&quot;&lt;/span&gt; through a refTable:
                                 *   binds a *pending* (simple foreign key) relation to the refTable parser,
                                 *   binds a *pending* (simple foreign key) relation to itself,
                                 *   and &lt;span class=&quot;code-quote&quot;&gt;&quot;finalizes&quot;&lt;/span&gt; (adds to $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_relations) its association relation
                                 */
                            }
                        }
                    }
                    &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                }
            }
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So, with our example schema,&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;LinkTable is exported with &lt;b&gt;no&lt;/b&gt; constraints (because has no relations at this time);&lt;/li&gt;
	&lt;li&gt;Table1 gets parsed, which finalizes the pending relation with Table2 (binded when loaded), binds to itself a pending relation with LinkTable, and binds to LinkTable parser the first &lt;b&gt;pending&lt;/b&gt; relation (with Table1); Table1 is then exported whilst it still has a pending relation;&lt;/li&gt;
	&lt;li&gt;Table2 gets parsed and exported the same way.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So now we have 2 problems:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;each table has been exported immediately after its parsing, i.e. in an &lt;em&gt;incomplete state&lt;/em&gt; (&lt;b&gt;this is the present issue&lt;/b&gt;)&lt;/li&gt;
	&lt;li&gt;even after the whole relations parsing loop, LinkTable has still &lt;em&gt;2 pending relations&lt;/em&gt;, and each of both other tables has one &quot;final&quot; &lt;em&gt;and one pending&lt;/em&gt; (but maybe it is supposed to be so...)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note that a second call to Doctrine_Core::generateSqlFromModels() just after the first one, will parse all models one more time and thus finalize those pending relations, generating all constraints (also will subsequent calls).&lt;/p&gt;


&lt;p&gt;For now I don&apos;t have a fix but I think we could consider:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;loop twice in Doctrine_Export::exportSortedClassesSql() and exportClassesSql(), and construct SQL queries only the 2nd time (but... hum...)&lt;/li&gt;
	&lt;li&gt;improve Doctrine_Relation_Parser? maybe explicitly call getRelations() after each bind() (in the getRelation() function)...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Anyway it seems clear that export shouldn&apos;t be done before all tables have been parsed.&lt;/p&gt;

&lt;p&gt;G.X&lt;/p&gt;</comment>
                    <comment id="13283" author="gx" created="Sat, 12 Jun 2010 16:17:25 +0000"  >&lt;p&gt;I still have no fix but in the waiting we can still discuss some &quot;user-side&quot; work-arounds (that don&apos;t need modifying Doctrine source code)...&lt;br/&gt;
Here is what crosses my mind first:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;(in the PHP working code) do a first &quot;dummy&quot; call to 
&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;$conn-&amp;gt;export-&amp;gt;exportClassesSql(Doctrine_Core::loadModels(&apos;models&apos;))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; just to ensure all relations are bound, then a &quot;real&quot; call to  &lt;tt&gt;Doctrine_Core::createTablesFromModels(&apos;models&apos;)&lt;/tt&gt; which will export all constraints well&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;(in the schema) rename &lt;em&gt;LinkTable&lt;/em&gt; to something like &lt;em&gt;ZzLinkTable&lt;/em&gt; so that it is exported last&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;explicitize&quot; the two (one-to-many) foreign key relations in LinkTable by completing the schema as follows:
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;---
LinkTable:
  columns:
    table1_id:
      primary: true
      type:    integer
    table2_id:
      primary: true
      type:    integer
#(added)
  relations:
    Table1:
      local:   table1_id
      foreign: id
    Table2:
      local:   table2_id
      foreign: id
#(/added)
Table1:
  relations:
    Table2:
      refClass: LinkTable
      local:    table1_id
      foreign:  table2_id
Table2:
  relations:
    Table1:
      refClass: LinkTable
      local:    table2_id
      foreign:  table1_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(&lt;em&gt;I think this one would also &quot;solve&quot; the behavior problem of Papp Richard&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But I&apos;m not that happy with the idea of choosing one of these &quot;hacks&quot; &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; if I had to, I would use this last one but (unless you use some &quot;&lt;tt&gt;onDelete: CASCADE&lt;/tt&gt;&quot; or so) it looks like unnecessary duplication...&lt;br/&gt;
Someone, any other idea? ^^&lt;/p&gt;

&lt;p&gt;G.X&lt;/p&gt;

&lt;p&gt;(edit: typo fix)&lt;/p&gt;</comment>
                    <comment id="13292" author="gx" created="Sun, 13 Jun 2010 08:00:34 +0000"  >&lt;p&gt;We can try another approach too: let&apos;s say that our generated PHP models classes &lt;b&gt;are&lt;/b&gt; incomplete.&lt;/p&gt;

&lt;p&gt;Indeed, for a simple foreign key relation (i.e. o2o and o2m / m2o), we can define it only once on the owning side in the YAML file, and the schema importer will generate complete PHP classes, with the &quot;hasOne&quot; on the owning side &lt;b&gt;and&lt;/b&gt; the auto-completed &quot;hasMany&quot; on the opposite side. E.g:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;YAML schema&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;Phonenumber:
  columns:
    user_id: integer
  relations:
    User: {local: user_id, foreign: id}
User:
# we don&apos;t precise the opposite relation here
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will generate the following classes (simplified a bit):&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;PHP models (1)&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;// models/Phonenumber.php
&lt;/span&gt;class Phonenumber &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;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;user_id&apos;,
                                    &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// models/User.php
&lt;/span&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;public&lt;/span&gt; function setUp() {
        &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; was auto-added during the schema &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Phonenumber&apos;, array(&apos;local&apos;   =&amp;gt; &apos;id&apos;,
                                            &apos;foreign&apos; =&amp;gt; &apos;user_id&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and this will work well.&lt;br/&gt;
BUT, now if we &lt;em&gt;remove the auto-added hasMany()&lt;/em&gt; in User.php, then run the following (which worked well before our manual modification):&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;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;require_once &apos;bootstrap.php&apos;;

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
Doctrine_Core::dump($user-&amp;gt;Phonenumber);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;we get some &lt;tt&gt;Fatal error: Uncaught exception &apos;Doctrine_Record_UnknownPropertyException&apos; with message &apos;Unknown record property / related component &quot;Phonenumber&quot; on &quot;User&quot;&apos;&lt;/tt&gt;, which is supposed to occur. Indeed, how could Doctrine know that a User has a &quot;link&quot; with Phonenumber? It would be only possible by parsing the relations of all the (loaded) models first...&lt;/p&gt;

&lt;p&gt;So we can say that &lt;em&gt;YAML schema files can be incomplete &lt;b&gt;whereas&lt;/b&gt; PHP models classes MUST be COMPLETE.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, considering it is not to change, why not apply this &quot;principle&quot; to (m2m) association relations?&lt;br/&gt;
i.e., &lt;b&gt;Doctrine documentation could warn&lt;/b&gt; that, if you want to have all constraints properly exported (like in the present issue) and/or use relations from an association class (having &lt;tt&gt;$link&lt;/tt&gt; instance of &lt;tt&gt;LinkTable&lt;/tt&gt;, you want to use &lt;tt&gt;$link-&amp;gt;Table1&lt;/tt&gt;, not just &lt;tt&gt;$link-&amp;gt;table1_id&lt;/tt&gt;), then you MUST complete your PHP models with the FK relations, like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;PHP models (2)&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;// models/LinkTable.php
&lt;/span&gt;class LinkTable &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;table1_id&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;table2_id&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-comment&quot;&gt;// ADD:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Table1&apos;, array(&apos;local&apos;   =&amp;gt; &apos;table1_id&apos;,
                                      &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Table2&apos;, array(&apos;local&apos;   =&amp;gt; &apos;table2_id&apos;,
                                      &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// models/Table1.php
&lt;/span&gt;class Table1 &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;public&lt;/span&gt; function setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Table2&apos;, array(&apos;refClass&apos; =&amp;gt; &apos;LinkTable&apos;,
                                       &apos;local&apos;    =&amp;gt; &apos;table1_id&apos;,
                                       &apos;foreign&apos;  =&amp;gt; &apos;table2_id&apos;));
        &lt;span class=&quot;code-comment&quot;&gt;// add too?:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;LinkTable&apos;, array(&apos;local&apos;    =&amp;gt; &apos;id&apos;,
                                          &apos;foreign&apos;  =&amp;gt; &apos;table1_id&apos;));
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// models/Table2.php
&lt;/span&gt;class Table2 &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;public&lt;/span&gt; function setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Table1&apos;, array(&apos;refClass&apos; =&amp;gt; &apos;LinkTable&apos;,
                                       &apos;local&apos;    =&amp;gt; &apos;table2_id&apos;,
                                       &apos;foreign&apos;  =&amp;gt; &apos;table1_id&apos;));
        &lt;span class=&quot;code-comment&quot;&gt;// add too?:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;LinkTable&apos;, array(&apos;local&apos;    =&amp;gt; &apos;id&apos;,
                                          &apos;foreign&apos;  =&amp;gt; &apos;table2_id&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After all, these additional relations are bound internally (if not already defined) when exporting tables to DB...&lt;/p&gt;

&lt;p&gt;We also said that the YAML can be incomplete, but for now the short schema.yml I took as an example in my first comment results in PHP classes &lt;em&gt;without&lt;/em&gt; those (2+1+1) adds.&lt;/p&gt;

&lt;p&gt;So to allow YAML to be incomplete even for m2m relations, &lt;em&gt;Doctrine_Import_Schema#_buildRelationships()&lt;/em&gt; would need some &quot;improvement&quot; so that it creates the many-to-one relation for each many-to-many relation (and the opposite one-to-many relation, on the association class side i.e. the owning side, would be auto-completed afterwards). However, a m2m relation is allowed to be defined on one single end, thus may be created one the other end only when _&lt;em&gt;autoCompleteOppositeRelations()&lt;/em&gt; is called, i.e. after _&lt;em&gt;buildRelationships()&lt;/em&gt; has looped over all the existing relations. So &lt;em&gt;Doctrine_Import_Schema#_autoCompleteOppositeRelations()&lt;/em&gt; would need the same kind of improvement...&lt;/p&gt;

&lt;p&gt;In fact I&apos;m not sure of what is a &quot;well defined&quot; model as soon as it uses refClass, the documentation sometimes uses contradictory examples...&lt;/p&gt;

&lt;p&gt;Sorry I was so verbose!&lt;br/&gt;
Thank you for developing Doctrine &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-473] createIndexSql() and dropIndexSql() use different index names (formatter) on MySQL and Postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-473</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While playing with createIndexSql() and dropIndexSql() i noticed, that the pgsql implementation differs from mysql. The index names usually are build with a &apos;_idx&apos; after the name. This is done through the formatter, i guess.&lt;/p&gt;

&lt;p&gt;I noticed, that in Doctrine_Export class the createIndexSql() method does not use the formatter, while dropIndexSql() do. So creating and dropping indexes on pgsql (in my case) fails because of the different names. It does work on mysql, because Doctrine_Export_Mysql class uses it&apos;s own createIndexSql() method where the formatter is used.&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;</description>
                <environment>Postgres 8.3, MySQL 5.0</environment>
            <key id="10825">DC-473</key>
            <summary>createIndexSql() and dropIndexSql() use different index names (formatter) on MySQL and Postgres</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="michael.piecko">Michael Piecko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 11:34:56 +0000</created>
                <updated>Tue, 8 Jun 2010 17:04:37 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12256" author="jwage" created="Mon, 15 Mar 2010 17:47:46 +0000"  >&lt;p&gt;Hi, can you provide either a patch or failing test case that shows the issue so that I can write a patch for it? Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12314" author="michael.piecko" created="Thu, 18 Mar 2010 03:44:00 +0000"  >&lt;p&gt;I must admit that i never did that (patch). And i know i should. I&apos;ll work on that over the weekend.&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;</comment>
                    <comment id="13218" author="jwage" created="Tue, 8 Jun 2010 17:04:37 +0000"  >&lt;p&gt;You can just make your changes and then run svn diff in the Doctrine directory and it will produce a patch/diff which you can attach here.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;the others do also reference &apos;definition&apos;, its just that for mysql and sqlite the code is simpler because there you can just give a new definition, in postgresql you need to explicitly pass what you want to change and therefore the code needs to work differently.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10710" name="doctrine.patch" size="2227" author="lea" created="Tue, 27 Jul 2010 08:33:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

&lt;p&gt;So I&apos;m not sure which is to blame, if the import is returning invalid data, or that alterTableSql ultimately misinterprets it, but, the end result is an incorrect ALTER command.&lt;/p&gt;
</description>
                <environment>MySQL 5.1, PHP 5.3.1, Doctrine 1.2 branch latest.</environment>
            <key id="11636">DC-793</key>
            <summary>import-&gt;listTableColumns / export-&gt;alterTableSql issues</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Jul 2010 18:03:18 +0000</created>
                <updated>Sat, 17 Jul 2010 18:03:18 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;As it is common to expect phpDocumentor comment syntax, the first word after the @param keyword specifies the type, which is in the current version &lt;cite&gt;object&lt;/cite&gt;. It would be really helpful if the current form could be changed from&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Doctrine/Import/Builder.php:1077&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;* @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; object %s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Doctrine/Import/Builder.php:1077&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;* @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; %s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;as it was propossed in the above mentioned issue.&lt;/p&gt;</description>
                <environment>Symfony 1.4.6 with Doctrine 1.2.2 on Debian Linux 5.0</environment>
            <key id="11631">DC-789</key>
            <summary>Better documentation for the generated getInstance method in generated *Table.class.php files</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cberg">Christoph Berg</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Jul 2010 03:02:11 +0000</created>
                <updated>Fri, 16 Jul 2010 03:02:11 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

&lt;p&gt;Seems like it should be done.&lt;/p&gt;</description>
                <environment>ubuntu/apache/postgres/php (LAP2/LAPP) Symfony 1.4.4 unmodified (orignal doctrine)</environment>
            <key id="11616">DC-783</key>
            <summary>Doing introspection of postgres datagbases with sequences for columns does not generate &apos;nextval(sequence_name)::regclass&apos; for default value</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 13:11:44 +0000</created>
                <updated>Mon, 12 Jul 2010 13:26:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13572" author="gearond" created="Mon, 12 Jul 2010 13:26:57 +0000"  >&lt;p&gt;I tried manually adding the default value to the yml file and symfony/doctrine ignores it - it never gets set in the next newly created database. Hmmmmm.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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




&lt;p&gt; &apos;length&apos;     =&amp;gt; $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;data_length&amp;#39;&amp;#93;&lt;/span&gt;,&lt;br/&gt;
doesn&apos;t use the $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val); witch make it Portable&lt;br/&gt;
use this instead&lt;br/&gt;
&apos;length&apos;     =&amp;gt; $decl&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;,&lt;/p&gt;</description>
                <environment>Oracle</environment>
            <key id="11487">DC-733</key>
            <summary>Length validator fail because it was bad initialized</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tripollite">Pierre</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 08:02:28 +0000</created>
                <updated>Mon, 14 Jun 2010 08:02:28 +0000</updated>
                                                                    <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-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-864] Generating YAML schema from model should pick up also charset, collate and other options</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-864</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I did change Doctrine/Export/Schema.php to pick up some options from model, then they get exported into YAML schema by current code.&lt;/p&gt;

&lt;p&gt;Adding the patch. (sorry, can&apos;t run the tests, so I&apos;m not sure whether it does break something, really shouldn&apos;t)&lt;/p&gt;

&lt;p&gt;In my project it works just as expected (did need it for the way I do migrations).&lt;/p&gt;

&lt;p&gt;TODO for Doctrine devs:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;run tests with my patch and let me know if there&apos;s a problem&lt;/li&gt;
	&lt;li&gt;consider other option names, which are worth of export, so far I did need &quot;charset&quot; and &quot;collate&quot;, and I added &quot;queryParts&quot; as well.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I hope my additions make sense and will help you to improve Doctrine project. (and that you will include it, so I don&apos;t have custom modified Doctrine &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11904">DC-864</key>
            <summary>Generating YAML schema from model should pick up also charset, collate and other options</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ped">Peter Helcmanovsky</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 06:15:08 +0000</created>
                <updated>Mon, 10 Jan 2011 09:51:03 +0000</updated>
                                                                    <component>Import/Export</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15118" author="ped" created="Mon, 10 Jan 2011 09:51:03 +0000"  >&lt;p&gt;By hunting down an eluding bug I figured out (i.e. by hard way) that the indexes are dropped as well during YAML generation.&lt;/p&gt;

&lt;p&gt;I will do another pull request on github including another 3 lines to fix that...&lt;/p&gt;

&lt;p&gt;I see this issue is ignored anyway by core devs.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10784" name="Export_Schema.patch" size="863" author="ped" created="Fri, 10 Sep 2010 06:15:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1005] Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1005</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The bugfix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-281&quot; title=&quot;Generate Models Db changes case in Relationship definition.&quot;&gt;&lt;del&gt;DC-281&lt;/del&gt;&lt;/a&gt; (r6802) contains an issue:&lt;/p&gt;

&lt;p&gt;When between two tables in a MySQL database there are two relations, one on both sides (i.e. both tables have a FK field to each other), one of the two is overwritten with the second by the schema importer. That is, at one class, there seems to be only one relation instead of both.&lt;/p&gt;

&lt;p&gt;The issue came in when the decision was made to store all class names in the definition array lower case, as one of the lookups in the array was not updated appropriately.&lt;/p&gt;

&lt;p&gt;See Doctrine/Import.php (1.2.4) line 416 - 435. In line 427, you can clearly see the change made in 6802&lt;/p&gt;

&lt;p&gt;Old:&lt;br/&gt;
&lt;tt&gt;$definitions[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;/tt&gt;&lt;br/&gt;
New:&lt;br/&gt;
&lt;tt&gt;$definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Line 421 however should also have been updated:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;if (in_array($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;, $relClasses) || isset($definitions[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;br/&gt;
Proposed fix:&lt;br/&gt;
&lt;tt&gt;if (in_array($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;, $relClasses) || isset($definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This error results in relations that already exist sometimes being overwritten.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12641">DC-1005</key>
            <summary>Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pelleke">Pelle ten Cate</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 May 2011 11:47:49 +0000</created>
                <updated>Tue, 17 May 2011 11:47:49 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-987] redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-987</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;line 121-128 of Doctrine_Export_Oracle appears to generate redundant code for creating a primary key constraint as primary keys (defined in schema.yml) are already generated during CREATE TABLE statements.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12481">DC-987</key>
            <summary>redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:35:54 +0000</created>
                <updated>Mon, 21 Mar 2011 12:35:54 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-457] Generating YAML schema from DB breaks on certain table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-457</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When attempting to reverse engineer databases using the generate-yaml-db task (via Symfony&apos;s doctrine:build-schema task), I&apos;ve run into some issues due to table names not being compatible with PHP classnames. It creates the PHP classes in /tmp, setting the class name to the same as the table name, and then attempts to build the YAML files off of those.&lt;/p&gt;

&lt;p&gt;I attempted to do this a few months ago and ran into issues because some of the table names began with numbers (&quot;123MyTable&quot; is not a valid PHP class name). My most recent attempt failed because of a table named &quot;List&quot;, which is a reserved PHP keyword.&lt;/p&gt;

&lt;p&gt;While I&apos;m not sure if this is the ideal solution, I think allowing a way to pre-define a prefix for the generated PHP class names would be great.&lt;/p&gt;</description>
                <environment>Linux, Symfony 1.4.1, Doctrine 1.2.1</environment>
            <key id="10788">DC-457</key>
            <summary>Generating YAML schema from DB breaks on certain table names</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ari">Ari Pringle</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jan 2010 23:49:21 +0000</created>
                <updated>Wed, 17 Mar 2010 19:25:09 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11787" author="chipnet" created="Mon, 22 Feb 2010 11:43:36 +0000"  >&lt;p&gt;I think there seems to be a general problem in usage of table names, when using the generating from database to yml.&lt;/p&gt;

&lt;p&gt;I think there something changed with the naming stragegies in the last versions (I do not know in wich one), but it works with doctrine 1.0.10 (used in symfony 1.2.8).&lt;/p&gt;

&lt;p&gt;theoretical stragegies:&lt;br/&gt;
1. Only the first letter is a capital (e.g. ProjectCategory --&amp;gt; Projectcategory)&lt;br/&gt;
2. When a _ is inside the name, the _ is removed an a capital will used (e.g. Project_Values --&amp;gt; ProjectValues)&lt;/p&gt;

&lt;p&gt;But doctrine does not make use of this anymore. When I generate with doctrine 1.2.1 (used in symfony 1.3.2) my table ProjectCategory will be named as ProjectCategory in schema. And when the schema is wrong, all generated models are incompatible to older versions.&lt;/p&gt;
</comment>
                    <comment id="11911" author="jwage" created="Mon, 1 Mar 2010 18:08:05 +0000"  >&lt;p&gt;Hmm. I don&apos;t quite understand. I tested the things you described and it all works as I expected it to. You&apos;ll have to provide some more information.&lt;/p&gt;</comment>
                    <comment id="12312" author="ari" created="Wed, 17 Mar 2010 19:25:09 +0000"  >&lt;p&gt;Sorry for the delay in response.&lt;/p&gt;

&lt;p&gt;Here&apos;s how to reproduce my original issue (I should also mention that I&apos;m running PHP 5.2.4):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;mysql&amp;gt; create table List (id &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; auto_increment,primary key(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;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;bash$ ./symfony doctrine:build-schema
&amp;gt;&amp;gt; doctrine  generating yaml schema from database

Parse error: syntax error, unexpected T_LIST, expecting T_STRING in /tmp/tmp_doctrine_models/List.php on line 17

bash$ sed -n &apos;17p&apos; /tmp/tmp_doctrine_models/List.php 
class List &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The same thing happens if the table name begins with a number (ie 123MyTable).&lt;/p&gt;

&lt;p&gt;Again, I&apos;m not sure if this is the ideal solution, but being able to define a prefix to the generated class names would take care of this issue (so the generated class name above could be MyPrefix_List instead of List)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

&lt;p&gt;Claudia&lt;/p&gt;</description>
                <environment>gentoo, MySQL 5.0.44-log, Doctrine 1.2, symfony 1.4.4</environment>
            <key id="11601">DC-780</key>
            <summary>Foreign key creation fails with MySQL 5.0.44</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="claudia_k">Claudia Kosny</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Jul 2010 04:23:24 +0000</created>
                <updated>Fri, 9 Jul 2010 04:23:24 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10695" name="Doctrine-Export.patch" size="611" author="claudia_k" created="Fri, 9 Jul 2010 04:23:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-737] generateModelsFromYaml with (generateTableClasses = true) doesn&apos;t generate tables classes if (generateBaseClasses = false)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-737</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I can&apos;t see the reason why Table classes are only generated if Base classes are... (the same occurs for Package classes, but regarding code comments a Package is required to extend a Base class... but a Table can&apos;t and won&apos;t...)&lt;/p&gt;

&lt;p&gt;Here is some... patch? :s (it doesn&apos;t make unit tests to fail)&lt;/p&gt;

&lt;p&gt;Best regards&lt;/p&gt;</description>
                <environment>Doctrine SVN 1.2 r.7676</environment>
            <key id="11495">DC-737</key>
            <summary>generateModelsFromYaml with (generateTableClasses = true) doesn&apos;t generate tables classes if (generateBaseClasses = false)</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="gx">Guilliam X</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jun 2010 09:26:14 +0000</created>
                <updated>Tue, 15 Jun 2010 09:27:54 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10653" name="DC-737.patch" size="948" author="gx" created="Tue, 15 Jun 2010 09:27:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-784] Removed unuseful code</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-784</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Self assignments like:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$table = $table;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;are unuseful and could be safely removed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11619">DC-784</key>
            <summary>Removed unuseful code</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicorac">Claudio Nicora</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Jul 2010 05:38:37 +0000</created>
                <updated>Tue, 13 Jul 2010 05:38:37 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10696" name="patch.diff" size="822" author="nicorac" created="Tue, 13 Jul 2010 05:38:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-924] type mismatch for keyfield in column aggregation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-924</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is the doc exemple on column aggregation inheritance :&lt;/p&gt;

&lt;p&gt;Entity:&lt;br/&gt;
  columns:&lt;br/&gt;
    username: string(20)&lt;br/&gt;
    password: string(16)&lt;br/&gt;
    created_at: timestamp&lt;br/&gt;
    updated_at: timestamp&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 1&lt;/p&gt;

&lt;p&gt;Group:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Entity&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 2&lt;/p&gt;

&lt;p&gt;But the keyField (type) is created as VARCHAR(255) so PostgreSQL return an error on applying inheritance condition :&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42883&amp;#93;&lt;/span&gt;: Undefined function: 7 ERROR:  operator does not exist: character varying = integer         &lt;br/&gt;
  LINE 1: ...D s.application = &apos;frontend&apos; AND s.lft = 1) AND (s.type = 2)                                     &lt;br/&gt;
                                                                     ^                                        &lt;br/&gt;
  HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.&lt;/p&gt;

&lt;p&gt;I found this with symfony sfFilebasePlugin on sfFilebase:create-root task.&lt;/p&gt;</description>
                <environment>PostgreSQL</environment>
            <key id="12095">DC-924</key>
            <summary>type mismatch for keyfield in column aggregation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nono">Arnaud Morvan</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Nov 2010 12:02:12 +0000</created>
                <updated>Thu, 11 Nov 2010 12:02:12 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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


&lt;p&gt;Then file with base definition of Box does not contain bindComponent sentence to bind Box model with connection specified for Entity model.&lt;/p&gt;</description>
                <environment>symfony 1.4</environment>
            <key id="12786">DC-1015</key>
            <summary>bindComponent not called before inherited classes base definitions</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="ardi">Adrian Nowicki</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jul 2011 21:21:12 +0000</created>
                <updated>Mon, 4 Jul 2011 21:21:12 +0000</updated>
                                                                    <component>Inheritance</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

&lt;p&gt;Professor:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Person&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 2&lt;/p&gt;
</description>
                <environment>PHP 5.2.11 (cli), Doctrine 1.2 (Revision: 7537)</environment>
            <key id="11179">DC-619</key>
            <summary>preHydrate/postHydrate events do not use proper sub-class component</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mlehner">Matt Lehner</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Apr 2010 14:55:23 +0000</created>
                <updated>Mon, 14 Jun 2010 09:28:51 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Inheritance</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-614] Separate the properties of the parent and the children</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-614</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I want to talk about the inheritance, simple type and columns_aggregation.&lt;/p&gt;

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

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


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

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

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

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

&lt;p&gt;The solution is more POO compliant.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11165">DC-614</key>
            <summary>Separate the properties of the parent and the children</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Apr 2010 05:45:08 +0000</created>
                <updated>Fri, 2 Apr 2010 05:58:41 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-536] Duplicate CREATE TABLE entries in schema.sql when using column_inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-536</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When creating a model involving column_inheritance the CREATE TABLE statement gets duplicated.&lt;/p&gt;

&lt;p&gt;The second CREATE TABLE include an index for the keyField.&lt;/p&gt;

&lt;p&gt;Test doctrine generated models and generated schema.sql attached.&lt;/p&gt;</description>
                <environment>MySQL 5 / PHP 5.3.1 / Symfony 1.4.3 (branch) / Doctrine 1.2.1 / Mac OSX</environment>
            <key id="10981">DC-536</key>
            <summary>Duplicate CREATE TABLE entries in schema.sql when using column_inheritance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="webpragmatist">webPragmatist</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Mar 2010 12:38:25 +0000</created>
                <updated>Thu, 18 Nov 2010 01:44:16 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Inheritance</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="11973" author="webpragmatist" created="Tue, 2 Mar 2010 13:05:19 +0000"  >&lt;p&gt;It seems this issue is related to using array_unique() and databases which doctrine creates index along with the CREATE TABLE statement.&lt;/p&gt;

&lt;p&gt;This does not occur on sqlite as shown above in the console-log.txt (this db uses the CREATE INDEX statement).&lt;/p&gt;</comment>
                    <comment id="11975" author="sacho" created="Tue, 2 Mar 2010 13:25:36 +0000"  >&lt;p&gt;Yes, it seems SQL CREATE TABLE statements are generated for each of the children as well, but with sqlite, array_unique() filters out the ones that are &quot;extra&quot;.&lt;br/&gt;
But the MySQL statements all differ(due to indexes, I don&apos;t know if other things can cause them to differ as well), and as such all are left.&lt;/p&gt;</comment>
                    <comment id="12867" author="boutell" created="Fri, 7 May 2010 12:22:40 +0000"  >&lt;p&gt;We&apos;re seeing this issue too. doctrine:build --all --and-load works fine, but doctrine:build-sql generates duplicate CREATE TABLE statements. Our in-house workflow is the former, so the latter came as a surprise. Is there any sign of progress on this one?&lt;/p&gt;</comment>
                    <comment id="13533" author="bascht" created="Wed, 7 Jul 2010 09:14:06 +0000"  >&lt;p&gt;This looks like a Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-123&quot; class=&quot;external-link&quot;&gt;DC-123&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="14772" author="kerdany" created="Thu, 18 Nov 2010 01:43:39 +0000"  >&lt;p&gt;A little addition to the symptoms of this problem.&lt;/p&gt;

&lt;p&gt;If the one of the child classes has a foreign key to another entity, another Third Create table SQL will be created, which contains the an index on the foreign key column.&lt;/p&gt;

&lt;p&gt;In other words, it seems that an additional create table statement is created for each automatically created index.&lt;/p&gt;

&lt;p&gt;An illustration is in the attached yml and sql schema:&lt;br/&gt;
kerdany_10-11-18-08-30.yml&lt;br/&gt;
kerdany_10-11-18-08-30.sql&lt;/p&gt;

&lt;p&gt;Tom Boutell: doctrine:build --all generates the problem with me!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10413" name="BaseInherited.class.php" size="429" author="webpragmatist" created="Tue, 2 Mar 2010 12:38:25 +0000" />
                    <attachment id="10412" name="BaseInheriter.class.php" size="1525" author="webpragmatist" created="Tue, 2 Mar 2010 12:38:25 +0000" />
                    <attachment id="10871" name="kerdany_10-11-18-08-30.sql" size="633" author="kerdany" created="Thu, 18 Nov 2010 01:42:16 +0000" />
                    <attachment id="10870" name="kerdany_10-11-18-08-30.yml" size="407" author="kerdany" created="Thu, 18 Nov 2010 01:42:16 +0000" />
                    <attachment id="10414" name="sandbox-console.txt" size="1465" author="webpragmatist" created="Tue, 2 Mar 2010 13:05:19 +0000" />
                    <attachment id="10411" name="schema.sql" size="416" author="webpragmatist" created="Tue, 2 Mar 2010 12:38:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

<item>
            <title>[DC-607] Doctrine concrete inheritance link between tables</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-607</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I pointed out a strange problem:&lt;br/&gt;
I have two tables that are linked with a one to many relation ship.&lt;br/&gt;
Each table has some concrete inherited tables.&lt;br/&gt;
Here is the schema:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Batch:
  columns:
    code: string
    is_pure: &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;

Flask:
  columns:
    batch_id: integer
    code: string
    quantity: integer
  relations:
    Batch:
      local: batch_id
      foreign: id
      foreignType: many
    
ProducedBatch:
  inheritance:
    type: concrete
    &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;: Batch
  columns:
    production_date: date
    
BoughtBatch:
  inheritance:
    type: concrete
    &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;: Batch
  columns:
    supplier: string
    
ProducedFlask:
  inheritance:
    type: concrete
    &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;: Flask
  columns:
    weight: integer
    
BoughtFlask:
  inheritance:
    type: concrete
    &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt;: Flask
  columns:
    price: integer
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem occurs when I try to populate the database.&lt;br/&gt;
Here is the 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;ProducedBatch:
  B1:
    code: Batch1

ProducedFlask:
  F1:
    Batch: B1
    code: Flask1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When loading fixtures, I get 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;Invalid row key specified: (batch) B1, referred to in (produced_flask) F1&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In fact, Doctrine doesn&apos;t take into account the primary key inherited from Flask table.&lt;br/&gt;
The mapping should be done between parent and child tables.&lt;/p&gt;

&lt;p&gt;The only solution to solve this is to set a relationship between each couple of sub-table (ProducedFlask -&amp;gt; ProducedBatch and BoughtFlask -&amp;gt; BoughtFlask).&lt;/p&gt;</description>
                <environment>Symfony 1.4.3, php5.3.0 (snow leopard version)</environment>
            <key id="11149">DC-607</key>
            <summary>Doctrine concrete inheritance link between tables</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="jc13">Julien Chiron</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Mar 2010 05:44:45 +0000</created>
                <updated>Wed, 21 Jul 2010 03:59:18 +0000</updated>
                                                                    <component>Inheritance</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13627" author="etag" created="Wed, 21 Jul 2010 03:59:18 +0000"  >&lt;p&gt;It is very strange that the doctrine inheritance system don&apos;t inherite all the relationship of the mother-table on all sub-table. I think that it will be a very good improvement to fix this problem.&lt;/p&gt;

&lt;p&gt;For example if you are 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;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: yml.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt; 
motherTable:
  columns:
     code: string
     relationTable_id: integer
  relation:
     relationTableRelation:
            local: relationTable_id
            foreign: id
            type: one     

subTable:
    inheritance:
        type: concrete
    colums:
        name: string

relationTable:
    columns:
        code: integer
    relations:
        motherTableRelation:
            local: id
            foreign: relationTable_id
            type: many
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;In this example, the relationTableRelation will be inherited, it is good but the other side of the relation in relation table will always go on motherTable and not on subTable, but motherTable is always empty, moreover subTable don&apos;t share its ID with motherTable, so this side of the relationship is unusefull because we can find subTable element in relation with a relationTable element.&lt;/p&gt;

&lt;p&gt;It will be good to find a solution to 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;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-464] [Inheritance] Couldn&apos;t save record with inheritance by a relationship if the record has no column modified (solution proposed)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-464</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Please consider the following TestCase&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;Inheritance with no property setted, saved by relationship&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Doctrine_Ticket_DC464_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareTables()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC464_Entity&apos;;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC464_Article&apos;;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC464_User&apos;;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC464_Group&apos;;
        parent::prepareTables();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testTest()
    {
        $User = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC464_User();

        $Article = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC464_Article();
        $Article-&amp;gt;title = &apos;my first article&apos;;
        $Article-&amp;gt;Author = $User;

        $Article-&amp;gt;save();

        $UserFetched = Doctrine::getTable(&apos;Ticket_DC464_User&apos;)-&amp;gt;find(1);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertTrue($UserFetched &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Ticket_DC464_User);
       &lt;span class=&quot;code-comment&quot;&gt;//$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($UserFetched-&amp;gt;type, 1);
&lt;/span&gt;

    }
}



class Ticket_DC464_Entity &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&apos;, &apos;integer&apos;, 11, array(&apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;facultative_field&apos;, &apos;string&apos;, 255);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;type&apos;, &apos;string&apos;, 255);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setSubClasses(array(
             &apos;Ticket_DC464_User&apos; =&amp;gt;  array(&apos;type&apos; =&amp;gt; 1),
             &apos;Ticket_DC464_Group&apos; =&amp;gt; array(&apos;type&apos; =&amp;gt; 2),
        ));

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;option(&apos;type&apos;, &apos;InnoDB&apos;);
    }

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

class Ticket_DC464_User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Ticket_DC464_Entity { }
class Ticket_DC464_Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Ticket_DC464_Entity { }

class Ticket_DC464_Article &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 11, array(&apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;title&apos;, &apos;string&apos;, 30);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;author_id&apos;, &apos;integer&apos;, 11);

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;option(&apos;type&apos;, &apos;InnoDB&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;Ticket_DC464_User as Author&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;author_id&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Notice that in the test, the $User instance has no property setted (in fact in this test, the &quot;useless_field&quot; in the model is... useless).&lt;/p&gt;

&lt;p&gt;This test fails (the $User object is not saved) because the method UnitOfWork-&amp;gt;saveRelatedLocalKeys() - called in saveGraph(), itself called by $Article-&amp;gt;save() - returns false because no column has been modified (line 395).&lt;/p&gt;



&lt;p&gt;To fix this, the Record-&amp;gt;assignInheritanceValues() should be executed in top of isModified(), or for each related object in UnitOfWork-&amp;gt;saveRelatedLocalKeys() (and probably UnitOfWork-&amp;gt;saveRelatedForeignKeys() too).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached the test.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10806">DC-464</key>
            <summary>[Inheritance] Couldn&apos;t save record with inheritance by a relationship if the record has no column modified (solution proposed)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="colin.darie">Colin Darie</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Jan 2010 23:51:39 +0000</created>
                <updated>Wed, 9 Jun 2010 06:50:22 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Inheritance</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11527" author="colin.darie" created="Sat, 30 Jan 2010 02:51:11 +0000"  >&lt;p&gt;Fix test with the right prefixes&lt;/p&gt;</comment>
                    <comment id="12259" author="jwage" created="Mon, 15 Mar 2010 17:51:17 +0000"  >&lt;p&gt;Do you have a patch for the issue too?&lt;/p&gt;</comment>
                    <comment id="12286" author="colin.darie" created="Tue, 16 Mar 2010 13:32:52 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;no I doesn&apos;t have a patch for this, because I was not sure what the best way to solve this.&lt;br/&gt;
However, patching the isModified() method is maybe the safest way, with a simple  $this-&amp;gt;assignInheritanceValues(); at top (around line 2100).&lt;/p&gt;</comment>
                    <comment id="13210" author="jwage" created="Tue, 8 Jun 2010 16:51:40 +0000"  >&lt;p&gt;Can you provide a patch for that change then so I can see it and test it? Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="13247" author="colin.darie" created="Wed, 9 Jun 2010 06:50:22 +0000"  >&lt;p&gt;I&apos;ve attached the patch.&lt;/p&gt;

&lt;p&gt;Once again, this patch fix the issue but there is maybe a better way to fix it to avoid the assignInheritanceValues() at each time.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10332" name="DC464TestCase.php" size="3293" author="colin.darie" created="Sat, 30 Jan 2010 02:51:11 +0000" />
                    <attachment id="10634" name="Record.php.patch" size="487" author="colin.darie" created="Wed, 9 Jun 2010 06:50:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;Doctrine creates the table with:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;CREATE TABLE `my_table` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `some_text` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, the following migration should rename the field from &lt;tt&gt;some_text&lt;/tt&gt; to &lt;tt&gt;just_text&lt;/tt&gt;:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
class Version1 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Migration_Base
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;renameColumn(&apos;my_table&apos;, &apos;some_text&apos;, &apos;just_text&apos;);
    }

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

&lt;p&gt;...however the field gets renamed and the type becomes &lt;tt&gt;VARCHAR(255)&lt;/tt&gt;, as the resulting &lt;tt&gt;SHOW CREATE TABLE my_table&lt;/tt&gt; shows:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;CREATE TABLE `my_table` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `a_varchar` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Causes data in the column greater than 255 bytes to get truncated&lt;/p&gt;</description>
                <environment>PHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May  7 2011 03:12:27) &lt;br/&gt;
Zend Engine v2.3.0&lt;br/&gt;
Xdebug v2.0.5&lt;br/&gt;
Turnkey LAMP 10.04 LTS x86_64&lt;br/&gt;
Symfony 1.4.11&lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1</environment>
            <key id="13561">DC-1053</key>
            <summary>Renaming a doctrine &apos;string&apos; field may result in loss of data as the field&apos;s type changes. (MySQL)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="benlancaster">Ben Lancaster</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Mar 2012 20:49:27 +0000</created>
                <updated>Mon, 26 Mar 2012 20:52:02 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-755] CLONE [DC-558] incorrect handling of MODEL_CLASS_PREFIX causes Doctrine_Migration_Diff to drop the whole database when working from YAML (Regression)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-755</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Replicating the bug:&lt;br/&gt;
1. Set ATTR_MODEL_CLASS_PREFIX non-null&lt;br/&gt;
2. create schema file with entity&lt;br/&gt;
3. run doctrine build-all&lt;br/&gt;
4. copy schema file&lt;br/&gt;
5. edit schema file to add column to entity&lt;br/&gt;
6. run generate-migrations-diff from copy of schema file to edited schema file&lt;/p&gt;

&lt;p&gt;Expected (previous) behaviour:&lt;br/&gt;
Migration is generated to add the new column to entity&lt;/p&gt;

&lt;p&gt;Real behaviour:&lt;br/&gt;
Drops entity from database and creates new&lt;/p&gt;</description>
                <environment>Current HEAD of Doctrine 1.2</environment>
            <key id="11528">DC-755</key>
            <summary>CLONE [DC-558] incorrect handling of MODEL_CLASS_PREFIX causes Doctrine_Migration_Diff to drop the whole database when working from YAML (Regression)</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="andrewcoulton">Andrew Coulton</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Jun 2010 09:58:04 +0000</created>
                <updated>Sun, 10 Oct 2010 18:51:58 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13377" author="andrewcoulton" created="Sun, 20 Jun 2010 10:08:30 +0000"  >&lt;p&gt;This seems to be a regression caused by the fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-558&quot; title=&quot;CLONE -generate-migrations-diff is producing bogus migrations (drops the whole database)&quot;&gt;&lt;del&gt;DC-558&lt;/del&gt;&lt;/a&gt; which added the MODEL_CLASS_PREFIX to the $_toPrefix in Doctrine_Migration_Diff::generateChanges.&lt;/p&gt;

&lt;p&gt;While this fixed the issue when generating diff from models to YAML, it has now created the reverse issue for generating diffs from YAML to YAML - as the models generated for the &quot;from&quot; schema do not get MODEL_CLASS_PREFIX prepended and so now this command will drop all existing tables and recreate.&lt;/p&gt;

&lt;p&gt;I believe the fix may be to amend as:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;        $from = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(
            Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX) . 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(
            Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX) . 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;Since it seems that when presented with a folder of models _generateModels ignores the prefix anyway. However, I&apos;m not sure of other impacts possible as a result?&lt;/p&gt;</comment>
                    <comment id="14141" author="andrewcoulton" created="Sun, 29 Aug 2010 06:29:06 +0000"  >&lt;p&gt;I&apos;ve been using and testing the modified version above locally for some time and it seems to work as expected. Any chance of this making it into core? Otherwise, the migrations feature is completely unusable when working YAML-YAML and using model prefixes on the newly released 1.2.3&lt;/p&gt;</comment>
                    <comment id="14144" author="jwage" created="Sun, 29 Aug 2010 12:22:54 +0000"  >&lt;p&gt;Has anyone been able to produce this in a test case?&lt;/p&gt;</comment>
                    <comment id="14182" author="andrewcoulton" created="Mon, 30 Aug 2010 18:16:35 +0000"  >&lt;p&gt;I&apos;ve attached a diff file with the DC755TestCase and the required from and to YAML schema files to reproduce this bug. I wasn&apos;t sure whether you prefer like this or as a git commit?&lt;/p&gt;</comment>
                    <comment id="14183" author="andrewcoulton" created="Mon, 30 Aug 2010 18:24:52 +0000"  >&lt;p&gt;Also attached a diff file of my proposed change to Doctrine_Migration_Diff to resolve this, but as I say unsure if it has implications on other migration types.&lt;/p&gt;</comment>
                    <comment id="14550" author="andrewcoulton" created="Sun, 10 Oct 2010 18:51:58 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/acoulton/doctrine1/tree/DC-755&quot; class=&quot;external-link&quot;&gt;http://github.com/acoulton/doctrine1/tree/DC-755&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10752" name="dc755TestCase.diff" size="3114" author="andrewcoulton" created="Mon, 30 Aug 2010 18:16:35 +0000" />
                    <attachment id="10753" name="fix755.diff" size="642" author="andrewcoulton" created="Mon, 30 Aug 2010 18:24:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-931] Newly generated Migration Classes failing to load due to method used to determine class name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-931</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The loadMigrationClassesFromDirectory() method in Doctrine_Migration uses array_diff on get_declared_classes() between including each classes script.&lt;/p&gt;

&lt;p&gt;When a new migration class is generated by Doctrine_Core::generateMigrationsFromDiff it&apos;s class is loaded, which means loadMigrationClassesFromDirectory silently fails to load the newly generated migration on the same request. This means that scripts that first generate migrations and then apply them must be executed twice - first to generate then to apply.&lt;/p&gt;

&lt;p&gt;The following example code is used to check if the database has been modifed, generate migrations between the base version and the latest models, and then migrate the database if needed:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;automigrate.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Core::generateYamlFromModels(ROOT_PATH.&apos;tmp/yaml/&apos;, ROOT_PATH.&apos;models/&apos;);
$result = Doctrine_Core::generateMigrationsFromDiff(ROOT_PATH.&apos;tmp/migrations/&apos;, ROOT_PATH.&apos;data/yaml/&apos;, ROOT_PATH.&apos;tmp/yaml/&apos;);

unlink(ROOT_PATH.&apos;data/yaml/schema.yml&apos;);
rename(ROOT_PATH.&apos;tmp/yaml/schema.yml&apos;, ROOT_PATH.&apos;data/yaml/schema.yml&apos;);

$migration = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Migration(ROOT_PATH.&apos;tmp/migrations&apos;);

$currentVersion = $migration-&amp;gt;getCurrentVersion();
$latestVersion = $migration-&amp;gt;getLatestVersion();
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($currentVersion &amp;lt; $latestVersion) {
	$migration-&amp;gt;migrate();
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;app-&amp;gt;addMessage(&lt;span class=&quot;code-quote&quot;&gt;&quot;Database migration completed (from version $currentVersion to version $latestVersion)&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;success&quot;&lt;/span&gt;);
} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;app-&amp;gt;addMessage(&lt;span class=&quot;code-quote&quot;&gt;&quot;Database is up to date and doesn&apos;t require migration (at version $currentVersion)&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;success&quot;&lt;/span&gt;);
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>LAMP</environment>
            <key id="12124">DC-931</key>
            <summary>Newly generated Migration Classes failing to load due to method used to determine class name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ppanther">Adam Benson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2010 02:04:00 +0000</created>
                <updated>Fri, 19 Nov 2010 02:04:00 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

<item>
            <title>[DC-928] [Migrations] Drop not null is not working in Postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-928</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When removing the not null from a column the migration does not change anything in the database. This is due to the following check on line 162 of lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Pgsql.php&lt;br/&gt;
if ( ! empty($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;notnull&amp;#39;&amp;#93;&lt;/span&gt;))&lt;/p&gt;

&lt;p&gt;So if notnull is not there or set to false or &apos;0&apos; or 0 the code does not enter into that if statement and therefore no changes are done to the not null value of the column.&lt;/p&gt;</description>
                <environment>Postgresql 8.4, Symfony 1.4, Doctrine 1.2</environment>
            <key id="12110">DC-928</key>
            <summary>[Migrations] Drop not null is not working in Postgres</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lea">Lea Haensenberger</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 07:56:22 +0000</created>
                <updated>Tue, 16 Nov 2010 11:44:46 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14755" author="lsmith" created="Tue, 16 Nov 2010 08:05:03 +0000"  >&lt;p&gt;@Lea: can you write up a patch for this? would also be nice if you could check if the same issue affects other drivers.&lt;/p&gt;</comment>
                    <comment id="14756" author="lea" created="Tue, 16 Nov 2010 11:44:21 +0000"  >&lt;p&gt;Here is a patch (attachment). The generate-migrations-diff Task in Symfony sets &apos;notnull&apos; to an empty string if it&apos;s false in the schema.yml, therefore the check for empty string.&lt;/p&gt;

&lt;p&gt;I had a quick look at the classes for other DBs, but that seems to be a postgres only issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10861" name="dropNotNullPatch.patch" size="1119" author="lea" created="Tue, 16 Nov 2010 11:44:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-888] Foreign key id columns do not respect ATTR_DEFAULT_IDENTIFIER_OPTIONS</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-888</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Some time ago Jon Wage suggested that one can override the 8-byte default integer type for IDs by setting Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS in configureDoctrine (in a Symfony project), like this:&lt;/p&gt;

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

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

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

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

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

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


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

&lt;p&gt;The new stable release of sfDoctrineGuardPlugin (for Symfony) does not specify an integer size as it formerly did, so the size of integers now defaults to 8 bytes. This breaks backwards compatibility with existing code that adds foreign key relationships to sfGuard objects like sfGuardUser, etc. Creating migrations to deal with changing this across all tables involved is quite difficult (all foreign key indexes must be dropped and recreated - doctrine:migrations-diff is unable to figure it out, understandably). &lt;/p&gt;</description>
                <environment>Any</environment>
            <key id="12006">DC-888</key>
            <summary>Foreign key id columns do not respect ATTR_DEFAULT_IDENTIFIER_OPTIONS</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Oct 2010 12:52:51 +0000</created>
                <updated>Wed, 13 Oct 2010 13:03:15 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                <component>Relations</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-867] Doctrine::ATTR_IDXNAME_FORMAT and Doctrine::ATTR_FKNAME_FORMAT are inconsistently applied during migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-867</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Given the following code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()
    {
        $idx = array(
            &apos;fields&apos; =&amp;gt; array(&apos;profile_id&apos;)
        );

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;1. Make a change to your schema.yml&lt;br/&gt;
2. Create the migrations diff by executing &lt;tt&gt;php symfony doctrine:generate-migrations-diff&lt;/tt&gt;&lt;br/&gt;
3. New file have been created at ./lib/migration/doctrine/*_version1.php&lt;br/&gt;
4. Try to migrate using command &lt;tt&gt;php symfony doctrine:migrate&lt;/tt&gt;&lt;br/&gt;
5. Results in error:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ORA-00942: table or view does not exist : SELECT version FROM migration_version. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT version FROM migration_version&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

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

&lt;p&gt;Best regards,&lt;br/&gt;
Michal&lt;/p&gt;</description>
                <environment></environment>
            <key id="12935">DC-1030</key>
            <summary>[PATCH] doctrine 1.2.4 ADD/DROP CONSTRAINT UNIQUE</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="m">MichalKJP</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Aug 2011 12:02:34 +0000</created>
                <updated>Fri, 19 Aug 2011 12:02:34 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11057" name="symfony_0010_doctrine_fix_unique_add_drop.patch" size="1339" author="m" created="Fri, 19 Aug 2011 12:02:34 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;The patch only fixes this one issue.  There are likely many areas in Doctrine that rely upon autocommit behavior in MySQL.  We will continue to look for them, and supply patches as we find them.  However, as we are only concerned about MySQL, our solutions will probably not apply to other PDO drivers.&lt;/p&gt;</description>
                <environment>RHEL 6.0, mysql 5.1.52</environment>
            <key id="12856">DC-1022</key>
            <summary>Doctrine migration does not set version when MySQL autocommit is false</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="afineman">Adam Fineman</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jul 2011 01:02:48 +0000</created>
                <updated>Tue, 26 Jul 2011 01:41:01 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11040" name="migration.patch" size="501" author="afineman" created="Tue, 26 Jul 2011 01:02:48 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-988] migrations should allow generation of SQL in place of DB manipulation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-988</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;At present migrations only allow for direct manipulation of the underlying database. However, many enterprise release processes disallow automated manipulation of databases (especially Oracle) due to a number of reasons (eg placing different objects in different table spaces). &lt;/p&gt;

&lt;p&gt;Because of this, it is preferable for developers to auto generate SQL and then hand over the specialist DBAs who may then filter/alter as needed on a per-environment basis.&lt;/p&gt;

&lt;p&gt;this is currently very easy to achieve with initial database query generation, as outputting SQL is an option, but there is no such option for migration scripts. Therefore I would like to request this option to be added to the migration class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12482">DC-988</key>
            <summary>migrations should allow generation of SQL in place of DB manipulation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:44:19 +0000</created>
                <updated>Mon, 21 Mar 2011 12:44:19 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-986] createIndexSql and dropConstant do not correct set index name suffix</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-986</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Current export methods are inconsitent with index/constraint name suffix (defautl %_idx). Both createConstraintSql() and dropIndex() methods correctly set the suffix, but dropConstraint() and createIndexSql() do not.&lt;/p&gt;

&lt;p&gt;this causes associated down() methods to fail when reverting changes to indexes/constraints&lt;/p&gt;

&lt;p&gt;Erros occur in : Export.php - lines 137 and 473&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12480">DC-986</key>
            <summary>createIndexSql and dropConstant do not correct set index name suffix</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:17:26 +0000</created>
                <updated>Wed, 23 Mar 2011 10:52:48 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-985] doctrine migration does not use tblname_format</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-985</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Migration commands update the database without correcting the default tablename using pre-set tblename_format parameters in databases.yml.&lt;/p&gt;

&lt;p&gt;There is a method for updating the tablename, but this appears to not be used by any script.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12479">DC-985</key>
            <summary>doctrine migration does not use tblname_format</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:13:28 +0000</created>
                <updated>Mon, 21 Mar 2011 12:13:28 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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


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

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

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

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

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

<item>
            <title>[DC-830] Migration for up() not adding suffix for index</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-830</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am still getting the same issue as previously closed a while ago on trac &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1964&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1964&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;migration.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class Add_Category_Slug_Index &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Migration_Base
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function up()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addIndex(&apos;category&apos;, &apos;category_sluggable&apos;, array(
             &apos;fields&apos; =&amp;gt; 
             array(
              0 =&amp;gt; &apos;slug&apos;,
             ),
             &apos;type&apos; =&amp;gt; &apos;unique&apos;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function down()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;removeIndex(&apos;category&apos;, &apos;category_sluggable&apos;, array(
             &apos;fields&apos; =&amp;gt; 
             array(
              0 =&amp;gt; &apos;slug&apos;,
             ),
             &apos;type&apos; =&amp;gt; &apos;unique&apos;,
             ));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above migration generates an index named &lt;b&gt;category_sluggable&lt;/b&gt; instead of  &lt;b&gt;category_sluggable_idx&lt;/b&gt;&lt;/p&gt;</description>
                <environment>Postgresql 8.4 / Symfony 1.4.6</environment>
            <key id="11780">DC-830</key>
            <summary>Migration for up() not adding suffix for index</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="webpragmatist">webPragmatist</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Aug 2010 17:05:06 +0000</created>
                <updated>Sat, 21 Aug 2010 07:06:10 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13968" author="webpragmatist" created="Mon, 16 Aug 2010 17:57:53 +0000"  >&lt;p&gt;If I change the name in the up() to &lt;b&gt;category_sluggable_idx&lt;/b&gt; both up and down work properly.&lt;/p&gt;</comment>
                    <comment id="14023" author="argasek" created="Sat, 21 Aug 2010 07:06:10 +0000"  >&lt;p&gt;Confirming. I had the same problem last week and as a workaround I had to change suffix from &quot;%s_idx&quot; to &quot;%s&quot;. Even if the bug is not reproducible in a test case, it indeed happens in live environment on PostgreSQL (in my case, Symphony is not used).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;... or maybe  I do something wrong? If did something maybe you have to put in manual how to use custom DQL in migrations correctly. I hope migrations are not only to change structure of tables, but also can be used to change data structure too. &lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
public function up() {

$conn = Doctrine_Manager::connection();  	  	
  	
$brands = Doctrine_Query::create ($conn)
  		-&amp;gt;select(&apos;b.id, b.name&apos;)
  		-&amp;gt;from(&apos;Brand b&apos;)
  		-&amp;gt;fetchArray();  // this query worked for me well. I have data
  		 	  	  	 	  	
foreach ($brands as $brand) {
  Doctrine_Query::create ($conn)
   	-&amp;gt;update(&apos;Brand&apos;)
  	-&amp;gt;set(&apos;safe_name&apos;, &apos;?&apos;, &apos;some_safe_name&apos;)
  	-&amp;gt;where(&apos;id = ?&apos;, $brand[&apos;id&apos;])
  	-&amp;gt;execute(); // this query was executed but not had any effect on data in DB
 }
//........
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Symfony Framework 1.3&lt;br/&gt;
Zend Server CE 5.0.2  (PHP 5.3.2)&lt;br/&gt;
Apache 2.2&lt;br/&gt;
MySQL 5.1.47&lt;br/&gt;
Windows XP </environment>
            <key id="11772">DC-827</key>
            <summary>Custom Doctrine_Query UPDATE statement inside migration scope not working</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="arnlukas">Arnoldas Lukasevicius</reporter>
                        <labels>
                    </labels>
                <created>Sat, 14 Aug 2010 13:48:18 +0000</created>
                <updated>Tue, 2 Nov 2010 06:28:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-768] Renaming a NOT NULL column without a default value fails in MySQL migrations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-768</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to rename a column that is NOT NULL and has no default value, Doctrine generates this SQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ALTER TABLE `article` CHANGE `typeid` `listid` INT DEFAULT NULL NOT NULL&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which fails. It should be:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ALTER TABLE `article` CHANGE `typeid` `listid` INT NOT NULL&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11555">DC-768</key>
            <summary>Renaming a NOT NULL column without a default value fails in MySQL migrations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jacksleight">Jack Sleight</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Jun 2010 15:26:49 +0000</created>
                <updated>Fri, 28 Jan 2011 10:29:50 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15125" author="mhughes" created="Tue, 11 Jan 2011 14:39:20 +0000"  >&lt;p&gt;can confirm this behaviour on mysql w/ 1.2.4&lt;/p&gt;</comment>
                    <comment id="15196" author="mhughes" created="Fri, 28 Jan 2011 10:29:50 +0000"  >&lt;p&gt;Attached is a patch that solves the issue.&lt;br/&gt;
It&apos;s not the most elegan solution.&lt;br/&gt;
But works and all tests pass.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10922" name="DC-768.patch" size="1602" author="mhughes" created="Fri, 28 Jan 2011 10:29:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

&lt;p&gt;I deleted all of the 3 entities, I executed symfony doctrine:generate-migrations-diff, which created the migration file containing:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropTable(&apos;customer&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropTable(&apos;customer_person&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropTable(&apos;customer_place&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Executing the migration, gave me error for constrain violation. To fix the error, I added:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropForeignKey(&apos;customer_person&apos;, &apos;customer_person_place_id_customer_place_id&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dropForeignKey(&apos;customer_place&apos;, &apos;customer_place_customer_id_customer_id&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11517">DC-750</key>
            <summary>migration error when deleting 2 or more related classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gionn">Giovanni Toraldo</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 16:31:18 +0000</created>
                <updated>Thu, 1 Jul 2010 05:29:04 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13480" author="gionn" created="Thu, 1 Jul 2010 05:28:45 +0000"  >&lt;p&gt;Another way for fixing this issue, could be to generate a migration class for each of the related tables, so they are executed in different transaction, so integrity constrains aren&apos;t violated.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-751] [PATCH] fix migration builder for remove index</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-751</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;remove the third argumnet it is not used/defined&lt;/p&gt;</description>
                <environment></environment>
            <key id="11519">DC-751</key>
            <summary>[PATCH] fix migration builder for remove index</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Jun 2010 03:44:21 +0000</created>
                <updated>Fri, 18 Jun 2010 03:44:21 +0000</updated>
                                                                    <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10670" name="remove_index.patch" size="734" author="gimler" created="Fri, 18 Jun 2010 03:44:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

<item>
            <title>[DC-597] symfony doctrine:generate-migrations-diff task doesn&apos;t take attributes into account</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-597</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I provided the following bug report on the symfony website and was redirected here.  The response I received was:&lt;/p&gt;

&lt;p&gt;Ticket #8438 (closed defect: invalid)&lt;br/&gt;
03/20/10 12:55:04 changed by Kris.Wallsmith&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;status changed from new to closed.&lt;/li&gt;
	&lt;li&gt;resolution set to invalid.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The symfony task is a wrapper for the Doctrine task. Please post issues to their Jira. &lt;a href=&quot;http://www.doctrine-project.org/jira&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;------------------&lt;br/&gt;
Bug details:&lt;br/&gt;
------------------&lt;/p&gt;

&lt;p&gt;When running doctrine:generate-migrations-diff, I am receiving foreign key files. However, my schema.yml is defined as such:&lt;/p&gt;

&lt;p&gt;attributes: &lt;br/&gt;
  export: tables&lt;br/&gt;
TableOne:&lt;br/&gt;
  columns:&lt;br/&gt;
    ...&lt;br/&gt;
TableTwo:&lt;br/&gt;
  columns:&lt;br/&gt;
    ...&lt;/p&gt;

&lt;p&gt;It would appear that when running doctrine:build it properly ignores the foreign key generation, but that it does not when running doctrine:generate-migrations-diff. This task should be corrected to take this attribute into account. Keep in mind that this may be relevant to the other migration tasks, and they should be updated as well if this is a valid bug. &lt;/p&gt;</description>
                <environment>Windows 7, Apache 2.2.14, PHP 5.2.11, MySQL 5.0.86</environment>
            <key id="11116">DC-597</key>
            <summary>symfony doctrine:generate-migrations-diff task doesn&apos;t take attributes into account</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="bobttd">Bob Stremel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Mar 2010 14:16:17 +0000</created>
                <updated>Tue, 8 Jun 2010 16:17:57 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-497] A new task to set migration to a certain version</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-497</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It would be nice to have a task which you could tell to set to the proper version. If the migrations_version table did not exist yet, it would create the table and set the version.&lt;/p&gt;

&lt;p&gt;Explanation:&lt;br/&gt;
  Most times migrations come as an after thought after the code db is already pushed live.  Therefore you have to manually create the migrations table and set it to a version just before the newest migration.&lt;/p&gt;

&lt;p&gt;  It might also be better to just update the migrate task to check if a migration_version table exists, if not to just run the single migration which is specified.&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="10880">DC-497</key>
            <summary>A new task to set migration to a certain version</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="isleshocky77">Stephen Ostrow</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Feb 2010 17:33:32 +0000</created>
                <updated>Sat, 13 Feb 2010 01:55:11 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Migrations</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>

<item>
            <title>[DC-767] Doctrine_Migration_Builder::generateMigrationClass() improperly loads migration class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-767</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;in function: Doctrine_Migration_Builder::generateMigrationClass() the generated migration class is included (require_once) after creation.  A loadMigrationClass call is made following &lt;span class=&quot;error&quot;&gt;&amp;#91;line 513&amp;#93;&lt;/span&gt; as:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;migration-&amp;gt;loadMigrationClass($className);&lt;/p&gt;

&lt;p&gt;I propose this should change to include the optional &quot;$path&quot; argument to Doctrine_Migration::loadMigrationClass() as:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;migration-&amp;gt;loadMigrationClass($className, $path);&lt;/p&gt;

&lt;p&gt;Since the $path variable is available for the loadMigrationClass it should be included.  More importantly NOT including $path breaks the certains behaviors.  This occurs as a side effect in symfony for instance when creating a new task that chains:&lt;/p&gt;

&lt;p&gt;doctrine:generate-migrations-diff&lt;br/&gt;
doctrine:migrate&lt;/p&gt;

&lt;p&gt;The reason for the problem is because the generate-migrations-diff properly creates the version class and file and then has a require_once that pulls the class into scope.  doctrine:migrate then runs Doctrine_Migration::loadMigrationClassesFromDirectory() to find all the migration classes.  The task does NOT see the newly created migration class because it is not associated with the directory dirname($path) pointed out above.  The function thoroughly scans the migration class directory  with require_once and array_diff&apos;s to find new classes.  But the new migrations class is already within declaration scope so is missed.  Thus the doctrine:migrate task always migrates to the version BEFORE the executed doctrine:generate-migration-diff.&lt;/p&gt;






</description>
                <environment>N/A</environment>
            <key id="11554">DC-767</key>
            <summary>Doctrine_Migration_Builder::generateMigrationClass() improperly loads migration class</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="bfranzke">Brandon Franzke</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Jun 2010 11:03:13 +0000</created>
                <updated>Fri, 25 Jun 2010 11:03:13 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-946] Oracle Doctrine_RawSql()-&gt;count() generates illegal SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-946</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Example RawSQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_RawSql();
    $q-&amp;gt;select(&apos;{k.*}&apos;)
          -&amp;gt;from(&apos;SHP_MANDANT_KATEGORIE k&apos;)
          -&amp;gt;addComponent(&apos;k&apos;, &apos;ShpMandantKategorie k&apos;)
          -&amp;gt;where( &apos;k.id_mandant=&apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getIdMandant() )
          -&amp;gt;andWhere( &apos;k.id_parent=&apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getIdMandantkategorie() )
          -&amp;gt;andWhere( &apos;k.aktiv=1&apos; )
          -&amp;gt;orderBy( &apos;k.sortorder&apos; ); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$q-&amp;gt;count() generates:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; COUNT(*) as num_results 
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; DISTINCT k.id_mandantkategorie 
              &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; SHP_MANDANT_KATEGORIE k 
              &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; k.id_mandant=2 AND k.id_parent=1520 AND k.aktiv=1) as results
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The illegal Part ist the &quot;as results&quot; at the end...&lt;/p&gt;</description>
                <environment></environment>
            <key id="12204">DC-946</key>
            <summary>Oracle Doctrine_RawSql()-&gt;count() generates illegal SQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="lars_pohlmann">Lars Pohlmann</reporter>
                        <labels>
                        <label>oracle</label>
                    </labels>
                <created>Wed, 8 Dec 2010 04:45:02 +0000</created>
                <updated>Mon, 6 Aug 2012 08:11:10 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18428" author="lars_pohlmann" created="Mon, 6 Aug 2012 08:10:30 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

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

<item>
            <title>[DC-781] Column order in generated SQL is based on relationships, instead of SELECT clause</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-781</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When executing below query as follows:&lt;br/&gt;
        $q = Doctrine_Query::create()&lt;br/&gt;
                -&amp;gt;select(&apos;bc.id, bbl.printed_name, bbl.rate, bc.name, bc.is_rate_variable&apos;)&lt;br/&gt;
                -&amp;gt;from(&apos;BillBatchLine bbl, bbl.Bill_Charge bc&apos;)&lt;br/&gt;
                -&amp;gt;where(&apos;bbl.bill_batch_id = ?&apos;, $bill_batch_id);&lt;br/&gt;
        return $q-&amp;gt;execute(array(), Doctrine::HYDRATE_NONE);&lt;/p&gt;

&lt;p&gt;SQL generated is:&lt;br/&gt;
SELECT b.printed_name AS b_&lt;em&gt;printed_name, b.rate AS b&lt;/em&gt;&lt;em&gt;rate, b2.id AS b2&lt;/em&gt;&lt;em&gt;id, b2.name AS b2&lt;/em&gt;&lt;em&gt;name, b2.is_rate_variable AS b2&lt;/em&gt;_is_rate_variable FROM Bill_Batch_Lines b LEFT JOIN bill_charges b2 ON b.bill_charge_id = b2.id AND (b2.deleted_at IS NULL) WHERE (b.bill_batch_id = &apos;2&apos; AND b.society_id = &apos;1&apos; AND b2.society_id = &apos;1&apos; AND (b.deleted_at IS NULL))&lt;/p&gt;

&lt;p&gt;Basically, columns are ordered based on relationships and not as defined in the SELECT clause&lt;/p&gt;</description>
                <environment>Windows / PHP 5.2.4 / MySQL 5.1.41 / Symfony 1.4.0</environment>
            <key id="11603">DC-781</key>
            <summary>Column order in generated SQL is based on relationships, instead of SELECT clause</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="prasadgupte">Prasad Gupte</reporter>
                        <labels>
                    </labels>
                <created>Sat, 10 Jul 2010 05:14:28 +0000</created>
                <updated>Sat, 10 Jul 2010 05:14:28 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-752] Data type &quot;decimal&quot; can be unsigned in MySQL 5.0</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-752</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have found in official docs of MySQL v5.0: &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html&quot; class=&quot;external-link&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Decimals can be unsigned: DECIMAL[(M&lt;span class=&quot;error&quot;&gt;&amp;#91;,D&amp;#93;&lt;/span&gt;)] &lt;span class=&quot;error&quot;&gt;&amp;#91;UNSIGNED&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;ZEROFILL&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Here above is my &quot;&lt;tt&gt;schema.yml&lt;/tt&gt;&quot; file:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;background-color: #EEEEEE;border-color: #333333;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;border-bottom-color: #333333;background-color: #EFEFEF;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
Project:
  columns:
    id:
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    salary_range_from:
      type: decimal(12)
      scale: 2
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After i run:&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;./symfony doctrine:build --all&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;my &quot;&lt;tt&gt;schema.sql&lt;/tt&gt;&quot; is:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;background-color: #EEEEEE;border-color: #333333;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;border-bottom-color: #333333;background-color: #EFEFEF;&quot;&gt;&lt;b&gt;schema.sql&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
CREATE TABLE `project` (
  `id` INT AUTO_INCREMENT, 
  `salary_range_from` DECIMAL(12, 2), 
  INDEX `company_id_idx` (`company_id`), PRIMARY KEY(`id`)
) DEFAULT CHARACTER SET utf8 ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>OS: FreeBSD 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 amd64&lt;br/&gt;
PHP: 5.2.13 (cli) (built: May  6 2010 01:51:58), Zend Engine v2.2.0, with Xdebug v2.0.5&lt;br/&gt;
Symfony: 1.4.6-DEV (/web/vendor/symfony/1.4-svn/lib)&lt;br/&gt;
MySQL: Ver 14.14 Distrib 5.1.46, for portbld-freebsd8.0 (amd64) using  5.2</environment>
            <key id="11522">DC-752</key>
            <summary>Data type &quot;decimal&quot; can be unsigned in MySQL 5.0</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="fruit">Ilya Sabelnikov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Jun 2010 10:38:31 +0000</created>
                <updated>Fri, 18 Jun 2010 10:38:31 +0000</updated>
                                                                    <component>Native SQL</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-515] HYDRATE_RECORD_HIERARCHY broken with many roots</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-515</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;DB schema:&lt;/p&gt;

&lt;p&gt;Category:&lt;br/&gt;
  actAs:&lt;br/&gt;
    NestedSet:&lt;br/&gt;
      hasManyRoots: true&lt;br/&gt;
      rootColumnName: root_id&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(64)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    image: string(64)&lt;br/&gt;
  indexes:&lt;br/&gt;
    tree:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;lft, rgt, root_id&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Sample data:&lt;/p&gt;

&lt;p&gt;id: &apos;1&apos;                                                                   &lt;br/&gt;
  name: &apos;Przyk&#322;adowa kategoria 1&apos;                                           &lt;br/&gt;
  image: null                                                               &lt;br/&gt;
  root_id: &apos;1&apos;                                                              &lt;br/&gt;
  lft: &apos;1&apos;                                                                  &lt;br/&gt;
  rgt: &apos;6&apos;                                                                  &lt;br/&gt;
  level: &apos;0&apos;                                                                &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;p&gt;  id: &apos;2&apos;                                                                   &lt;br/&gt;
  name: &apos;Przyk&#322;adowa kategoria 2&apos;                                           &lt;br/&gt;
  image: null                                                               &lt;br/&gt;
  root_id: &apos;2&apos;&lt;br/&gt;
  lft: &apos;1&apos;&lt;br/&gt;
  rgt: &apos;6&apos;&lt;br/&gt;
  level: &apos;0&apos;&lt;br/&gt;
-&lt;br/&gt;
  id: &apos;3&apos;&lt;br/&gt;
  name: &apos;Przyk&#322;adowa podkategoria 1&apos;&lt;br/&gt;
  image: null&lt;br/&gt;
  root_id: &apos;2&apos;&lt;br/&gt;
  lft: &apos;2&apos;&lt;br/&gt;
  rgt: &apos;5&apos;&lt;br/&gt;
  level: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  id: &apos;4&apos;&lt;br/&gt;
  name: &apos;Przyk&#322;adowa podkategoria 2&apos;&lt;br/&gt;
  image: null&lt;br/&gt;
  root_id: &apos;2&apos;&lt;br/&gt;
  lft: &apos;3&apos;&lt;br/&gt;
  rgt: &apos;4&apos;&lt;br/&gt;
  level: &apos;2&apos;&lt;br/&gt;
-&lt;br/&gt;
  id: &apos;5&apos;&lt;br/&gt;
  name: teset1&lt;br/&gt;
  image: null&lt;br/&gt;
  root_id: &apos;1&apos;&lt;br/&gt;
  lft: &apos;2&apos;&lt;br/&gt;
  rgt: &apos;5&apos;&lt;br/&gt;
  level: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  id: &apos;6&apos;&lt;br/&gt;
  name: test2&lt;br/&gt;
  image: null&lt;br/&gt;
  root_id: &apos;1&apos;&lt;br/&gt;
  lft: &apos;3&apos;&lt;br/&gt;
  rgt: &apos;4&apos;&lt;br/&gt;
  level: &apos;2&apos;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When using HYDRATE_RECORD_HIERARCHY, the first top-level category is empty. Everything is assigned to the other one. Only single-root trees work properly.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10935">DC-515</key>
            <summary>HYDRATE_RECORD_HIERARCHY broken with many roots</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="krojew">Kamil Rojewski</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Feb 2010 15:30:42 +0000</created>
                <updated>Wed, 9 Jun 2010 03:11:58 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12304" author="krojew" created="Wed, 17 Mar 2010 05:46:20 +0000"  >&lt;p&gt;If you look at Doctrine_Collection::toHierarchy() you&apos;ll notice that there is NO reference to root_id, therefore it treats the entire collection as 1 tree (which is false). The bug is 100% repeatable. I&apos;ve made a fast walkaround ba adding a multi-tree hydrator:&lt;/p&gt;

&lt;div class=&quot;code panel&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 MultiRootHydrator &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Hydrator_RecordDriver
{
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function hydrateResultSet($stmt)
  {
    $result = parent::hydrateResultSet($stmt);

    $collection = array();
    foreach ($result as $item)
    {
      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!isset($collection[$item-&amp;gt;root_id]))
        $collection[$item-&amp;gt;root_id] = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Collection($result-&amp;gt;getTable());

      $collection[$item-&amp;gt;root_id]-&amp;gt;add($item);
    }

    $result = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Collection($result-&amp;gt;getTable());
    foreach ($collection as $tree)
    {
      $tree = $tree-&amp;gt;toHierarchy();
      $record = $tree-&amp;gt;getFirst();

      $result-&amp;gt;add($record, $record-&amp;gt;root_id);
    }

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

&lt;p&gt;It should clarify the problem.&lt;/p&gt;</comment>
                    <comment id="13206" author="jwage" created="Tue, 8 Jun 2010 16:31:25 +0000"  >&lt;p&gt;I think it was intended that you would only convert a single tree to a hierarchy. What would the structure of the returned data be like?&lt;/p&gt;</comment>
                    <comment id="13243" author="krojew" created="Wed, 9 Jun 2010 03:11:58 +0000"  >&lt;p&gt;A Doctrine_Collection with root nodes seems to work fine. It allows to traverse the tree for each root.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-870] NestedSet not moving children of child nodes correctly</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-870</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The best way I can explain the issue is with code. Please see the below:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;&amp;lt;?php

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

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * I will now demostrate incorrect moving back of child nodes.
 */
$child2-&amp;gt;getNode()-&amp;gt;moveAsLastChildOf($child1);
/**
 * Now the tree should go back to looking like this:
 * 1
 * - 2
 * - - 3
 * - - - 4
 * 5
 * 
 * But the tree now looks like this:
 * 1
 * - 2
 * - - - 4
 * - - 3
 * 5
 */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 10.04 x64&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11933">DC-870</key>
            <summary>NestedSet not moving children of child nodes correctly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="theashman">Ashley Broadley</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 11:25:54 +0000</created>
                <updated>Mon, 20 Sep 2010 11:53:27 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14420" author="theashman" created="Mon, 20 Sep 2010 11:28:02 +0000"  >&lt;p&gt;Fixing code spacing&lt;/p&gt;</comment>
                    <comment id="14421" author="theashman" created="Mon, 20 Sep 2010 11:49:04 +0000"  >&lt;p&gt;I have also noticed that moving a root node back into its original position as a child also corrupts the tree. I have added an example to the original post&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-971] Tree result sets hydrators are checking for column level not field level</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-971</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Tree hierarchy hydrators (Doctrine_Collection::toHierarchy and Doctrine_Array_Hierarchy_Driver::hydrateResultSet) are checking wheter the column `level` exists.&lt;/p&gt;

&lt;p&gt;The level column can be aliased, and for oracle, it is required to do so. Therefor it is better to check, whether the aliased field level exists.&lt;/p&gt;

&lt;p&gt;Patch included in pull request&lt;/p&gt;</description>
                <environment></environment>
            <key id="12392">DC-971</key>
            <summary>Tree result sets hydrators are checking for column level not field level</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="adrive">Miloslav &quot;adrive&quot; Kmet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 06:37:11 +0000</created>
                <updated>Wed, 16 Feb 2011 06:37:11 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-403] Eliminate queries produced by Doctrine_Node_NestedSet::getDescendants() when possible</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-403</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;h3&gt;&lt;a name=&quot;Howtoreproduce&quot;&gt;&lt;/a&gt;How to reproduce&lt;/h3&gt;

&lt;ol&gt;
	&lt;li&gt;fetch a tree with nested set
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$root = Doctrine::getTable($model)-&amp;gt;getTree()-&amp;gt;findRoot($rootId);
$treeObject= Doctrine::getTable($model)-&amp;gt;getTree()-&amp;gt;fetchTree($root-&amp;gt;getId()); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
	&lt;li&gt;issue
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$root-&amp;gt;getNode()-&amp;gt;getChildren();

or there will be a total query mess in a lambda function with a loop getChildren().
...
&amp;lt;?php foreach($root-&amp;gt;getChildren() as $child): ?&amp;gt;
   ....
&amp;lt;?php endforeach; ?&amp;gt;
...

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Problem is described more verbosely here &amp;#8211; &lt;a href=&quot;http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/&quot; class=&quot;external-link&quot;&gt;http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Whatbehaviorisexpected&quot;&gt;&lt;/a&gt;What behavior is expected&lt;/h3&gt;
&lt;p&gt;An already fetched record instance is returned, without calling database and without causing query flooding.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Likeinpropel.&quot;&gt;&lt;/a&gt;Like in propel.&lt;/h3&gt;
&lt;p&gt;In propel if you are calling ....::retrieveTree($id) it returns the root&lt;br/&gt;
with completed, pooled (cached) and linked  tree.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Whathappens&quot;&gt;&lt;/a&gt;What happens&lt;/h3&gt;
&lt;p&gt;An additional query is issued&lt;/p&gt;

&lt;p&gt;This is a big slip in architecture of Doctrine`s nested set implementation.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10693">DC-403</key>
            <summary>Eliminate queries produced by Doctrine_Node_NestedSet::getDescendants() when possible</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="zidler">alex</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Jan 2010 20:52:18 +0000</created>
                <updated>Fri, 16 Apr 2010 12:18:05 +0000</updated>
                                    <version>1.2.1</version>
                                <fixVersion>1.2.0</fixVersion>
                                <component>Nested Set</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-467] Can&apos;t create root node if multiple roots and primary key have multiple columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-467</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to create new root node, the following exception is thrown.&lt;/p&gt;

&lt;p&gt;PHP Fatal error:  Uncaught exception &apos;Doctrine_Tree_Exception&apos; with message &apos;Node must have a root id set or must  be persistent and have a single-valued numeric primary key in order to be created as a root node. Automatic assignment of a root id on transient/new records is no longer supported.&apos;&lt;/p&gt;

&lt;p&gt;This only happens when hasManyRoots is true, and table have multiple columns in primary key.&lt;/p&gt;

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

&lt;p&gt;$category = new Menu();&lt;br/&gt;
$category-&amp;gt;name = &apos;Menu Root&apos;;&lt;br/&gt;
$category-&amp;gt;language_id = 1;&lt;br/&gt;
$category-&amp;gt;root_id = 23;&lt;br/&gt;
$category-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;$treeObject = Doctrine::getTable(&apos;Menu&apos;)-&amp;gt;getTree();&lt;br/&gt;
$treeObject-&amp;gt;createRoot($category);&lt;/p&gt;


&lt;p&gt;and menu table is defined as follows:&lt;/p&gt;

&lt;p&gt;       $this-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 8, array(&lt;br/&gt;
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,&lt;br/&gt;
             &apos;primary&apos; =&amp;gt; true,&lt;br/&gt;
             &apos;autoincrement&apos; =&amp;gt; true,&lt;br/&gt;
             &apos;length&apos; =&amp;gt; &apos;8&apos;,&lt;br/&gt;
        ));&lt;br/&gt;
        $this-&amp;gt;hasColumn(&apos;language_id&apos;, &apos;integer&apos;, 8, array(&lt;br/&gt;
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,&lt;br/&gt;
             &apos;primary&apos; =&amp;gt; true,&lt;br/&gt;
             &apos;length&apos; =&amp;gt; &apos;8&apos;,&lt;br/&gt;
        ));&lt;/p&gt;

&lt;p&gt;If i remove primary option from language_id column, everything works as it should.&lt;/p&gt;</description>
                <environment>Linux, PostgreSQL</environment>
            <key id="10817">DC-467</key>
            <summary>Can&apos;t create root node if multiple roots and primary key have multiple columns</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="liquidbrain">Milan Cvejic</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 05:31:16 +0000</created>
                <updated>Fri, 16 Apr 2010 12:17:22 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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


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

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

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


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


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


&lt;p&gt;As it can be seen from output, the relation &quot;UserFriend&quot; shows insane data:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;sometime there are two records in &quot;UserFriend&quot; - and that&apos;s wrong&lt;/li&gt;
	&lt;li&gt;user 4 has friendship with 4 - that&apos;s also wrong, not in the fixtures.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Debian</environment>
            <key id="11710">DC-807</key>
            <summary>Equal nest relation uses incorrect SQL and returns incorrect data</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="denis.chmel">Denis Chmel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Aug 2010 10:40:59 +0000</created>
                <updated>Tue, 3 Aug 2010 10:42:24 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13769" author="denis.chmel" created="Tue, 3 Aug 2010 10:42:24 +0000"  >&lt;p&gt;If this will be useful. here&apos;s the SQL it produces:&lt;/p&gt;

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

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

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

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

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


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



&lt;p&gt;Here is a test case, simply made of the code samples given in documentation : &lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/hierarchical-data/en#nested-set:working-with-trees:creating-a-root-node&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/hierarchical-data/en#nested-set:working-with-trees:creating-a-root-node&lt;/a&gt;&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/*
 * Creating a Root Node
 */
$category = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
$category-&amp;gt;name = &apos;Root Category 1&apos;;
$category-&amp;gt;save();

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


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

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

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




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

$category-&amp;gt;refresh();
$category-&amp;gt;getNode()-&amp;gt;hasChildren(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;... that&apos;s now ok !&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3.2 (cli) (built: Apr 12 2010 15:44:21) &lt;br/&gt;
Copyright (c) 1997-2010 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Zend Extension Manager v5.1, Copyright (c) 2003-2010, by Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Data Cache v4.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [disabled]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Utils v1.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [enabled]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Optimizer+ v4.1, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [disabled]&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [enabled]&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
MySQL&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Server: Localhost via UNIX socket&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Server version: 5.1.41-3ubuntu12.1&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Protocol version: 10</environment>
            <key id="11420">DC-707</key>
            <summary>When inserting node as direct children of a root node, it seems the root node is not populated with new lft/rgt values...</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="julien">Julien G</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 May 2010 05:03:06 +0000</created>
                <updated>Sat, 7 Aug 2010 15:39:17 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-890] public function detach break the nested set tree [patch attached]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-890</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I detach a node from the tree using &lt;tt&gt;$node-&amp;gt;detach();&lt;/tt&gt; it set the left and right value to zero without shifting, creating a possible tree corruption.&lt;br/&gt;
It still work somehow because inserting a new node will shift the value but keep the hole in the tree.&lt;/p&gt;

&lt;p&gt;I&apos;ve looked to the original commit in Trac (&lt;a href=&quot;http://trac.doctrine-project.org/changeset/4089&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/4089&lt;/a&gt;) and I don&apos;t think the original idea of the commit was to leave a hole.&lt;br/&gt;
I&apos;ve added 3 lines of code (that I copied from the delete function which works properly), the coresponding patch is joigned to the bug ticket&lt;/p&gt;</description>
                <environment>not environment dependant</environment>
            <key id="12008">DC-890</key>
            <summary>public function detach break the nested set tree [patch attached]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="alex-pex">Alexandre PAIXAO</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Oct 2010 12:12:36 +0000</created>
                <updated>Thu, 14 Oct 2010 12:20:06 +0000</updated>
                                                                    <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14567" author="alex-pex" created="Thu, 14 Oct 2010 12:18:31 +0000"  >&lt;p&gt;ex:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;root                1       4&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;- node A       2       3&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;after detach :&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;root                1       4&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;- node A         0       0&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;then a new one :&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;root                1       6&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;- node B        4       5&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;- node A         0       0&lt;/tt&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10826" name="NestedSet.patch" size="490" author="alex-pex" created="Thu, 14 Oct 2010 12:12:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;SELECT COUNT(*) AS num_results FROM product p WHERE p.product_name LIKE &apos;%motorola%&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Zend Server CE</environment>
            <key id="12058">DC-914</key>
            <summary>Doctrine_Pager ignores custom COUNT query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="arnlukas">Arnoldas Lukasevicius</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Nov 2010 06:23:30 +0000</created>
                <updated>Mon, 7 Nov 2011 22:54:46 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16774" author="blueskypoa" created="Mon, 7 Nov 2011 22:54:46 +0000"  >&lt;p&gt;I found a possible solution to the problem.&lt;/p&gt;

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

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

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

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

&lt;p&gt;Query.php (Doctrine Stable 1.2.4)&lt;/p&gt;

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

<item>
            <title>[DC-897] Pager ignores default model hasMany ORDER BY statements, caused by getLimitSubquery ignoring same</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-897</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Our model configuration includes several hasMany statements, for example:&lt;/p&gt;

&lt;p&gt;        $this-&amp;gt;hasMany(&apos;Subcategory as Subcategories&apos;, array(&lt;br/&gt;
            &apos;refClass&apos; =&amp;gt; &apos;SubcategoryTone&apos;,&lt;br/&gt;
            &apos;local&apos; =&amp;gt; &apos;tone_id&apos;,&lt;br/&gt;
            &apos;foreign&apos; =&amp;gt; &apos;subcategory_id&apos;,&lt;br/&gt;
            &apos;cascade&apos; =&amp;gt; array(&apos;delete&apos;),&lt;br/&gt;
            &apos;orderBy&apos; =&amp;gt; &apos;order_id&apos;,&lt;br/&gt;
        ));&lt;/p&gt;

&lt;p&gt;We noticed that the ORDER BY directive worked just fine with a normal query, but the order by was being ignored when we fed it into the Pager.&lt;/p&gt;

&lt;p&gt;For example:&lt;br/&gt;
            $aa = $t-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;br/&gt;
            var_dump($aa&lt;span class=&quot;error&quot;&gt;&amp;#91;4&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;            $pager = new Doctrine_Pager($t, $currentPage, $resultsPerPage);&lt;br/&gt;
            $bb = $pager-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;            var_dump($bb&lt;span class=&quot;error&quot;&gt;&amp;#91;4&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;These two var_dumps would give different results because the ORDER BY is ignored by the limit subquery in the pager.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12025">DC-897</key>
            <summary>Pager ignores default model hasMany ORDER BY statements, caused by getLimitSubquery ignoring same</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="angrygreenfrogs">Andrew Eross</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 02:50:21 +0000</created>
                <updated>Wed, 10 Nov 2010 01:41:21 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14593" author="angrygreenfrogs" created="Fri, 22 Oct 2010 03:05:23 +0000"  >&lt;p&gt;I&apos;ve also found a fix for the issue (thanks to George over here for finding the location of the problem) ... we found that simply moving the ORDER BY generation code inside of buildSqlQuery() to be ABOVE the if block containing getLimitSubquery() resolves the issue.&lt;/p&gt;

&lt;p&gt;We&apos;re not super familiar with the Doctrine code-base, so everything looks to work fine after moving the code block, and it fixes the issue, but would love to hear if this is a real fix.&lt;/p&gt;

&lt;p&gt;diff from 1.2.3 via our SVN:&lt;/p&gt;

&lt;p&gt;Index: Query.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; Query.php   (revision 1120)&lt;br/&gt;
+++ Query.php   (working copy)&lt;br/&gt;
@@ -1256,7 +1256,46 @@&lt;br/&gt;
                 $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;where&amp;#39;&amp;#93;&lt;/span&gt;[] = &apos;(&apos; . $string . &apos;)&apos;;&lt;br/&gt;
             }&lt;br/&gt;
         }&lt;br/&gt;
+        &lt;br/&gt;
+    // Fix the orderbys so we only have one orderby per value&lt;br/&gt;
+        foreach ($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt; as $k =&amp;gt; $orderBy) {&lt;br/&gt;
+            $e = explode(&apos;, &apos;, $orderBy);&lt;br/&gt;
+            unset($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$k&amp;#93;&lt;/span&gt;);&lt;br/&gt;
+            foreach ($e as $v) &lt;/p&gt;
{
+                $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
+            }
&lt;p&gt;+        }&lt;/p&gt;

&lt;p&gt;+        // Add the default orderBy statements defined in the relationships and table classes&lt;br/&gt;
+        // Only do this for SELECT queries&lt;br/&gt;
+        if ($this-&amp;gt;_type === self::SELECT) {&lt;br/&gt;
+            foreach ($this-&amp;gt;_queryComponents as $alias =&amp;gt; $map) {&lt;br/&gt;
+                $sqlAlias = $this-&amp;gt;getSqlTableAlias($alias);&lt;br/&gt;
+                if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
+                    $orderBy = $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getOrderByStatement($sqlAlias, true);&lt;br/&gt;
+                    if ($orderBy == $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderBy&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;br/&gt;
+                        if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ref&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
+                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], true);
+                        }
&lt;p&gt; else &lt;/p&gt;
{
+                            $orderBy = null;
+                        }
&lt;p&gt;+                    }&lt;br/&gt;
+                } else &lt;/p&gt;
{
+                    $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, true);
+                }
&lt;p&gt;+&lt;br/&gt;
+                if ($orderBy) {&lt;br/&gt;
+                    $e = explode(&apos;,&apos;, $orderBy);&lt;br/&gt;
+                    $e = array_map(&apos;trim&apos;, $e);&lt;br/&gt;
+                    foreach ($e as $v) {&lt;br/&gt;
+                        if ( ! in_array($v, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
+                            $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
+                        }
&lt;p&gt;+                    }&lt;br/&gt;
+                }&lt;br/&gt;
+            }&lt;br/&gt;
+        }&lt;br/&gt;
+&lt;br/&gt;
         $modifyLimit = true;&lt;br/&gt;
         $limitSubquerySql = &apos;&apos;;&lt;/p&gt;

&lt;p&gt;@@ -1307,47 +1346,8 @@&lt;/p&gt;

&lt;p&gt;             $q .= &apos; WHERE &apos; . $limitSubquerySql . $where;&lt;br/&gt;
             //   .  (($limitSubquerySql == &apos;&apos; &amp;amp;&amp;amp; count($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;where&amp;#39;&amp;#93;&lt;/span&gt;) == 1) ? substr($where, 1, -1) : $where);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;}&lt;br/&gt;
+        }        &lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;// Fix the orderbys so we only have one orderby per value&lt;/li&gt;
	&lt;li&gt;foreach ($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt; as $k =&amp;gt; $orderBy) {&lt;/li&gt;
	&lt;li&gt;$e = explode(&apos;, &apos;, $orderBy);&lt;/li&gt;
	&lt;li&gt;unset($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$k&amp;#93;&lt;/span&gt;);&lt;/li&gt;
	&lt;li&gt;foreach ($e as $v) 
{
-                $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
-            }&lt;/li&gt;
	&lt;li&gt;}&lt;br/&gt;
-&lt;/li&gt;
	&lt;li&gt;// Add the default orderBy statements defined in the relationships and table classes&lt;/li&gt;
	&lt;li&gt;// Only do this for SELECT queries&lt;/li&gt;
	&lt;li&gt;if ($this-&amp;gt;_type === self::SELECT) {&lt;/li&gt;
	&lt;li&gt;foreach ($this-&amp;gt;_queryComponents as $alias =&amp;gt; $map) {&lt;/li&gt;
	&lt;li&gt;$sqlAlias = $this-&amp;gt;getSqlTableAlias($alias);&lt;/li&gt;
	&lt;li&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;/li&gt;
	&lt;li&gt;$orderBy = $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getOrderByStatement($sqlAlias, true);&lt;/li&gt;
	&lt;li&gt;if ($orderBy == $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderBy&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;/li&gt;
	&lt;li&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;ref&amp;#39;&amp;#93;&lt;/span&gt;)) 
{
-                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], true);
-                        }
&lt;p&gt; else &lt;/p&gt;
{
-                            $orderBy = null;
-                        }&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;} else 
{
-                    $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, true);
-                }
&lt;p&gt;-&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;if ($orderBy) {&lt;/li&gt;
	&lt;li&gt;$e = explode(&apos;,&apos;, $orderBy);&lt;/li&gt;
	&lt;li&gt;$e = array_map(&apos;trim&apos;, $e);&lt;/li&gt;
	&lt;li&gt;foreach ($e as $v) {&lt;/li&gt;
	&lt;li&gt;if ( ! in_array($v, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)) 
{
-                            $this-&amp;gt;_sqlParts[&apos;orderby&apos;][] = $v;
-                        }&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;}&lt;/li&gt;
	&lt;li&gt;}&lt;br/&gt;
-&lt;br/&gt;
         $q .= ( ! empty($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;groupby&amp;#39;&amp;#93;&lt;/span&gt;)) ? &apos; GROUP BY &apos; . implode(&apos;, &apos;, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;groupby&amp;#39;&amp;#93;&lt;/span&gt;)  : &apos;&apos;;&lt;br/&gt;
         $q .= ( ! empty($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;having&amp;#39;&amp;#93;&lt;/span&gt;)) ?  &apos; HAVING &apos;   . implode(&apos; AND &apos;, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;having&amp;#39;&amp;#93;&lt;/span&gt;): &apos;&apos;;&lt;br/&gt;
         $q .= ( ! empty($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)) ? &apos; ORDER BY &apos; . implode(&apos;, &apos;, $this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt;)  : &apos;&apos;;&lt;br/&gt;
@@ -1396,7 +1396,7 @@&lt;br/&gt;
             $subquery = &apos;SELECT DISTINCT &apos;;&lt;br/&gt;
         }&lt;br/&gt;
         $subquery .= $this-&amp;gt;_conn-&amp;gt;quoteIdentifier($primaryKey);&lt;br/&gt;
-&lt;br/&gt;
+        &lt;br/&gt;
         // pgsql &amp;amp; oracle need the order by fields to be preserved in select clause&lt;br/&gt;
         if ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {&lt;br/&gt;
             foreach ($this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;orderby&amp;#39;&amp;#93;&lt;/span&gt; as $part) 
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {@@ -1420,7 +1420,7 @@                         // don&amp;#39;t add primarykey column (its already in the select clause)                         if ($part !== $primaryKey) {
                             $subquery .= &apos;, &apos; . $partOriginal;
-                        }+                        }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt; &lt;br/&gt;
                     }&lt;br/&gt;
                 }&lt;br/&gt;
             }&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Property changes on: Query.php&lt;br/&gt;
___________________________________________________________________&lt;br/&gt;
Deleted: svn:keywords&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Id Revision&lt;br/&gt;
Deleted: svn:eol-style&lt;/li&gt;
	&lt;li&gt;LF&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="14594" author="angrygreenfrogs" created="Fri, 22 Oct 2010 03:05:58 +0000"  >&lt;p&gt;Diff file&lt;/p&gt;</comment>
                    <comment id="14700" author="angrygreenfrogs" created="Wed, 10 Nov 2010 01:41:14 +0000"  >&lt;p&gt;patch -p0 ./libs/doctrine/Doctrine/Query.php ./Doctrine_Query.php.ORDERBY.patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10856" name="Doctrine_Query.php.ORDERBY.patch" size="5166" author="angrygreenfrogs" created="Wed, 10 Nov 2010 01:41:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-312] Doctrine_Pager query &quot;influences&quot; Doctrine::getTable() query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-312</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I use the same procedure without Doctrine_Pager everything works fine, with Doctrine_Pager the behavior of later queries is strange. Example:&lt;br/&gt;
----------------WORKING:&lt;br/&gt;
1. I fetch list &lt;br/&gt;
Doctrine_Query::create()&lt;del&gt;&amp;gt;select(&apos;z.&lt;b&gt;,s.&lt;/b&gt;,o.*,u.jmeno as Vlo&#382;il,k.nazev_cs as Kategorie&apos;)&lt;/del&gt;&amp;gt;from(&apos;ShopZbozi z,z.Obrazek o,z.Soubor s,z.Uzivatel u,z.ShopKategorie k&apos;)&lt;del&gt;&amp;gt;orderby(&apos;z.nazev_cs ASC&apos;)&lt;/del&gt;&amp;gt;fetchArray(); &lt;/p&gt;

&lt;p&gt;2. I fetch a row to edit independently on the list above&lt;br/&gt;
$object = Doctrine::getTable(&apos;ShopZbozi&apos;)-&amp;gt;find(123);&lt;/p&gt;

&lt;p&gt;3. edit properties of the object...&lt;/p&gt;

&lt;p&gt;4. $object-&amp;gt;replace();&lt;br/&gt;
the object is fetched with no related objects like &lt;span class=&quot;error&quot;&gt;&amp;#91;Uzivatel&amp;#93;&lt;/span&gt; or &lt;span class=&quot;error&quot;&gt;&amp;#91;Soubor&amp;#93;&lt;/span&gt;, so when I change for example $object-&amp;gt;iduzivatel (related Uzivatel object id) and save it is OK&lt;/p&gt;

&lt;p&gt;----------------BROKEN:&lt;br/&gt;
1. I fetch list in Pager&lt;br/&gt;
new Doctrine_Pager(Doctrine_Query::create()&lt;del&gt;&amp;gt;select(&apos;z.&lt;b&gt;,s.&lt;/b&gt;,o.*,u.jmeno as Vlo&#382;il,k.nazev_cs as Kategorie&apos;)&lt;/del&gt;&amp;gt;from(&apos;ShopZbozi z,z.Obrazek o,z.Soubor s,z.Uzivatel u,z.ShopKategorie k&apos;)&lt;del&gt;&amp;gt;orderby(&apos;z.nazev_cs ASC&apos;),$this&lt;/del&gt;&amp;gt;page,$this-&amp;gt;perpage);&lt;/p&gt;

&lt;p&gt;2. I fetch a row to edit independently on the list above    (in contrast to the first working example this $object is fetched with EMPTY RELATION OBJECTS, which causes inserting empty new rows when calling -&amp;gt;replace())&lt;br/&gt;
$object = Doctrine::getTable(&apos;ShopZbozi&apos;)-&amp;gt;find(123);&lt;/p&gt;

&lt;p&gt;3. edit properties of the object...&lt;/p&gt;

&lt;p&gt;4. $object-&amp;gt;replace(); &lt;br/&gt;
-&amp;gt; the $object has all the related object fetched as it was defined in the list in Pager - like it was used as a template for getTable and when -&amp;gt;replace() - new empty related objects are inserted in DB.&lt;/p&gt;


&lt;p&gt;I&apos;ve been using Doctrine for I guess 2 years now and I believe this bug/strange behavior has always been there.&lt;br/&gt;
Maybe I&apos;m wrong and it is not a bug, but the behavior is strange and it took me really long to find where the problem is and I still don&apos;t know how to use pager without influencing the later queries.&lt;br/&gt;
Thanx John Mathew&lt;/p&gt;</description>
                <environment>Debian testing squeeze 32 bit.</environment>
            <key id="10544">DC-312</key>
            <summary>Doctrine_Pager query &quot;influences&quot; Doctrine::getTable() query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="seiffs">Jan Matousek</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 10:19:08 +0000</created>
                <updated>Wed, 2 Dec 2009 10:20:19 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-188] Pager breaks when HAVING clause references existing table column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-188</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Pager breaks when HAVING clause references any existing table column.&lt;/p&gt;

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

&lt;p&gt;        $q = Doctrine_Query::create()&lt;br/&gt;
             -&amp;gt;select(&quot;u.id, u.first_name, u.last_name, u.is_active&quot;)&lt;br/&gt;
             -&amp;gt;addSelect(&apos;COUNT(u.id) as rolecount&apos;)&lt;br/&gt;
             -&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
             -&amp;gt;leftJoin(&apos;u.Roles r&apos;)&lt;br/&gt;
             -&amp;gt;groupBy(&apos;u.id&apos;)&lt;br/&gt;
             -&amp;gt;having(&quot;rolecount &amp;gt; 2 and u.is_active = 1&quot;);&lt;/p&gt;

&lt;p&gt;Execution of query by itself works fine (eg via execute(), fetch...)&lt;/p&gt;

&lt;p&gt;When putting this query in a Doctrine_Pager, error outputs:&lt;/p&gt;

&lt;p&gt;        $pager = new Doctrine_Pager(&lt;br/&gt;
              $q,&lt;br/&gt;
              $currentPage, &lt;br/&gt;
              $resultsPerPage &lt;br/&gt;
        );&lt;/p&gt;

&lt;p&gt;        $pager-&amp;gt;execute();&lt;/p&gt;


&lt;p&gt;Error Received:&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;u.is_active&apos; in &apos;having clause&apos;&lt;/p&gt;</description>
                <environment>Local: Windows/Cygwin/XAMPP&lt;br/&gt;
Stage &amp;amp; Prod:  CentOS&lt;br/&gt;
Apache / MySQL&lt;br/&gt;
Framework:  Zend&lt;br/&gt;
</environment>
            <key id="10340">DC-188</key>
            <summary>Pager breaks when HAVING clause references existing table 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="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="benbac">Benedict Bacayon</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 21:50:18 +0000</created>
                <updated>Tue, 20 Jul 2010 01:14:31 +0000</updated>
                                    <version>1.1.5</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13615" author="ryan" created="Tue, 20 Jul 2010 01:12:54 +0000"  >&lt;p&gt;a quick fix for this is to enclose the field in parentheses when selecting it, then use an alias to reference it inside the having clause. eg &lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;select(&quot;u.id, u.first_name, u.last_name, (u.is_active) u_is_active&quot;)&lt;br/&gt;
-&amp;gt;addSelect(&apos;COUNT(u.id) as rolecount&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;u.Roles r&apos;)&lt;br/&gt;
-&amp;gt;groupBy(&apos;u.id&apos;)&lt;br/&gt;
-&amp;gt;having(&quot;rolecount &amp;gt; 2 and u_is_active = 1&quot;);&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-544] Doctrine_Pager bug with Oracle. getNumResults doesn&apos;t return the correct number of records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-544</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The function getNumResults() doesn&apos;t work correctly.&lt;/p&gt;

&lt;p&gt;This is my model class&lt;/p&gt;
&lt;div class=&quot;code panel&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 ReviewListTable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Table
{
 &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getAvailable()
 {
   &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createQuery()
   -&amp;gt;select(&apos;DISTINCT(to_char(file_date, \&apos;YYYY-MM-DD\&apos;)) fdate&apos;)
   -&amp;gt;orderBy(&apos;fdate DESC&apos;);
 }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If i execute this fonction, the number of record is 31. If i use the Pager, the result is 5744 records&lt;/p&gt;

&lt;p&gt;Controler:&lt;/p&gt;
&lt;div class=&quot;code panel&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;pager = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Pager(
                           Doctrine_Core::getTable(&apos;ReviewList&apos;)-&amp;gt;getAvailable(),
                           $request-&amp;gt;getParameter(&apos;page&apos;, 1),
                           20);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;View:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$rs = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;pager-&amp;gt;execute();
echo $pager-&amp;gt;getNumResults();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10993">DC-544</key>
            <summary>Doctrine_Pager bug with Oracle. getNumResults doesn&apos;t return the correct number of records</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="garfield-fr">Bertrand Zuchuat</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Mar 2010 04:29:53 +0000</created>
                <updated>Thu, 18 Mar 2010 08:02:39 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12235" author="jwage" created="Mon, 15 Mar 2010 16:20:49 +0000"  >&lt;p&gt;Hmm. I don&apos;t quite understand. Can you make a test case?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10492" name="DC544TestCase.php" size="4092" author="garfield-fr" created="Thu, 18 Mar 2010 08:02:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-739] Pager returns incorrect page number when constructed on query with HAVING</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-739</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;//method returns those categories that have any products, it returns 3 records&lt;br/&gt;
public function getCategoriesWithProductsQuery()&lt;/p&gt;
 {
   $query = $this-&amp;gt;createQuery(&apos;z&apos;)-&amp;gt;select( &apos;z.*, COUNT(p.id) prod_number&apos; )
          -&amp;gt;leftJoin( &apos;z.AdvertiseProducts p&apos; )-&amp;gt;groupBy( &apos;z.id&apos; )-&amp;gt;having(&apos;prod_number &amp;gt; 0&apos;);

   return $query;
 }

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

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

&lt;p&gt;//pager works, but it &quot;thinks&quot; that there are more pages than in reality. with maxPerPage = 2, it thinks that there are 4 pages, but looking at query result it //should be only 2 pages.&lt;/p&gt;</description>
                <environment>Ubuntu 9.10, &lt;br/&gt;
Apache/MySQL,&lt;br/&gt;
Framework: Symfony 1.4&lt;br/&gt;
</environment>
            <key id="11499">DC-739</key>
            <summary>Pager returns incorrect page number when constructed on query with HAVING</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="pawelbaranski">Pawe&#322; Bara&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 03:14:11 +0000</created>
                <updated>Wed, 16 Jun 2010 03:16:39 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Pager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-926] Doctrine ignored PORTABILITY_FIX_CASE and ATTR_FIELD_CASE settings when building query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-926</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Setting:&lt;br/&gt;
$conn-&amp;gt;setAttribute(Doctrine_Core::ATTR_PORTABILITY, Doctrine_Core::PORTABILITY_FIX_CASE)&lt;br/&gt;
$conn-&amp;gt;setAttribute(Doctrine_Core::ATTR_FIELD_CASE, CASE_UPPER)&lt;/p&gt;

&lt;p&gt;I expect column names in built queries to be uppercase, but they remain to be lowercase.&lt;/p&gt;</description>
                <environment>Tested on CentOS 5, Ubuntu 10.4, MYSQL and MSSQL databases</environment>
            <key id="12101">DC-926</key>
            <summary>Doctrine ignored PORTABILITY_FIX_CASE and ATTR_FIELD_CASE settings when building query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dziamid">Dziamid Zayankouski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Nov 2010 17:27:10 +0000</created>
                <updated>Fri, 12 Nov 2010 17:29:13 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-918] Causing ORA-01791 when try to sort on relation field and use limit in query to Oracle DB</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-918</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;b&gt;Schema in yml format&lt;/b&gt;&lt;br/&gt;
&lt;em&gt;in Symfony it looks more simple, but i&apos;m going to show relation in detail&lt;/em&gt;
&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-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;PrType:
  columns:   
    name:                   { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }                          

PrTypeTranslation:
  columns:   
    id:                     { type: integer, notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    name:                   { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    lang:                   { type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
  relations:
    PrType:                 { onDelete: CASCADE, local: id_id, foreign: id, foreignAlias: Translation }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When i try to execute this code:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;   $q = Doctrine_Query::create()
            -&amp;gt;from(&apos;PrType tp&apos;)
            -&amp;gt;leftJoin(&apos;tp.Translation t WITH t.lang = ?&apos;, &apos;ru&apos;)
            -&amp;gt;orderBy(&apos;t.name&apos;)
            -&amp;gt;limit(10);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;doctrine executes next statement:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;p2&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; AS &lt;span class=&quot;code-quote&quot;&gt;&quot;p2__name&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;p2&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;lang&quot;&lt;/span&gt; AS &lt;span class=&quot;code-quote&quot;&gt;&quot;p2__lang&quot;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;pr_type&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p&quot;&lt;/span&gt;
LEFT JOIN &lt;span class=&quot;code-quote&quot;&gt;&quot;pr_type_translation&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p2&quot;&lt;/span&gt; ON &lt;span class=&quot;code-quote&quot;&gt;&quot;p&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;p2&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; AND (&lt;span class=&quot;code-quote&quot;&gt;&quot;p2&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;lang&quot;&lt;/span&gt; = :oci_b_var_1)
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; IN (
              &lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; a.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; ( 
                          &lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; DISTINCT &lt;span class=&quot;code-quote&quot;&gt;&quot;p3&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;
                          &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;pr_type&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p3&quot;&lt;/span&gt;
                          INNER JOIN &lt;span class=&quot;code-quote&quot;&gt;&quot;pr_type_translation&quot;&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p4&quot;&lt;/span&gt; ON &lt;span class=&quot;code-quote&quot;&gt;&quot;p3&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;p4&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; AND (&lt;span class=&quot;code-quote&quot;&gt;&quot;p4&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;lang&quot;&lt;/span&gt; = &apos;ru&apos;) 
                          ORDER &lt;span class=&quot;code-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p4&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; ) a 
                          &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; ROWNUM &amp;lt;= 10) 
ORDER &lt;span class=&quot;code-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;p2&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;This sql code produces next error&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ORA-01791: not a SELECTed expression
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Error occures, because (from ORACODE)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There is an incorrect ORDER BY item. The query is a SELECT DISTINCT query with an ORDER BY clause. In this context, all ORDER BY items must be constants, SELECT list expressions, or expressions whose operands are constants or SELECT list expressions&lt;/p&gt;&lt;/blockquote&gt;
</description>
                <environment>Windows 2003 Server, Oracle 10g, Symfony 1.4.8</environment>
            <key id="12072">DC-918</key>
            <summary>Causing ORA-01791 when try to sort on relation field and use limit in query to Oracle DB</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dmishh">Dmitriy</reporter>
                        <labels>
                    </labels>
                <created>Sat, 6 Nov 2010 07:02:53 +0000</created>
                <updated>Sat, 6 Nov 2010 08:48:17 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14676" author="dmishh" created="Sat, 6 Nov 2010 07:04:10 +0000"  >&lt;p&gt;Some very similar issue were reported and resolved here &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1038&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1038&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="14678" author="dmishh" created="Sat, 6 Nov 2010 08:46:45 +0000"  >&lt;p&gt;Reason of issue was founded. It appears because i&apos;m using oci8 driver, and this drivername not be listed in &lt;em&gt;if&lt;/em&gt; statement on line 1401 in &lt;b&gt;Doctrine/Query.php&lt;/b&gt;:
&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-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;LINE 1401: &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I changed to:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;LINE 1401: &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;oci8&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sorry, but i don&apos;t know how to create patch diff file.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-972] MySQL field aliases with triple ticks</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-972</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In revision 7691 something has happened. Ever since I updated my Doctrine to that revision all my queries having &quot; ... fieldname AS aliasname ... &quot; go crazy and make the PHP to throw an exception, like this:&lt;/p&gt;

&lt;p&gt;&apos;Doctrine_Connection_Mysql_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;t.`id`&apos; in &apos;field list&apos;.  Failing Query:&lt;br/&gt;
&quot;SELECT `t`.`id` AS `t_&lt;em&gt;id`, `t`.```id``` AS `t&lt;/em&gt;&lt;em&gt;0`, `t`.```name``` AS `t&lt;/em&gt;&lt;em&gt;1`, `t`.`id` AS `t&lt;/em&gt;&lt;em&gt;0`, `t`.`name` AS `t&lt;/em&gt;_1` FROM `territoryCombined` `t` ORDER BY `t`.`name` asc&quot;&apos;&lt;br/&gt;
in ...path here.../doctrine/lib/Doctrine/Connection.php:1082&lt;/p&gt;

&lt;p&gt;The problem is that the DQL parser somewhere along the process encapsualtes aliases in ticks, but then it does it again in lib/Doctrine/Formatter.php : quoteIdentifier() , which is called in lib/Doctrine/Connection : quoteIdentifier() , which is called in lib/Doctrine/Query.php : processPendingFields() @ between lines 485 and 512. The problem is that by the time the alias name gets to line 507 it is already encapsualted in ticks, but it does it again. At the end we end up with ```alias``` , which is not good.&lt;/p&gt;

&lt;p&gt;It only happens to aliases. If I say select(&apos;*&apos;) or select(&quot;t.id, t.name&quot;) then it executes properly. Only the aliases couse problems.&lt;/p&gt;

&lt;p&gt;A test query:&lt;/p&gt;

&lt;p&gt;$vTerritories = Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&quot;t.id as territory_id, t.name as territory_name&quot;)&lt;br/&gt;
                    -&amp;gt;from(&apos;TerritoryCombined t&apos;)&lt;br/&gt;
                    -&amp;gt;orderBy(&apos;t.name asc&apos;)&lt;br/&gt;
                    -&amp;gt;fetchArray();&lt;/p&gt;


&lt;p&gt;MY PROPOSED PATCH:&lt;/p&gt;

&lt;p&gt;If I change the Formatter::quoteIdentifier() to this:&lt;/p&gt;

&lt;p&gt;    public function quoteIdentifier($str, $checkOption = true)&lt;/p&gt;
    {
        $tmp = $this-&amp;gt;conn-&amp;gt;identifier_quoting; // I move up this line to here because I need it

        if ( (substr($str, 0, 1) == $tmp[&apos;start&apos;]) &amp;amp;&amp;amp; (substr($str, -1) == $tmp[&apos;end&apos;]) ) return $str; // new line; is it already quoted? if yes, then don&apos;t do it again

        // the rest is unchanged
    }

&lt;p&gt;then it works correctly. Please note I only tested that in MySQL, as we use MySQL in all our projects.&lt;/p&gt;</description>
                <environment>MySQL 5, PHP 5</environment>
            <key id="12396">DC-972</key>
            <summary>MySQL field aliases with triple ticks</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="hroland">Roland Huszti</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 11:14:24 +0000</created>
                <updated>Wed, 16 Feb 2011 11:14:24 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10941" name="BaseTerritoryCombined.php" size="2337" author="hroland" created="Wed, 16 Feb 2011 11:14:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-665] Named parameters doesn&apos;t work on MSSQL anymore</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-665</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After upgrading to Doctrine 1.2.2 queries with named arguments doesn&apos;t work anymore.&lt;br/&gt;
Whenever querying like&lt;br/&gt;
                    $query = Doctrine_Query::create();&lt;br/&gt;
                    $customer = $query-&amp;gt;from(&apos;Customers&apos;)&lt;br/&gt;
                                      -&amp;gt;where(&quot;id = :id&quot;&lt;br/&gt;
                                            , array(&apos;id&apos;=&amp;gt;$user&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;customer_id&amp;#39;&amp;#93;&lt;/span&gt;))&lt;br/&gt;
                                      -&amp;gt;fetchOne(array(), Doctrine::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;I get the error &lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 10007 Incorrect syntax near &apos;:&apos;. &lt;span class=&quot;error&quot;&gt;&amp;#91;10007&amp;#93;&lt;/span&gt; (severity 5) &lt;/p&gt;

&lt;p&gt;If changing the query to &lt;br/&gt;
                    $query = Doctrine_Query::create();&lt;br/&gt;
                    $customer = $query-&amp;gt;from(&apos;Customers&apos;)&lt;br/&gt;
                                      -&amp;gt;where(&quot;id = ?&quot;&lt;br/&gt;
                                            , array($user&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;customer_id&amp;#39;&amp;#93;&lt;/span&gt;))&lt;br/&gt;
                                      -&amp;gt;fetchOne(array(), Doctrine::HYDRATE_ARRAY);&lt;br/&gt;
it works fine.&lt;br/&gt;
Testing with MySQL works fine, so it seems contained to MSSQL&lt;/p&gt;
</description>
                <environment>Windows Server 2003. PHP 5.2.12. MS SQL Server 2008</environment>
            <key id="11319">DC-665</key>
            <summary>Named parameters doesn&apos;t work on MSSQL anymore</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="denpet">Dennis Pettersson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 May 2010 10:43:34 +0000</created>
                <updated>Wed, 22 Sep 2010 00:55:15 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12842" author="denpet" created="Thu, 6 May 2010 03:07:13 +0000"  >&lt;p&gt;Should mention I upgraded from 1.1.6 to 1.2.2, so the problem might be present in earlier 1.2.x versions as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-627] Work on link-table and leftJoin</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-627</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Looking at the attachment to see the little schema.&lt;br/&gt;
Tree table : items, items_children and children.&lt;/p&gt;

&lt;p&gt;The link-table items_children is here to create a many-to-many relationships between Items and Children.&lt;/p&gt;

&lt;p&gt;So, after configure the YAML and generated Models.&lt;br/&gt;
We can do something like that :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$query	= Doctrine_Query::create ()&lt;br/&gt;
    		-&amp;gt;select (&quot;items.title, children.title&quot;)&lt;br/&gt;
    		-&amp;gt;from (&quot;Item items&quot;)&lt;br/&gt;
    		-&amp;gt;leftJoin (&quot;item.children children&quot;);&lt;br/&gt;
$items = $query-&amp;gt;execute ();&lt;/p&gt;

&lt;p&gt;$items //An array of items&lt;br/&gt;
$items&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;title //A string&lt;br/&gt;
$items&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;children //An array of children&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The SQL Output of the query is :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT `i`.`id_item` AS `i_&lt;em&gt;id_item`, `i`.`title` AS `i&lt;/em&gt;&lt;em&gt;title`, `c`.`id_child` AS `c&lt;/em&gt;&lt;em&gt;id_child`, `c`.`title` AS `c&lt;/em&gt;_title` FROM `items` `i` LEFT JOIN `items_children` `i2` ON (`i`.`id_item` = `i2`.`id_item`) LEFT JOIN `children` `c` ON `i2`.`id_child` = `c`.`id_child` &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;All array are order by something, in this case it&apos;s a natural order which come from the items_children order into database.&lt;/p&gt;

&lt;p&gt;Now, I want to apply a condition, or a filter on the items_children table.&lt;br/&gt;
If I translate my demand to SQL Query :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT `i`.`id_item` AS `i_&lt;em&gt;id_item`, `i`.`title` AS `i&lt;/em&gt;&lt;em&gt;title`, `c`.`id_child` AS `c&lt;/em&gt;&lt;em&gt;id_child`, `c`.`title` AS `c&lt;/em&gt;_title` FROM `items` `i` LEFT JOIN `items_children` `i2` ON (`i`.`id_item` = `i2`.`id_item`) LEFT JOIN `children` `c` ON `i2`.`id_child` = `c`.`id_child` ORDER BY `c1`.`index`&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Or something crazy :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT `i`.`id_item` AS `i_&lt;em&gt;id_item`, `i`.`title` AS `i&lt;/em&gt;&lt;em&gt;title`, `c`.`id_child` AS `c&lt;/em&gt;&lt;em&gt;id_child`, `c`.`title` AS `c&lt;/em&gt;_title` FROM `items` `i` LEFT JOIN `items_children` `i2` ON (`i`.`id_item` = `i2`.`id_item`) LEFT JOIN `children` `c` ON `i2`.`id_child` = `c`.`id_child` WHERE `c1`.`index` &amp;gt; 2&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;But how can I do that with DQL ? Because I have no access to the Link-table.&lt;/p&gt;

&lt;p&gt;Link-Table are use to create many-to-many, that could be OOP array. So we have to be allowed to add &quot;index&quot; to order the result. Also, we have to be allowed to add condition on this tables, like &quot;datePromote&quot; or simply &quot;enabled&quot;.&lt;/p&gt;

&lt;p&gt;The solution should be on the following DQL Query :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$query	= Doctrine_Query::create ()&lt;br/&gt;
    		-&amp;gt;select (&quot;items.title, children.title&quot;)&lt;br/&gt;
    		-&amp;gt;from (&quot;Item items&quot;)&lt;br/&gt;
    		-&amp;gt;leftJoin (&quot;item.children children&quot;)&lt;br/&gt;
    		-&amp;gt;leftJoin (&quot;ItemsChildren link_table&quot;)&lt;br/&gt;
    		-&amp;gt;orderBy (&quot;link_table.index&quot;)&lt;br/&gt;
$items = $query-&amp;gt;execute ();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;But the SQL Output is :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SELECT `i`.`id_item` AS `i_&lt;em&gt;id_item`, `i`.`title` AS `i&lt;/em&gt;&lt;em&gt;title`, `c`.`id_child` AS `c&lt;/em&gt;&lt;em&gt;id_child`, `c`.`title` AS `c&lt;/em&gt;_title` FROM `items` `i` LEFT JOIN `items_children` `i2` ON (`i`.`id_item` = `i2`.`id_item`) LEFT JOIN `children` `c` ON `i2`.`id_child` = `c`.`id_child`, `items_children` `i3` ORDER BY `i3`.`index` &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;To conclude, it&apos;s a blocker problem. Because I can&apos;t use a standard DB schema.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Armetiz.&lt;/p&gt;</description>
                <environment>Windows Seven - WAMP 2.0i</environment>
            <key id="11215">DC-627</key>
            <summary>Work on link-table and leftJoin</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Apr 2010 04:56:01 +0000</created>
                <updated>Tue, 13 Apr 2010 05:07:32 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10568" name="composition.png" size="14915" author="armetiz" created="Tue, 13 Apr 2010 04:56:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

&lt;p&gt;Yan&lt;/p&gt;</description>
                <environment>Windows server 2003  PHP 5.2.17 / XP PRO 32bits XAMPP PHP 5.3.5&lt;br/&gt;
MSSQL / MYSQL&lt;br/&gt;
Symfony 1.4.6</environment>
            <key id="12702">DC-1009</key>
            <summary>save() also updates fields which should not be</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="karibusan">Yan Urquiza</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Jun 2011 15:24:12 +0000</created>
                <updated>Wed, 8 Jun 2011 15:40:42 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11012" name="after_with_execute.PNG" size="110183" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11011" name="after_with_save.PNG" size="110270" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11010" name="before.PNG" size="108968" author="karibusan" created="Wed, 8 Jun 2011 15:24:12 +0000" />
                    <attachment id="11014" name="retrieveByExamBatchStatus.php" size="1246" author="karibusan" created="Wed, 8 Jun 2011 15:29:50 +0000" />
                    <attachment id="11013" name="schema.yml" size="4243" author="karibusan" created="Wed, 8 Jun 2011 15:29:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-347] AddPendingJoinConditions doesn&apos;t work if alias equals model name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-347</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If the alias in a from-query is equal to the model name, I get an exception when executing the query after adding a &quot;pendingJoinCondition&quot;.&lt;/p&gt;

&lt;p&gt;See attached testCase.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10594">DC-347</key>
            <summary>AddPendingJoinConditions doesn&apos;t work if alias equals model name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="jensen83">Christian Jaentsch</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 14:51:23 +0000</created>
                <updated>Fri, 29 Jan 2010 06:50:10 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11517" author="hobodave" created="Fri, 29 Jan 2010 03:05:21 +0000"  >&lt;p&gt;I fail to see why you would use an alias that is equal to the model name.&lt;/p&gt;</comment>
                    <comment id="11519" author="jensen83" created="Fri, 29 Jan 2010 06:50:10 +0000"  >&lt;p&gt;To clarify again: Using an alias equal to the model name is the same as not using an alias at all. The built sql is the same afterwards (and the addPendingJoinCondition behaviour is the same as well).&lt;/p&gt;

&lt;p&gt;I would not use an alias equal to the model name myself, but sometimes this is used in Doctrine core, e.g. in Doctrine_Relation_ForeignKey around line 60. So to solve the problem either all the core queries, where no alias or an alias equal to the model name is used, have to be rewritten or the behaviour of a respective query has to be changed somehow so that applying an addPendingJoinCondition is possible even in the given case.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="10223" name="AliasEqualsModelNameTestCase.php" size="2441" author="jensen83" created="Wed, 9 Dec 2009 14:51:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-815] Model&apos;s default sorting breaks subqueries</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-815</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It works except subqueries. Main table&apos;s order is added to subquery and vice versa. SQL query looks like this:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
SELECT t.id AS t_&lt;em&gt;id FROM ticket&lt;/em&gt;_d_c9999_&lt;em&gt;record t WHERE (t.id = (SELECT MAX(t2.id) AS t2&lt;/em&gt;&lt;em&gt;0 FROM ticket&lt;/em&gt;_d_c9999__record t2 ORDER BY t.id ASC, t2.id ASC)) ORDER BY t.id ASC, t2.id ASC&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Query fails because there is &amp;gt;&amp;gt;no such column &quot;t.id&quot;&amp;lt;&amp;lt;.&lt;/p&gt;

&lt;p&gt;I include a testcase when it is all visible.&lt;/p&gt;

&lt;p&gt;BTW. there is nothing about that feature (and relation orderBy) in docs. It is only in UPGRADE file.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11752">DC-815</key>
            <summary>Model&apos;s default sorting breaks subqueries</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="extreme">Jacek J&#281;drzejewski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Aug 2010 07:31:23 +0000</created>
                <updated>Mon, 14 Mar 2011 18:01:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14064" author="extreme" created="Wed, 25 Aug 2010 07:26:04 +0000"  >&lt;p&gt;Anyone?&lt;/p&gt;</comment>
                    <comment id="15487" author="beverage" created="Thu, 10 Mar 2011 08:57:34 +0000"  >&lt;p&gt;Am having the same issue!&lt;/p&gt;

&lt;p&gt;Eventually found the orderBy option on both the model and on relationships and was over joyed as I&apos;d been trying to find a way of doing this, but it didn&apos;t work!!&lt;/p&gt;

&lt;p&gt;Found the patch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-651&lt;/a&gt; which solved the first problem I encountered but now I&apos;m getting this.&lt;/p&gt;</comment>
                    <comment id="15498" author="beverage" created="Mon, 14 Mar 2011 18:01:49 +0000"  >&lt;p&gt;Had a look at the code and tried only setting the orderBy if the current component is actually referenced in the from sql part of the query.&lt;/p&gt;

&lt;p&gt;Looking at what is selected from, &lt;tt&gt;$this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;from&amp;#39;&amp;#93;&lt;/span&gt;&lt;/tt&gt;, it appears that the main table (&lt;tt&gt;$map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getTableName()&lt;/tt&gt;) and &lt;tt&gt;$sqlAlias&lt;/tt&gt; is include with a zero index and joined tables are keyed by their &lt;tt&gt;$alias&lt;/tt&gt; (or at least the content of these variables within the loop).&lt;/p&gt;

&lt;p&gt;From this I believe I could detect if the current entry in the loop was from a table that was in the current &quot;FROM&quot; part of the query by looking for the table name and alias as an entry or the current alias as a key in the &quot;FROM&quot; array.&lt;/p&gt;

&lt;p&gt;Within my sub query the orderBy valeus would still get applied but only in the subquery and not in the main query where they were included before, out of scope.&lt;/p&gt;

&lt;p&gt;With patch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; title=&quot;[PATCH] Doctrine_Record::option(&amp;#39;orderBy&amp;#39;, ...) of join&amp;#39;s right side being applied to refTable in m2m relationship&quot;&gt;DC-651&lt;/a&gt; applied my code in Query.php at line 1315 noew looks as follows:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
                &lt;span class=&quot;code-comment&quot;&gt;// Note: Only include orderBy values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; tables we&apos;re actually selecting from (both the root table or
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// tables referenced from it)
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array(&lt;span class=&quot;code-quote&quot;&gt;&quot;{$map[&apos;table&apos;]-&amp;gt;getTableName()} {$sqlAlias}&quot;&lt;/span&gt;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) || array_key_exists($alias, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;])) {
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($map[&apos;relation&apos;])) {
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($map[&apos;ref&apos;])) {
                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($map[&apos;relation&apos;][&apos;orderBy&apos;] &amp;amp;&amp;amp; $orderBy == $map[&apos;relation&apos;][&apos;orderBy&apos;]) {
                                $orderBy = $map[&apos;relation&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            }
                        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                            $orderBy = $map[&apos;relation&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderBy == $map[&apos;relation&apos;][&apos;orderBy&apos;]) {
                                $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                            }
                        }
                    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                        $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                    }
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                        $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                }

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

&lt;p&gt;Am I correct in my assumptions?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10735" name="DC9999TestCase.php" size="997" author="extreme" created="Wed, 11 Aug 2010 07:31:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-930] Complex query with DISTINCT and LIMIT on pgsql causes a SQLSTATE exception - problem in doctrine_subquery_alias</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-930</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There is a problem in the following code in Doctrine/Query.php (lines 1257-1279) inside the buildSqlQuery() method:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            $subquery = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getLimitSubquery();

            &lt;span class=&quot;code-comment&quot;&gt;// what about composite keys?
&lt;/span&gt;            $idColumnName = $table-&amp;gt;getColumnName($table-&amp;gt;getIdentifier());

            &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; (strtolower($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;getDriverName())) {
                &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;mysql&apos;:
[...]
                &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;pgsql&apos;:
                    $subqueryAlias = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteIdentifier(&apos;doctrine_subquery_alias&apos;);

                    &lt;span class=&quot;code-comment&quot;&gt;// pgsql needs special nested LIMIT subquery
&lt;/span&gt;                    $subquery = &apos;SELECT &apos; . $subqueryAlias . &apos;.&apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;quoteIdentifier($idColumnName)
                            . &apos; FROM (&apos; . $subquery . &apos;) AS &apos; . $subqueryAlias;

                    &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
            }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above code is executed when a query consist of DISTINCT and LIMIT clauses. The most common situation is using pager. &lt;br/&gt;
The problem is in the subquery variable. The $idColumnName variable often has value &quot;id&quot;. In such a situation in case of  $subquery consist of some JOINs and some tables have column named &quot;id&quot;, we have:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; doctrine_subquery_alias.id &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; ((&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; DISTINCT d1.id, d2.id &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; ...)) AS doctrine_subquery_alias
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It, of course, causes the &quot;ambiguous column name&quot; pgsql exception.&lt;/p&gt;</description>
                <environment>pgsql</environment>
            <key id="12112">DC-930</key>
            <summary>Complex query with DISTINCT and LIMIT on pgsql causes a SQLSTATE exception - problem in doctrine_subquery_alias</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="j.debowczyk">Jacek D&#281;bowczyk</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Nov 2010 09:54:02 +0000</created>
                <updated>Tue, 16 Nov 2010 09:54:02 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-927] Query with left join and group clause returns only one row, even though there are multiple results</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-927</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;under certain circumstances, Doctrine will only return one result out of a bunch of results, for example:&lt;/p&gt;

&lt;p&gt;$ symfony doctrine:dql &quot;from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)&quot;&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;1&apos;&lt;/p&gt;

&lt;p&gt;Expected outcome:&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-16&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
  reserveringen: &apos;0&apos;&lt;/p&gt;

&lt;p&gt;The query works fine without the left join:&lt;br/&gt;
$ symfony doctrine:dql &quot;from Tafel t where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels group by date(t.tijd)&quot;&lt;br/&gt;
&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: from Tafel t  where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, group by date(t.tijd)&lt;br/&gt;
found 2 results&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-14&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;br/&gt;
-&lt;br/&gt;
  date: &apos;2010-11-16&apos;&lt;br/&gt;
  tafels: &apos;1&apos;&lt;/p&gt;</description>
                <environment>Windows 7-64 bit&lt;br/&gt;
Symfony 1.4.8</environment>
            <key id="12102">DC-927</key>
            <summary>Query with left join and group clause returns only one row, even though there are multiple results</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="dareaper">Bart van den Burg</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Nov 2010 07:55:55 +0000</created>
                <updated>Thu, 19 May 2011 07:50:36 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14734" author="dareaper" created="Sun, 14 Nov 2010 07:56:37 +0000"  >&lt;p&gt;As you can see, by the way, it does actually say &quot;found 2 results&quot;, but then returns only one.&lt;/p&gt;</comment>
                    <comment id="15239" author="geckow" created="Tue, 8 Feb 2011 07:08:14 +0000"  >&lt;p&gt;There are multiple reports from people that are hurt by this bug:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm&quot; class=&quot;external-link&quot;&gt;http://www.devcomments.com/doctrine-execute-only-returns-one-row-to286270.htm&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.devcomments.com/Problem-with-Doctrine-and-Join-GroupBy-query-at87536.htm&quot; class=&quot;external-link&quot;&gt;http://www.devcomments.com/Problem-with-Doctrine-and-Join-GroupBy-query-at87536.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting the Hydration-mode to HYDRATE_NONE yields multiple result rows (but is not useful). &lt;/p&gt;</comment>
                    <comment id="15337" author="victoruiz" created="Fri, 18 Feb 2011 13:49:55 +0000"  >&lt;p&gt;Related in some way with multiple order by clauses. If I remove all of them but one it works, the problem appears when I put more than one order by criteria.&lt;/p&gt;</comment>
                    <comment id="15865" author="mikeseth" created="Thu, 19 May 2011 07:50:36 +0000"  >&lt;p&gt;This is a hydration problem that occurs because the ID columns of the joined tables are not SELECT&apos;ed explicitly. The offending code is a loop in the graph base hydrator, but I don&apos;t understand it well enough to fix it with any certainty that I don&apos;t break anything. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-920] The ability to add sql in the query between the first word and body of the query (allowing &quot;SELECT STRAIGHT_JOIN&quot; etc)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-920</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I recently discovered that I could greatly optimize some of the queries that were being run through our system by adding a STRAIGHT_JOIN keyword to the front of the select&lt;/p&gt;

&lt;p&gt;I added a feature to doctrine which allows me to inject sql into the query in the right place to enable features such as &quot;STRAIGHT_JOIN&quot; but I can&apos;t post the patch because my patches are starting to run together &amp;#8211; the syntax with in the generated patch would also contain parts of other patches I have posted to jira but have not yet been included in the doctrine svn.&lt;/p&gt;

&lt;p&gt;I still wanted to make this post because it will give me a ticket number to base my test cases around.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP XAMP</environment>
            <key id="12082">DC-920</key>
            <summary>The ability to add sql in the query between the first word and body of the query (allowing &quot;SELECT STRAIGHT_JOIN&quot; etc)</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Nov 2010 02:30:49 +0000</created>
                <updated>Tue, 9 Nov 2010 22:25:55 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14698" author="willf1976" created="Tue, 9 Nov 2010 22:25:35 +0000"  >&lt;p&gt;In order to show what this patch fixes I am including my test case for the patch below:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;AS IS&quot;&lt;/span&gt; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * &amp;lt;http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org&amp;gt;.
&lt;/span&gt; */

/**
 * Doctrine_Ticket_DC920_TestCase
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
 * @author      Will Ferrer
 * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt; * @category    &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; Relational Mapping
 * @link        www.doctrine-project.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Ticket_DC920_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase 
{

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodySelect()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        
        $q-&amp;gt;parseDqlQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = &apos;123 123&apos;&quot;&lt;/span&gt;);
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT STRAIGHT_JOIN e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON (p.phonenumber = &apos;123 123&apos;) WHERE (e.type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT DISTINCT STRAIGHT_JOIN u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = &apos;123 123&apos;&quot;&lt;/span&gt;);
    }

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

        $q-&amp;gt;parseDqlQuery(&apos;DELETE IGNORE FROM User&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;DELETE IGNORE FROM entity WHERE (type = 0)&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;DELETE IGNORE FROM User&quot;&lt;/span&gt;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyDeleteNoneDQL() 
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;delete(&apos;IGNORE&apos;);
		$q-&amp;gt;from(&apos;User&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;DELETE IGNORE FROM entity WHERE (type = 0)&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;DELETE IGNORE FROM User&quot;&lt;/span&gt;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyUpdate() 
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();

        $q-&amp;gt;parseDqlQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE User u SET u.name = &apos;someone&apos;&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE entity SET name = &apos;someone&apos; WHERE (type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE User u SET u.name = &apos;someone&apos;&quot;&lt;/span&gt;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testBeforeBodyUpdateNonDql() 
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;update(&apos;IGNORE&apos;);
		$q-&amp;gt;from(&apos;User u&apos;);
		$q-&amp;gt;set(&apos;name&apos;, &lt;span class=&quot;code-quote&quot;&gt;&quot;&apos;someone&apos;&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE entity SET name = &apos;someone&apos; WHERE (type = 0)&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &lt;span class=&quot;code-quote&quot;&gt;&quot;UPDATE IGNORE User u SET name = &apos;someone&apos;&quot;&lt;/span&gt;);
    }

}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-916] fetchOne defect</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-916</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Query fetchOne method now retrieves and hydrates all collection, which can be time consumable. I suggest to add limit 1 in fetchOne method.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12065">DC-916</key>
            <summary>fetchOne defect</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="orlanster">Roman</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Nov 2010 04:32:05 +0000</created>
                <updated>Mon, 24 Jan 2011 11:27:24 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15155" author="gena01" created="Fri, 21 Jan 2011 17:35:47 +0000"  >&lt;p&gt;This is a defect. People assume there&apos;s an implied limit(1) in the query because of fetchOne(). Please fix this, this is pretty serious stuff.&lt;/p&gt;</comment>
                    <comment id="15156" author="gena01" created="Fri, 21 Jan 2011 19:57:54 +0000"  >&lt;p&gt;Doctrine_Table actually &quot;works around&quot; the issue but explicitly doing limit(1) before doing fetchOne():&lt;/p&gt;

&lt;p&gt;public function findOneBy($fieldName, $value, $hydrationMode = null)&lt;/p&gt;
    {
        return $this-&amp;gt;createQuery(&apos;dctrn_find&apos;)
            -&amp;gt;where($this-&amp;gt;buildFindByWhere($fieldName), (array) $value)
            -&amp;gt;limit(1)
            -&amp;gt;fetchOne(array(), $hydrationMode);
    }</comment>
                    <comment id="15171" author="jwage" created="Sun, 23 Jan 2011 14:17:13 +0000"  >&lt;p&gt;Was this always like this or did it change recently?&lt;/p&gt;</comment>
                    <comment id="15179" author="gena01" created="Mon, 24 Jan 2011 11:27:24 +0000"  >&lt;p&gt;Frankly I have no idea. &lt;/p&gt;

&lt;p&gt;Also adding a limit(1) shouldn&apos;t break anything and is straight forward. We would also want to fix findOneBy not to do limit(1) since fetchOne() should take care of this after the fix is in place.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;Will&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12053">DC-910</key>
            <summary>Sub queries do not work properly in the on clause of a join</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Nov 2010 18:54:39 +0000</created>
                <updated>Tue, 2 Nov 2010 00:06:00 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14658" author="willf1976" created="Tue, 2 Nov 2010 00:06:00 +0000"  >&lt;p&gt;took out some commented code chunks&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10841" name="DC_910_fix.patch" size="11377" author="willf1976" created="Tue, 2 Nov 2010 00:06:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-889] Using RANDOM() AS rand as last field WITHOUT a comma between them works, but not randomly</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-889</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The difference between the two code samples below is that there is a comma after &apos;lo.postal&apos;_code in the second example:&lt;/p&gt;

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

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

</description>
                <environment>ubuntu 64 bit, using a task in symfony</environment>
            <key id="12007">DC-889</key>
            <summary>Using RANDOM() AS rand as last field WITHOUT a comma between them works, but not randomly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Oct 2010 00:22:30 +0000</created>
                <updated>Thu, 14 Oct 2010 00:22:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-877] Hydrator fatal error: Found non-unique key mapping named &apos;lang&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-877</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;You could find the ticket&apos;s test case in the attachments.&lt;/p&gt;</description>
                <environment>PHP 5.2.13</environment>
            <key id="11967">DC-877</key>
            <summary>Hydrator fatal error: Found non-unique key mapping named &apos;lang&apos;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="fruit">Ilya Sabelnikov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 10:08:55 +0000</created>
                <updated>Fri, 22 Oct 2010 06:04:32 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10829" name="Ticket_DC877_TestCase.php" size="4859" author="fruit" created="Fri, 22 Oct 2010 06:04:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-874] Allow parameters to be passed to Doctrine_Query::select()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-874</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While I believe it&apos;s not so extraordinary to have parameters in a SELECT clause, Doctrine_Query::select() does not allow to pass parameters, next to the SELECT clause. You can still pass any parameters to execute(), but I do believe it would be nice to be able to pass the parameter values right away to select() as you can with where() etc.&lt;/p&gt;

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

&lt;p&gt;Doctrine_Query::create()&lt;del&gt;&amp;gt;select(&apos;f.*, (f.id = ?) AS selected&apos;))&lt;/del&gt;&amp;gt;from(&apos;Foo f&apos;)-&amp;gt;execute(array($selected_id));&lt;/p&gt;

&lt;p&gt;This principle would apply to any select-field that has a calculated value that comes from a parameter.&lt;/p&gt;</description>
                <environment>Any</environment>
            <key id="11964">DC-874</key>
            <summary>Allow parameters to be passed to Doctrine_Query::select()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="gerryvdm">Gerry Vandermaesen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 06:04:19 +0000</created>
                <updated>Thu, 23 Dec 2010 05:49:10 +0000</updated>
                                                                    <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14999" author="leszczu" created="Thu, 23 Dec 2010 05:49:10 +0000"  >&lt;p&gt;I believe this should be major improvement for Doctrine. Without this feature, some queries can&apos;t be created.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-876] Basic Request return one element.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-876</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;h4&gt;&lt;a name=&quot;itrytogetallpreferenceswithanIdUserspecified.&quot;&gt;&lt;/a&gt;i try to get all preferences with an IdUser specified.&lt;/h4&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;UserHasPreference:
  connection: hopscore
  actAs:
    I18n:
      fields: [value]
    Timestampable:
      created:
        name: created_at
        type: timestamp
        format: Y-m-d H:i:s
  columns:
    idUserHasPreference:
      name: idUserHasPreference as id
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    UsersIdUser:
      name: UsersIdUser as idUser
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    PreferencesIdPreference:
      name: PreferencesIdPreference as idPreference
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    MatchLinksMatchLinkId:
      name: MatchLinksMatchLinkId as MatchLinkId
      type: integer(4)
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    value:
      type: string(100)
  relations:
    Users:
      class: User
      local: idUser
      foreign: id
      type: one
    Preferences:
      class: Preference
      local: idPreference
      foreign: id
      type: one
    MatchLinks:
      class: MatchLink
      local: MatchLinkId
      foreign: id
      type: one
  options:
    collate: utf8_unicode_ci
    charset: utf8
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Doctrine Request&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$preferences = Doctrine_Query::create()
		-&amp;gt;select(&apos;uhp.idPreference as idPref&apos;)
		-&amp;gt;addSelect(&apos;uhpt.value as value&apos;)
		-&amp;gt;addSelect(&apos;uhp.MatchLinkId as idItem&apos;)
		-&amp;gt;from(&apos;UserHasPreference uhp&apos;)
		-&amp;gt;innerJoin(&apos;uhp.Translation uhpt&apos;)
		-&amp;gt;where(&apos;uhp.idUser = ?&apos;, intval($idUser))
		-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);
	    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $preferences;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With $preferences-&amp;gt;getSqlQuery(); and getParams(); and report this SQL query in phpmydadmin.&lt;br/&gt;
With SQL i have 13 elements. But in my object &lt;b&gt;$preference&lt;/b&gt; i have one element (Doctrine::HYDRATE_ARRAY)&lt;br/&gt;
With &quot;Doctrine::HYDRATE_NONE&quot;,  i have 13 elements as SQL query.&lt;/p&gt;</description>
                <environment>Windows XP Pro. Service Pack 3, Eclipe PDT, Doctrine 1.2.3,  Php 5.2.11</environment>
            <key id="11966">DC-876</key>
            <summary>Basic Request return one element.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="rudy.bruneau">rudybruneau</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 08:47:10 +0000</created>
                <updated>Tue, 5 Oct 2010 08:08:38 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14529" author="eirikhm" created="Tue, 5 Oct 2010 08:08:38 +0000"  >&lt;p&gt;I have the same problem, and I think this is related to the select statement. It seems that a select statement where all fields are aliased will cause this behavior. A simple work-around is to select one field without aliasing it. &lt;/p&gt;


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

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

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


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

&lt;p&gt;count($results) = 250&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10817" name="image.jpg" size="27934" author="rudy.bruneau" created="Thu, 30 Sep 2010 08:47:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-873] Update Execute Params do not persist </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-873</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have been trying to update numerous records with the one doctrine_query object (which could be my problem) and passing the query execute params to persist to the dbase. eg&lt;/p&gt;

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

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

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

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

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

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

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

&lt;p&gt;Any all help appreciated.&lt;br/&gt;
Thanks&lt;br/&gt;
Kyle&lt;/p&gt;</description>
                <environment>LAMP php5.2.6 Symfony 1.4 </environment>
            <key id="11957">DC-873</key>
            <summary>Update Execute Params do not persist </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="kylerclarke">Kyle Clarke</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Sep 2010 20:57:19 +0000</created>
                <updated>Sun, 26 Sep 2010 20:57:19 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1010] When putting a subquery in the where clause which includes a join and a limit the limit subquery algorithm mistakenly modifies the subquery</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1010</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have fixed this in my own version of doctrine but unfortunately I am to far diverged from the trunk to offer a patch.&lt;/p&gt;

&lt;p&gt;here is a test case:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testSubqueryInWhereWithJoinAndLimit()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;select(&apos;u.id&apos;);
        $q-&amp;gt;from(&apos;User u&apos;);
        $q-&amp;gt;where(&apos;u.id NOT IN (SELECT a.id FROM User u2 LEFT JOIN u2.Album a LIMIT 1)&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;SELECT e.id AS e__id FROM entity e WHERE (e.id NOT IN (SELECT a.id AS a__id FROM entity e2 LEFT JOIN album a ON e2.id = a.user_id WHERE (e2.type = 0) LIMIT 1) AND (e.type = 0))&apos;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To fix the issue I changed this line in Doctrine_Query as follows:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;limit&apos;]) || ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;offset&apos;])) &amp;amp;&amp;amp; $needsSubQuery &amp;amp;&amp;amp; $limitSubquery) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;limit&apos;]) || ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;offset&apos;])) &amp;amp;&amp;amp; $needsSubQuery &amp;amp;&amp;amp; $limitSubquery &amp;amp;&amp;amp; !$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;isSubquery()) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;p&gt;Sincerely&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key i