<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 09:34:53 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+AND+fixVersion+%3D+%221.2.2%22&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+fixVersion+%3D+%221.2.2%22</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="113" total="113"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<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-895] [I18n] Defining languages with locality (eg. en_GB) breaks functionality with SQL Integrity error - fix included</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-895</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When defining languages as language_COUNTRY codes (supported by symfony by default), the functionality to work with I18n records breaks, resulting in &quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1062 Duplicate entry&quot; errors.&lt;/p&gt;

&lt;p&gt;The reason is very simple: Doctrine&apos;s I18n language column is defined as a CHAR(2), thus shortening eg. &quot;en_GB&quot; value to &quot;en&quot;, thus causing the above SQL error when a &quot;en&quot; translation for a record already exists.&lt;/p&gt;

&lt;p&gt;The solution is even simpler: change the column&apos;s length to 7 in the Doctrine_I18n class&apos;s options: I&apos;ve tested this and all runs great: the correct SQL is being generated, the models behave correct, ...&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="12019">DC-895</key>
            <summary>[I18n] Defining languages with locality (eg. en_GB) breaks functionality with SQL Integrity error - fix included</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="4levels">Erik Van Kelst</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Oct 2010 04:21:59 +0000</created>
                <updated>Wed, 20 Oct 2010 04:42:40 +0000</updated>
                    <resolved>Wed, 20 Oct 2010 04:42:40 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.0</fixVersion>
                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.3</fixVersion>
                                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14583" author="4levels" created="Wed, 20 Oct 2010 04:42:40 +0000"  >&lt;p&gt;Length of the i18n column is configurable...&lt;/p&gt;</comment>
                </comments>
                    <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-799] Doctrine_Query::parseFunctionExpression() produces unexpected results if the expression contains a function</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-799</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When &lt;em&gt;Doctrine_Query::parseFunctionExpression()&lt;/em&gt; is called with the following parameter and &lt;em&gt;$this-&amp;gt;_conn-&amp;gt;expression&lt;/em&gt; is of type &lt;em&gt;Doctrine_Expression_MySql&lt;/em&gt;:&lt;/p&gt;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-764] Major-&gt;please.....Value of Primary key from sequence in Postgres table NOT being set (although sequence gets incremented)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-764</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In the ERD/schema that I have set up, a couple levels down in hierarchal order, a table has 3 composite foreign keys, and one sequence of its own. That sequence does not get get set into the &apos;Table-&amp;gt;sequence variable&apos;. That means when the file &apos;UnitOfWork&apos; executes the function &apos;_assignSequence()&apos;, it finds no sequence name, and skips the assignment of the sequence value. &lt;/p&gt;

&lt;p&gt;This of course blows up my inserts.&lt;/p&gt;

&lt;p&gt;I have included the following documentation:&lt;/p&gt;

&lt;p&gt;A/ An installation and further description README.tx file.&lt;br/&gt;
B/ SQL script to generate a anonymous version of my ERD - I.E. the table names and column names have been changed to protect the guilty (and proprietary)&lt;br/&gt;
C/ A fixture file to load some data.&lt;br/&gt;
D/ A *.png file showing a graphical view of the ERD.&lt;br/&gt;
E/ The generated schema.yml file from ./symfony doctrine:build-schema&lt;br/&gt;
F/ A modifiled (has certain echo statements for troubleshooting purposes) UnitOfWork.php file.&lt;br/&gt;
G/ A task file to run that tries to load the schema with valid values.&lt;br/&gt;
H/ An output file from running the Task and modified UnitOfWork.php file showing the exact point of error during insert.&lt;/p&gt;

&lt;p&gt;Please let me know what I can do to help get this troubleshot quicly. Thx&lt;br/&gt;
E/ &lt;/p&gt;</description>
                <environment>Ubuntu9.10 / PHP 5.2.6-3ubuntu4.5 with Suhosin-Patch 0.9.6.2 / Postgres-8.4 / Symfony 1.4.1 </environment>
            <key id="11550">DC-764</key>
            <summary>Major-&gt;please.....Value of Primary key from sequence in Postgres table NOT being set (although sequence gets incremented)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 20:51:13 +0000</created>
                <updated>Fri, 25 Jun 2010 18:00:37 +0000</updated>
                    <resolved>Fri, 25 Jun 2010 18:00:37 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.0</fixVersion>
                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                <fixVersion>1.2.3</fixVersion>
                                <component>Connection</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13414" author="gearond" created="Fri, 25 Jun 2010 13:27:20 +0000"  >&lt;p&gt;Don&apos;t know if it&apos;s related, but I ran:&lt;/p&gt;

&lt;p&gt;./symfony doctrine:build-sql&lt;/p&gt;

&lt;p&gt;on the database in this bug report, and none of the tables got sequences assigned to them, nor default values set coming from a sequence.&lt;/p&gt;

&lt;p&gt;This is Postgres.&lt;/p&gt;</comment>
                    <comment id="13415" author="gearond" created="Fri, 25 Jun 2010 13:54:31 +0000"  >&lt;p&gt;So much for getting around this problem easily, &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I tried doing this:&lt;/p&gt;

&lt;p&gt;$e_table=Doctrine::getTable(&apos;E&apos;);&lt;br/&gt;
$e_table-&amp;gt;setOption(&apos;sequenceName&apos;, &apos;e_id&apos;);&lt;br/&gt;
$e_options=$e_table-&amp;gt;getOptions();&lt;br/&gt;
var_dump($e_options);&lt;/p&gt;

&lt;p&gt;before inserting a record into the &apos;E&apos; table. The option value &apos;sequenceName&apos; is in the option array and returns correctly. However, when doing an insert immediatley after the above code, I get:&lt;/p&gt;

&lt;p&gt;   &apos;sequence name was Array&apos; (from my troubleshooting &apos;echo&apos; statements in the modified UnitOfWork.php file)&lt;/p&gt;

&lt;p&gt;and the following errors: (you have to be using my modified UOW.php file to get the same line number there.)&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php on line 917&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2222&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2223&lt;br/&gt;
PREVIOUS line was processingSingleInsert&lt;/p&gt;

&lt;p&gt;Warning: Invalid argument supplied for foreach() in /home/bugreport/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 1151&lt;/p&gt;

&lt;p&gt;So I am wondering, does the public function table-&amp;gt;setOption();   even work, correclty that is?&lt;/p&gt;
</comment>
                    <comment id="13416" author="gearond" created="Fri, 25 Jun 2010 14:06:09 +0000"  >&lt;p&gt;If I instead just retrieve the next val of the sequence manually, change &apos;id&apos; column manually, then it works. But It then fails on the insert into the &apos;J&apos; table.&lt;/p&gt;

&lt;p&gt;Apparently, Doctrine does not like composite primary foreign keys with a sequence also part of the foreign key. I wonder if my file would work on the Oracle version?&lt;/p&gt;</comment>
                    <comment id="13417" author="gearond" created="Fri, 25 Jun 2010 17:57:39 +0000"  >&lt;p&gt;Showing simpler version of ERD/Schema converting Primary Foreign Keys to Foreign keys. The then required unique index on the former Primary Foreign Keys has not yet been coded. Just create it on all the keys in tables E and J, that were listed as primary in the first version in the zip file&lt;/p&gt;</comment>
                    <comment id="13418" author="gearond" created="Fri, 25 Jun 2010 18:00:37 +0000"  >&lt;p&gt;See last comment, but the short answer is . . . at this date, 2010-06-25, even Doctrine 2.0-DBAL can&apos;t do what I&apos;m trying to get verson 1.2.1 to do.&lt;/p&gt;

&lt;p&gt;So I got around it by converting primary foreign keys to foreign keys and then putting a unique index on the formerly primary keys.&lt;/p&gt;

&lt;p&gt;However, the child of the table treated that way, E(parent), J(child), now only has one foreign key, for E. To get all the ancestors, I will have to do subselects and joins. Oh well.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="10679" name="bugreport.zip" size="52298" author="gearond" created="Thu, 24 Jun 2010 20:51:13 +0000" />
                    <attachment id="10681" name="bug_report_create_postgresql.sql" size="7103" author="gearond" created="Fri, 25 Jun 2010 17:57:39 +0000" />
                    <attachment id="10680" name="schema.yml" size="5469" author="gearond" created="Fri, 25 Jun 2010 17:57:39 +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-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-717] Default value for columns is generated wrong. THe default value becomes the result value in the schema files.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-717</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When generating models from db with doctrine 1.2.2, default with functions in database get evaluated and the value goes to the generated schema files thus cousing error on insert/update.&lt;/p&gt;

&lt;p&gt;Example: &lt;br/&gt;
Table:&lt;br/&gt;
CREATE TABLE Usuario (&lt;br/&gt;
    id SERIAL  NOT NULL,&lt;br/&gt;
    apelido CHARACTER VARYING(50)  NOT NULL,&lt;br/&gt;
    email CHARACTER VARYING(255)  NOT NULL,&lt;br/&gt;
    dtRegistro TIMESTAMP DEFAULT &apos;now()&apos;  NOT NULL,&lt;br/&gt;
    idUsuarioSituacao INTEGER,&lt;br/&gt;
    senha CHARACTER(32),&lt;br/&gt;
    CONSTRAINT PK_Usuario PRIMARY KEY (id),&lt;br/&gt;
    CONSTRAINT TUC_Usuario_1 UNIQUE (email)&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;Code to generate files:&lt;br/&gt;
		$dManager = Doctrine_Manager::getInstance();	&lt;br/&gt;
		$dManager-&amp;gt;setAttribute(Doctrine::ATTR_MODEL_LOADING,Doctrine::MODEL_LOADING_CONSERVATIVE);&lt;br/&gt;
		$dManager-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);&lt;/p&gt;

&lt;p&gt;		$dManager-&amp;gt;setAttribute(Doctrine::ATTR_PORTABILITY, Doctrine::PORTABILITY_NONE);&lt;br/&gt;
		$dManager-&amp;gt;setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_NONE);&lt;br/&gt;
		$dManager-&amp;gt;setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);&lt;br/&gt;
		$dManager-&amp;gt;setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);&lt;br/&gt;
		$dManager-&amp;gt;setAttribute(Doctrine::ATTR_QUERY_LIMIT, Doctrine::LIMIT_ROWS);&lt;/p&gt;

&lt;p&gt;Doctrine_Core::generateModelsFromDb(&apos;c:\temp&apos;, array(&apos;dbcon&apos;), array(&apos;generateTableClasses&apos; =&amp;gt; true, &apos;classPrefix&apos;  =&amp;gt;  &apos;D&apos;));&lt;/p&gt;

&lt;p&gt;Resulting file:&lt;br/&gt;
abstract class DBaseUsuario extends Doctrine_Record&lt;br/&gt;
{&lt;br/&gt;
    public function setTableDefinition()&lt;/p&gt;
    {
        $this-&amp;gt;setTableName(&apos;usuario&apos;);
        $this-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; false,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;primary&apos; =&amp;gt; true,
             &apos;sequence&apos; =&amp;gt; &apos;usuario_id&apos;,
             ));
        $this-&amp;gt;hasColumn(&apos;apelido&apos;, &apos;string&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;fixed&apos; =&amp;gt; false,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; true,
             &apos;primary&apos; =&amp;gt; false,
             ));
        $this-&amp;gt;hasColumn(&apos;email&apos;, &apos;string&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;fixed&apos; =&amp;gt; false,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; true,
             &apos;primary&apos; =&amp;gt; false,
             ));
        $this-&amp;gt;hasColumn(&apos;dtregistro&apos;, &apos;timestamp&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;timestamp&apos;,
             &apos;fixed&apos; =&amp;gt; false,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; true,
            &apos;default&apos; =&amp;gt; &apos;\&apos;2010-06-04 11:10:12.078\&apos;::timestamp without time zone&apos;,
             &apos;primary&apos; =&amp;gt; false,
             ));
        $this-&amp;gt;hasColumn(&apos;idusuariosituacao&apos;, &apos;integer&apos;, 4, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;length&apos; =&amp;gt; 4,
             &apos;fixed&apos; =&amp;gt; false,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; false,
             &apos;primary&apos; =&amp;gt; false,
             ));
        $this-&amp;gt;hasColumn(&apos;senha&apos;, &apos;string&apos;, null, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;fixed&apos; =&amp;gt; true,
             &apos;unsigned&apos; =&amp;gt; false,
             &apos;notnull&apos; =&amp;gt; false,
             &apos;primary&apos; =&amp;gt; false,
             ));
    }
&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;The function now() for default value gets replaced by &apos;default&apos; =&amp;gt; &apos;\&apos;2010-06-04 11:10:12.078\&apos;::timestamp without time zone&apos;,&lt;/p&gt;</description>
                <environment>Apache 2.2, PostgresSQL 8.4, Windows XP</environment>
            <key id="11448">DC-717</key>
            <summary>Default value for columns is generated wrong. THe default value becomes the result value in the schema files.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="uacaman">angelo ayres camargo</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Jun 2010 12:33:27 +0000</created>
                <updated>Sun, 6 Jun 2010 10:39:22 +0000</updated>
                    <resolved>Sun, 6 Jun 2010 10:39:22 +0000</resolved>
                            <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13119" author="uacaman" created="Sun, 6 Jun 2010 10:39:22 +0000"  >&lt;p&gt;as of now i dont know if this is a error from case modeling tool or doctrine, will close and do further testing.&lt;/p&gt;</comment>
                </comments>
                    <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-674] NULL Dates are translated to &apos;0000-00-00&apos; after upgrading to 1.2.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-674</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Once the upgrade was done from Doctrine 1.2.1 to 1.2.2 we discovered that date related issues started to appear.&lt;br/&gt;
With dates that are persisted in DB as NULL are translated to &quot;0000-00-00&quot; when retrieved from DB. This has occurred in multiple places and is quite worrying as there is a lot of dates in our project. This means that everywhere in our codebase where we check a datevalue in our Models is NULL we need also to check for the string literal &quot;0000-00-00&quot;.&lt;/p&gt;
</description>
                <environment>Zend Framework, Ubuntu 9.10, MySQL </environment>
            <key id="11343">DC-674</key>
            <summary>NULL Dates are translated to &apos;0000-00-00&apos; after upgrading to 1.2.2</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="villeit">Ville It&#228;maa</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 May 2010 07:59:54 +0000</created>
                <updated>Wed, 6 Oct 2010 06:29:40 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                <fixVersion>1.2.1</fixVersion>
                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12895" author="jwage" created="Mon, 10 May 2010 12:19:21 +0000"  >&lt;p&gt;Are you able to reproduce this in a test case?&lt;/p&gt;</comment>
                    <comment id="12909" author="villeit" created="Tue, 11 May 2010 04:54:06 +0000"  >&lt;p&gt;We reverted to Doctrine 1.2.1 after realising the bug to confirm it was Doctrine 1.2.2 that was the cause for the problem. And as a result the records with NULL dates in the DB became NULL in the Models.&lt;br/&gt;
But when using Doctrine 1.2.2, the NULL dates became &apos;0000-00-00&apos; in the Models.&lt;br/&gt;
I don&apos;t have any other way to reproduce this error.&lt;/p&gt;</comment>
                    <comment id="12912" author="jwage" created="Tue, 11 May 2010 08:06:09 +0000"  >&lt;p&gt;Were you able to identity which changeset it was? You can read about creating test cases here &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/unit-testing&lt;/a&gt;&lt;/p&gt;

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


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

        date_of_birth:
            type: date

BASE MODEL

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

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

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

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

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

BASE MODEL

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

&lt;p&gt;You may try adding these to your YAML and (base) models&lt;/p&gt;

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

    fieldname:
         . . .
        notnull: false
        default: null

BASE MODEL

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-605] importSchema uses the connection name to identify the schema name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-605</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;importSchema in Doctrine_Import(l:369) iterates over the connections to check if it matches the passed $databases, however, giving the connection a name anything different than the databasename causes the entire function to malfunction..&lt;/p&gt;

&lt;p&gt;So a workaround is to pass connection names as a second argument to `generateModelsFromDb` instead of the database names.&lt;/p&gt;

&lt;p&gt;Also, if you wouldnt give a name to a connection, as you would possible do with cache connections since the argument isnt mandatory, then the equation is skipped entirely causing it to run on the cache connection..&lt;/p&gt;</description>
                <environment>mysql5 unix</environment>
            <key id="11145">DC-605</key>
            <summary>importSchema uses the connection name to identify the schema name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pbijl">pbijl</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Mar 2010 09:52:05 +0000</created>
                <updated>Mon, 29 Mar 2010 14:36:24 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:36:24 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12498" author="jwage" created="Mon, 29 Mar 2010 14:33:37 +0000"  >&lt;p&gt;Hi, the variable in the code is just not named very well. It is supposed to be connection names and not database names. I will rename the variable in the code.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-602] Cardinality violation when searching phrase</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-602</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Im have setup search behaviour for my model.&lt;/p&gt;

&lt;p&gt;Searching phrase &quot;foo bar&quot; throws &quot;Doctrine_Connection_Mysql_Exception&quot;&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;21000&amp;#93;&lt;/span&gt;: Cardinality violation: 1242 Subquery returns more than 1 row&lt;/p&gt;

&lt;p&gt;To fix the issue replace line 208 in file: Doctrine/Search/Query.php &lt;/p&gt;

&lt;p&gt;$where .= &apos; AND (position + &apos; . $k . &apos;) = (SELECT position FROM &apos; . $this-&amp;gt;_table-&amp;gt;getTableName() . &apos; WHERE &apos; . $this-&amp;gt;parseWord($word) . &apos;)&apos;;&lt;/p&gt;

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

&lt;p&gt;$where .= &apos; AND (position + &apos; . $k . &apos;) IN (SELECT position FROM &apos; . $this-&amp;gt;_table-&amp;gt;getTableName() . &apos; WHERE &apos; . $this-&amp;gt;parseWord($word) . &apos;)&apos;;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11141">DC-602</key>
            <summary>Cardinality violation when searching phrase</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mishal">Mishal</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Mar 2010 12:57:23 +0000</created>
                <updated>Mon, 29 Mar 2010 14:42:41 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:42:41 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-596] make it possible to pass in builderOptions for templates</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-596</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://trac.symfony-project.org/ticket/8421&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8421&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It seems like it just requires to pass in a builderOption array into any class extending Doctrine_Record_Generator. I think it would be a good idea to start adding support for this into all internal behaviors.&lt;/p&gt;

&lt;p&gt;and then doing something like the following in the schema:&lt;/p&gt;

&lt;p&gt;Foo:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Taggable:&lt;br/&gt;
      builderOptions:&lt;br/&gt;
        baseClassName: MyBaseRecord&lt;/p&gt;</description>
                <environment></environment>
            <key id="11114">DC-596</key>
            <summary>make it possible to pass in builderOptions for templates</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Mar 2010 11:12:21 +0000</created>
                <updated>Mon, 29 Mar 2010 14:00:24 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:00:24 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12449" author="jwage" created="Wed, 24 Mar 2010 10:16:56 +0000"  >&lt;p&gt;You can go ahead and commit this. It looks good to me! Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12450" author="lsmith" created="Wed, 24 Mar 2010 10:59:45 +0000"  >&lt;p&gt;ok .. i will apply the patch to the Taggable behavior. Not sure when I will find time to do the same for the core behaviors, a helping hand would be appreciated.&lt;/p&gt;</comment>
                    <comment id="12492" author="jwage" created="Mon, 29 Mar 2010 14:00:24 +0000"  >&lt;p&gt;We can add it to the other behaviors as needed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10513" name="Tag.php.patch" size="659" author="lsmith" created="Tue, 23 Mar 2010 11:12:21 +0000" />
                    <attachment id="10514" name="Taggable.php.patch" size="1139" author="lsmith" created="Tue, 23 Mar 2010 11:12:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-592] PHP Fatal error:  Call to undefined method Doctrine_Connection_Oracle::getDeclaration() in  ....\Doctrine\Export\Oracle.php on line 501</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-592</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I try to execute a migration of my DB with doctrine CLI migrate, i get this error.&lt;br/&gt;
I fixed it changing the following  in Export/Oracle.php&lt;br/&gt;
#501 :  $fields[] = $this-&amp;gt;conn-&amp;gt;getDeclaration($fieldName, $field);    =&amp;gt; $fields[] = $this-&amp;gt;getDeclaration($fieldName, $field);&lt;/p&gt;

&lt;p&gt;#509 :  $fields[] = $fieldName. &apos; &apos; . $this-&amp;gt;conn-&amp;gt;getDeclaration(&apos;&apos;, $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;);   =&amp;gt;  $fields[] = $fieldName. &apos; &apos; . $this-&amp;gt;getDeclaration(&apos;&apos;, $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="11106">DC-592</key>
            <summary>PHP Fatal error:  Call to undefined method Doctrine_Connection_Oracle::getDeclaration() in  ....\Doctrine\Export\Oracle.php on line 501</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="zebulon303">zebulon303</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Mar 2010 09:01:51 +0000</created>
                <updated>Mon, 29 Mar 2010 14:48:50 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:48:50 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-579] Doctrine_Record-&gt;_get() with $load === false generates E_NOTICE (patch)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-579</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Record.php, _get() method called with $load parameter setted to false can generate an E_NOTICE.&lt;br/&gt;
Attached patch fix this.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11074">DC-579</key>
            <summary>Doctrine_Record-&gt;_get() with $load === false generates E_NOTICE (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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="colin.darie">Colin Darie</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Mar 2010 13:00:27 +0000</created>
                <updated>Mon, 29 Mar 2010 14:24:55 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:24:55 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12495" author="jwage" created="Mon, 29 Mar 2010 14:24:55 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10488" name="Record.php.patch" size="885" author="colin.darie" created="Wed, 17 Mar 2010 13:00:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-577] Sluggable can not index slug if using a provider</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-577</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Sluggable template does not add an index for the slug if the fields option is empty.&lt;/p&gt;

&lt;p&gt;The provider option will not be used if the fields option is not empty.&lt;/p&gt;

&lt;p&gt;The Sluggable template does not use the fields option in creating the index for the slug, so removing the requirement for a non-empty fields option seems to be an appropriate fix.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11064">DC-577</key>
            <summary>Sluggable can not index slug if using a provider</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dward">David Ward</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Mar 2010 11:09:14 +0000</created>
                <updated>Tue, 16 Mar 2010 15:18:31 +0000</updated>
                    <resolved>Tue, 16 Mar 2010 15:18:31 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Sluggable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10480" name="Sluggable.patch" size="966" author="dward" created="Tue, 16 Mar 2010 11:09:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-574] Add support for __toString() in the generator</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-574</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I noticed that the TaggableTag class does not contain a __toString() method. Looking further I found that the generator does not support this atm, but it was easy to add.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11058">DC-574</key>
            <summary>Add support for __toString() in the generator</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Mar 2010 13:46:40 +0000</created>
                <updated>Mon, 15 Mar 2010 14:20:57 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:20:57 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10472" name="Builder.php.patch" size="1222" author="lsmith" created="Mon, 15 Mar 2010 13:46:40 +0000" />
                    <attachment id="10471" name="Generator.php.patch" size="807" author="lsmith" created="Mon, 15 Mar 2010 13:46:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

<item>
            <title>[DC-570] Make table classes suffix configurable (with patch)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-570</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I follow Zend Framework (PEAR) class naming conventions, and my user table class should be named &lt;tt&gt;User_Table&lt;/tt&gt; instead of &lt;tt&gt;UserTable&lt;/tt&gt; and be placed in &lt;tt&gt;User/Table.php&lt;/tt&gt; instead of &lt;tt&gt;UserTable.php&lt;/tt&gt;. Since &lt;tt&gt;Table&lt;/tt&gt; suffix is hardcoded, it&apos;s not possible to do that.&lt;/p&gt;

&lt;p&gt;I added &lt;tt&gt;ATTR_TABLE_CLASS_SUFFIX&lt;/tt&gt; attribute and set it to &lt;tt&gt;Table&lt;/tt&gt; by default, so that existing code is not affected. Now, if I want, I can change that prefix to &lt;tt&gt;_Table&lt;/tt&gt; and be happy. The patch is attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11051">DC-570</key>
            <summary>Make table classes suffix configurable (with 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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="elnur">Elnur Abdurrakhimov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Mar 2010 17:36:08 +0000</created>
                <updated>Mon, 15 Mar 2010 11:16:31 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:23:56 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Attributes</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12181" author="jwage" created="Mon, 15 Mar 2010 10:23:47 +0000"  >&lt;p&gt;I like the idea, but the patch is not quite right. We should not use an attribute for this, it should just be an option in the builder. I committed a fix for this and should solve your problem.&lt;/p&gt;</comment>
                    <comment id="12187" author="jwage" created="Mon, 15 Mar 2010 11:16:31 +0000"  >&lt;p&gt;Just a note, my previous comment is wrong. We do need this to be an attribute so that the Connection.php can load the tables too with the right format.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10456" name="patch-doctrine-table-class-suffix.diff" size="3883" author="elnur" created="Sat, 13 Mar 2010 17:36:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-569] Duplicate unique indexes on PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-569</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Generated by doctrine-cli SQL is:&lt;/p&gt;

&lt;p&gt;&amp;#8211; this is ok&lt;br/&gt;
CREATE TABLE &quot;image&quot; (&quot;id&quot; BIGSERIAL, &quot;alt&quot; VARCHAR(255), &quot;title&quot; VARCHAR(500), &quot;filename&quot; VARCHAR(255), &quot;width&quot; BIGINT, &quot;height&quot; BIGINT, &quot;slug&quot; VARCHAR(255), &quot;createdat&quot; TIMESTAMP NOT NULL, &quot;updatedat&quot; TIMESTAMP NOT NULL, PRIMARY KEY(&quot;id&quot;));&lt;br/&gt;
CREATE TABLE &quot;news&quot; (&quot;id&quot; BIGSERIAL, &quot;title&quot; VARCHAR(255), &quot;leadmarkup&quot; VARCHAR(500), &quot;leadhtml&quot; VARCHAR(600), &quot;bodymarkup&quot; TEXT, &quot;bodyhtml&quot; TEXT, &quot;slug&quot; VARCHAR(255), &quot;createdat&quot; TIMESTAMP NOT NULL, &quot;updatedat&quot; TIMESTAMP NOT NULL, PRIMARY KEY(&quot;id&quot;));&lt;br/&gt;
CREATE TABLE &quot;snippet&quot; (&quot;id&quot; BIGSERIAL, &quot;name&quot; VARCHAR(255), &quot;bodymarkup&quot; TEXT, &quot;bodyhtml&quot; TEXT, &quot;slug&quot; VARCHAR(255), &quot;createdat&quot; TIMESTAMP NOT NULL, &quot;updatedat&quot; TIMESTAMP NOT NULL, PRIMARY KEY(&quot;id&quot;));&lt;br/&gt;
&amp;#8211; this causes error&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable&quot; ON &quot;image&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable&quot; ON &quot;news&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable&quot; ON &quot;snippet&quot; (&quot;slug&quot;);&lt;/p&gt;

&lt;p&gt;After importing this to PostgreSQL, I get &apos;index already exists&apos; error.&lt;/p&gt;

&lt;p&gt;On PostgreSQL unique indexes names must not be the same.&lt;br/&gt;
I think the correct form should be:&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable-image&quot; ON &quot;image&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable-news&quot; ON &quot;news&quot; (&quot;slug&quot;);&lt;br/&gt;
CREATE UNIQUE INDEX &quot;sluggable-snippet&quot; ON &quot;snippet&quot; (&quot;slug&quot;);&lt;/p&gt;

&lt;p&gt;Schema file attached.&lt;/p&gt;</description>
                <environment>Window, Ubuntu, PostgreSQL 8.3, PHP 5.3</environment>
            <key id="11049">DC-569</key>
            <summary>Duplicate unique indexes on PostgreSQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="admirau">admirau</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Mar 2010 10:37:19 +0000</created>
                <updated>Mon, 15 Mar 2010 15:32:01 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:32:01 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Cli</component>
                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12223" author="jwage" created="Mon, 15 Mar 2010 15:32:01 +0000"  >&lt;p&gt;This was fixed here &lt;a href=&quot;http://trac.doctrine-project.org/changeset/7372&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/changeset/7372&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10454" name="schema.yml" size="837" author="admirau" created="Sat, 13 Mar 2010 10:37:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-568] Make it possible to use microtime as the version value when using Versionable</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-568</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This patch basically makes it possible to pass in a custom auditlog listener as well as providing a new listener that uses microtime to generate the version value&apos;s instead of incrementing an integer value starting at 1. This should provide a much better handling for concurrent inserts and should also be faster, since for all but the first version a complex select is necessary in the current implementation.&lt;/p&gt;

&lt;p&gt;Open question is if the accuracy multiplier should be an option or not. Also is there any reason why the column definition doesnt default to an unsigned, not that it matters all that much?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11047">DC-568</key>
            <summary>Make it possible to use microtime as the version value when using Versionable</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Mar 2010 06:55:28 +0000</created>
                <updated>Mon, 15 Mar 2010 10:47:56 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:47:56 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12184" author="jwage" created="Mon, 15 Mar 2010 10:47:56 +0000"  >&lt;p&gt;Thanks to Lukas this is fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10451" name="Listener.php.patch" size="946" author="lsmith" created="Sat, 13 Mar 2010 06:55:28 +0000" />
                    <attachment id="10453" name="Microtime.php" size="2075" author="lsmith" created="Sat, 13 Mar 2010 06:55:28 +0000" />
                    <attachment id="10452" name="Versionable.php.patch" size="1081" author="lsmith" created="Sat, 13 Mar 2010 06:55:28 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-567] RawSql: getCountSqlQuery does not work correctly with PostgreSQL (patch provided)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-567</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Dears,&lt;/p&gt;

&lt;p&gt;Line 309 in Doctrine_RawSql:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $q = &apos;SELECT COUNT( DISTINCT &apos;.implode(&apos;,&apos;,$fields).&apos;) as num_results&apos;;

        $string = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getInheritanceCondition($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRootAlias());
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($string)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;][] = $string;
        }

        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]))?    &apos; FROM &apos;     . implode(&apos; &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]))?   &apos; WHERE &apos;    . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]))? &apos; GROUP BY &apos; . implode(&apos;, &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]))?  &apos; HAVING &apos;   . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]) : &apos;&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;produces with PostgreSQL: Undefined function: 7 ERROR: function count(bigint, integer) does not exist&lt;/p&gt;

&lt;p&gt;but&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $q = &apos;SELECT COUNT(*) as num_results FROM (SELECT DISTINCT &apos;.implode(&apos;, &apos;,$fields);

        $string = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getInheritanceCondition($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRootAlias());
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! empty($string)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;][] = $string;
        }

        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]))?    &apos; FROM &apos;     . implode(&apos; &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]))?   &apos; WHERE &apos;    . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;where&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]))? &apos; GROUP BY &apos; . implode(&apos;, &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;groupby&apos;]) : &apos;&apos;;
        $q .= ( ! empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]))?  &apos; HAVING &apos;   . implode(&apos; AND &apos;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;having&apos;]) : &apos;&apos;;

        $q .= &apos;) as results&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;works and should work with every database server.&lt;/p&gt;

&lt;p&gt;Continue your great work &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

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

&lt;p&gt;Rapha&#235;l Dehousse&lt;/p&gt;</description>
                <environment></environment>
            <key id="11046">DC-567</key>
            <summary>RawSql: getCountSqlQuery does not work correctly with PostgreSQL (patch provided)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rdehouss">Rapha&#235;l Dehousse</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Mar 2010 15:58:29 +0000</created>
                <updated>Mon, 15 Mar 2010 10:33:14 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:33:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12182" author="jwage" created="Mon, 15 Mar 2010 10:25:24 +0000"  >&lt;p&gt;Hi, it would be really helpful if all suggested changes are supplied as a patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

<item>
            <title>[DC-564] Postgresql: listSequences: relname badly &quot;formatted&quot; (patch provided)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-564</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Dears,&lt;/p&gt;

&lt;p&gt;Let&apos;s say you create your database first. If you have a serial/bigserial, a sequence is automaticaly created. It&apos;s called for example: &apos;id_seq&apos;&lt;br/&gt;
During the cretion of the model, the sequence name is, so, called id_seq.&lt;/p&gt;

&lt;p&gt;But in Doctrine_Formatter, line 233, you have getSequenceName that format Doctrine_Core::ATTR_SEQNAME_FORMAT that comes from Doctrine_Manager line 143, you have Doctrine_Core::ATTR_SEQNAME_FORMAT =&amp;gt; &quot;%s_seq&quot;, so, the sequence name will wrongly be id_seq_seq.&lt;/p&gt;

&lt;p&gt;This could be avoid if the sequence_name would not contain the &quot;_seq&quot; suffix coming from the import. WDYT?&lt;/p&gt;

&lt;p&gt;This could be possible thanks to a change in Doctrine_Import_Pgsql, line 50:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&apos;listSequences&apos; =&amp;gt; &quot;SELECT
        rtrim(relname, &apos;_seq&apos;)
    FROM
        pg_class
    WHERE relkind = &apos;S&apos; AND relnamespace IN
        (SELECT oid FROM pg_namespace
        WHERE nspname NOT LIKE &apos;pg_%&apos; AND nspname != &apos;information_schema&apos;)&quot;,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So, rtrim(relname, &apos;_seq&apos;) in place of relname only.&lt;br/&gt;
I&apos;m not sure rtrim is the best solution but you got what I meant.&lt;/p&gt;

&lt;p&gt;Voil&#224; my 2 cents.&lt;/p&gt;

&lt;p&gt;Hope it will help&lt;/p&gt;

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

&lt;p&gt;Rapha&#235;l Dehousse&lt;/p&gt;</description>
                <environment></environment>
            <key id="11035">DC-564</key>
            <summary>Postgresql: listSequences: relname badly &quot;formatted&quot; (patch provided)</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rdehouss">Rapha&#235;l Dehousse</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Mar 2010 16:41:51 +0000</created>
                <updated>Mon, 15 Mar 2010 15:13:01 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:13:01 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12217" author="rdehouss" created="Mon, 15 Mar 2010 14:44:21 +0000"  >&lt;p&gt;Here is a patch to apply in the doctrine lib directory&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10475" name="DC-564_Doctrine_Import_Pgsql.php.patch" size="894" author="rdehouss" created="Mon, 15 Mar 2010 14:44:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-563] Import/Pgsql: listTableRelations: bad use of strpos search composite foreign keys (patch provided)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-563</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Dears,&lt;/p&gt;

&lt;p&gt;First, I would like to thank you for your great work.&lt;/p&gt;

&lt;p&gt;Second, the bug:&lt;/p&gt;

&lt;p&gt;Line ~279 in the function listTableRelations, there is a mistake in the use of strpos : strpos(&apos;,&apos;, $values&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;) and strpos(&apos;,&apos;, $values&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;), it should be strpos($values&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, &apos;,&apos;) and strpos($values&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;, &apos;,&apos;) &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;With this code, strpos always returns false and so, the composite foreign keys are not skipped as desired.&lt;/p&gt;

&lt;p&gt;Continue your great job&lt;/p&gt;

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

&lt;p&gt;Rapha&#235;l Dehousse&lt;/p&gt;</description>
                <environment></environment>
            <key id="11029">DC-563</key>
            <summary>Import/Pgsql: listTableRelations: bad use of strpos search composite foreign keys (patch provided)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rdehouss">Rapha&#235;l Dehousse</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Mar 2010 09:05:11 +0000</created>
                <updated>Mon, 15 Mar 2010 14:36:59 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:36:59 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12189" author="rdehouss" created="Mon, 15 Mar 2010 11:22:09 +0000"  >&lt;p&gt;The fix you did does not fix the problem&lt;/p&gt;

&lt;p&gt;The problem is the order of the parameter in strpos&lt;/p&gt;

&lt;p&gt;I will create a patch this avond and attach it here&lt;/p&gt;</comment>
                    <comment id="12191" author="jwage" created="Mon, 15 Mar 2010 11:24:11 +0000"  >&lt;p&gt;I see, that is why patches are always preferred. it is impossible to copy and paste changes out of a comment &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Patches should always be attached!&lt;/p&gt;</comment>
                    <comment id="12213" author="rdehouss" created="Mon, 15 Mar 2010 14:31:42 +0000"  >&lt;p&gt;Here is a patch.&lt;/p&gt;

&lt;p&gt;You can apply it on the last revision of the branch 1.2&lt;/p&gt;

&lt;p&gt;The patch is to apply on the file Doctrine/Import/Pgsql.php&lt;/p&gt;</comment>
                    <comment id="12214" author="rdehouss" created="Mon, 15 Mar 2010 14:32:06 +0000"  >&lt;p&gt;Here is the patch as promised &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="12216" author="jwage" created="Mon, 15 Mar 2010 14:36:59 +0000"  >&lt;p&gt;Thanks for the patch &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10474" name="DC-563_Doctrine_Import_Pgsql.php.patch" size="827" author="rdehouss" created="Mon, 15 Mar 2010 14:31:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

<item>
            <title>[DC-559] Doctrine_Core::loadModels() caching</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-559</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Add ability to cache result of Doctrine_Core::loadModels().  &lt;br/&gt;
My &quot;models&quot; folder contains more than 20 record classes plus more than 20 base classes. I added result caching for conservative model loading and it&apos;s reduced application bootstrap time more than 100ms. &lt;br/&gt;
Here code that I added to Doctrine_Core::loadModels()&lt;br/&gt;
Cache hit check at the beginning of the 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;                $models = zend_shm_cache_fetch(&apos;doctrine::models_conservative&apos;);
                $modelPatch = zend_shm_cache_fetch(&apos;doctrine::models_conservative_paths&apos;);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $models &amp;amp;&amp;amp; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; !== $modelPatch){
                    self::$_loadedModelFiles = $modelPatch;
                    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $models;
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Result caching before return 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;           asort($loadedModels);
            zend_shm_cache_store(&apos;doctrine::models_conservative&apos;,$loadedModels);
            zend_shm_cache_store(&apos;doctrine::models_conservative_paths&apos;,self::$_loadedModelFiles);
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $loadedModels;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Of course zend_shm_cache_* is not proposed as caching solution.&lt;br/&gt;
I didn&apos;t use agressive model loading, but I think that caching for aggresive modlel loading can be done with compilation of all models to one file&lt;/p&gt;</description>
                <environment></environment>
            <key id="11014">DC-559</key>
            <summary>Doctrine_Core::loadModels() caching</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="murzik">Lozovoy Max</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2010 17:12:24 +0000</created>
                <updated>Mon, 15 Mar 2010 15:15:43 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:15:43 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12220" author="jwage" created="Mon, 15 Mar 2010 15:15:30 +0000"  >&lt;p&gt;The changes are not valid and you can do the same thing outside of Doctrine in your bootstrap. We don&apos;t need to patch Doctrine in order for you to do this.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-557] Primary Key Error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-557</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;All keys are being set as primary key, wich is useless once we have a serial.&lt;/p&gt;

&lt;p&gt;Fix: Doctrine/I18n.php &lt;br/&gt;
#098:  $defaultOptions = array( &lt;br/&gt;
#099:    &apos;fixed&apos; =&amp;gt; true, &lt;br/&gt;
#100:    &apos;primary&apos; =&amp;gt; false &lt;br/&gt;
#101:  )&lt;/p&gt;</description>
                <environment></environment>
            <key id="11012">DC-557</key>
            <summary>Primary Key Error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="4">Incomplete</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sid.gbf">Sid GBF</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2010 14:42:03 +0000</created>
                <updated>Mon, 15 Mar 2010 15:17:28 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:17:28 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>I18n</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12221" author="jwage" created="Mon, 15 Mar 2010 15:17:28 +0000"  >&lt;p&gt;These changes are not valid and they break the test case. Not enough information is present for this to be valid or a complete ticket. Please re-open if you have more information or a proper patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-556] Index name error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-556</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;At this moment, if you have more than one table that is sluggable, it get an error cause tries to set the very same name to ALL sluggable indexes. Here is a fix:&lt;/p&gt;

&lt;p&gt;#55: &apos;indexName&apos;     =&amp;gt;  null &lt;/p&gt;

&lt;p&gt;#74: if($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;indexName&amp;#39;&amp;#93;&lt;/span&gt; === null) &lt;br/&gt;
#75:   $this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;indexName&amp;#39;&amp;#93;&lt;/span&gt; = $this-&amp;gt;getTable()- &amp;gt;getTableName().&apos;_sluggable&apos;; &lt;/p&gt;</description>
                <environment></environment>
            <key id="11011">DC-556</key>
            <summary>Index name error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sid.gbf">Sid GBF</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2010 14:40:40 +0000</created>
                <updated>Mon, 15 Mar 2010 15:29:45 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 15:29:45 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Sluggable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12180" author="sid.gbf" created="Mon, 15 Mar 2010 10:11:08 +0000"  >&lt;p&gt;Fixing some typos&lt;/p&gt;</comment>
                    <comment id="12222" author="jwage" created="Mon, 15 Mar 2010 15:29:45 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10468" name="sluggable.diff" size="978" author="sid.gbf" created="Mon, 15 Mar 2010 10:11:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-555] infinite recursion happens when saving models with circular reference</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-555</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After upgrading symfony from 1.2 to 1.4, my website began to have problems saving some models.  After some research, I found that it was caused by infinite recursion. Let&apos;s say Model A has many B (B belongs to A). Each A also points to one of the B objects it owns. So it&apos;s a circular reference. Some ppl might argue that it&apos;s not a good pratice to have circular reference in the data model, I agree. But it worked fine in Doctrine 1.0, so I prefer not to change it.  In Doctrine 1.2.1, it seems that when A and its related B are both modified (dirty), if I try to save A, Doctrine will try to save B due to cascade update, and when saving B, it will again try to save its related A ...&lt;/p&gt;

&lt;p&gt;I compared the source code of Doctrine_Connection_UnitOfWork between 1.0 and 1.2.1, and found out that in Doctrine 1.2.1, the model is no longer locked when saveRelatedLocalKeys is invoked. I don&apos;t understand this change. After I changed the line &quot;$this-&amp;gt;saveRelatedLocalKeys($record);&quot; to&lt;/p&gt;

&lt;p&gt;$record-&amp;gt;state($record-&amp;gt;exists() ? Doctrine_Record::STATE_LOCKED : Doctrine_Record::STATE_TLOCKED);&lt;br/&gt;
$this-&amp;gt;saveRelatedLocalKeys($record);&lt;br/&gt;
$record-&amp;gt;state($state);&lt;/p&gt;

&lt;p&gt;my website returned to normal again. And so far i haven&apos;t found any problem caused by my change&lt;/p&gt;

&lt;p&gt;So I hope someone can look into this and let me know if my change is safe. Or if I&apos;m wrong, is there any way I can get around the infinite recursion problem without changing my database schema? Thanks.&lt;/p&gt;</description>
                <environment>linux, symfony 1.4</environment>
            <key id="11010">DC-555</key>
            <summary>infinite recursion happens when saving models with circular reference</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jing">Jing Z</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2010 10:40:31 +0000</created>
                <updated>Mon, 15 Mar 2010 16:09:54 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 16:09:54 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12228" author="jwage" created="Mon, 15 Mar 2010 16:09:54 +0000"  >&lt;p&gt;Thanks for the issue and patch!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10435" name="UnitOfWork.php" size="34843" author="jing" created="Tue, 9 Mar 2010 10:40:31 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-550] Cannot update record from one large integer to another large integer (severe problem for 32bit systems, due to the low upper limit of the int data type)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-550</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;From what I understand, doctrine mostly stores integers as strings. To check whether an integer has been modified, the following code in Doctrine_Record is used:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    protected function _isValueModified($type, $old, $new)
    {
        if ($new instanceof Doctrine_Expression) {
            return true;
        }

        if ($type == &apos;boolean&apos; &amp;amp;&amp;amp; (is_bool($old) || is_numeric($old)) &amp;amp;&amp;amp; (is_bool($new) || is_numeric($new)) &amp;amp;&amp;amp; $old == $new) {
            return false;
        } else if (in_array($type, array(&apos;decimal&apos;, &apos;float&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($new)) {
            return $old * 100 != $new * 100;
        } else if (in_array($type, array(&apos;integer&apos;, &apos;int&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($new)) {
            return (int) $old !== (int) $new;  # &amp;lt;--- ********** THIS LINE CASTS STRING TO INT **********
        } else if ($type == &apos;timestamp&apos; || $type == &apos;date&apos;) {
            return strtotime($old) !== strtotime($new);
        } else {
            return $old !== $new;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On the line indicated above an integer, stored as a string, is cast to a PHP integer data type, and compared with the existing value of the field currently stored in the database.  For values that fall within the int type range, this works fine.  However, when changing a value falling above the range, which on 32bit systems is 2147483647, to another value falling above the range, these casts cause the code to evaluate both as 2147483647 and hence the field is not added to the _IsModified() array, and the value is not updated.&lt;/p&gt;

&lt;p&gt;Bearing in mind that validation to confirm whether these strings are in numeric format should already have occurred by this point in the process, is there any need to cast the strings at all?  Thus, is the following a possible solution?&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;            return $old !== $new;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This seems to work fine for me in my limited trials although, admittedly, there may be some consequences about which I am not aware.&lt;/p&gt;

&lt;p&gt;Note that this issue is not so evident on 64bit systems, where the upper limit is much higher.&lt;/p&gt;</description>
                <environment>Symfony 1.4 from &lt;a href=&quot;http://svn.symfony-project.com/branches/1.4,&quot;&gt;http://svn.symfony-project.com/branches/1.4,&lt;/a&gt; Windows XP Pro SP2, 32bit Processor, PHP 5.2.8, MySQL </environment>
            <key id="11003">DC-550</key>
            <summary>Cannot update record from one large integer to another large integer (severe problem for 32bit systems, due to the low upper limit of the int data type)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="hal">hal</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Mar 2010 07:18:03 +0000</created>
                <updated>Mon, 15 Mar 2010 14:14:20 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:14:20 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12061" author="hal" created="Tue, 9 Mar 2010 14:40:56 +0000"  >&lt;p&gt;Patch for described problem (untested)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10437" name="Record.php.patch" size="667" author="hal" created="Tue, 9 Mar 2010 14:40:56 +0000" />
                    <attachment id="10436" name="Record.php.patch" size="667" author="hal" created="Tue, 9 Mar 2010 14:39:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-549] Doctrine_DataDict_Oracle TYPO</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-549</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;grep -rn &apos;lenght&apos; Doctrine/*&lt;br/&gt;
Doctrine/DataDict/Oracle.php:197:  $lenght = 3;&lt;/p&gt;

&lt;p&gt;MEDIUMINT 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;} elseif ( ! is_null($length) &amp;amp;&amp;amp; (int)$length &amp;lt;= 3) { // TINYINT
    $length = 1;
} elseif ( ! is_null($length) &amp;amp;&amp;amp; (int)$length &amp;lt;= 5) { // SMALLINT
    $length = 2;
} elseif ( ! is_null($length) &amp;amp;&amp;amp; (int)$length &amp;lt;= 8) { // MEDIUMINT
    $lenght = 3;
} elseif ( ! is_null($length) &amp;amp;&amp;amp; (int)$length &amp;lt;= 10) { // INT
    $length = 4;
} elseif ( ! is_null($length) &amp;amp;&amp;amp; (int)$length &amp;lt;= 20) { //BIGINT
    $length = 8;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment></environment>
            <key id="11001">DC-549</key>
            <summary>Doctrine_DataDict_Oracle TYPO</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="maxim.olenik">Maxim Olenik</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Mar 2010 02:43:06 +0000</created>
                <updated>Mon, 15 Mar 2010 16:18:09 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 16:18:09 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12233" author="jwage" created="Mon, 15 Mar 2010 16:18:09 +0000"  >&lt;p&gt;Thanks for the issue and patch. For future reference, it is easier if you provide a patch produced by svn. Thanks again, Jon!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-546] [PATCH] Missing $this-&gt;_table in Doctrine_Search when Index table not generated on the fly, throws Doctrine_Search_Exception&apos; with message &apos;Invalid argument type. Expected instance of Doctrine_Table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-546</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;See &lt;a href=&quot;http://trac.doctrine-project.org/ticket/896&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/896&lt;/a&gt;. &lt;br/&gt;
Its closed as invalid, but 1.2.1 (stable) throws &apos;Doctrine_Search_Exception&apos; with message &apos;Invalid argument type. Expected instance of Doctrine_Table.&apos; if the searchable behavior&apos;s index table is not generated on-the-fly, because Doctrine_Search::buildTable() never gets invoked.&lt;/p&gt;

&lt;p&gt;It&apos;s possible to workaround it by deleting generated classes.&lt;/p&gt;

&lt;p&gt;Patch attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10995">DC-546</key>
            <summary>[PATCH] Missing $this-&gt;_table in Doctrine_Search when Index table not generated on the fly, throws Doctrine_Search_Exception&apos; with message &apos;Invalid argument type. Expected instance of Doctrine_Table</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dudu">dudu</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Mar 2010 11:52:10 +0000</created>
                <updated>Thu, 11 Mar 2010 10:48:14 +0000</updated>
                    <resolved>Thu, 11 Mar 2010 10:48:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Searchable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10428" name="doctrine_1.2.1_searchable_generated_class_serach_missing_table" size="1122" author="dudu" created="Thu, 4 Mar 2010 11:52:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-545] MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-545</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve two issues with saving records with SQL Server.&lt;/p&gt;

&lt;p&gt;Firstly, SQL Server does not allow NULL or DEFAULT values to be used against identity columns. When inserting a record without any modified fields, Doctrine_Record_UnitOfWork::processSingleInsert sets all fields to NULL - including the identity columns. This causes this error:&lt;/p&gt;

&lt;p&gt;&quot;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 339 &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;DEFAULT or NULL are not allowed as explicit identity values&quot;&lt;/p&gt;

&lt;p&gt;Ideally identity columns could be excluded but that would break tables that consist of those columns. Instead I&apos;ve patched Doctrine_Connnection_MSSQL to, in this &apos;blank insert&apos; circumstance only, insert default values and then update the inserted row with null values as necessary (the latter may be unnecessary but I wanted to preserve the original behaviour).&lt;/p&gt;

&lt;p&gt;Secondly, there exists a bug in (as I understand it) Microsoft&apos;s ODBC driver &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, that causes all bound parameters within a sub-select to be cast as strings before being interpreted by SQL Server. This results in the following error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;22018&amp;#93;&lt;/span&gt;: Invalid character value for cast specification: 206&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;http://bugs.php.net/36561&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/36561&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using SQL Server through ODBC all Doctrine queries that use sub-selects are failing, for example the query generated by a Doctrine_Table-&amp;gt;find()&lt;/p&gt;

&lt;p&gt;SELECT * FROM (SELECT TOP 1 * FROM (SELECT TOP 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__id&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;name&amp;#93;&lt;/span&gt; AS &lt;span class=&quot;error&quot;&gt;&amp;#91;m__name&amp;#93;&lt;/span&gt; FROM &lt;span class=&quot;error&quot;&gt;&amp;#91;model&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt; WHERE (&lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt;.&lt;span class=&quot;error&quot;&gt;&amp;#91;id&amp;#93;&lt;/span&gt; = ?)) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;inner_tbl&amp;#93;&lt;/span&gt;) AS &lt;span class=&quot;error&quot;&gt;&amp;#91;outer_tbl&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;To combat this I&apos;ve extended the Doctrine_Connection_Common execute() method in Doctrine_Connection_Mssql to replace bound parameters so they&apos;re inline instead. This has its drawbacks, like reduced protection against SQL injection, but since the alternative is the majority of my queries failing I don&apos;t see a better option.&lt;/p&gt;

&lt;p&gt;I realise this second issue isn&apos;t a Doctrine concern per se, but I thought I&apos;d bring it up since I imagine anyone using SQL server will be experiencing it.&lt;/p&gt;

&lt;p&gt;A patch against 1.2.1 is attached. This patch also incorporates the latest patch in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-289&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-289&lt;/a&gt;, which has now been committed to trunk; my additions are at the bottom of the file.&lt;/p&gt;</description>
                <environment>PHP 5.3.1&lt;br/&gt;
Windows XP&lt;br/&gt;
Microsoft SQL Server 2008</environment>
            <key id="10994">DC-545</key>
            <summary>MSSQL Server: Inserting blank records throws exception / Invalid casting of bound query parameters in sub-selects.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Mar 2010 09:08:19 +0000</created>
                <updated>Mon, 15 Mar 2010 10:46:14 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 10:46:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12042" author="craigmarvelley" created="Fri, 5 Mar 2010 11:58:55 +0000"  >&lt;p&gt;Updated original ticket as another issue I found is closely linked and involved refactoring of my original patch.&lt;/p&gt;</comment>
                    <comment id="12043" author="craigmarvelley" created="Fri, 5 Mar 2010 11:59:36 +0000"  >&lt;p&gt;Updated patch&lt;/p&gt;</comment>
                    <comment id="12081" author="jwage" created="Thu, 11 Mar 2010 10:50:47 +0000"  >&lt;p&gt;Hi, I tried applying your patch to Doctrine 1.2 latest SVN to give it a test and it did not apply cleanly. Please re-open if you can provide an updated patch.&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12086" author="craigmarvelley" created="Thu, 11 Mar 2010 12:08:06 +0000"  >&lt;p&gt;Updated patch that should apply cleanly.&lt;/p&gt;</comment>
                    <comment id="12087" author="craigmarvelley" created="Thu, 11 Mar 2010 12:09:03 +0000"  >&lt;p&gt;Hi, thanks for looking at this. I&apos;ve updated the patch against 1.2 HEAD, hopefully that&apos;ll apply for you.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10443" name="Doctrine_Connection_MSSQL.patch" size="3420" author="craigmarvelley" created="Thu, 11 Mar 2010 12:08:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-543] Doctrine_Inflector::unaccent does not replace the norwegian characters &#230;&#248;&#229;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-543</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Inflector::unaccent does not know about the norwegian accent characters &#230;&#248;&#229;&#198;&#216;&#197; so when sluggable is making slugs it ends up splitting words &lt;/p&gt;

&lt;p&gt;&quot;M&#248;te&quot; is turned into &apos;m-te&apos; instead of &apos;mote&apos; which is more apropriate&lt;/p&gt;</description>
                <environment>all</environment>
            <key id="10992">DC-543</key>
            <summary>Doctrine_Inflector::unaccent does not replace the norwegian characters &#230;&#248;&#229;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ivarne">Ivar Nesje</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Mar 2010 15:15:46 +0000</created>
                <updated>Tue, 16 Mar 2010 13:55:07 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:05:51 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Sluggable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12028" author="ivarne" created="Thu, 4 Mar 2010 08:30:19 +0000"  >&lt;p&gt;Sory, the patch had a little typo. I forgot to add a , after the previously last entry in the array.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10425" name="inflector.patch" size="644" author="ivarne" created="Thu, 4 Mar 2010 08:30:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-537] Timestamp Validator splits on wrong character (from Trac #2018)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-537</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;To validate data of type &apos;timestamp&apos;, the validator splits the Date/Time using a space, where as, the format created by date(&apos;c&apos;) specifies a &apos;T&apos; to split the Date/Time.  It seems the simple fix should be to change the space on line 47 of Doctrine/Validator/Timestamp.php to a &apos;T&apos;&lt;/p&gt;

&lt;p&gt;Date generated from gmdate(&apos;c&apos;) - 2010-03-02T22:08:56+00:00&lt;/p&gt;</description>
                <environment>Problem exists in SVN as of r7298</environment>
            <key id="10982">DC-537</key>
            <summary>Timestamp Validator splits on wrong character (from Trac #2018)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drowe">Dave Rowe</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Mar 2010 17:06:49 +0000</created>
                <updated>Thu, 24 Jun 2010 10:06:18 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:32:24 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11989" author="drowe" created="Tue, 2 Mar 2010 17:28:00 +0000"  >&lt;p&gt;Patch to explode on &apos;T&apos; instead of &apos; &apos;, to align with the expected results of gmdate(&apos;r&apos;)&lt;/p&gt;</comment>
                    <comment id="13407" author="sigma" created="Thu, 24 Jun 2010 10:06:18 +0000"  >&lt;p&gt;So how do I now validate datetime values (YYYY-MM-DD HH-MM-SS) before that bugfix? I&apos;m using mysql 5.0, that uses YYYY-MM-DD for column type datetime. May be there should be another validator for that format, thats splits by a space.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10415" name="Doctrine_TimestampValidation.patch" size="780" author="drowe" created="Tue, 2 Mar 2010 17:28:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-529] HYDRATE_SINGLE_SCALAR returns false for fetchOne() correct value for execute()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-529</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This simple query:&lt;/p&gt;

&lt;p&gt;			$vRetVal = Doctrine_Query::create()&lt;br/&gt;
								-&amp;gt;select(&apos;id&apos;)&lt;br/&gt;
								-&amp;gt;from(&apos;LocationCombined&apos;)&lt;br/&gt;
								-&amp;gt;where(&apos;name = ?&apos;, $pRegionName)&lt;br/&gt;
								-&amp;gt;fetchOne(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);&lt;/p&gt;

&lt;p&gt;returns &quot;false&quot;, but if I use &lt;br/&gt;
								-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);&lt;/p&gt;

&lt;p&gt;I get the correct result in my variable.&lt;/p&gt;
</description>
                <environment>Linux 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:02:26 UTC 2010 x86_64 GNU/Linux&lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) using  EditLine wrapper&lt;br/&gt;
Apache/2.2.12 (Ubuntu)&lt;br/&gt;
PHP 5.3.1&lt;br/&gt;
Doctine 1.2 rev 7229</environment>
            <key id="10969">DC-529</key>
            <summary>HYDRATE_SINGLE_SCALAR returns false for fetchOne() correct value for execute()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="karmankertesz">Karman Kertesz</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Feb 2010 11:32:10 +0000</created>
                <updated>Mon, 1 Mar 2010 16:34:42 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:34:42 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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


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


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


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



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

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

<item>
            <title>[DC-522] Can not use charset and collate in a table basis when using global charset and collate in Doctrine_Manager</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-522</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Can not use charset and collate in a table basis when using global charset and collate in Doctrine_Manager.&lt;/p&gt;


&lt;p&gt;When using + symfony:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;ProjectConfiguration.class.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function configureDoctrine(Doctrine_Manager $manager)
  {
    $manager-&amp;gt;setCharset(&apos;utf8&apos;);
    $manager-&amp;gt;setCollate(&apos;utf8_bin&apos;);
  }

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


&lt;p&gt;And some schema like,&lt;/p&gt;


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

PageIndex:
  tableName:                           t_page_index
  columns:
    id:                                { type: integer  , length: 20 , primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;    , autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;                                                  }
    title:                             { type: string   , length: 200                   , notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;                                                        }
  options:
    collate:                           utf8_general_ci
    

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


&lt;p&gt;When generating the database, the table will have as collate utf8_bin, not being possible overwriting it at a table level.&lt;/p&gt;


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


&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Table.class.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($name, Doctrine_Connection $conn, $initDefinition = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn = $conn;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;] = $name;
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setParent($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn);           
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;addTable($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parser = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Relation_Parser($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($initDefinition) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initDefinition();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initIdentifier();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record-&amp;gt;setUp();

            &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; tree, set up tree
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;isTree()) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTree()-&amp;gt;setUp();
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;tableName&apos;])) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(Doctrine_Inflector::tableize($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]));
            }
        }
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_filters[]  = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Filter_Standard();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_repository = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Table_Repository($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($charset = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;charset&apos;] = $charset;
        }
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($collate = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;collate&apos;] = $collate;
        }

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


&lt;p&gt;Here the charset and the collate are overwritten (in the last lines of the method) by the global values.&lt;/p&gt;

&lt;p&gt;A fix could be something like:&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Table.class.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($name, Doctrine_Connection $conn, $initDefinition = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn = $conn;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;] = $name;
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setParent($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn);           
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;addTable($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parser = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Relation_Parser($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
        

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($charset = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;charset&apos;] = $charset;
        }
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($collate = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE)) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;collate&apos;] = $collate;
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($initDefinition) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initDefinition();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initIdentifier();

            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;record-&amp;gt;setUp();

            &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; tree, set up tree
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;isTree()) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTree()-&amp;gt;setUp();
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;tableName&apos;])) {
                $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(Doctrine_Inflector::tableize($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;name&apos;]));
            }
        }
        
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_filters[]  = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Filter_Standard();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_repository = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Table_Repository($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);

        

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


&lt;p&gt;Now the initDefinition method is called after the setup of the global charset and collate. Then if found a collate option in the table then that collate will be used.&lt;/p&gt;
</description>
                <environment>Wamp 2.0, Windows XP PS2.</environment>
            <key id="10951">DC-522</key>
            <summary>Can not use charset and collate in a table basis when using global charset and collate in Doctrine_Manager</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathan.nieto">Jonathan Nieto</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Feb 2010 19:47:16 +0000</created>
                <updated>Mon, 15 Mar 2010 14:18:56 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:18:56 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11976" author="jwage" created="Tue, 2 Mar 2010 13:28:38 +0000"  >&lt;p&gt;Can you provide your changes as a patch?&lt;/p&gt;</comment>
                    <comment id="12065" author="jonathan.nieto" created="Tue, 9 Mar 2010 18:02:43 +0000"  >&lt;p&gt;Patch done!.&lt;/p&gt;</comment>
                    <comment id="12209" author="jwage" created="Mon, 15 Mar 2010 14:18:56 +0000"  >&lt;p&gt;Thanks again for another issue and patch &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10439" name="Doctrine_Table___construct.txt" size="1259" author="jonathan.nieto" created="Tue, 9 Mar 2010 18:02:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;In Doctrine_Connection_UnitOfWork::processSingleInsert():&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
       $fields = $record-&amp;gt;getPrepared();
        $table = $record-&amp;gt;getTable();

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-518] Generated *Table.class.php should contain a getInstance() method</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-518</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using the symfony framework but assume that the following only affects the classes that were auto generated by Doctrine.&lt;/p&gt;

&lt;p&gt;When doctrine generates the model classes for e.g. the sql table &quot;manage_users&quot; it generates:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
  lib/model/doctrine/ManageUsers.class.php                           &amp;lt;- extends Doctrine_Table
  lib/model/doctrine/ManageUsersTable.class.php                 &amp;lt;- extends BaseManageUsers
  lib/model/doctrine/base/BaseManageUsers.class.php       &amp;lt;- extends sfDoctrineRecord
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;As far as I understand the ManageUsersTable class is supposed to be autoloaded by Doctrine (cf. ATTR_AUTOLOAD_TABLE_CLASSES) and injected into&lt;br/&gt;
the class returned by Doctrine::getTable(&apos;ManageUsers&apos;).&lt;/p&gt;

&lt;p&gt;The first problem is that it is hard to figure out for newbies how to access methods in this class because they try all means to instanciate it or looking for static methods but eventually fail &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;The second problem is that using it this way, the IDE auto completion feature has no chance to figure out that the returned object offers methods defined in ManageUsersTable.class.php, it can only know that the results is an instance of Doctrine_Table.&lt;/p&gt;

&lt;p&gt;The third problem is that one has to repeatingly write Doctrine::getTable(&quot;ManageUser&quot;) in the source code which is quite error prone - or did you notice that I missed an &quot;s&quot; in the example just given &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; The IDE has again no chance to spot this.&lt;/p&gt;

&lt;p&gt;A simple solution to all problems would be an auto generated getInstance method like this:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
 class ManageUsersTable extends Doctrine_Table {
    /** Returns an instance of this class.
     *
     * @return ManageUsersTable
     */
    public static function getInstance() {
        return Doctrine::getTable(&apos;ManageUsers&apos;);
    }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;This way one could write ManageUs&amp;lt;AUTOCOMPLETION&amp;gt;::getInstance()-&amp;gt;get&amp;lt;AUTOCOMPLETION&amp;gt;(); and there would be far less typo bugs!&lt;/p&gt;

&lt;p&gt;bye,&lt;/p&gt;

&lt;p&gt;&lt;del&gt;christian&lt;/del&gt;&lt;/p&gt;</description>
                <environment>Symfony 1.3 with Doctrine 1.2 on Debian 5.0 Linux</environment>
            <key id="10939">DC-518</key>
            <summary>Generated *Table.class.php should contain a getInstance() method</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lathspell">Christian Hammers</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Feb 2010 05:31:24 +0000</created>
                <updated>Mon, 15 Mar 2010 17:07:54 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:07:54 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-517] [PATCH] copy() method ignores INDEXBY associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-517</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;relations are copied by [] instead of &lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;, which will remove any INDEXBY assocations.   See attached patch.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10938">DC-517</key>
            <summary>[PATCH] copy() method ignores INDEXBY associations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="slickrick">Ian Ricketson</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Feb 2010 18:33:27 +0000</created>
                <updated>Mon, 1 Mar 2010 16:45:32 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:45:32 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10383" name="copy.patch" size="719" author="slickrick" created="Mon, 22 Feb 2010 18:33:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-513] Complex HAVING clause generates incorrect SQL in Doctrine_Query::getCountSqlQuery() and Doctrine_Query::getLimitSubquery() [patch included]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-513</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I created a DQL query with a complex having clause, such as:&lt;/p&gt;

&lt;p&gt;Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;Record r&apos;)&lt;br/&gt;
-&amp;gt;addSelect(&apos;r.*&apos;)&lt;br/&gt;
-&amp;gt;addSelect(&apos;((ACOS(SIN( ... AS miles&apos;) // Determines miles from lat/longs&lt;br/&gt;
-&amp;gt;having(&apos;(r.location IS NULL) OR (miles &amp;lt;= r.location)&apos;);&lt;/p&gt;

&lt;p&gt;The query works fine when executed by itself. However, when passed to Doctrine_Query::getCountSqlQuery(), it strips the r.location from the select fields, however this field remains in the having clause, and SQL errors out saying that it can&apos;t find the field. Then, when it is passed to Doctrine_Query::buildSqlQuery(true) by Doctrine_Pager-&amp;gt;execute() (true designates to use getLimitSubquery()), getLimitSubquery() does the same thing and doesn&apos;t include these fields in the subquery.&lt;/p&gt;

&lt;p&gt;I built a patch that I am using for my application to get around this. What it does is it searches for anything matching `&lt;span class=&quot;error&quot;&gt;&amp;#91;a-z0-9_&amp;#93;&lt;/span&gt;&lt;ins&gt;`.`&lt;span class=&quot;error&quot;&gt;&amp;#91;a-z0-9_&amp;#93;&lt;/span&gt;&lt;/ins&gt;` in getCountSqlQuery() and getLimitSubquery() in the HAVING clause (for instance, would match `r`.`location`) and adds the field to the select query. This is a patch for Doctrine-1.2.1, and I haven&apos;t tested it extensively, so I&apos;m not sure if it breaks anything, however in the quick testing I have done it seems to be working OK.&lt;/p&gt;

&lt;p&gt;I greatly appreciate all the work the Doctrine team has done for this amazing ORM - keep up the good work! If I can be of any other assistance, please let me know.&lt;/p&gt;</description>
                <environment>php 5.3.0</environment>
            <key id="10928">DC-513</key>
            <summary>Complex HAVING clause generates incorrect SQL in Doctrine_Query::getCountSqlQuery() and Doctrine_Query::getLimitSubquery() [patch included]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="cocoloco">Dave Kozma</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Feb 2010 18:08:40 +0000</created>
                <updated>Thu, 11 Mar 2010 10:37:37 +0000</updated>
                    <resolved>Thu, 11 Mar 2010 10:37:37 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Pager</component>
                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12079" author="jwage" created="Thu, 11 Mar 2010 10:37:37 +0000"  >&lt;p&gt;Thanks for the issue and patch.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10380" name="Query.patch" size="1123" author="cocoloco" created="Sun, 21 Feb 2010 18:08:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-512] Wrong sorting of migration files</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-512</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I name migration files just as 1.php, 2.php, ..., 10.php, then sorting goes wrong and they will be read in this order: 1.php, 10.php, 2.php, ....&lt;/p&gt;

&lt;p&gt;I fixed it just by replacing&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ksort($classesToLoad);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;ksort($classesToLoad, SORT_NUMERIC);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10922">DC-512</key>
            <summary>Wrong sorting of migration files</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="elnur">Elnur Abdurrakhimov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Feb 2010 04:32:11 +0000</created>
                <updated>Tue, 2 Mar 2010 11:57:03 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 11:57:03 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10376" name="patch-migration-sort.diff" size="460" author="elnur" created="Sat, 20 Feb 2010 04:32:11 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-511] Inflector::classify is slow</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-511</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The Doctrine_Inflector::classify is used a lot while doing batch script. The implementation is based on preg_replace_callback method which is slow. By adding a small cache layer this can speed up Doctrine&lt;/p&gt;
</description>
                <environment>php5.3.1, macosx 10.6.2</environment>
            <key id="10918">DC-511</key>
            <summary>Inflector::classify is slow</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rande">Thomas Rabaix</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Feb 2010 03:48:01 +0000</created>
                <updated>Mon, 1 Mar 2010 16:49:30 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:49:30 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11755" author="rande" created="Fri, 19 Feb 2010 03:51:22 +0000"  >&lt;p&gt;The patch ...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10375" name="patch_dc_511.patch" size="812" author="rande" created="Fri, 19 Feb 2010 03:51:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-510] setColumnOption(s) doesn&apos;t update _identifier when setting column as primary (symfony 1.4.2)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-510</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;class PlgSlide extends BasePlgSlide&lt;br/&gt;
{&lt;br/&gt;
  public function setTableDefinition() &lt;/p&gt;
{
    parent::setTableDefinition();
    $this-&amp;gt;setColumnOptions(&apos;domain_id&apos;, array(&apos;primary&apos; =&amp;gt; true));
  }
&lt;p&gt;...&lt;br/&gt;
doesn&apos;t work, domain_id field is not added as part of identifier for PlgSlide table records&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;class PlgSlide extends BasePlgSlide&lt;br/&gt;
{&lt;br/&gt;
  public function setTableDefinition() &lt;/p&gt;
{
    parent::setTableDefinition();
    $this-&amp;gt;hasColumn(&apos;domain_id&apos;, &apos;integer&apos;, 4, array(
             .... other field option options here
             &apos;primary&apos; =&amp;gt; true
           ));
   }
&lt;p&gt;do work as expected.&lt;/p&gt;

&lt;p&gt;I&apos;ve made some investigation and found code fragment at Table.php, in function setColumn, line 1373:&lt;br/&gt;
           if (isset($options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;br/&gt;
...&lt;br/&gt;
                $this-&amp;gt;_identifier = (array) $this-&amp;gt;_identifier;&lt;/p&gt;

&lt;p&gt;but no such functionality for setColumnOption function, Table.php, line 1235&lt;/p&gt;</description>
                <environment>symfony 1.4.2</environment>
            <key id="10916">DC-510</key>
            <summary>setColumnOption(s) doesn&apos;t update _identifier when setting column as primary (symfony 1.4.2)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="wayfarer">Vladimir Droznik</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Feb 2010 12:33:46 +0000</created>
                <updated>Tue, 2 Mar 2010 13:46:32 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:46:32 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-508] All but the first migrations fail with PostgreSQL [patch included]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-508</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The problem is in this method:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _createMigrationTable()
{
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_migrationTableCreated) {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    }

    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_migrationTableCreated = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;

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

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(Exception $e) {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When &lt;tt&gt;migration_version&lt;/tt&gt; table doesn&apos;t exist, everything works like it should. But subsequent migrations fail, because after failing at creating &lt;tt&gt;migration_version&lt;/tt&gt; table every subsequent queries in that transaction fail.&lt;/p&gt;

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

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

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

<item>
            <title>[DC-506] Doctrine_Adapter_Statement_Oracle missing fetch statement in fetchAll()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-506</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It looks like the developer changed their mind on how to set the flags halfway through coding, as the $flags variable is not used.  Critically, if the default FETCH_BOTH is specified, then no fetch is performed.  I also did some testing with the OCI_BOTH constant, and could not get it to return the desired results (only enumerated results were returned).  I also tried replacing OCI_BOTH with OCI_NUM + OCI_ASSOC with the same results.&lt;/p&gt;

&lt;p&gt;I guess this should either throw an exception (not supported) or be fixed to return the appropriate results.&lt;/p&gt;

&lt;p&gt;Line 361 in v1.2&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $flags = OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC;

        $&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; = $fetchStyle &amp;amp; Doctrine::FETCH_COLUMN;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($fetchStyle == Doctrine::FETCH_BOTH) {
            $flags = OCI_BOTH;
            $numberOfRows = @oci_fetch_all($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;statement, $data, $skip, $maxrows, OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC + OCI_RETURN_LOBS);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($fetchStyle == Doctrine::FETCH_ASSOC) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Linux RHEL5 (discovered in Symfony, but crosschecked with Doctrine 1.x source)</environment>
            <key id="10909">DC-506</key>
            <summary>Doctrine_Adapter_Statement_Oracle missing fetch statement in fetchAll()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beornharris">Beorn Harris</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Feb 2010 09:52:06 +0000</created>
                <updated>Tue, 2 Mar 2010 13:57:32 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 13:57:32 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.0.13</version>
                <version>1.0.14</version>
                <version>1.1.4</version>
                <version>1.1.5</version>
                <version>1.1.6</version>
                <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-505] Doctrine_Cache_Db can be much faster</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-505</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Each  Doctrine_Cache_Db-&amp;gt;_doFetch() invocation costs about 50 ms on my PC(depending on the data of course). By using built-in pack() function performance can be increased 700x times. Each invocation now costs about 0.07 ms. The change is very considerable for pages with multiple queries.&lt;/p&gt;</description>
                <environment>Intel(R) Pentium(R) 4 CPU 3.20GHz, Redhat</environment>
            <key id="10905">DC-505</key>
            <summary>Doctrine_Cache_Db can be much faster</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vadik56">vadik56</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2010 13:19:50 +0000</created>
                <updated>Mon, 15 Mar 2010 17:22:58 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:22:58 +0000</resolved>
                            <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Caching</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12251" author="jwage" created="Mon, 15 Mar 2010 17:22:58 +0000"  >&lt;p&gt;Thanks for the issue and patch! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10371" name="doctrine_cache_speedup.diff" size="490" author="vadik56" created="Tue, 16 Feb 2010 13:19:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-504] toArray not using lazy loading</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-504</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When selecting specific fields in a doctrine query, and calling toArray, the resulting arrays ignore the selected fields and load all values from the database record.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$phones = Doctrine_Query::create()
        -&amp;gt;select(&apos;ph.phone_type&apos;)
        -&amp;gt;from(&apos;Phone ph&apos;)
        -&amp;gt;orderBy(&apos;ph.phone_type&apos;)
        -&amp;gt;limit(2)
        -&amp;gt;execute()
        -&amp;gt;toArray();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above query when dumped returns...&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 1
            [status] =&amp;gt; 
            [phone_type] =&amp;gt; business
            [number] =&amp;gt; 8003041538
            [current_status_id] =&amp;gt; 1
            [created_at] =&amp;gt; 2010-01-08 15:08:34
            [updated_at] =&amp;gt; 2010-01-08 15:08:34
        )

    [1] =&amp;gt; Array
        (
            [id] =&amp;gt; 2
            [status] =&amp;gt; 
            [phone_type] =&amp;gt; business
            [number] =&amp;gt; 2052052055
            [current_status_id] =&amp;gt; 1
            [created_at] =&amp;gt; 2010-02-14 13:07:12
            [updated_at] =&amp;gt; 2010-02-14 13:07:12
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Ubuntu 9.10, PHP 5.2, Zend Framework 9.6</environment>
            <key id="10904">DC-504</key>
            <summary>toArray not using lazy loading</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="davidma7685">David Ash</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2010 11:51:10 +0000</created>
                <updated>Wed, 10 Mar 2010 18:53:01 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 14:13:09 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11742" author="davidma7685" created="Tue, 16 Feb 2010 12:07:03 +0000"  >&lt;p&gt;After a quick test, using -&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ARRAY) returns the expected results, but toArray does not.&lt;/p&gt;</comment>
                    <comment id="12078" author="xborns" created="Wed, 10 Mar 2010 18:53:01 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Using the latest SVN from the 1.2 branch, this code returns null values for the fields that are not part of the select call. For example: &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Doctrine_Query::create()
                -&amp;gt;select(&apos;venue_id, extended_name&apos;)
                -&amp;gt;from(&apos;Model_Venue v&apos;)
                -&amp;gt;execute()
                -&amp;gt;toArray();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will return the following:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
array
 0 =&amp;gt; 
    array
      &apos;venue_id&apos; =&amp;gt; string &apos;160&apos; (length=3)
      &apos;number&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;venue&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;extended_name&apos; =&amp;gt; string &apos;&lt;span class=&quot;code-object&quot;&gt;Long&lt;/span&gt; Venue Name 160&apos; 
  1 =&amp;gt; 
    array
      &apos;venue_id&apos; =&amp;gt; string &apos;161&apos; (length=3)
      &apos;number&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;venue&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      &apos;extended_name&apos; =&amp;gt; string &apos;&lt;span class=&quot;code-object&quot;&gt;Long&lt;/span&gt; Venue Name 161&apos; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I believe it should not include the `number` and `venue` columns within the array? The correct SQL query is returned only giving me the venue_id and extended_name columns.  Not sure if that is a bug/feature since I did not find it within the documentation. &lt;/p&gt;

&lt;p&gt;I am running a MS SQL 2005 server,  PHP 5.3.1 w/ pdo_mssql Apache 2.2.14. Thanks.&lt;/p&gt;

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

<item>
            <title>[DC-503] Migrations task generates wrong diff for long table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-503</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With the attached schema, a migrations diff is generated after an initial setup of the project, although&lt;br/&gt;
there are no differences at all. The two models are exactly identical, the only difference is the&lt;br/&gt;
lenght of their table names. A diff is detected for model &quot;Institute&quot;, but not for the one called &quot;Institut&quot;.&lt;/p&gt;

&lt;p&gt;The reason is in the generation of the foreign keys (Doctrine_Connection line 1624), which&lt;br/&gt;
generates an abbreviated foreign key name for names longer than 64 characters. This&lt;br/&gt;
is true in the &quot;to&quot; models of the migration, but not in the &quot;from&quot; models.&lt;/p&gt;
</description>
                <environment>All</environment>
            <key id="10902">DC-503</key>
            <summary>Migrations task generates wrong diff for long table names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pulse00">Robert Gruendler</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2010 05:02:38 +0000</created>
                <updated>Mon, 15 Mar 2010 12:10:01 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:10:01 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11732" author="pulse00" created="Tue, 16 Feb 2010 06:54:34 +0000"  >&lt;p&gt;I couldn&apos;t find a way to alter the max_identifier_length property of Doctrine_Connection, so i&apos;ve created a patch&lt;br/&gt;
that introduces an ATTR_MAX_IDENTIFIER_LENGTH Connection attribute. If set, the maxLength is taken from&lt;br/&gt;
the attribute, if not set, it defaults to 64 like now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10370" name="0001-migrations-fix.patch" size="2876" author="pulse00" created="Tue, 16 Feb 2010 06:52:31 +0000" />
                    <attachment id="10369" name="1266313871_version1.php" size="1567" author="pulse00" created="Tue, 16 Feb 2010 05:02:38 +0000" />
                    <attachment id="10368" name="schema.yml" size="517" author="pulse00" created="Tue, 16 Feb 2010 05:02:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-500] Duplicate Index for foreign key(MySQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-500</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If an index with the same as the foreign key field exists and is not an array, and it is not the last in the list, adds it twice&lt;/p&gt;


&lt;p&gt;SUGGESTION SOLUTION:&lt;/p&gt;

&lt;p&gt;Doctrine/Export/Mysql.php (136): $found = $found || ($local == $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fields&amp;#39;&amp;#93;&lt;/span&gt;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="10896">DC-500</key>
            <summary>Duplicate Index for foreign key(MySQL)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="valgard">Sven P&#246;che</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Feb 2010 12:01:18 +0000</created>
                <updated>Tue, 2 Mar 2010 12:03:42 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:03:42 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-495] Allow the end of line style to be set in the record builder</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-495</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When building base models on multiple boxes with different operating systems, the use of PHP_EOL in the model builder is problematic since when you rebuild you basically change every line of every file, leading to huge commits that are impossible to review.&lt;/p&gt;

&lt;p&gt;I therefore added an eolStyle option to the Doctrine_Import_Builder class that allows you to specify which EOL markers to use.&lt;/p&gt;

&lt;p&gt;It works perfectly fine here and the patch is attached, if the option is not specified the code remains the same as before btw so no performance loss or any possible BC break.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="10878">DC-495</key>
            <summary>Allow the end of line style to be set in the record builder</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="seldaek">Jordi Boggiano</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Feb 2010 10:54:49 +0000</created>
                <updated>Mon, 29 Mar 2010 14:02:32 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:02:32 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12310" author="seldaek" created="Wed, 17 Mar 2010 11:13:41 +0000"  >&lt;p&gt;The applied fix is NOT correct. My patch did it at the end of the file generation specifically because the file contains stuff generated by many other classes (or something).&lt;/p&gt;

&lt;p&gt;With the current state, and eolStyle set to \n, the result looks like this, which is completely wrong:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;    {\n&lt;br/&gt;
        $this-&amp;gt;setTableName(&apos;foo);\n&lt;br/&gt;
        $this-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 4, array(\r\n&lt;br/&gt;
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,\r\n&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Please revert and apply the original patch that was working perfectly fine..&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10365" name="doctrine-eolstyle.patch" size="879" author="seldaek" created="Fri, 12 Feb 2010 10:54:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-493] method bracketExplode when tablename contains &quot;Join&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-493</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;br/&gt;
I&apos;m using Symfony 1.4.1 with Doctrine (I imagine that the doctrine&apos;s version is 1.2.1), and I have a strange behavior because my table name is &quot;piece_jointe&quot;, so it contains &quot;JOIN&quot; keyword inside.&lt;br/&gt;
In Doctrine_Query_Tokenizer class, the method bracketExplode explode string with a regular expression &quot;#(JOIN)#i&quot;, so the table name is exploded and nothing works after that.&lt;/p&gt;

&lt;p&gt;do you think it&apos;s possible to write a better regular expression to avoid this behavior ? Maybe add spaces after JOIN : &quot;#(JOIN )#i but if there is a line break... or &quot;#(JOIN&lt;span class=&quot;error&quot;&gt;&amp;#91;\s \n&amp;#93;&lt;/span&gt;)#i&quot;&lt;br/&gt;
For now, I&apos;ll rename the table !&lt;/p&gt;

&lt;p&gt;Thanks a lot,&lt;br/&gt;
best regards&lt;br/&gt;
Etienne&lt;/p&gt;</description>
                <environment>Windows 7 / Linux Ubuntu, Apapche 2.2, PHP 5.3</environment>
            <key id="10865">DC-493</key>
            <summary>method bracketExplode when tablename contains &quot;Join&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="evoilliot">Etienne VOILLIOT</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Feb 2010 09:52:25 +0000</created>
                <updated>Mon, 15 Mar 2010 17:31:44 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:31:44 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10361" name="bracketExplode.gif" size="18956" author="evoilliot" created="Thu, 11 Feb 2010 09:52:25 +0000" />
                    <attachment id="10362" name="ScreenHunter_01 Feb. 11 15.48.gif" size="11979" author="evoilliot" created="Thu, 11 Feb 2010 09:52:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-492] Nested set behavior not correctly working (Doctrine_Node_NestedSet::shiftRlValues) (Updated)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-492</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using the code:&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;main.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    $parent = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
    $parent-&amp;gt;setName(&apos;Parent&apos;);
    $parent-&amp;gt;save();
    Doctrine_Core::getTable(&apos;Category&apos;)-&amp;gt;getTree()-&amp;gt;createRoot($parent);
    
    $child = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Category();
    $child-&amp;gt;setName(&apos;Child&apos;);
    $child-&amp;gt;save();
    
    $child-&amp;gt;getNode()-&amp;gt;insertAsLastChildOf($parent);

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


&lt;p&gt;Now it throws an exception with the message:&lt;/p&gt;

&lt;p&gt;&quot;Unknown component alias Category&quot; from the Doctrine_Query_Abstract class, line 743.&lt;/p&gt;


&lt;p&gt;Tracking down the problem, it seems that in the method shiftRlValues there was a problem:&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;NestedSet.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    &lt;span class=&quot;code-comment&quot;&gt;// shift left columns
&lt;/span&gt;        $componentName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tree-&amp;gt;getBaseComponent();

        $qLeft  = Doctrine_Core::getTable($componentName)
            -&amp;gt;createQuery()
            -&amp;gt;update();

        $qRight = Doctrine_Core::getTable($componentName)
            -&amp;gt;createQuery()
            -&amp;gt;update();

        $qLeft = $qLeft-&amp;gt;set($componentName . &apos;.lft&apos;, $componentName.&apos;.lft + ?&apos;, $delta)
                       -&amp;gt;where($componentName . &apos;.lft &amp;gt;= ?&apos;, $first);
        $qLeft = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tree-&amp;gt;returnQueryWithRootId($qLeft, $rootId);

        $resultLeft = $qLeft-&amp;gt;execute();
        
        &lt;span class=&quot;code-comment&quot;&gt;// shift right columns
&lt;/span&gt;        $qRight = $qRight-&amp;gt;set($componentName . &apos;.rgt&apos;, $componentName.&apos;.rgt + ?&apos;, $delta)
                         -&amp;gt;where($componentName . &apos;.rgt &amp;gt;= ?&apos;, $first);

        $qRight = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tree-&amp;gt;returnQueryWithRootId($qRight, $rootId);

        $resultRight = $qRight-&amp;gt;execute();


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


&lt;p&gt;Making a comparison with the NestedSet class in the 1.0 series, realized that the update methods need the component name resulting in:&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;NestedSet.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    &lt;span class=&quot;code-comment&quot;&gt;// shift left columns
&lt;/span&gt;        $componentName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tree-&amp;gt;getBaseComponent();

        $qLeft  = Doctrine_Core::getTable($componentName)
            -&amp;gt;createQuery()
            -&amp;gt;update(&amp;lt;b&amp;gt;$componentName&amp;lt;/b&amp;gt;);

        $qRight = Doctrine_Core::getTable($componentName)
            -&amp;gt;createQuery()
            -&amp;gt;update(&amp;lt;b&amp;gt;$componentName&amp;lt;/b&amp;gt;);

        $qLeft = $qLeft-&amp;gt;set($componentName . &apos;.lft&apos;, $componentName.&apos;.lft + ?&apos;, $delta)
                       -&amp;gt;where($componentName . &apos;.lft &amp;gt;= ?&apos;, $first);
        $qLeft = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tree-&amp;gt;returnQueryWithRootId($qLeft, $rootId);

        $resultLeft = $qLeft-&amp;gt;execute();
        
        &lt;span class=&quot;code-comment&quot;&gt;// shift right columns
&lt;/span&gt;        $qRight = $qRight-&amp;gt;set($componentName . &apos;.rgt&apos;, $componentName.&apos;.rgt + ?&apos;, $delta)
                         -&amp;gt;where($componentName . &apos;.rgt &amp;gt;= ?&apos;, $first);

        $qRight = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tree-&amp;gt;returnQueryWithRootId($qRight, $rootId);

        $resultRight = $qRight-&amp;gt;execute();


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


&lt;p&gt;Now the queries work correctly!.&lt;/p&gt;



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


&lt;p&gt;I seems the cause of the problem was the fact of overwriting createQuery method from Doctrine_Table&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;kcDoctrineTable.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 createQuery($alias = &apos;&apos;)
  {
    $alias = empty($alias) ? $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getAlias() : trim($alias);
    $alias = &apos; &apos;.$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;null&lt;/span&gt;, $class)-&amp;gt;from($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getComponentName().$alias);
  }
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getAlias()
  {
    $name  = substr(get_class($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;), 0, -5);
    $name  = sfInflector::underscore($name);
    $names = explode(&apos;_&apos;, $name);
    array_walk($names, create_function(&apos;&amp;amp;$v, $k&apos;, &apos;$v = $v{0};&apos;));
    $alias = implode(&apos;&apos;, $names);
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $alias;
  }

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


&lt;p&gt;I was trying to give and alias always by default:&lt;/p&gt;

&lt;p&gt;Category -&amp;gt;   c&lt;br/&gt;
CategoryAttribute -&amp;gt; ca&lt;br/&gt;
CategoryAttributeExtension -&amp;gt; cae&lt;/p&gt;


&lt;p&gt;This breaks shiftRlValues method from NestedSet because there, it is used the component name as alias, and when createQuery creates a &quot;from&quot; part with a different alias the whole query crush.&lt;/p&gt;


&lt;p&gt;It would be nice to have this feature in a future release.&lt;/p&gt;</description>
                <environment>Windows XP, Wampserver 2.0 with php 5.2.9-2 and mysql 5.1.33 and apache 2.2.11</environment>
            <key id="10864">DC-492</key>
            <summary>Nested set behavior not correctly working (Doctrine_Node_NestedSet::shiftRlValues) (Updated)</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathan.nieto">Jonathan Nieto</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Feb 2010 08:58:08 +0000</created>
                <updated>Mon, 15 Mar 2010 12:22:42 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 12:22:42 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Nested Set</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11961" author="jwage" created="Tue, 2 Mar 2010 12:04:54 +0000"  >&lt;p&gt;Can you provide these changes as a patch? It&apos;s hard to identify the changes and understand everything without it.&lt;/p&gt;</comment>
                    <comment id="12200" author="jwage" created="Mon, 15 Mar 2010 12:22:42 +0000"  >&lt;p&gt;I was able to pull your changes out of the pasted code. For future issues please create a patch as it is easier to see exactly what changes you made.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-488] Cannot parse table name including &apos;join&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-488</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Cannot parse table name including &apos;join&apos;.&lt;/p&gt;

&lt;p&gt;$q = new Doctrine_Query();&lt;br/&gt;
$q-&amp;gt;from(&apos;MyJoinProblem&apos;);&lt;/p&gt;

&lt;p&gt;In above code, I want to query like &apos;SELECT m.id AS m__id FROM MyJoinProplem m&apos;.&lt;br/&gt;
But, Doctrine try to find &apos;My&apos; table and &apos;Problem&apos; table.&lt;br/&gt;
Table name is &apos;MyJoinProblem&apos;.&lt;/p&gt;</description>
                <environment>php 2.3.11, Windows 7 64bits</environment>
            <key id="10855">DC-488</key>
            <summary>Cannot parse table name including &apos;join&apos;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="gilchris">Chang-gun Lee</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Feb 2010 01:45:38 +0000</created>
                <updated>Mon, 15 Mar 2010 17:35:30 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:35:30 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10359" name="9998TestCase.php" size="2198" author="gilchris" created="Wed, 10 Feb 2010 01:45:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-487] Worng docs: @return docs of some methods in Doctrine_Query_Abstract class are worng.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-487</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;@return docs of getSqlQueryPart should be mixed.&lt;br/&gt;
@return docs of setSqlQueryPart, addSqlQueryPart, removeSqlQueryPart, removeDqlQueryPart, copySubqueryInfo, useResultCache, useQueryCache, expireResultCache, expireQueryCache, setResultCacheLifeSpan and setQueryCacheLifeSpan should be Doctrine_Query.&lt;/p&gt;

&lt;p&gt;This issue is also reported in the user ml. &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/ee5d40f03242af8b&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/ee5d40f03242af8b&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10856">DC-487</key>
            <summary>Worng docs: @return docs of some methods in Doctrine_Query_Abstract class are worng.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="mugeso">TANAKA Koichi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Feb 2010 02:02:04 +0000</created>
                <updated>Mon, 15 Mar 2010 17:39:15 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:39:15 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Query</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10360" name="docfix.diff" size="4940" author="mugeso" created="Wed, 10 Feb 2010 03:13:10 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-483] Indentifiers are not quoted in queries build for Nested Relations (patch included)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-483</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It was OK using reserved words as column names before I started using Nested Relations: queries started to fail because Doctrine_Core::ATTR_QUOTE_IDENTIFIER is ignored by query builder for Nested Relations.&lt;/p&gt;

&lt;p&gt;I solved this problem by wrapping identifiers with Doctrine_Formatter::quoteIdentifier() in several places. I&apos;m providing a patch for your to review and commit.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description>
                <environment>Ubuntu, PHP, MySQL</environment>
            <key id="10849">DC-483</key>
            <summary>Indentifiers are not quoted in queries build for Nested Relations (patch included)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="elnur">Elnur Abdurrakhimov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Feb 2010 05:41:54 +0000</created>
                <updated>Mon, 1 Mar 2010 15:40:12 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 15:40:12 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Native SQL</component>
                <component>Query</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10355" name="patch.diff" size="6125" author="elnur" created="Mon, 8 Feb 2010 05:41:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-482] $data passed to foreach is wrong</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-482</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Calling a query that doesn&apos;t use all tablecols gives php warnings such as:&lt;/p&gt;


&lt;p&gt;Errorcode: 	E_WARNING &lt;span class=&quot;error&quot;&gt;&amp;#91;php warning&amp;#93;&lt;/span&gt; (2)&lt;br/&gt;
Message: 	Invalid argument supplied for foreach()&lt;br/&gt;
File: 	Record.php&lt;br/&gt;
Line: 	1151&lt;/p&gt;

&lt;p&gt;--------------------------------------------------------------&lt;br/&gt;
$data = empty($data) ? $this-&amp;gt;getTable()-&amp;gt;find($id, Doctrine_Core::HYDRATE_ARRAY) : $data;           &lt;br/&gt;
foreach ($data as $field =&amp;gt; $value) {&lt;br/&gt;
--------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;$data is empty but not an array.&lt;/p&gt;</description>
                <environment>Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 (xampp 1.7.3)</environment>
            <key id="10848">DC-482</key>
            <summary>$data passed to foreach is wrong</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="xsign">Florian Wolf</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Feb 2010 17:30:51 +0000</created>
                <updated>Mon, 15 Mar 2010 17:45:10 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:45:10 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-480] Since 1.2, records can&apos;t have columns named &quot;options&quot; anymore</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-480</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Since Doctrine 1.2, Doctrine_Record_Abstract has a new getOptions() method. This forbids any models to have some columns named &quot;options&quot; (and this breaks compatibility with older versions).&lt;/p&gt;

&lt;p&gt;I think this should be mentioned in documentation and release notes. And maybe, an exception should be thrown if a reserved doctrine keyword (options, table...) is defined as column name.&lt;/p&gt;

&lt;p&gt;Of course, a better resolution would to not make the word &quot;options&quot; a reserved keyword but I don&apos;t know it&apos;s really possible in 1.2.x.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10841">DC-480</key>
            <summary>Since 1.2, records can&apos;t have columns named &quot;options&quot; anymore</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="colin.darie">Colin Darie</reporter>
                        <labels>
                    </labels>
                <created>Sat, 6 Feb 2010 20:54:12 +0000</created>
                <updated>Mon, 1 Mar 2010 16:58:13 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:58:13 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Documentation</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-475] generate-migrations-diff is producing bogus migrations (drops the whole database)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-475</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Replicating the bug:&lt;br/&gt;
1. unzip vanilla sandbox.&lt;br/&gt;
2. create schema file with entity&lt;br/&gt;
3. run ./doctrine build-all&lt;br/&gt;
4. modify schema, add column to entity.&lt;br/&gt;
5. run ./doctrine generate-migrations-diff&lt;/p&gt;

&lt;p&gt;Expected behaviour:&lt;br/&gt;
generates migration wich adds column to entity.&lt;/p&gt;

&lt;p&gt;Real behaviour:&lt;br/&gt;
Drops entity from database&lt;/p&gt;

&lt;p&gt;Similar issue: &lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/8b4a0fc0778a388a/79446784623b8497?lnk=gst&amp;amp;q=1.2.1+migration&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/8b4a0fc0778a388a/79446784623b8497?lnk=gst&amp;amp;q=1.2.1+migration&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Vanilla sandbox on version 1.2.1 and 1.2.0&lt;br/&gt;
both sqlite and mysql, so its not driver dependant</environment>
            <key id="10827">DC-475</key>
            <summary>generate-migrations-diff is producing bogus migrations (drops the whole database)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mhughes">Matthew Hughes</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 14:54:47 +0000</created>
                <updated>Wed, 3 Mar 2010 17:26:26 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 17:57:21 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="11577" author="mhughes" created="Tue, 2 Feb 2010 14:59:47 +0000"  >&lt;p&gt;I&apos;ve just tested on Doctrine 1.1.6 sandbox, and the expected behaviour is met.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;</comment>
                    <comment id="11578" author="spiffyjr" created="Tue, 2 Feb 2010 15:01:08 +0000"  >&lt;p&gt;I can confirm this behavior. I have attached a few pastebin posts for more information.&lt;/p&gt;

&lt;p&gt;Steps:&lt;br/&gt;
1. Create schema (&lt;a href=&quot;http://pastebin.com/f1726889&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/f1726889&lt;/a&gt;)&lt;br/&gt;
2. ./doctrine build-all&lt;br/&gt;
3. Modify schema (&lt;a href=&quot;http://pastebin.com/d5ad9b0ee&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d5ad9b0ee&lt;/a&gt;)&lt;br/&gt;
4. ./doctrine generate-migrations-diff (&lt;a href=&quot;http://pastebin.com/d1c30e6f5&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d1c30e6f5&lt;/a&gt;)&lt;/p&gt;</comment>
                    <comment id="11982" author="mgatto" created="Tue, 2 Mar 2010 13:53:46 +0000"  >&lt;p&gt;Thanks for this fix, Johnathan; its much appreciated.&lt;/p&gt;</comment>
                    <comment id="12014" author="mgatto" created="Wed, 3 Mar 2010 13:38:56 +0000"  >&lt;p&gt;This seems to still be broken.&lt;/p&gt;

&lt;p&gt;I updated my install to the latest SVN to get this fix and ran &quot;doctrine.php generate-migrations-diff&quot; with a changed schema and unchanged model classes. The resulting migration is identical to the full DB drop-recreate as I had before this fix.&lt;/p&gt;</comment>
                    <comment id="12015" author="mhughes" created="Wed, 3 Mar 2010 14:07:44 +0000"  >&lt;p&gt;I&apos;m getting the expected behaviour&lt;br/&gt;
on 1.2 branch.  you might be using the wrong branch/tag.&lt;/p&gt;

&lt;p&gt;thanks jwage btw.&lt;/p&gt;</comment>
                    <comment id="12018" author="spiffyjr" created="Wed, 3 Mar 2010 17:26:26 +0000"  >&lt;p&gt;I checked out the 1.2 branch and do not encounter the same error as before but I still am unable to get migrations to function. I&apos;m getting the error message &quot;Could not generate migration classes from difference&quot; using the following settings:&lt;/p&gt;

&lt;p&gt;doctrine.data_fixtures_path = APPLICATION_PATH &quot;/configs/data/fixtures&quot;&lt;br/&gt;
doctrine.sql_path           = APPLICATION_PATH &quot;/configs/data/sql&quot;&lt;br/&gt;
doctrine.migrations_path    = APPLICATION_PATH &quot;/configs/migrations&quot;&lt;br/&gt;
doctrine.yaml_schema_path   = APPLICATION_PATH &quot;/configs/schema&quot;&lt;br/&gt;
doctrine.models_path        = APPLICATION_PATH &quot;/models&quot;&lt;/p&gt;

&lt;p&gt;doctrine.generate_models_options.pearStyle = true&lt;br/&gt;
doctrine.generate_models_options.generateTableClasses = false&lt;br/&gt;
doctrine.generate_models_options.generateBaseClasses = true&lt;br/&gt;
doctrine.generate_models_options.baseClassPrefix = &quot;Base_&quot;&lt;br/&gt;
doctrine.generate_models_options.baseClassesDirectory =&lt;br/&gt;
doctrine.generate_models_options.classPrefixFiles = false&lt;br/&gt;
doctrine.generate_models_options.classPrefix = &quot;Model_&quot;&lt;/p&gt;

&lt;p&gt;$doctrineConfig = $this-&amp;gt;getOption(&apos;doctrine&apos;);&lt;br/&gt;
$manager = Doctrine_Manager::getInstance();&lt;br/&gt;
$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true);&lt;br/&gt;
$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX, &apos;Model_&apos;);&lt;br/&gt;
$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_PEAR);&lt;br/&gt;
$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL);&lt;/p&gt;

&lt;p&gt;Doctrine_Core::loadModels($doctrineConfig&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;models_path&amp;#39;&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;$conn = Doctrine_Manager::connection($doctrineConfig&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dsn&amp;#39;&amp;#93;&lt;/span&gt;, &apos;doctrine&apos;);&lt;br/&gt;
$conn-&amp;gt;setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM, true);&lt;/p&gt;

&lt;p&gt;I&apos;m invoking the CLI by using:&lt;/p&gt;

&lt;p&gt;$config = $application-&amp;gt;getOption(&apos;doctrine&apos;);&lt;br/&gt;
$cli = new Doctrine_Cli($config);&lt;br/&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;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-472] In the relatedExists method of the Doctrine_Record class the exception is incorrectly thrown imho</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-472</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using the result of a:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$q = Doctrine::createQuery()
        -&amp;gt;from(&apos;User u&apos;)
        -&amp;gt;leftJoin(&apos;Role r&apos;);

$users = $q-&amp;gt;execute();

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


&lt;p&gt;now if we want to iterate and know if exists the according role for each user&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
foreach ($users as $user)
{
  $role_name = $user-&amp;gt;relatedExists(&apos;Role&apos;) ? $user-&amp;gt;getRole()-&amp;gt;getName() : &apos;&apos;;
}

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


&lt;p&gt;the exception in the relatedExists method will be thrown:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function relatedExists($name)
    {
        $newReference = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasReference($name)) {
            $newReference = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        }

        $reference = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $reference &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Record) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Exception(
                &apos;You can only call relatedExists() on a relationship that &apos;.
                &apos;returns an instance of Doctrine_Record&apos;
            );
        }
        $exists = $reference-&amp;gt;exists();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($newReference) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;clearRelated($name);
        }

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


&lt;p&gt;because the according role record does not exist for some users ( a user just could have one record).&lt;/p&gt;

&lt;p&gt;it could be better this way:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function relatedExists($name)
    {
        $newReference = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasReference($name)) {
            $newReference = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        }

        $reference = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $reference &amp;amp;&amp;amp; ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;hasRelation($name)) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Record_Exception(
                &apos;You can only call relatedExists() on a relationship that &apos;.
                &apos;returns an instance of Doctrine_Record&apos;
            );
        }

        $exists = $reference ? $reference-&amp;gt;exists() : &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($newReference) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;clearRelated($name);
        }

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


&lt;p&gt;With this change, this method can be used to check newly created user objects or some retrieved from the db (left join with role) smoothly.&lt;/p&gt;</description>
                <environment>Windows XP, WAMP 2.0, PHP 5.2.11</environment>
            <key id="10824">DC-472</key>
            <summary>In the relatedExists method of the Doctrine_Record class the exception is incorrectly thrown imho</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathan.nieto">Jonathan Nieto</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 22:52:15 +0000</created>
                <updated>Mon, 15 Mar 2010 14:16:38 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:16:38 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11964" author="jwage" created="Tue, 2 Mar 2010 12:14:55 +0000"  >&lt;p&gt;Hi, I was able to copy and paste your change out of the comment, but when I apply it and run the tests. It seems to break something, which I expected. Your changes allows collections through now and it calls a method that doesn&apos;t exist on Doctrine_Collection. Give your change a try and run the tests, maybe you can provide a more complete patch and we can include it for 1.2.2 release. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12064" author="jonathan.nieto" created="Tue, 9 Mar 2010 17:38:14 +0000"  >&lt;p&gt;Hi, I just made the patch and ran it against the tests. No errors arose.&lt;/p&gt;

&lt;p&gt;I have the following explanation for the patch:&lt;/p&gt;

&lt;p&gt;The main difference with the previous relatedExists is when checking a relation not serialized in the database but that already exists in the current record. Then the current related exists will return true and the previous relatedExists will return false because that object does not exist in the database.&lt;/p&gt;

&lt;p&gt;Take in count that there are two states of the object:&lt;br/&gt;
1.- When retrieve with findOne without any relation&lt;br/&gt;
2.- When retrieve leftJoin or innerJoin with a relation&lt;/p&gt;</comment>
                    <comment id="12208" author="jwage" created="Mon, 15 Mar 2010 14:16:38 +0000"  >&lt;p&gt;Thanks for the issue and patch! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10438" name="Doctrine_Record_relatedExists.txt" size="1299" author="jonathan.nieto" created="Tue, 9 Mar 2010 17:38:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-469] getAccessors and getMutators shows notices if they are not set</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-469</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It&apos;s a very minor problem I know that. However when I try to use getAccessors() or getMutators() functions, if nothing is set on the table definitions, it throws some notices on the php (on error_reporting all) that such an index does not exists. As there is no such index to be found it returns null instead of expected array (empty if there is no mutators for that table)&lt;/p&gt;

&lt;p&gt;public function getAccessors()&lt;br/&gt;
{&lt;br/&gt;
        $componentName = $this-&amp;gt;_table-&amp;gt;getComponentName();&lt;br/&gt;
        if (!isset(self::$_customAccessors&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentName&amp;#93;&lt;/span&gt;)) &lt;/p&gt;
{
            return array();
        }
&lt;p&gt;        return self::$_customAccessors&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentName&amp;#93;&lt;/span&gt;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;such a code solves the problem and not notices is thrown and empty array is returned if there is no accessors. Same kind of an improvement is required for getMutators too&lt;/p&gt;

&lt;p&gt;I know that this is a minor issue however I wanted to inform you.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10819">DC-469</key>
            <summary>getAccessors and getMutators shows notices if they are not set</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="radalin">roy simkes</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 13:05:55 +0000</created>
                <updated>Mon, 15 Mar 2010 17:48:56 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:48:56 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-468] Project directories that have underscores (ie my_project) in the name get replaced with slashes (my/project) when generating models</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-468</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a project name that contains an underscore.  When I run the doctrine CLI to create the models from the yaml file, something string replaces all underscores with slashes.&lt;/p&gt;

&lt;p&gt;So where I would be expecting the models to be generated in &apos;my_project/application/models&apos;, it is instead being generated in &apos;my/project/application/models&apos;&lt;/p&gt;
</description>
                <environment>Ubuntu Hardy</environment>
            <key id="10818">DC-468</key>
            <summary>Project directories that have underscores (ie my_project) in the name get replaced with slashes (my/project) when generating models</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rfan">Robert Fan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Feb 2010 07:35:14 +0000</created>
                <updated>Mon, 15 Mar 2010 17:49:38 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 17:49:38 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Cli</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12257" author="jwage" created="Mon, 15 Mar 2010 17:49:38 +0000"  >&lt;p&gt;This should already be fixed in the latest 1.2 in SVN and will be in 1.2.2&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

&lt;p&gt;The key cache does not track enforce unique entries, thus multiple entries can be in the cache. See:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    protected function _saveKey($key)
    {
        $keys = $this-&amp;gt;fetch($this-&amp;gt;_cacheKeyIndexKey);
        $keys[] = $key;

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

&lt;p&gt;I was about to backport the 2.0 code to allow enabling/disabling the use of doctrine_cache_keys, but I noticed that it is already in 1.2 at the last second:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    public function save($id, $data, $lifeTime = false, $saveKey = true)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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


&lt;p&gt;The only other API change made is the signature of the &lt;tt&gt;Doctrine_Cache_Interface::save()&lt;/tt&gt; methods:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    public function save($id, $data, $lifeTime = false, $saveKey = true)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;is now&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    public function save($id, $data, $lifeTime = false)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

<item>
            <title>[DC-459] Typo in Doctrine_Validator_Email</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-459</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Typo in comments for Doctrine_Validator_Email-&amp;gt;_checkMx()&lt;/p&gt;

&lt;p&gt;Patch attached.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10794">DC-459</key>
            <summary>Typo in Doctrine_Validator_Email</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jboyd">Josh Boyd</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jan 2010 21:35:01 +0000</created>
                <updated>Mon, 1 Mar 2010 16:19:57 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:19:57 +0000</resolved>
                            <version>1.1.6</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10321" name="fix_typo.patch" size="533" author="jboyd" created="Wed, 27 Jan 2010 21:35:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

<item>
            <title>[DC-441] When using PearStyle model loading and  a classPrefix, the Doctrine CLI will ignore any SQL operations if model_autoloading is set to conservative </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-441</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using PearStyle model loading and  a classPrefix, the Doctrine CLI will ignore any SQL operations if model_autoloading is set to conservative . If model_autoloading is set to aggressive, then everything works as expected.&lt;/p&gt;

&lt;p&gt;Here&apos;s my Doctrine configuration:&lt;/p&gt;

&lt;p&gt;doctrine.generate_models_options.pearStyle = true&lt;br/&gt;
doctrine.generate_models_options.generateTableClasses = false&lt;br/&gt;
doctrine.generate_models_options.generateBaseClasses = true&lt;br/&gt;
doctrine.generate_models_options.baseClassPrefix = &quot;Base_&quot;&lt;br/&gt;
doctrine.generate_models_options.baseClassesDirectory =&lt;br/&gt;
doctrine.generate_models_options.classPrefixFiles = false&lt;br/&gt;
doctrine.generate_models_options.classPrefix = &quot;Model_&quot;&lt;br/&gt;
; Conservative Model Loading:&lt;br/&gt;
doctrine.model_autoloading = 2&lt;/p&gt;

&lt;p&gt;and my Doctrine initialization method:&lt;br/&gt;
    protected function _initDoctrine()&lt;/p&gt;
    {
        $this-&amp;gt;getApplication()-&amp;gt;getAutoloader()
            -&amp;gt;pushAutoloader(array(&apos;Doctrine&apos;, &apos;autoload&apos;));
        spl_autoload_register(array(&apos;Doctrine&apos;, &apos;modelsAutoload&apos;));

        $doctrineConfig = $this-&amp;gt;getOption(&apos;doctrine&apos;);
        $manager = Doctrine_Manager::getInstance();
        $manager-&amp;gt;setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
        $manager-&amp;gt;setAttribute(
          Doctrine::ATTR_MODEL_LOADING,
          $doctrineConfig[&apos;model_autoloading&apos;]
        );
        
        

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

        $conn = Doctrine_Manager::connection($doctrineConfig[&apos;dsn&apos;],&apos;doctrine&apos;);
        $conn-&amp;gt;setAttribute(Doctrine::ATTR_USE_NATIVE_ENUM, true);
     return $conn;
    }

&lt;p&gt;and my doctrine.php CLI file:&lt;/p&gt;

&lt;p&gt;require_once &apos;Zend/Application.php&apos;;&lt;/p&gt;

&lt;p&gt;// Create application, bootstrap, and run&lt;br/&gt;
$application = new Zend_Application(&lt;br/&gt;
    APPLICATION_ENV,&lt;br/&gt;
    APPLICATION_PATH . &apos;/configs/application.ini&apos;&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;$application-&amp;gt;getBootstrap()-&amp;gt;bootstrap(&apos;doctrine&apos;);&lt;/p&gt;

&lt;p&gt;$config = $application-&amp;gt;getOption(&apos;doctrine&apos;);&lt;br/&gt;
$cli = new Doctrine_Cli($config);&lt;br/&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;
</description>
                <environment>Mac OS X, PHP 5.2.9</environment>
            <key id="10755">DC-441</key>
            <summary>When using PearStyle model loading and  a classPrefix, the Doctrine CLI will ignore any SQL operations if model_autoloading is set to conservative </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jlebensold">Jon Lebensold</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Jan 2010 22:36:21 +0000</created>
                <updated>Tue, 16 Mar 2010 15:13:52 +0000</updated>
                    <resolved>Tue, 16 Mar 2010 15:13:52 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                <component>Cli</component>
                <component>Import/Export</component>
                <component>Native SQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11947" author="ovgray" created="Tue, 2 Mar 2010 10:21:22 +0000"  >&lt;p&gt;I hope this is an appropriate place for these comments.&lt;/p&gt;

&lt;p&gt;I have been experimenting with the sort of ZF-Doctrine setup described by Jon. I find that everything does &lt;em&gt;not&lt;/em&gt; work as expected with model-autoloading set to aggressive.&lt;/p&gt;

&lt;p&gt;If the models directory contains&lt;/p&gt;

&lt;p&gt;models/&lt;br/&gt;
  Address.php&lt;br/&gt;
  Base/&lt;br/&gt;
    Address.php&lt;br/&gt;
    User.php&lt;br/&gt;
  User.php&lt;/p&gt;

&lt;p&gt;operations like &apos;create-tables&apos; will fail with an error message that says:&lt;/p&gt;

&lt;p&gt;&quot;Fatal error: Class &apos;Model_Base_Address&apos; not found in /path/to/models/Address.php&quot;&lt;/p&gt;

&lt;p&gt;There is no error if the same operation on the same models is performed by a &quot;pure Doctrine&quot; CLI setup like the one in the Sandbox is used, with model-autoloading set to MODEL_LOADING_PEAR = 3. The difference is that in Jon&apos;s setup and mine, the Zend autoloader is registered before the Doctrine models autoloader. In this configuration, the Zend autoloader can find files with a &apos;Model_&apos; prefix in the &apos;models&apos; directory.&lt;/p&gt;

&lt;p&gt;When the Doctrine models autoloader loads a file it puts information about the file in Doctrine_Core::_loadedModelsFiles. It looks as though Doctrine_Core::loadModels and perhaps other cli operations rely on this, assuming that if a model file has been loaded, information about that file can be obtained from Doctrine_Core::_loadedModelsFiles. That won&apos;t be the case if the Zend autoloader loaded the file, as might occur if an instance of Address.php was created before the iterator in Doctrine_Core::loadModels got to Base/Address.php.&lt;/p&gt;

&lt;p&gt;The same problem occurs if doctrine.generate_models_options.baseClassPrefix is set to &quot;Base.&quot; It does not occur if that parameter is set to &quot;A&quot; or &quot;A/&quot;.&lt;/p&gt;

&lt;p&gt;I considered whether this problem might be related to the ZF unfriendly restriction referred to in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-277&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-277&lt;/a&gt;, because classPrefixFiles is set to &apos;false&apos; as it has to be for the standard ZF configuration. However, perhaps serendipitously, the cli operations seem to work fine with that setting using the &apos;pure Doctrine&apos; cli setup. &lt;/p&gt;

&lt;p&gt;I hope this information assists in sorting out this bug.&lt;/p&gt;</comment>
                    <comment id="11953" author="jlebensold" created="Tue, 2 Mar 2010 10:52:40 +0000"  >&lt;p&gt;Owen, thanks for bringing this up. I noticed the issue, as did a number of the people on zendcasts.com.&lt;/p&gt;</comment>
                    <comment id="12293" author="jwage" created="Tue, 16 Mar 2010 15:13:52 +0000"  >&lt;p&gt;I don&apos;t see any issue/bug described here. If your classes are organized to be for PEAR style and you don&apos;t have it configured to work that way, then of course it is not going to work. That is expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-437] Connection::query() can use wrong connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-437</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;As I understand, &lt;tt&gt;Doctrine_Connection::query()&lt;/tt&gt; method is intended to execute DQL queries using precisely this connection.&lt;br/&gt;
But here is the code:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;894     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function query($query, array $params = array(), $hydrationMode = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
895     {
896         $parser = Doctrine_Query::create();                                                                                
897         $res = $parser-&amp;gt;query($query, $params, $hydrationMode);
898         $parser-&amp;gt;free();
899 
900         &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $res;
901     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

<item>
            <title>[DC-434] setCharset($charset) on mysql/pgsql connections does not set Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-434</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When calling setCharset on a connection I expect that getCharset returns the charset which is set before.&lt;/p&gt;

&lt;p&gt;That works on sqlite and other Connections, but not on mysql and pgsql.&lt;/p&gt;

&lt;p&gt;Doctrine_Connection_Mysql and Doctrine_Connection_Pgsql overwrite setCharset (defined in Doctrine_Configurable) and only execute their SET NAMES query and don&apos;t set Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET which is used by getCharset().&lt;/p&gt;

&lt;p&gt;Solution would be to call &lt;/p&gt;

&lt;p&gt;parent::setCharset($charset);&lt;/p&gt;

&lt;p&gt;in Doctrine_Connection_Mysql::setCharset($charset) and Doctrine_Connection_Pgsql::setCharset($charset).&lt;/p&gt;</description>
                <environment></environment>
            <key id="10740">DC-434</key>
            <summary>setCharset($charset) on mysql/pgsql connections does not set Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="robo47@robo47.net">Benjamin Steininger</reporter>
                        <labels>
                    </labels>
                <created>Sat, 16 Jan 2010 13:31:33 +0000</created>
                <updated>Mon, 1 Mar 2010 18:16:04 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 18:16:04 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Connection</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11600" author="robo47@robo47.net" created="Wed, 3 Feb 2010 16:16:17 +0000"  >&lt;p&gt;Two diffs for the files&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10341" name="Mysql.php.diff" size="383" author="robo47@robo47.net" created="Wed, 3 Feb 2010 16:16:17 +0000" />
                    <attachment id="10342" name="Pgsql.php.diff" size="226" author="robo47@robo47.net" created="Wed, 3 Feb 2010 16:16:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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





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

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

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

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

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

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

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

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

<item>
            <title>[DC-414] Sluggable template fails on case insensitive fields [solution]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-414</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Template_Listener_Sluggable performs the following check to see if an existing matching slug exists (line 219):
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;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;while&lt;/span&gt; (in_array($slug, $similarSlugs)) {
  $slug = call_user_func_array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;builder&apos;], array($proposal.&apos;-&apos;.$i, $record));
  $i++;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;in_array performs case sensitive string matching, which can cause errors if the sluggable field is case insensitive. This can easily be fixed by calling strtolower when creating the $similarSlugs array and on $slug itself. That is:
&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Sluggable.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$similarSlugs = array();
foreach ($similarSlugResult as $key =&amp;gt; $value) {
    $similarSlugs[$key] = strtolower($value[$name]);
}

$i = 1;
&lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; (in_array(strtolower($slug), $similarSlugs)) {
    $slug = call_user_func_array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_options[&apos;builder&apos;], array($proposal.&apos;-&apos;.$i, $record));
    $i++;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Even if the sluggable column is BINARY / case sensitive, I think it&apos;s an undesired behavior to have multiple slugs with the same case insensitive string.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="10708">DC-414</key>
            <summary>Sluggable template fails on case insensitive fields [solution]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeremy">Jeremy Kauffman</reporter>
                        <labels>
                    </labels>
                <created>Sun, 10 Jan 2010 19:25:57 +0000</created>
                <updated>Mon, 1 Mar 2010 20:14:29 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 20:14:29 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.0.13</version>
                <version>1.0.14</version>
                <version>1.1.4</version>
                <version>1.1.5</version>
                <version>1.1.6</version>
                <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11359" author="jeremy" created="Sun, 10 Jan 2010 19:28:41 +0000"  >&lt;p&gt;Messed up the formatting.&lt;/p&gt;</comment>
                    <comment id="11918" author="jwage" created="Mon, 1 Mar 2010 18:31:55 +0000"  >&lt;p&gt;I don&apos;t see how this change is necessary. The generated slugs are always lowercases anyways. These strtolower() functions don&apos;t do anything.&lt;/p&gt;</comment>
                    <comment id="11929" author="jeremy" created="Mon, 1 Mar 2010 19:28:35 +0000"  >&lt;p&gt;Jon,&lt;/p&gt;

&lt;p&gt;The resulting slugs are only in lower case if you are using the default slug builder (Doctrine_Inflector::urlize). I didn&apos;t realize that urlize made called str_to_lower or I would have mentioned that.&lt;/p&gt;

&lt;p&gt;So, this is still a bug. In MySQL, unique indexes are case insensitive*. in_array performs case sensitive comparisons. So if I have a slug builder that allows variations in case, it is possible for Sluggable to generate two identical slugs.&lt;/p&gt;

&lt;p&gt;To reproduce this bug, comment out the &quot;strtolower&quot;/&quot;mb_strttolower&quot; functions in Inflector::urlize and save a record with two identical fields that are used to generate a slug.&lt;/p&gt;

&lt;p&gt;*is this the SQL standard? I did a search but couldn&apos;t find an answer)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-413] Validating Spanish &#209; produces &quot;Notice&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-413</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine Version 1.2.1&lt;/p&gt;

&lt;p&gt;I am entering a simple string into a text input, and running a validator for non-blank and minimum length.&lt;/p&gt;

&lt;p&gt;When I enter a Spanish character such as &#209; (N with squiggle on top), the Validator is producing a notice:&lt;/p&gt;

&lt;p&gt;Notice: iconv_strlen() &lt;span class=&quot;error&quot;&gt;&amp;#91;function.iconv-strlen&amp;#93;&lt;/span&gt;: Detected an incomplete multibyte character in input string in D:\wamp\www\doctrine\lib\Doctrine\Validator.php on line 131&lt;/p&gt;

&lt;p&gt;One work-around suggested at &lt;a href=&quot;http://www.php.net/manual/en/function.iconv-strlen.php#62320&quot; class=&quot;external-link&quot;&gt;http://www.php.net/manual/en/function.iconv-strlen.php#62320&lt;/a&gt; is to use&lt;br/&gt;
            return strlen(utf8_decode($string));&lt;br/&gt;
instead - not sure whether that provides the same result, though. I have replaced the line in my own Validator class and it seems to be working fine.&lt;/p&gt;</description>
                <environment>Windows 7, WAMP Server, PHP 5.2.6</environment>
            <key id="10707">DC-413</key>
            <summary>Validating Spanish &#209; produces &quot;Notice&quot;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="seriksen">Steve</reporter>
                        <labels>
                    </labels>
                <created>Sun, 10 Jan 2010 16:11:24 +0000</created>
                <updated>Mon, 1 Mar 2010 18:35:47 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 18:35:47 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

<item>
            <title>[DC-410] Email-validator doesn&apos;t work</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-410</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m generating my models from YAML. The email validator is correctly parsed into the model, but it doesn&apos;t work. If I try to insert &apos;a&apos; or something that is not valid, I don&apos;t get any error at all and the row is inserted. See attachments for models.&lt;/p&gt;

&lt;p&gt;        $user = new AppUser();&lt;br/&gt;
        $user-&amp;gt;name =  &apos;Testuser&apos;;&lt;br/&gt;
        $user-&amp;gt;password = sha1(&apos;lala&apos;);&lt;br/&gt;
        $user-&amp;gt;email = &apos;a&apos;;&lt;br/&gt;
        $user-&amp;gt;role = &apos;ADMIN&apos;;&lt;br/&gt;
        $user-&amp;gt;save();&lt;/p&gt;</description>
                <environment>PostgreSQL 8.4, PHP 5.2.11, Apache2</environment>
            <key id="10703">DC-410</key>
            <summary>Email-validator doesn&apos;t work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="neographikal">Sander</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jan 2010 20:38:53 +0000</created>
                <updated>Tue, 2 Mar 2010 12:29:23 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:29:23 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11403" author="robo47@robo47.net" created="Sun, 17 Jan 2010 16:19:07 +0000"  >&lt;p&gt;Is Validation activated for your Connection/Manager via the attributes ? It&apos;s off by default.&lt;/p&gt;

&lt;p&gt;From the manual:&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration#naming-convention-attributes:validation-mode-constants&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/configuration#naming-convention-attributes:validation-mode-constants&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Validation by default is turned off so if you wish for your data to be validated you will need to enable it. Some examples of how to change this configuration are provided below.&lt;/p&gt;</comment>
                    <comment id="11404" author="neographikal" created="Sun, 17 Jan 2010 16:28:51 +0000"  >&lt;p&gt;Ah crap, I feel so stupid. My bad......&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10276" name="BaseAppUser.php" size="2103" author="neographikal" created="Fri, 8 Jan 2010 20:38:53 +0000" />
                    <attachment id="10275" name="schema.yml" size="620" author="neographikal" created="Fri, 8 Jan 2010 20:38:53 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-408] Schema generation on Oracle databases fails due to invalid/unexistant table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-408</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sometimes the ORACLE engine has object names that are not tables, and the doctrine generator tries to&lt;br/&gt;
generate classes for them, the following patch solves the problem.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;Solution found thanks to Vladimir Tamara  - vtamara AT pasosdejesus DOT org&amp;#93;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;diff -u Doctrine/Import/Oracle.php.orig Doctrine/Import/Oracle.php&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;--- Doctrine/Import/Oracle.php.orig     2010-01-07 17:08:33.000000000
-0500
+++ Doctrine/Import/Oracle.php  2010-01-07 17:08:54.000000000 -0500
@@ -203,7 +203,7 @@
      */
     &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function listTables($database = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
     {
-        $query = &quot;SELECT * FROM user_objects WHERE object_type =
&apos;TABLE&apos;&quot;;
+        $query = &quot;SELECT * FROM user_objects WHERE object_type =
&apos;TABLE&apos; and object_name in (select table_name from user_tables)&quot;;
         &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;fetchColumn($query);
     }

@@ -252,4 +252,4 @@
         $query = &apos;SELECT view_name FROM sys.user_views&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;fetchColumn($query);
     }
-}
\ No newline at end of file
+}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.2.4-2ubuntu5.9 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 26 2009 14:00:44) &lt;br/&gt;
Copyright (c) 1997-2007 The PHP Group&lt;br/&gt;
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies&lt;br/&gt;
&lt;br/&gt;
Oracle database 10gR2&lt;br/&gt;
Symfony 1.4.1</environment>
            <key id="10701">DC-408</key>
            <summary>Schema generation on Oracle databases fails due to invalid/unexistant table names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tuork">Andres Molina</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jan 2010 14:18:13 +0000</created>
                <updated>Mon, 1 Mar 2010 18:45:53 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 18:45:53 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11564" author="adrive" created="Sun, 31 Jan 2010 21:17:06 +0000"  >&lt;p&gt;Hi Andres.&lt;/p&gt;

&lt;p&gt;Bear in mind, that materialized views are also acting like a table. But I think, that they should be imported into doctrine&apos;s models too. But I never use an schema Import.&lt;/p&gt;

&lt;p&gt;I don&apos;t see any differences in the results of both queries. &lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
SELECT * FROM user_objects WHERE object_type = &apos;TABLE&apos;;&lt;br/&gt;
SELECT * FROM user_objects WHERE object_type = &apos;TABLE&apos; and object_name in (select table_name from user_tables)&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Both are returning the same resultset. I have only basic objects (tables, views, mviews, some synonyms and some database links). No custom types and so on...&lt;/p&gt;

&lt;p&gt;Wouldn&apos;t be much better to use only &quot;select table_name from user_tables&quot; ?&lt;/p&gt;

&lt;p&gt;I am curious what object types are also acted like a table except mviews. Can you provide more info about your database objects?&lt;/p&gt;</comment>
                    <comment id="11569" author="tuork" created="Sun, 31 Jan 2010 23:23:43 +0000"  >&lt;p&gt;Miloslav,&lt;/p&gt;

&lt;p&gt;The issue I was having was that Oracle was generating some sort of mirror images of existing tables and saving them as table objects with very funky names (names that Doctrine wasn&apos;t able to parse correctly). The query modification I supplied makes sure that the tables objects found by the original query are also the tables named in user_tables, and not the aforementioned &quot;mirror images&quot;.&lt;/p&gt;

&lt;p&gt;It would in fact be simpler to use &quot;select table_name from user_tables&quot;, but I wasn&apos;t sure whether object information was used somewhere else. &lt;/p&gt;

&lt;p&gt;The database I was using was pretty simple. Pretty much your run-of-the-mill relational tables and a couple of sequences. I wasn&apos;t using any views or anything of the sort.&lt;/p&gt;

&lt;p&gt;As far as I can tell, the user objects that were causing a problem were some sort of temporary objects Oracle creates and stores as table objects.&lt;/p&gt;</comment>
                    <comment id="11570" author="adrive" created="Sun, 31 Jan 2010 23:34:28 +0000"  >&lt;p&gt;That sounds like dropped objects in recycle bin. They usually have funky names with all the bells and whistles around alphanumerical keys (eg:&quot;BIN$HGnc55/7rRPgQPeM/qQoRw==$0&quot;) .&lt;/p&gt;

&lt;p&gt;Just purge your recycle bin with &quot;purge recyclebin;&quot;.&lt;/p&gt;</comment>
                    <comment id="11601" author="tuork" created="Wed, 3 Feb 2010 16:20:06 +0000"  >&lt;p&gt;Unfortunately, the database that was giving me issues no longer exists, so I can&apos;t test if  &quot;purge recyclebin&quot;. However, the example object_name you gave is spot-on, so I&apos;m pretty sure that&apos;s the cause of the issue.&lt;/p&gt;

&lt;p&gt;Either way, I think the modification to the query I submitted is worthwhile as it would avoid this type of issue. If no data from objects is necessary, the query could be replaced altogether with &quot;select table_name from user_tables&quot; (as Miloslav mentioned in the first comment).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-407] Doctrine_Core::HYDRATE_SINGLE_SCALAR improvement</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-407</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Right now HYDRATE_SINGLE_SCALAR will always return one value, regardless of whether you use execute() or fetchOne(). This limits the usefulness of the hydrator, as it could be expanded to work in situations where you want to hydrate a single column from a result-set. For example think of a scenario where you want to populate a multi option element of a form with IDs from a db model.&lt;/p&gt;

&lt;p&gt;Right now if you have 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;$items = Doctrine_Query::create()-&amp;gt;select(&apos;id&apos;)-&amp;gt;from(&apos;Items&apos;)-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You will end up having just the id of the first item. However I think it should return a flat array of all the ids, 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;array(1, 3, 4, 5, 8)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Having it work this way would still let you use HYDRATE_SINGLE_SCALAR to hydrate a single value; you would just use fetchOne instead of execute. Changing the implementation won&apos;t really have any negative performance impacts either.&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a patch that adds this functionality and updates the unit tests to take it into account.&lt;/p&gt;

&lt;p&gt;I realize that this might not be added in 1.2 since it&apos;d break backwards compatibility, but if there&apos;s going to be 1.3, this should be in it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10699">DC-407</key>
            <summary>Doctrine_Core::HYDRATE_SINGLE_SCALAR improvement</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="reko_t">Reko Tiira</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jan 2010 11:06:44 +0000</created>
                <updated>Mon, 15 Mar 2010 11:06:47 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 11:06:47 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11367" author="lsmith" created="Wed, 13 Jan 2010 12:20:18 +0000"  >&lt;p&gt;i agree .. there is a lot of power in PDO&apos;s fetchAll() also in terms of grouping (PDO::FETCH_GROUP, PDO::FETCH_UNIQUE) data etc. that is hidden in Doctrine. i have even found myself having to fallback to PDO in a few places because of this.&lt;/p&gt;</comment>
                    <comment id="11921" author="jwage" created="Mon, 1 Mar 2010 18:47:51 +0000"  >&lt;p&gt;We can&apos;t change this in Doctrine 1.2 as it would break BC.&lt;/p&gt;</comment>
                    <comment id="11941" author="lsmith" created="Tue, 2 Mar 2010 01:26:07 +0000"  >&lt;p&gt;yeah obviously there would be a need for new fetch modes. but this means new features, risking new bugs etc.&lt;/p&gt;</comment>
                    <comment id="12186" author="jwage" created="Mon, 15 Mar 2010 11:06:47 +0000"  >&lt;p&gt;Hi, I modified your patch a bit and committed it. I think this should be ok now and is backwards compatible with the previous version.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10274" name="Doctrine_Hydrate_SingleScalar.patch" size="1452" author="reko_t" created="Fri, 8 Jan 2010 11:06:44 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-406] more robust handling for &quot;actAs: [Timstampable]&quot; handling</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-406</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;see: &lt;a href=&quot;http://trac.symfony-project.org/ticket/8044&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/8044&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This patch ensures that any numeric keys are flipped individually instead of simply peaking into the first element and assuming the rest of the array has the same structure.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10698">DC-406</key>
            <summary>more robust handling for &quot;actAs: [Timstampable]&quot; 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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Jan 2010 22:49:43 +0000</created>
                <updated>Tue, 12 Jan 2010 20:44:04 +0000</updated>
                    <resolved>Tue, 12 Jan 2010 20:44:04 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10272" name="Builder.php.diff" size="1396" author="lsmith" created="Thu, 7 Jan 2010 22:49:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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


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

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

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

&lt;p&gt;Doctrine_Connection_Statement starting on line: 234&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;getAttribute(Doctrine::PORTABILITY_EMPTY_TO_NULL)) {
    foreach ($params as $key =&amp;gt; $value) {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($value == &apos;&apos;) {
            $params[$key] = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the first test in this block should be (Portability Mode Attributes must be handled this way):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn-&amp;gt;getAttribute(Doctrine::ATTR_PORTABILITY) &amp;amp; Doctrine::PORTABILITY_EMPTY_TO_NULL) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the second test should be:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_string($value) &amp;amp;&amp;amp; $value === &apos;&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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

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

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

<item>
            <title>[DC-395] sfYaml library included twice</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-395</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I don&apos;t know if this is important but it seems sfYaml is included twice in Doctrine 1.2.1.  Once in vendor/sfYaml and once again in Doctrine/Parser/sfYaml&lt;/p&gt;</description>
                <environment></environment>
            <key id="10679">DC-395</key>
            <summary>sfYaml library included twice</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 07:21:37 +0000</created>
                <updated>Tue, 8 Jun 2010 15:11:42 +0000</updated>
                    <resolved>Tue, 8 Jun 2010 15:11:42 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11745" author="beberlei" created="Tue, 16 Feb 2010 16:26:15 +0000"  >&lt;p&gt;This should be fixed asap, it makes running the test-suite (with coverage) impossible.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;mysql&amp;gt; select SLUG, LFT, RGT, LEVEL from pk_context_cms_page;&lt;br/&gt;
&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; SLUG     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LFT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; RGT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LEVEL &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /        &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   12 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /about   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   10 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   11 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; global   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  NULL &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    9 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    3 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    8 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     2 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    4 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    5 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     3 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c/d &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     3 &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;br/&gt;
7 rows in set (0.00 sec)&lt;/p&gt;

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

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

&lt;p&gt;mysql&amp;gt; select SLUG, LFT, RGT, LEVEL from pk_context_cms_page;&lt;br/&gt;
&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; SLUG     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LFT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; RGT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LEVEL &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /        &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   12 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /about   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   10 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   11 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; global   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  NULL &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    9 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    3 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    8 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     2 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    4 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     3 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c/d &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    5 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     4 &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;br/&gt;
7 rows in set (0.00 sec)&lt;/p&gt;

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

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

&lt;p&gt;mysql&amp;gt; select SLUG, LFT, RGT, LEVEL from pk_context_cms_page&lt;br/&gt;
    -&amp;gt; ;&lt;br/&gt;
&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; SLUG     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LFT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; RGT  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; LEVEL &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /        &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    1 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   12 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     0 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /about   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   10 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   11 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; global   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;  NULL &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    2 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    9 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     1 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    3 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    8 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     2 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     5 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; /a/b/c/d &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    7 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    6 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;     4 &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;br/&gt;
7 rows in set (0.00 sec)&lt;/p&gt;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-378] Typo in documentation for Taggable Extension</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-378</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There are some typos in your documentation for Taggable extension.&lt;/p&gt;

&lt;p&gt;In section related to getPopularTags method, if I use your code, like &lt;cite&gt;Doctrine::getTable(&apos;BlogPost&apos;)-&amp;gt;getPopularTags();&lt;/cite&gt; I get an exception &quot;Unknown method Doctrine_Table::getPopularTags&quot; (with replacing &lt;cite&gt;BlogPost&lt;/cite&gt; by my model name). In effect, it&apos;s not the table for my model that I must use but the table for TaggeableTag.&lt;br/&gt;
Besides, in your tests, you use &lt;cite&gt;Doctrine::getTable(&apos;TaggableTag&apos;)&lt;/cite&gt; &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;I have write a patch to fix these typos. It&apos;s attached to this ticket.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10648">DC-378</key>
            <summary>Typo in documentation for Taggable Extension</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fabienp">Fabien Pennequin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Dec 2009 18:20:25 +0000</created>
                <updated>Mon, 15 Mar 2010 14:42:39 +0000</updated>
                    <resolved>Mon, 15 Mar 2010 14:42:39 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Extensions</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11990" author="balupton" created="Tue, 2 Mar 2010 20:17:36 +0000"  >&lt;p&gt;I believe the TaggableTag table is used to hold all tags, so if you have multiple tables that use tags, TaggableTag will contain the tags for all the tables using the Taggable extension. By doing: Doctrine::getTable(&apos;BlogPost&apos;)-&amp;gt;getPopularTags(); we only want to get the popular tags for that table alone.&lt;/p&gt;

&lt;p&gt;However, I could be totally wrong???&lt;/p&gt;</comment>
                    <comment id="11997" author="ivarne" created="Wed, 3 Mar 2010 04:16:00 +0000"  >&lt;p&gt;Only problem is that I can not Doctrine::getTable(&apos;BogPost&apos;)-&amp;gt;getPopularTags() throws an exeption.&lt;br/&gt;
You wil have to do as in the test case and make sure that the table clases is 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-comment&quot;&gt;// Load the models you want tags form
&lt;/span&gt;Doctrine::getTable(&apos;BlogPost&apos;);
Doctrine::getTable(&apos;Article&apos;);
&lt;span class=&quot;code-comment&quot;&gt;// Then the automaticaly generated TaggableTag model can be loaded
&lt;/span&gt;$tags = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags();
&lt;span class=&quot;code-comment&quot;&gt;// or you can spesify spesific models you want tags from
&lt;/span&gt;$tags = Doctrine::getTable(&apos;TaggableTag&apos;)-&amp;gt;getPopularTags(array(&apos;BlogPost&apos;,&apos;Article&apos;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is how it works for me, at least. Benjamin, have you tested and got a resonable result from Doctrine::getTable(&apos;BlogPost&apos;)-&amp;gt;getPopularTags()?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10251" name="DocsGetPopularTags.patch" size="2228" author="fabienp" created="Tue, 22 Dec 2009 18:20:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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


  Couldn&apos;t find class FooBar

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

&lt;p&gt;The attached schema.yml looks like this:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# /config/doctrine/schema.yml
Foo:
  columns:
    id:
      type:                    integer(8)
      primary:                 true
      autoincrement:           true
    foo_field:                 string(100)
  relations:
    Bars:
      class:                   Bar
      refClass:                JoinFooBar
      local:                   foo_id
      foreign:                 bar_id
Bar:
  columns:
    id:
      type:                    integer(8)
      primary:                 true
      autoincrement:           true
    bar_field:               string(30)
JoinFooBar:
  columns:
    foo_id:
      type:                    integer(8)
      primary:                 true
    bar_id:
      type:                    integer(8)
      primary:                 true

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

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

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

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

&lt;p&gt;If the schema is changed from:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;...
    bar_field:               string(30)
JoinFooBar:
  columns:
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;...
    bar_field:               string(30)
FooBar:
  columns:
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

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

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


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

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

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


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

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

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

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

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

&lt;p&gt;Current version of Doctrine_Query_Tokenizer::getSplitRegExpFromArray() (Doctrine 1.2, as of r7034):&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
    private function getSplitRegExpFromArray(array $d){
        $d = array_map(&apos;preg_quote&apos;, $d);

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

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

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

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

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

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

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

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

&lt;p&gt;An alternative solution, but far less robust, would be just to modify Doctrine_Query_From::parse() from&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    public function parse($str, $return = false)
    {
        $str = trim($str);
        $parts = $this-&amp;gt;_tokenizer-&amp;gt;bracketExplode($str, &apos;JOIN&apos;);

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

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

&lt;p&gt;to this, with spaces around the JOIN string passed to bracketExplode():&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    public function parse($str, $return = false)
    {
        $str = trim($str);
        $parts = $this-&amp;gt;_tokenizer-&amp;gt;bracketExplode($str, &apos; JOIN &apos;);

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-352] Doctrine_RawSql/Caching fatal error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-352</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_RawSql::calculateResultCacheHash tries to call $this-&amp;gt;getSql() - an undefined method - on line 444 of RawSql.php.&lt;/p&gt;</description>
                <environment>Solaris</environment>
            <key id="10602">DC-352</key>
            <summary>Doctrine_RawSql/Caching fatal error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="wickethewok">Jonathan Shelly</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Dec 2009 22:05:56 +0000</created>
                <updated>Mon, 1 Mar 2010 15:47:38 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 15:47:38 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Caching</component>
                <component>Native SQL</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11461" author="snapshot" created="Sun, 24 Jan 2010 17:35:04 +0000"  >&lt;p&gt;I get the same error during:&lt;br/&gt;
$q = new Doctrine_RawSql();&lt;br/&gt;
$q-&amp;gt;useResultCache(true);&lt;/p&gt;

&lt;p&gt;I fixed it, by change from:&lt;br/&gt;
$sql = $this-&amp;gt;getSql();&lt;br/&gt;
to:&lt;br/&gt;
$sql = $this-&amp;gt;getDql();&lt;/p&gt;

&lt;p&gt;In Doctrine_RawSql 444 line.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-350] Problem with Doctrine_Record::link() where $this-&gt;$alias is NULL (including possible fix)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-350</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine 1.1 problem&lt;/p&gt;

&lt;p&gt;Doctrine_Record::link() was causing problems for me at the following 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; 
  foreach ($records as $record) {
    $this-&amp;gt;$alias-&amp;gt;add($record);
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;After a little digging, the problem was due to the value 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; $this-&amp;gt;$alias&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;  being NULL.&lt;/p&gt;

&lt;p&gt;Changing the code to 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; 
  foreach ($records as $record) {
    $this-&amp;gt;get($alias)-&amp;gt;add($record);
  }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Seemed to solve the problem, but I am not sure if this is the correct thing to do!&lt;/p&gt;

&lt;p&gt;Could you take a look at this and then either &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;update this ticket to let me know if this is the right thing to do or&lt;/li&gt;
	&lt;li&gt;patch the next version of doctrine-1.1 to include this fix if this is sensible (and does not break something else!).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For your reference, the code block (in Symfony) that ended up causing a problem here looks 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; 
# /lib/model/doctrine/Foo.class.php

class Foo extends BaseFoo {
  public function save(Doctrine_Connection $conn = null) {
    if ($this-&amp;gt;isNew()) {
      $this-&amp;gt;createBar();
    }
    return parent::save($conn);
  }

 /**
  * Generate a Bar for this Foo and link to it (does NOT save)
  *
  * @return boolean   true if a new Bar was created, false if not
  */
  public function createBar() {
    if (empty($this-&amp;gt;sf_guard_user_id)) {
      $this-&amp;gt;Bar = new Bar();
      $this-&amp;gt;Bar-&amp;gt;setAbc($this-&amp;gt;getAbc());
      $this-&amp;gt;Bar-&amp;gt;save();
      $this-&amp;gt;Bar-&amp;gt;link(&apos;xyz&apos;, XyzTable::XYZ_ID_DEFAULT); // This is the line that caused the problems
      return true;
    } else {
      return false;
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Yours,&lt;/p&gt;


&lt;p&gt;Christian&lt;/p&gt;</description>
                <environment>symfony 1.2.7&lt;br/&gt;
MySQL 5.1.30&lt;br/&gt;
php 5.2.8</environment>
            <key id="10599">DC-350</key>
            <summary>Problem with Doctrine_Record::link() where $this-&gt;$alias is NULL (including possible fix)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="caponica">Christian Seaman</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Dec 2009 12:29:22 +0000</created>
                <updated>Mon, 1 Mar 2010 19:03:29 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 19:03:29 +0000</resolved>
                            <version>1.1.6</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-346] synchronize records based on the primary keys, patch available</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-346</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I do a synchronizeWithArray(), the order of the elements in the array has to be the same as they are saved in the database.&lt;br/&gt;
Of course this can not be assumed in any situation, where you have reordered form-elements etc.&lt;/p&gt;

&lt;p&gt;I would expect, if I add the IDs to the elements in the array, that the update-process is based on them and not on the element-order.&lt;/p&gt;

&lt;p&gt;Please take a look at this old ticket: &lt;a href=&quot;http://trac.doctrine-project.org/ticket/2097&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/2097&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The attached patch works really nice on the actual revision too.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10593">DC-346</key>
            <summary>synchronize records based on the primary keys, patch available</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="4">Incomplete</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="testvogel">Marcus H&#228;u&#223;ler</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 12:02:59 +0000</created>
                <updated>Thu, 11 Mar 2010 10:08:14 +0000</updated>
                    <resolved>Thu, 11 Mar 2010 10:08:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11932" author="jwage" created="Mon, 1 Mar 2010 19:56:18 +0000"  >&lt;p&gt;Hi, have you tested this patch against Doctrine 1.2 and ran the test suite? When I give it a try, it wouldn&apos;t quite apply cleanly and it seems to break lots of tests. I&apos;ll keep looking at it, let me know if you have any more information or if you have another version of the patch. Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-345] delete reference between OneToOne-Relation with synchronizeWithArray(), patch available</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-345</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There is no possibility to delete a reference on a OneToOne-Relation with synchronizeWithArray().&lt;/p&gt;

&lt;p&gt;If User and Group would be OneToOne related, i would expect that I could do something like the following (like on ManyToMany-Relations), to delete the relation between both.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$user-&amp;gt;synchronizeWithArray(array(
    &apos;Group&apos; =&amp;gt; array() // no error, but the relation is not deleted
));

or

$user-&amp;gt;synchronizeWithArray(array(
    &apos;Group&apos; =&amp;gt; array(null) // error, cause doctrine expects an existing ID
));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;This fixes the problem:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Index: library/Doctrine/Record.php
===================================================================
--- library/Doctrine/Record.php	(revision 6903)
+++ library/Doctrine/Record.php	(working copy)
@@ -2012,6 +2012,8 @@
                     if (isset($value[0]) &amp;amp;&amp;amp; ! is_array($value[0])) {
                         $this-&amp;gt;unlink($key, array(), false);
                         $this-&amp;gt;link($key, $value, false);
+                    } else if (empty($value) || (null === current($value))) {
+                    	$this-&amp;gt;unlink($key, array(), false);
                     } else {
                         $this-&amp;gt;$key-&amp;gt;synchronizeWithArray($value);
                     }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="10592">DC-345</key>
            <summary>delete reference between OneToOne-Relation with synchronizeWithArray(), patch available</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="4">Incomplete</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="testvogel">Marcus H&#228;u&#223;ler</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 11:51:07 +0000</created>
                <updated>Thu, 11 Mar 2010 10:09:14 +0000</updated>
                    <resolved>Thu, 11 Mar 2010 10:09:14 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11934" author="jwage" created="Mon, 1 Mar 2010 20:00:18 +0000"  >&lt;p&gt;Hmm. The second syntax is weird. I think the first syntax makes more sense, no?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-343] Doctrine_View_Exception is documented as &quot;Doctrine_Validator_Exception&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-343</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;PHPdoc mislabels the class&lt;/p&gt;</description>
                <environment></environment>
            <key id="10590">DC-343</key>
            <summary>Doctrine_View_Exception is documented as &quot;Doctrine_Validator_Exception&quot;</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathancollins">Jonathan Collins</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 06:34:31 +0000</created>
                <updated>Mon, 1 Mar 2010 16:31:58 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 16:31:58 +0000</resolved>
                            <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Documentation</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-334] Doctrine_Migration_Diff relies sys_get_tmp_dir in a way that will break with mutliple projects running the command at once</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-334</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;sys_get_temp_dir returns the same value at all times for a given Unix user.&lt;/p&gt;

&lt;p&gt;This means that if one attempts to run doctrine:generate_migrations_diff on two projects at once, they will contend for the same temporary folder. Temporary files ought to be specific to an instance of a task, or at least to a project.&lt;/p&gt;

&lt;p&gt;A fix would be to append getpid() to sys_get_temp_dir and use that as the temp dir throughout the task. That is completely task-specific:&lt;/p&gt;

&lt;p&gt;$tmp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . getpid();&lt;br/&gt;
mkdir($tmp);&lt;/p&gt;

&lt;p&gt;Another fix would be to use a folder within the data/ folder of the project, which is project-specific:&lt;/p&gt;

&lt;p&gt;$tmp = sfConfig::get(&apos;sf_data_dir&apos;) . DIRECTORY_SEPARATOR . &apos;doctrine_tmp&apos;;&lt;/p&gt;

&lt;p&gt;(We use the latter approach in pkToolkitPlugin)&lt;/p&gt;
</description>
                <environment>Symfony 1.3</environment>
            <key id="10578">DC-334</key>
            <summary>Doctrine_Migration_Diff relies sys_get_tmp_dir in a way that will break with mutliple projects running the command at once</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="boutell">Tom Boutell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Dec 2009 21:34:07 +0000</created>
                <updated>Tue, 8 Dec 2009 17:58:54 +0000</updated>
                    <resolved>Tue, 8 Dec 2009 17:58:54 +0000</resolved>
                            <version>1.2.0</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11075" author="jwage" created="Mon, 7 Dec 2009 21:48:46 +0000"  >&lt;p&gt;How about this patch?&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Index: lib/Doctrine/Migration/Diff.php
===================================================================
--- lib/Doctrine/Migration/Diff.php	(revision 6893)
+++ lib/Doctrine/Migration/Diff.php	(working copy)
@@ -45,7 +45,8 @@
                                 &apos;created_indexes&apos;     =&amp;gt;  array(),
                                 &apos;dropped_indexes&apos;     =&amp;gt;  array()),
               $_migration,
-              $_startingModelFiles = array();
+              $_startingModelFiles = array(),
+              $_tmpPath;
 
     &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; $_toPrefix   = &apos;ToPrfx&apos;,
                      $_fromPrefix = &apos;FromPrfx&apos;;
@@ -68,6 +69,7 @@
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_from = $from;
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_to = $to;
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_startingModelFiles = Doctrine_Core::getLoadedModelFiles();
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTmpPath(sys_get_temp_dir() . DIRECTORY_SEPARATOR . getmypid());
 
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($migration &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Migration) {
             $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_migration = $migration;
@@ -77,6 +79,20 @@
     }
 
     /**
+     * Set the temporary path to store the generated models &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; generating diffs
+     *
+     * @param string $tmpPath
+     * @&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 setTmpPath($tmpPath)
+    {
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! is_dir($tmpPath)) {
+            mkdir($tmpPath, 0777, &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;_tmpPath = $tmpPath;
+    }
+
+    /**
      * Get unique hash id &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; migration instance
      *
      * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string $uniqueId
@@ -301,7 +317,7 @@
      */
     &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _generateModels($prefix, $item)
     {
-        $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . strtolower($prefix) . &apos;_doctrine_tmp_dirs&apos;;
+        $path = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tmpPath . DIRECTORY_SEPARATOR . strtolower($prefix) . &apos;_doctrine_tmp_dirs&apos;;
         $options = array(
             &apos;classPrefix&apos; =&amp;gt; $prefix,
             &apos;generateBaseClasses&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
@@ -357,7 +373,7 @@
         }
 
         &lt;span class=&quot;code-comment&quot;&gt;// clean up tmp directories
&lt;/span&gt;-        Doctrine_Lib::removeDirectories(sys_get_temp_dir() . DIRECTORY_SEPARATOR . strtolower(self::$_fromPrefix) . &apos;_doctrine_tmp_dirs&apos;);
-        Doctrine_Lib::removeDirectories(sys_get_temp_dir() . DIRECTORY_SEPARATOR . strtolower(self::$_toPrefix) . &apos;_doctrine_tmp_dirs&apos;);
+        Doctrine_Lib::removeDirectories($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tmpPath . DIRECTORY_SEPARATOR . strtolower(self::$_fromPrefix) . &apos;_doctrine_tmp_dirs&apos;);
+        Doctrine_Lib::removeDirectories($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_tmpPath . DIRECTORY_SEPARATOR . strtolower(self::$_toPrefix) . &apos;_doctrine_tmp_dirs&apos;);
     }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11086" author="boutell" created="Tue, 8 Dec 2009 15:06:07 +0000"  >&lt;p&gt;Looks good&lt;/p&gt;</comment>
                    <comment id="11095" author="jwage" created="Tue, 8 Dec 2009 17:58:54 +0000"  >&lt;p&gt;Thanks for helping with the issue. It is fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;If this is not a BUG maybe it could be considered a feature request then?&lt;/p&gt;</comment>
                    <comment id="11014" author="juokaz" created="Sat, 5 Dec 2009 04:30:47 +0000"  >&lt;p&gt;I understand you, sometimes adopting a framework can be a pain &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Problem is coming from the lines:&lt;/p&gt;

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

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

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

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

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

<item>
            <title>[DC-319] getModified() returns object where ids are expected</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-319</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Assigning a new unsaved relation to an entity confuses &lt;tt&gt;getModified()&lt;/tt&gt; to return records for values such as &lt;tt&gt;userId&lt;/tt&gt;, that are expected to be ints.&lt;/p&gt;

&lt;p&gt;Here is a full example to reproduce:&lt;/p&gt;

&lt;div class=&quot;code panel&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
require_once &apos;_loader.php&apos;;

$mgr = Doctrine_Manager::getInstance();
$mgr-&amp;gt;openConnection(&apos;....&apos;);

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

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 32);
    }
}

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

        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;body&apos;, &apos;string&apos;, 256);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;userId&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;userId&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;id&apos;
        ));
    }
}

Doctrine::dropDatabases();
Doctrine::createDatabases();
Doctrine::createTablesFromArray(array(&apos;User&apos;, &apos;Post&apos;));

$joe = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$joe-&amp;gt;name = &apos;Joe&apos;;
$joe-&amp;gt;save();

$post = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Post();
$post-&amp;gt;body = &apos;Hi&apos;;
$post-&amp;gt;User = $joe;
$post-&amp;gt;save();

$bill = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$bill-&amp;gt;name = &apos;Bill&apos;;
&lt;span class=&quot;code-comment&quot;&gt;//$bill-&amp;gt;save(); // If &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; is uncommented everything works fine
&lt;/span&gt;
$post-&amp;gt;User = $bill;

var_dump(&apos; --- New --- &apos;);
var_dump($post-&amp;gt;getModified());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And instead of a id for &lt;tt&gt;userId&lt;/tt&gt; I get 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;string(13) &lt;span class=&quot;code-quote&quot;&gt;&quot; --- New --- &quot;&lt;/span&gt;
array(1) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;userId&quot;&lt;/span&gt;]=&amp;gt;
  object(User)#37 (18) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_node:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    NULL
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_id:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    array(0) {
    }
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_data:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    array(2) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;]=&amp;gt;
      object(Doctrine_Null)#4 (0) {
      }
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;]=&amp;gt;
      string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;Bill&quot;&lt;/span&gt;
    }
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_values:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    array(0) {
    }
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_state:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(2)
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_lastModified:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    array(0) {
    }
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_modified:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    array(1) {
      [0]=&amp;gt;
      string(4) &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;
    }
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;_oldValues:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;&quot;&lt;/span&gt;]=&amp;gt;
    array(1) {
      [&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;]=&amp;gt;
      NULL
    }
    ... trimmed ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;expected&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;string(13) &lt;span class=&quot;code-quote&quot;&gt;&quot; --- New --- &quot;&lt;/span&gt;
array(1) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;userId&quot;&lt;/span&gt;]=&amp;gt;
  string(1) &lt;span class=&quot;code-quote&quot;&gt;&quot;2&quot;&lt;/span&gt;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Tested on 1.1 and 1.2 branches from svn. (same result)&lt;/p&gt;</description>
                <environment>PHP 5.2.10 on Ubuntu 9.10</environment>
            <key id="10556">DC-319</key>
            <summary>getModified() returns object where ids are expected</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladev">Emil Vladev</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 15:32:43 +0000</created>
                <updated>Tue, 2 Mar 2010 13:50:54 +0000</updated>
                    <resolved>Tue, 2 Mar 2010 12:50:03 +0000</resolved>
                            <version>1.1.7</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11970" author="jwage" created="Tue, 2 Mar 2010 12:49:54 +0000"  >&lt;p&gt;This is the expected behavior. Because you haven&apos;t saved $bill yet, it is temporarily storing the reference to the object in the foreign key field.&lt;/p&gt;</comment>
                    <comment id="11977" author="vladev" created="Tue, 2 Mar 2010 13:30:19 +0000"  >&lt;p&gt;But sholnd&apos;t it be NULL. &lt;tt&gt;userId&lt;/tt&gt; is expected to be an int - not an object - doesn&apos;t feel right?!?&lt;/p&gt;</comment>
                    <comment id="11980" author="jwage" created="Tue, 2 Mar 2010 13:50:54 +0000"  >&lt;p&gt;Hmm. I guess it could go either way. If you haven&apos;t saved yet, then the property has changed, we just don&apos;t know the id yet. I could imagine someone wanting to know that an object was assigned to that foreign key but not saved yet. Either way, I don&apos;t think we can change the behavior in Doctrine 1.2 if people might be relying on it already.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;Should be&lt;/p&gt;

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;Then you could do something like this&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;if ( ! isset($array[$name]) &amp;amp;&amp;amp; ( (!$rel-&amp;gt;isRefClass() &amp;amp;&amp;amp; ! $rel-&amp;gt;isOneToOne()) || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
    unset($this-&amp;gt;$name);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The unlinking works anyway.&lt;/p&gt;</comment>
                    <comment id="11049" author="jwage" created="Mon, 7 Dec 2009 18:13:33 +0000"  >&lt;p&gt;This fixes your test case but I want to test it before we include it in a release(1.2.2)&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Index: lib/Doctrine/Relation.php
===================================================================
--- lib/Doctrine/Relation.php	(revision 6882)
+++ lib/Doctrine/Relation.php	(working copy)
@@ -74,6 +74,8 @@
                                   &apos;orderBy&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
                                   );
 
+    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_isRefClass = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
+
     /**
      * constructor
      *
@@ -416,6 +418,24 @@
         }
     }
 
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function isRefClass()
+    {
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isRefClass === &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
+            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isRefClass = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
+            $table = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable();
+            foreach ($table-&amp;gt;getRelations() as $name =&amp;gt; $relation) {
+                foreach ($relation[&apos;table&apos;]-&amp;gt;getRelations() as $relation) {
+                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($relation[&apos;refTable&apos;]) &amp;amp;&amp;amp; $relation[&apos;refTable&apos;] === $table) {
+                        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isRefClass = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
+                        &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;(2);
+                    }
+                }
+            }
+        }
+
+        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_isRefClass;
+    }
+
     /**
      * __toString
      *
Index: lib/Doctrine/Record.php
===================================================================
--- lib/Doctrine/Record.php	(revision 6882)
+++ lib/Doctrine/Record.php	(working copy)
@@ -2024,8 +2024,8 @@
         &lt;span class=&quot;code-comment&quot;&gt;// Eliminate relationships missing in the $array
&lt;/span&gt;         foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_references as $name =&amp;gt; $relation) {
 	        $rel = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;getRelation($name);
-	
-			&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($array[$name]) &amp;amp;&amp;amp; ( ! $rel-&amp;gt;isOneToOne() || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
+
+            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $rel-&amp;gt;isRefClass() &amp;amp;&amp;amp; ! isset($array[$name]) &amp;amp;&amp;amp; ( ! $rel-&amp;gt;isOneToOne() || ! isset($array[$rel-&amp;gt;getLocalFieldName()]))) {
                 unset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$name);
             }
         }
Index: tests/Ticket/DC300TestCase.php
===================================================================
--- tests/Ticket/DC300TestCase.php	(revision 0)
+++ tests/Ticket/DC300TestCase.php	(revision 0)
@@ -0,0 +1,127 @@
+&amp;lt;?php
+/*
+ *  $Id$
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &lt;span class=&quot;code-quote&quot;&gt;&quot;AS IS&quot;&lt;/span&gt; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * &amp;lt;http:&lt;span class=&quot;code-comment&quot;&gt;//www.phpdoctrine.org&amp;gt;.
&lt;/span&gt;+ */
+
+/**
+ * Doctrine_Ticket_DC300_TestCase
+ *
+ * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
+ * @author      Konsta Vesterinen &amp;lt;kvesteri@cc.hut.fi&amp;gt;
+ * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt;+ * @category    &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; Relational Mapping
+ * @link        www.phpdoctrine.org
+ * @since       1.0
+ * @version     $Revision$
+ */
+class Doctrine_Ticket_DC300_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase
+{
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareData()
+    {
+        $g1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_Group();
+        $g1[&apos;name&apos;] = &apos;group1&apos;;
+        $g1-&amp;gt;save();
+
+        $g2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_Group();
+        $g2[&apos;name&apos;] = &apos;group2&apos;;
+        $g2-&amp;gt;save();
+
+        $g3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_Group();
+        $g3[&apos;name&apos;] = &apos;group3&apos;;
+        $g3-&amp;gt;save();
+
+        $u1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Ticket_DC300_User();
+        $u1[&apos;name&apos;] = &apos;user1&apos;;
+        $u1[&apos;Groups&apos;]-&amp;gt;add($g1);
+        $u1[&apos;Groups&apos;]-&amp;gt;add($g2);
+        $u1-&amp;gt;save();
+    }
+
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareTables()
+    {
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC300_Group&apos;;
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC300_User&apos;;
+        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Ticket_DC300_UserGroup&apos;;
+        parent::prepareTables();
+    }
+
+    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testRefTableEntriesOnManyToManyRelationsWithSynchronizeWithArray()
+    {
+		$u1 = Doctrine::getTable(&apos;Ticket_DC300_User&apos;)-&amp;gt;find(1);
+
+		&lt;span class=&quot;code-comment&quot;&gt;// update the groups user (id 1) is linked to
&lt;/span&gt;+		$u1-&amp;gt;synchronizeWithArray(array(
+			&apos;Groups&apos; =&amp;gt; array(
+				array(&apos;name&apos; =&amp;gt; &apos;group1 update&apos;),
+				array(&apos;name&apos; =&amp;gt; &apos;group2 update&apos;)
+			)
+		));
+		$u1-&amp;gt;save();
+
+		&lt;span class=&quot;code-comment&quot;&gt;// update the user-objects with real data from database
&lt;/span&gt;+		$u1-&amp;gt;loadReference(&apos;Groups&apos;);
+
+		&lt;span class=&quot;code-comment&quot;&gt;// check wether the two database-entries in RefTable exists
&lt;/span&gt;+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual(count($u1-&amp;gt;Groups), 2);
+    }
+   
+}
+
+class Ticket_DC300_Group &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
+{
+	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
+	{
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 255);
+	}
+	
+	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
+	{
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Ticket_DC300_User as Users&apos;, array(
+			&apos;local&apos; =&amp;gt; &apos;group_id&apos;,
+			&apos;foreign&apos; =&amp;gt; &apos;user_id&apos;,
+			&apos;refClass&apos; =&amp;gt; &apos;Ticket_DC300_UserGroup&apos;
+		));
+	}
+}
+
+class Ticket_DC300_User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
+{
+	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
+	{
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 255);
+	}
+
+	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
+	{
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Ticket_DC300_Group as Groups&apos;, array(
+			&apos;local&apos; =&amp;gt; &apos;user_id&apos;,
+			&apos;foreign&apos; =&amp;gt; &apos;group_id&apos;,
+			&apos;refClass&apos; =&amp;gt; &apos;Ticket_DC300_UserGroup&apos;
+		));
+	}
+}
+
+class Ticket_DC300_UserGroup &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
+{
+	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
+	{
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;user_id&apos;, &apos;integer&apos;);
+		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;group_id&apos;, &apos;integer&apos;);
+	}
+}
\ No newline at end of file
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11115" author="testvogel" created="Wed, 9 Dec 2009 09:30:50 +0000"  >&lt;p&gt;I tested your patch in our project and it seems to work very well.&lt;/p&gt;

&lt;p&gt;Thank you and your team for the good work &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; !&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10193" name="DC300TestCase.php" size="2504" author="testvogel" created="Mon, 30 Nov 2009 13:20:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

&lt;p&gt;Thank you for your attention.&lt;/p&gt;</comment>
                    <comment id="11273" author="gensisns" created="Tue, 22 Dec 2009 19:53:07 +0000"  >&lt;p&gt;No problem at all, I really thought that was the issue &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &lt;/p&gt;

&lt;p&gt;Are you using dblib? If so, edit \lib\Doctrine\Query.php line 1367:&lt;br/&gt;
&amp;lt;         if ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos;) {&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;         if ($driverName == &apos;pgsql&apos; || $driverName == &apos;oracle&apos; || $driverName == &apos;oci&apos; || $driverName == &apos;mssql&apos; || $driverName == &apos;odbc&apos; || $driverName == &apos;dblib&apos;) {&lt;/p&gt;

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

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

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

&lt;p&gt;Thank you.&lt;/p&gt;</comment>
                    <comment id="11275" author="gensisns" created="Tue, 22 Dec 2009 20:37:57 +0000"  >&lt;p&gt;Give it a try on a bucnh of queries and see it you can come up with anything that isn&apos;t working (because of this issue &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;) otherwise, maybe we can finally get this committed.&lt;/p&gt;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-139] Versionable behavior not use the right connection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-139</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have 2 connections and a table with versionable behavior. The problem is that doctrine use the last connection defined in the database.yml for the article_version table not the connection from the article table.&lt;/p&gt;

&lt;p&gt;I think it is also good idea to add a connection option to the behavior.&lt;/p&gt;</description>
                <environment>symfony 1.2.9&lt;br/&gt;
</environment>
            <key id="10234">DC-139</key>
            <summary>Versionable behavior not use the right connection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Oct 2009 15:31:24 +0000</created>
                <updated>Mon, 1 Mar 2010 19:10:57 +0000</updated>
                    <resolved>Mon, 1 Mar 2010 19:10:57 +0000</resolved>
                            <version>1.0.12</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Behaviors</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="10426" author="jwage" created="Mon, 2 Nov 2009 23:05:02 +0000"  >&lt;p&gt;When I test this it works as expected and I took a look at the code and the generated models from behaviors inherit the connection from its parent.&lt;/p&gt;</comment>
                    <comment id="11175" author="pookey" created="Fri, 11 Dec 2009 15:35:36 +0000"  >&lt;p&gt;I can reproduce this.... but, not reliably at the moment.  There does seem to be an issue though &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="11177" author="romanb" created="Fri, 11 Dec 2009 17:02:38 +0000"  >&lt;p&gt;reopening on behalf of pookey/Ian.&lt;/p&gt;</comment>
                    <comment id="11178" author="pookey" created="Fri, 11 Dec 2009 17:06:31 +0000"  >&lt;p&gt;whilst I&apos;m still trying to track down exactly how to reproduce this in a nice simple test... I have found this proof that the issue exists.&lt;/p&gt;

&lt;p&gt;Modifying AuditLog::getMaxVersion() to include 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;        $connName1 = Doctrine::getTable(&apos;RadiusUserNote&apos;)-&amp;gt;getConnection()-&amp;gt;getName();
        $connName2 = Doctrine::getTable($className)-&amp;gt;getConnection()-&amp;gt;getName();
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot; - name of connecion used &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &apos;RadiusUserNote&apos; is {$connName1}, however.... \n&quot;&lt;/span&gt;;
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot; the name of connecion used &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &apos;{$className}&apos; is {$connName2}\n&quot;&lt;/span&gt;;
        die();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;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;- name of connecion used &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &apos;RadiusUserNote&apos; is radius_christina, however.... the name of connecion used &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &apos;RadiusUserNoteVersion&apos; is maildb
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11482" author="micahg" created="Mon, 25 Jan 2010 20:00:38 +0000"  >&lt;p&gt;This patch checks the Manager for a bound component instead of relying on the internal connection of the class at the time.&lt;/p&gt;

&lt;p&gt;This is against Doctrine 1.2.1&lt;/p&gt;</comment>
                    <comment id="11491" author="micahg" created="Wed, 27 Jan 2010 20:40:16 +0000"  >&lt;p&gt;Affects 1.2.1 as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10316" name="Generator.php.patch.DC-139" size="472" author="micahg" created="Mon, 25 Jan 2010 20:00:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-104] Fetching a subset of records from the view</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-104</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;As far as I can see, all rows are fetched from a view. There is not much sense to use views if you cannot filter result based on some where conditions, so this would be a great improvement to the View class.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10180">DC-104</key>
            <summary>Fetching a subset of records from the view</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="2">Won&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="veli">Velimira Metodieva</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Oct 2009 13:51:30 +0000</created>
                <updated>Tue, 16 Mar 2010 14:49:09 +0000</updated>
                    <resolved>Tue, 16 Mar 2010 14:42:02 +0000</resolved>
                                            <fixVersion>1.2.2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12290" author="jwage" created="Tue, 16 Mar 2010 14:49:09 +0000"  >&lt;p&gt;I meant to comment on this. We could possibly include this in a 1.2.x version, it is not that straight forward of a fix tho. If you can provide a BC patch we can consider including it. Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>