<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu May 23 13:51:01 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+AND+resolution+%3D+Unresolved+AND+component+is+EMPTY+ORDER+BY+priority+DESC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DC+AND+resolution+%3D+Unresolved+AND+component+is+EMPTY+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="98" total="98"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-1021] i am executing doctrine type query i am geting error  please gave me reply</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1021</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$query = new Doctrine_Query();&lt;br/&gt;
$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,c.country_id,c.country_name&apos;)&lt;br/&gt;
//$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,ea.Country&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;Entities e&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.EntityAddresses ea ON ea.entity_id = e.entity_id AND ea.address_type =&quot;M&quot;&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ea.Country c ON ea.country = c.country_id&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.ActiveFactories s&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;e.status=1&apos;);&lt;br/&gt;
if(!empty($alpha))&lt;br/&gt;
{&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;e.entity_name like &apos;&quot;.$alpha.&quot;%&apos;&quot;);&lt;br/&gt;
}&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;s.company_id=&quot;.$parentId)&lt;br/&gt;
-&amp;gt;andWhere(&quot;e.entity_type=2&quot;)&lt;br/&gt;
-&amp;gt;andWhere(&apos;s.status=1&apos;)&lt;br/&gt;
-&amp;gt;groupBy(&apos;e.entity_id&apos;);&lt;/p&gt;</description>
                <environment>windows ,wamp,php</environment>
            <key id="12849">DC-1021</key>
            <summary>i am executing doctrine type query i am geting error  please gave me reply</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rajani">cherukuri</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Jul 2011 15:05:33 +0000</created>
                <updated>Sun, 24 Jul 2011 15:05:33 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-962] Broken logic when doctrine translates limit&apos;s into subqueries, with joins. (with patch)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-962</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Problem exists when Doctrine formulates a subquery to perform a limit when a join in included.&lt;/p&gt;

&lt;p&gt;The problem is that the where clause that doctrine creates for the subquery (the WHERE IN clause) is inserted as the first where clause.&lt;br/&gt;
This will break the parameter duplicate done at Doctrine_Query_Abstract:969, as the order of the parameters is now wrong.&lt;/p&gt;

&lt;p&gt;Consider:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
select * from table
join metadata WITH c = ?
where a = ? and b = ?
limit 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;with parameters be (1, 2, 3)&lt;/p&gt;

&lt;p&gt;Doctrine will translate this to&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
select * from table
join metadata WITH c = ?
where table.id IN (
    select id from table
    join metadata WITH c = ?
    where a = ? and b = ?
    limit 1
)
and a = ? and b = ?
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Doctrine will duplicate the params (Doctrine_Query_Abstract:969) to (1, 2, 3, 1, 2, 3), but now they are in the wrong order completely.&lt;br/&gt;
They should be (1,1,2,3,2,3).&lt;/p&gt;

&lt;p&gt;The easy fix is to move the limit subquery to the LAST where clause, which would reuslt in a query like so:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
select * from table
join metadata WITH c = ?
where a = ? and b = ?
and table.id IN (
    select id from table
    join metadata WITH c = ?
    where a = ? and b = ?
    limit 1
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Attached is a patch to fix this issue, along with a patch that fixes all unit tests referring to the old query format.&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="12347">DC-962</key>
            <summary>Broken logic when doctrine translates limit&apos;s into subqueries, with joins. (with patch)</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ben.davies">Ben Davies</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 10:11:22 +0000</created>
                <updated>Wed, 2 Feb 2011 10:19:59 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15207" author="ben.davies" created="Wed, 2 Feb 2011 10:19:59 +0000"  >&lt;p&gt;upping to blocker since this breaks very basic queries&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10926" name="Query.php.patch" size="1381" author="ben.davies" created="Wed, 2 Feb 2011 10:11:22 +0000" />
                    <attachment id="10927" name="Tests.patch" size="17500" author="ben.davies" created="Wed, 2 Feb 2011 10:11:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1025] Doctrine is unable to handle table names with spaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1025</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When trying to query a table which contains spaces I get the following exception&lt;/p&gt;

&lt;p&gt;I have attached an simple example to reproduce&lt;/p&gt;


&lt;p&gt;C:\Documents and Settings\daniel\Dokumenter\NetBeansProjects\test&amp;gt;php doctrineTest.php&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Query_Exception&apos; with message &apos;Unknown table alias with&apos; in C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php:856&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 C:\Doctrine-1.2.3\Doctrine\Query.php(1022): Doctrine_Query_Abstract-&amp;gt;getComponentAlias(&apos;with&apos;)&lt;br/&gt;
#1 C:\Doctrine-1.2.3\Doctrine\Query.php(1239): Doctrine_Query-&amp;gt;_buildSqlFromPart()&lt;br/&gt;
#2 C:\Doctrine-1.2.3\Doctrine\Query.php(1133): Doctrine_Query-&amp;gt;buildSqlQuery(true)&lt;br/&gt;
#3 C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php(958): Doctrine_Query-&amp;gt;getSqlQuery(Array)&lt;br/&gt;
#4 C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php(1026): Doctrine_Query_Abstract-&amp;gt;_execute(Array)&lt;br/&gt;
#5 C:\Documents and Settings\daniel\Dokumenter\NetBeansProjects\test\doctrineTest.php(18): Doctrine_Query_Abstract-&amp;gt;execute()&lt;br/&gt;
#6 &lt;/p&gt;
{main}
&lt;p&gt;  thrown in C:\Doctrine-1.2.3\Doctrine\Query\Abstract.php on line 856&lt;/p&gt;</description>
                <environment>PHP Version 5.2.14&lt;br/&gt;
Apache 2&lt;br/&gt;
MySQL&lt;br/&gt;
Windows Xp</environment>
            <key id="12892">DC-1025</key>
            <summary>Doctrine is unable to handle table names with spaces</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sajbar">Daniel Borg</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Aug 2011 07:43:13 +0000</created>
                <updated>Tue, 2 Aug 2011 10:37:03 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11041" name="doctrineTest.php" size="509" author="sajbar" created="Tue, 2 Aug 2011 07:43:14 +0000" />
                    <attachment id="11042" name="tbl.php" size="810" author="sajbar" created="Tue, 2 Aug 2011 07:43:14 +0000" />
                    <attachment id="11043" name="tbl_1.php" size="234" author="sajbar" created="Tue, 2 Aug 2011 07:43:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1040] allow queries with table joins across different databases</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1040</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m currently working on a project which relies upon several databases declared in databases.yml in symfony 1.4.8.&lt;/p&gt;

&lt;p&gt;I was facing an issue that has already been raised by other people, namely that you can&apos;t join tables which reference each other among different mysql databases.&lt;/p&gt;

&lt;p&gt;I&apos;ve dug a bit in the Doctrine_Query class and came to a solution that is acceptable for us, and allows now to make joins accross databases. Description follows :&lt;/p&gt;

&lt;p&gt;first change is in the Doctrine_Core class, that gets stuffed with a new constant :&lt;br/&gt;
const ATTR_DATABASE_NAME                = 0x1DB;&lt;/p&gt;

&lt;p&gt;this constant allows us to add a new attribute to the databases.yml file as in :&lt;br/&gt;
  gesdoc:&lt;br/&gt;
    class: sfDoctrineDatabase&lt;br/&gt;
    param:&lt;br/&gt;
      dsn:      mysql:host=127.0.0.1;dbname=gesdoc&lt;br/&gt;
      username: root&lt;br/&gt;
      password: &lt;br/&gt;
      attributes:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;************* NEW ATTRIBUTE BELOW ************&lt;br/&gt;
        database_name: gesdoc&lt;br/&gt;
        default_table_collate: utf8_general_ci&lt;br/&gt;
        default_table_charset: utf8&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;after that, a few changes have been done in the Doctrine_Query class which is attached to this issue for the sake of readability.&lt;/p&gt;

&lt;p&gt;This may not be optimal, and probably need some regression testing, but it is currently working fine on our test server.&lt;/p&gt;

&lt;p&gt;after this is done, I was able to issue queries like the following :&lt;br/&gt;
    $x = DocumentTable::getInstance()-&amp;gt;createQuery(&apos;d&apos;)&lt;br/&gt;
                                     -&amp;gt;distinct()&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;d.Travail t&apos;)&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;t.CdcIndInt ci&apos;)&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;ci.CdcIndExt ce&apos;)&lt;br/&gt;
                                     -&amp;gt;leftJoin(&apos;ce.Cahierdescharge cdc&apos;)&lt;br/&gt;
                                     -&amp;gt;where(&apos;cdc.cdc_chro = ?&apos;, $cdc_chro)&lt;br/&gt;
                                    -&amp;gt;addWhere(&apos;d.id != ?&apos;, $document_id)&lt;br/&gt;
                                    -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;where the referenced tables are in different databases. The necessary object binding has been done in every model class following the paradigm :&lt;/p&gt;

&lt;p&gt;Doctrine_Manager::getInstance()-&amp;gt;bindComponent(&apos;CdcIndInt &apos;, &apos;gescdc&apos;);&lt;br/&gt;
abstract class BaseCdcIndInt extends sfDoctrineRecord&lt;br/&gt;
{&lt;br/&gt;
...&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;I don&apos;t know if this description is clear enough, so let me know if something is missing/wrong.&lt;/p&gt;</description>
                <environment>Windows XP SP3, Apache 2, PHP 5.3, MySQL 5.1.36, Symfony 1.4.8, Doctrine 1.2.3</environment>
            <key id="13198">DC-1040</key>
            <summary>allow queries with table joins across different databases</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fabrice.agnello">Fabrice Agnello</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Nov 2011 14:42:03 +0000</created>
                <updated>Thu, 17 Nov 2011 14:42:03 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11111" name="Query.php" size="86043" author="fabrice.agnello" created="Thu, 17 Nov 2011 14:42:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-701] Aggregates functions do not return proper values when using many relationships and limits</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-701</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi All&lt;/p&gt;

&lt;p&gt;I have encountered a problem that seems very core to the way that doctrine works &amp;#8211; if you apply an aggregate function to a column in a table and then join to another table via a many relationship while also using a limit, like so:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$q = Doctrine_Query::create();
$q-&amp;gt;from(&apos;Customer Customer&apos;); 
$q-&amp;gt;addSelect(&apos;COUNT(Customer.id) as COUNT_customer_id&apos;);
$q-&amp;gt;addSelect(&apos;Customer_Order.id as order_id&apos;); 
$q-&amp;gt;leftJoin(&apos;Customer.Order Customer_Order&apos;); &lt;span class=&quot;code-comment&quot;&gt;// Many relationship here
&lt;/span&gt;$q-&amp;gt;limit(20);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It produces this correct DQL:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT COUNT(Customer.id) as COUNT_customer_id, Customer_Order.id as order_id 
FROM Customer Customer 
  LEFT JOIN Customer.Order Customer_Order 
LIMIT 20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However the SQL it produces will not return an accurate count &amp;#8211; the count is restricted by the limit:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT COUNT(p.id) AS p__0, p2.id AS p2__1 
FROM product_customers p 
  LEFT JOIN product_orders p2 ON p.id = p2.customer_id 
WHERE p.id IN (&apos;1&apos;, &apos;2&apos;, &apos;3&apos;, &apos;4&apos;, &apos;5&apos;, &apos;6&apos;, &apos;7&apos;, &apos;8&apos;, &apos;9&apos;, &apos;10&apos;, &apos;11&apos;, &apos;12&apos;, &apos;13&apos;, &apos;14&apos;, &apos;15&apos;, &apos;16&apos;, &apos;17&apos;, &apos;18&apos;, &apos;19&apos;, &apos;20&apos;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This produces a count of 21 instead of what it should be (1000).&lt;/p&gt;

&lt;p&gt;The reason for this is because Doctrine&apos;s internal functionality does an intermediary query where it gets gets the ids needed from the customer table in order to use them as the IN portion of the constraints on the final query &amp;#8211; like so:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT DISTINCT p3.id FROM product_customers p3 LIMIT 20
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It may seem strange that I am applying a limit to a query which will aggregate to 1 to row . In the actual queries that alerted me to this problem I am using a group by. The reason I am not reporting this bug with a group by in my example however is that you can not use a group by with a many relationship and a limit in doctrine 1.2.2 as it works currently (see bug: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-594&quot; title=&quot;When using a combination of: a group by field referencing a table in a relation, a join to a different table via a many type relation and a limit clause, doctrine creates a broken query then throws an exception&quot;&gt;&lt;del&gt;DC-594&lt;/del&gt;&lt;/a&gt;). However I am personally able to use a limit with a group by and many relationship since I am using a version of the code I patched my self to repair bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-594&quot; title=&quot;When using a combination of: a group by field referencing a table in a relation, a join to a different table via a many type relation and a limit clause, doctrine creates a broken query then throws an exception&quot;&gt;&lt;del&gt;DC-594&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is my sample schema in case its helpful.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;detect_relations: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;: Example
options:
  type: INNODB
  charset: utf8
Order:
  tableName: orders
  columns:
    order_id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    customer_id:
      type: integer(4)
    order_date: timestamp
  relations:
    Customer:
      type: one
      local: customer_id
      foreign: customer_id
  options:
    type: InnoDB
Customer:
  tableName: customers
  columns:
    customer_id:
      type: integer(4)
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    firstname:
      type: string(45)
    lastname:
      type: string(45)
    streetaddress:
      type: string(45)
    city:
      type: string(45)
    state:
      type: string(45)
    postalcode:
      type: string(45)
  relations:
    Order:
      type: many
      local: customer_id
      foreign: customer_id
  options:
    type: InnoDB
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks much.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;

&lt;p&gt;&lt;sub&gt;edit: split SQL code to make the discussion readable without huge horizontal scrolling...&lt;/sub&gt;&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="11409">DC-701</key>
            <summary>Aggregates functions do not return proper values when using many relationships and limits</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 May 2010 20:28:27 +0000</created>
                <updated>Mon, 1 Nov 2010 20:12:17 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13153" author="jwage" created="Tue, 8 Jun 2010 10:27:47 +0000"  >&lt;p&gt;Is this still a problem? I am not sure if this can be patched easily. The limit subquery algorithm is flawed deeply but also a core part of the current way Doctrine 1 works.&lt;/p&gt;</comment>
                    <comment id="13237" author="willf1976" created="Tue, 8 Jun 2010 19:06:56 +0000"  >&lt;p&gt;Hi Jon&lt;/p&gt;

&lt;p&gt;This bug is still an issue for me but I think it may be VERY hard to patch since it seems very core to the way Doctrine 1 works.&lt;/p&gt;

&lt;p&gt;The project I am working on at the moment is a visual query builder that is highly reliant on Doctrine. In order to prevent users from making queries that would trigger this bug I am currently giving an alert when ever a query that would trigger this bug is created.&lt;/p&gt;

&lt;p&gt;It would be great if this were patchable but if not I should be able to get by.&lt;/p&gt;

&lt;p&gt;Does Doctrine 2 fix this problem?&lt;/p&gt;

&lt;p&gt;Thanks for the help.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</comment>
                    <comment id="13240" author="jwage" created="Tue, 8 Jun 2010 20:34:37 +0000"  >&lt;p&gt;In Doctrine 2 the limit subquery algorithm does not exist. It is now up to the developer to write the query to handle the scenario instead of Doctrine &quot;trying&quot; to automate it for you. Since the situation where it is needed it is so rare, and each case can be slightly different it is better to let the developer handle it in those cases.&lt;/p&gt;</comment>
                    <comment id="13241" author="willf1976" created="Tue, 8 Jun 2010 21:07:17 +0000"  >&lt;p&gt;Hi Jon&lt;/p&gt;

&lt;p&gt;Does that mean that Doctrine 2 can no longer intelligently handle limits with many relationships, and doesn&apos;t have the ability to hydrate a return with sub arrays in it for many relationships?&lt;/p&gt;

&lt;p&gt;Thanks again for your help.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</comment>
                    <comment id="13256" author="jwage" created="Wed, 9 Jun 2010 13:06:48 +0000"  >&lt;p&gt;That is correct. We do not automatically try and limit the relationships with a &quot;limit subquery&quot; as it causes more problems then it helps.&lt;/p&gt;</comment>
                    <comment id="13265" author="willf1976" created="Thu, 10 Jun 2010 05:05:53 +0000"  >&lt;p&gt;Hi Jon&lt;/p&gt;

&lt;p&gt;I was thinking about what you said here &amp;#8211; that the &quot;limit subquery&quot; causes more harm than good. It occur to me that I really do like being able to use this method (it comes in very handy very often) but some times it would really help to be able to turn it off (the bug in this thread is a good example such a time). So I figured why not just make an option to turn it off and have the best of both worlds? I looked at the code and found it was really very easy to put in a property which can be set on the query object to enable or disable the use of the limit subquery.&lt;/p&gt;

&lt;p&gt;I made the change in my code base and found it very useful for several situations I was dealing with in my own project.&lt;/p&gt;

&lt;p&gt;The one thing I couldn&apos;t do is make a test case for this new feature &amp;#8211; I couldn&apos;t find an existing test case that was actually triggering the limit subquery as I understood it to work (I couldn&apos;t find a test case that would put an WHERE IN constraint with all the ids gathered in the limit subquery.  I tried some test cases that I THOUGHT would activate this feature but it didn&apos;t seem that they did).&lt;/p&gt;

&lt;p&gt;After adding this feature to my code base I also wanted a new hydrator &amp;#8211; one that worked like scalar but would put in array key names that were the same as the ones you would see in HYDRATE_ARRAY. I noticed that HYDRATE_SCALAR already had the ability to do this but it required that a value of false be passed into the $aliasPrefix argument of the _gatherRowData function. I made a custom hydrator I call HYDRATE_ARRAY_SHALLOW that passes in this false value. I then realized this might be handy to add to doctrine so I integrated it into my code base and made a few test cases for it.&lt;/p&gt;

&lt;p&gt;There are 2 patches I am now attaching this to thread:&lt;/p&gt;

&lt;p&gt;disableLimitSubquery_2010-06-10_Doctrine_1.2_SVN.patch &amp;#8211; this patch adds the disableLimitSubquery property to query objects so that users can turn off the use of the subquery for those times when they don&apos;t want to use that behavior (fixing the bug in this thread and probably others)&lt;/p&gt;

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

&lt;p&gt;disableLimitSubquery_and_HYDRATE_ARRAY_SHALLOW_2010-06-10_Doctrine_1.2_SVN.patch &amp;#8211; this is the same as the first patch but also contains the HYDRATE_ARRAY_SHALLOW hydration type I mentioned above (which tends to go well with disableLimitSubquery turned on).&lt;/p&gt;

&lt;p&gt;I put these in 2 patches incase you liked 1 feature but disliked the other.&lt;/p&gt;

&lt;p&gt;If you like either of this features I would be very happy to see them added to doctrine.&lt;/p&gt;

&lt;p&gt;Also if you have any advice on how to improve these features (or info on how to make a good test case for disableLimitSubquery) please let me know.&lt;/p&gt;

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

&lt;p&gt;Will Ferrer&lt;/p&gt;</comment>
                    <comment id="13266" author="willf1976" created="Thu, 10 Jun 2010 05:07:31 +0000"  >&lt;p&gt;Reopened because I added a patch that I think in essence fixes the issues.&lt;/p&gt;</comment>
                    <comment id="14221" author="jwage" created="Wed, 1 Sep 2010 14:09:17 +0000"  >&lt;p&gt;Thanks for the issue and patches.&lt;/p&gt;

&lt;p&gt;Fixed here &lt;a href=&quot;http://github.com/doctrine/doctrine1/commit/2ad78e62e360133efc04bf6897bf679c7f3d833b&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/commit/2ad78e62e360133efc04bf6897bf679c7f3d833b&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14228" author="willf1976" created="Wed, 1 Sep 2010 19:24:16 +0000"  >&lt;p&gt;individual patch for this issue with out other features included&lt;/p&gt;</comment>
                    <comment id="14655" author="willf1976" created="Mon, 1 Nov 2010 20:11:40 +0000"  >&lt;p&gt;adding test cases for these features&lt;/p&gt;</comment>
                    <comment id="14656" author="willf1976" created="Mon, 1 Nov 2010 20:12:17 +0000"  >&lt;p&gt;reopened because I posted some test cases to add to doctrine along with the patchs previously posted&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10835" name="DC_701_adds_disbaleLimitSubquery_testcase.patch" size="2398" author="willf1976" created="Mon, 1 Nov 2010 20:11:40 +0000" />
                    <attachment id="10836" name="DC_701_adds_hydrateArrayShallow_testcase.patch" size="2117" author="willf1976" created="Mon, 1 Nov 2010 20:11:40 +0000" />
                    <attachment id="10767" name="DC_701_fix_adds_arrayShallow.patch" size="7909" author="willf1976" created="Wed, 1 Sep 2010 19:24:16 +0000" />
                    <attachment id="10766" name="DC_701_fix_adds_disableLimitSubQuery.patch" size="2267" author="willf1976" created="Wed, 1 Sep 2010 19:24:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-932] Queries fail when a model contains underscore and we try to apply a limit</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-932</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Actually, I&apos;ve a dead simple schema.yml, with two tables:&lt;/p&gt;

&lt;p&gt;T_Media:&lt;br/&gt;
    actAs:&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
    columns:&lt;br/&gt;
        media_id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;        name: string(25)&lt;/p&gt;


&lt;p&gt;J_Acl:&lt;br/&gt;
    columns:&lt;br/&gt;
        media_id: integer&lt;br/&gt;
    relations:&lt;br/&gt;
        Media: &lt;/p&gt;
{ class: T_Media, local: media_id, foreign: media_id, onDelete: CASCADE }


&lt;p&gt;I have some fixtures:&lt;br/&gt;
T_Media:&lt;br/&gt;
    m1:&lt;br/&gt;
        name: foobar&lt;/p&gt;

&lt;p&gt;J_Acl:&lt;br/&gt;
    a1:&lt;br/&gt;
        Media: m1&lt;/p&gt;

&lt;p&gt;And then, the DQL query I want to execute:&lt;/p&gt;

&lt;p&gt;&quot;From T_Media m INNER JOIN m.J_Acl order by m.created_at limit 1&quot;&lt;/p&gt;

&lt;p&gt;But if I run this query, for instance in CLI, I got an error:&lt;br/&gt;
./symfony doctrine:dql &quot;From T_Media m INNER JOIN m.J_Acl order by m.created_at limit 1&quot;&lt;/p&gt;


&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S02&amp;#93;&lt;/span&gt;: Base table or view not found: 1146 Table &apos;test_noel.t2__media&apos; doesn&apos;t exist.&lt;br/&gt;
Failing Query: &quot;SELECT DISTINCT t2.media_id FROM t2_&lt;em&gt;media t2 INNER JOIN j2&lt;/em&gt;_acl j2 ON t2.media_id = j2.media_id ORDER BY t2.created_at LIMIT 1&quot;&lt;/p&gt;

&lt;p&gt;Notes: &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the query works if I do not apply the limit clause.&lt;/li&gt;
	&lt;li&gt;if I remove the underscore from the model, or if I set manually the tableName to remove the double underscore, it works&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>Doctrine 1.2, Symfony 1.4.6, MySQL, Postgresql</environment>
            <key id="12125">DC-932</key>
            <summary>Queries fail when a model contains underscore and we try to apply a limit</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="noel">Noel GUILBERT</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2010 08:47:27 +0000</created>
                <updated>Fri, 19 Nov 2010 08:47:27 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1058] Warning: Invalid argument supplied for foreach() in SqlWalker.php line 899</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1058</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hallo, i get the error&lt;br/&gt;
Warning: Invalid argument supplied for foreach() in /var/www/phverbose/vendor/doctrine/Doctrine/ORM/Query/SqlWalker.php line 899&lt;/p&gt;

&lt;p&gt;Here is the line&lt;br/&gt;
foreach ($assoc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relationToTargetKeyColumns&amp;#39;&amp;#93;&lt;/span&gt; as $relationColumn =&amp;gt; $targetColumn) {&lt;/p&gt;

&lt;p&gt;Here are the relations and the query&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/4352511&quot; class=&quot;external-link&quot;&gt;http://pastie.org/4352511&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/4352498&quot; class=&quot;external-link&quot;&gt;http://pastie.org/4352498&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the dump of $assoc before warning&lt;/p&gt;


&lt;p&gt;array(16) {&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;fieldName&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(5) &quot;sites&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;joinTable&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  array(0) {&lt;br/&gt;
  }&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;targetEntity&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(13) &quot;Entities\Site&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;mappedBy&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(6) &quot;emails&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;inversedBy&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  NULL&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;cascade&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  array(1) &lt;/p&gt;
{
    [0]=&amp;gt;
    string(7) &quot;persist&quot;
  }
&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;orphanRemoval&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;fetch&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  int(2)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;type&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  int(8)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isOwningSide&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;sourceEntity&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  string(14) &quot;Entities\Email&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeRemove&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadePersist&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(true)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeRefresh&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeMerge&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;isCascadeDetach&amp;quot;&amp;#93;&lt;/span&gt;=&amp;gt;&lt;br/&gt;
  bool(false)&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>Linux, Ubuntu 12, php 5.4</environment>
            <key id="13891">DC-1058</key>
            <summary>Warning: Invalid argument supplied for foreach() in SqlWalker.php line 899</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="alexanderc">Alexander Cucer</reporter>
                        <labels>
                        <label>paginator</label>
                    </labels>
                <created>Sun, 29 Jul 2012 09:44:56 +0000</created>
                <updated>Sun, 29 Jul 2012 09:44:56 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1052] limit() get lost on multiple joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1052</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$strSql = UserFeedTable::getInstance()&lt;del&gt;&amp;gt;createQuery(&apos;q&apos;)&lt;/del&gt;&amp;gt;&lt;br/&gt;
                select(&apos;q.&lt;b&gt;, f.&lt;/b&gt;, fi.&lt;b&gt;, fav.&lt;/b&gt;&apos;)-&amp;gt;&lt;br/&gt;
                leftJoin(&apos;q.Feed f&apos;)-&amp;gt;&lt;br/&gt;
                leftJoin(&apos;f.FeedItem fi&apos;)-&amp;gt;&lt;br/&gt;
                leftJoin(&apos;fi.Favorite fav&apos;)-&amp;gt;&lt;br/&gt;
                andWhere(&apos;q.profile_id = ?&apos;, $intUserId)-&amp;gt;&lt;br/&gt;
                andWhere(&apos;q.is_active = ?&apos;, true)-&amp;gt;&lt;br/&gt;
                limit(10)-&amp;gt;getSqlQuery();&lt;br/&gt;
var_dump($strSql);&lt;/p&gt;

&lt;p&gt;string(1075) &quot;SELECT u.id AS u_&lt;em&gt;id, u.name AS u&lt;/em&gt;&lt;em&gt;name, u.image AS u&lt;/em&gt;&lt;em&gt;image, u.lead AS u&lt;/em&gt;&lt;em&gt;lead, u.headline AS u&lt;/em&gt;&lt;em&gt;headline, u.sort AS u&lt;/em&gt;&lt;em&gt;sort, u.is_active AS u&lt;/em&gt;&lt;em&gt;is_active, u.is_favorite AS u&lt;/em&gt;&lt;em&gt;is_favorite, u.feed_id AS u&lt;/em&gt;&lt;em&gt;feed_id, u.profile_id AS u&lt;/em&gt;&lt;em&gt;profile_id, u.category_id AS u&lt;/em&gt;&lt;em&gt;category_id, u.created_at AS u&lt;/em&gt;&lt;em&gt;created_at, u.updated_at AS u&lt;/em&gt;&lt;em&gt;updated_at, f.id AS f&lt;/em&gt;&lt;em&gt;id, f.url AS f&lt;/em&gt;&lt;em&gt;url, f.name AS f&lt;/em&gt;&lt;em&gt;name, f.created_at AS f&lt;/em&gt;&lt;em&gt;created_at, f.updated_at AS f&lt;/em&gt;&lt;em&gt;updated_at, f2.id AS f2&lt;/em&gt;&lt;em&gt;id, f2.lead AS f2&lt;/em&gt;&lt;em&gt;lead, f2.description AS f2&lt;/em&gt;&lt;em&gt;description, f2.image AS f2&lt;/em&gt;&lt;em&gt;image, f2.pub_date AS f2&lt;/em&gt;&lt;em&gt;pub_date, f2.link AS f2&lt;/em&gt;&lt;em&gt;link, f2.feed_id AS f2&lt;/em&gt;&lt;em&gt;feed_id, f2.created_at AS f2&lt;/em&gt;&lt;em&gt;created_at, f2.updated_at AS f2&lt;/em&gt;&lt;em&gt;updated_at, f3.id AS f3&lt;/em&gt;&lt;em&gt;id, f3.profile_id AS f3&lt;/em&gt;&lt;em&gt;profile_id, f3.feed_item_id AS f3&lt;/em&gt;&lt;em&gt;feed_item_id, f3.created_at AS f3&lt;/em&gt;&lt;em&gt;created_at, f3.updated_at AS f3&lt;/em&gt;_updated_at FROM user_feed u LEFT JOIN feed f ON u.feed_id = f.id LEFT JOIN feed_item f2 ON f.id = f2.feed_id LEFT JOIN favorite f3 ON f2.id = f3.feed_item_id WHERE u.id IN (&apos;7&apos;, &apos;8&apos;, &apos;9&apos;, &apos;10&apos;, &apos;11&apos;) AND (u.profile_id = ? AND u.is_active = ?)&quot;&lt;/p&gt;

&lt;p&gt;As you can see, the limit is missing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13543">DC-1052</key>
            <summary>limit() get lost on multiple joins</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="kempf-solutions">Michael Kempf</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Mar 2012 13:37:12 +0000</created>
                <updated>Tue, 20 Mar 2012 13:37:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-690] Wrong data type for oracle integer</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-690</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Trying to migrate from doctrine 1 to 1.2 and this problem came up to me, i cant map a column to integer(7) (which should create a number(7) column)  using Oracle, he always create a NUMBER(20) field.&lt;/p&gt;

&lt;p&gt;Taking a look at Doctrine_DataDict_Oracle i realize the problem is here.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11384">DC-690</key>
            <summary>Wrong data type for oracle integer</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="dead_thinker">Arian Maykon de Ara&#250;jo Di&#243;genes</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 May 2010 10:06:23 +0000</created>
                <updated>Tue, 8 Jun 2010 11:05:38 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13162" author="jwage" created="Tue, 8 Jun 2010 11:05:38 +0000"  >&lt;p&gt;We made a bunch of changes/fixes related to oracle. This was to fix another bug I believe. I can&apos;t remember the user that is responsible for these changes. Does anyone else remember or know anything?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-802] Alias in select and having</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-802</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;i have query&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;select(&apos;g.&lt;b&gt;,gp.&lt;/b&gt;,st.&lt;b&gt;,np.&lt;/b&gt;,v.&lt;b&gt;,s.&lt;/b&gt;,max(gp.card_date) as md&apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;gragdans as g&apos;)&lt;br/&gt;
            -&amp;gt;innerJoin(&apos;g.Pribs_ gp&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;gp.Streets_ st&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;gp.Viddocs_ v&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;gp.Sobits_ s&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;st.Npunkts_ np&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;g.grid in &apos;.$idlst,1)&lt;br/&gt;
            -&amp;gt;orderby(&apos;fam&apos;)&lt;br/&gt;
            -&amp;gt;having(&apos;gp.card_date=md&apos;);&lt;/p&gt;

&lt;p&gt;When it runs i have error:&lt;/p&gt;

&lt;p&gt;&amp;lt;b&amp;gt;Fatal error&amp;lt;/b&amp;gt;:  Uncaught exception&lt;br/&gt;
&apos;Doctrine_Connection_Mysql_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;:&lt;br/&gt;
Column not found: 1054 Unknown column &apos;md&apos; in &apos;having clause&apos;&apos; in Z:&lt;br/&gt;
\home\new\www\system\application\plugins\doctrine\lib\Doctrine&lt;br/&gt;
\Connection.php:1082&lt;/p&gt;

&lt;p&gt;SQL for it looks like:&lt;/p&gt;

&lt;p&gt;SELECT g.grid AS g_&lt;em&gt;grid, g.fam AS g&lt;/em&gt;&lt;em&gt;fam, g.nam AS g&lt;/em&gt;_nam, g.otc AS&lt;br/&gt;
g_&lt;em&gt;otc, g.date_rogd AS g&lt;/em&gt;&lt;em&gt;date_rogd, g.gosgrid AS g&lt;/em&gt;_gosgrid,&lt;br/&gt;
g.rogd_place AS g_&lt;em&gt;rogd_place, g.pol AS g&lt;/em&gt;_pol, g.reg_date AS&lt;br/&gt;
g_&lt;em&gt;reg_date, g.deesp AS g&lt;/em&gt;&lt;em&gt;deesp, p.pribid AS p&lt;/em&gt;_pribid, p.grid AS&lt;br/&gt;
p_&lt;em&gt;grid, p.strid AS p&lt;/em&gt;&lt;em&gt;strid, p.hom AS p&lt;/em&gt;&lt;em&gt;hom, p.cor AS p&lt;/em&gt;_cor, p.kva&lt;br/&gt;
AS p_&lt;em&gt;kva, p.reg_date AS p&lt;/em&gt;&lt;em&gt;reg_date, p.vidid AS p&lt;/em&gt;_vidid, p.pas_ser&lt;br/&gt;
AS p_&lt;em&gt;pas_ser, p.pas_no AS p&lt;/em&gt;&lt;em&gt;pas_no, p.org_name AS p&lt;/em&gt;_org_name,&lt;br/&gt;
p.pas_date AS p_&lt;em&gt;pas_date, p.sobid AS p&lt;/em&gt;_sobid, p.reg_expire AS&lt;br/&gt;
p_&lt;em&gt;reg_expire, p.card_date AS p&lt;/em&gt;&lt;em&gt;card_date, s.strid AS s&lt;/em&gt;_strid,&lt;br/&gt;
s.npid AS s_&lt;em&gt;npid, s.name AS s&lt;/em&gt;&lt;em&gt;name, v.vidid AS v&lt;/em&gt;_vidid, v.name AS&lt;br/&gt;
v_&lt;em&gt;name, s2.sobid AS s2&lt;/em&gt;&lt;em&gt;sobid, s2.cod_s AS s2&lt;/em&gt;_cod_s, s2.cod_oi AS&lt;br/&gt;
s2_&lt;em&gt;cod_oi, s2.name AS s2&lt;/em&gt;&lt;em&gt;name, n.npid AS n&lt;/em&gt;&lt;em&gt;npid, n.name AS n&lt;/em&gt;_name,&lt;br/&gt;
n.sid AS n_&lt;em&gt;sid, MAX(p.card_date) AS p&lt;/em&gt;_0 FROM gragdans g INNER JOIN&lt;br/&gt;
prib p ON g.grid = p.grid LEFT JOIN streets s ON p.strid = s.strid&lt;br/&gt;
LEFT JOIN viddoc v ON p.vidid = v.vidid LEFT JOIN sobit s2 ON p.sobid&lt;br/&gt;
= s2.sobid LEFT JOIN npunkt n ON s.npid = n.npid WHERE (g.grid in (4,&lt;br/&gt;
13, 19, 20)) HAVING p.card_date=md ORDER BY g.fam&lt;/p&gt;

&lt;p&gt;But i need Query looks like:&lt;/p&gt;

&lt;p&gt;SELECT g.grid AS g_&lt;em&gt;grid, g.fam AS g&lt;/em&gt;&lt;em&gt;fam, g.nam AS g&lt;/em&gt;_nam, g.otc AS&lt;br/&gt;
g_&lt;em&gt;otc, g.date_rogd AS g&lt;/em&gt;&lt;em&gt;date_rogd, g.gosgrid AS g&lt;/em&gt;_gosgrid,&lt;br/&gt;
g.rogd_place AS g_&lt;em&gt;rogd_place, g.pol AS g&lt;/em&gt;_pol, g.reg_date AS&lt;br/&gt;
g_&lt;em&gt;reg_date, g.deesp AS g&lt;/em&gt;&lt;em&gt;deesp, p.pribid AS p&lt;/em&gt;_pribid, p.grid AS&lt;br/&gt;
p_&lt;em&gt;grid, p.strid AS p&lt;/em&gt;&lt;em&gt;strid, p.hom AS p&lt;/em&gt;&lt;em&gt;hom, p.cor AS p&lt;/em&gt;_cor, p.kva&lt;br/&gt;
AS p_&lt;em&gt;kva, p.reg_date AS p&lt;/em&gt;&lt;em&gt;reg_date, p.vidid AS p&lt;/em&gt;_vidid, p.pas_ser&lt;br/&gt;
AS p_&lt;em&gt;pas_ser, p.pas_no AS p&lt;/em&gt;&lt;em&gt;pas_no, p.org_name AS p&lt;/em&gt;_org_name,&lt;br/&gt;
p.pas_date AS p_&lt;em&gt;pas_date, p.sobid AS p&lt;/em&gt;_sobid, p.reg_expire AS&lt;br/&gt;
p_&lt;em&gt;reg_expire, p.card_date AS p&lt;/em&gt;&lt;em&gt;card_date, s.strid AS s&lt;/em&gt;_strid,&lt;br/&gt;
s.npid AS s_&lt;em&gt;npid, s.name AS s&lt;/em&gt;&lt;em&gt;name, v.vidid AS v&lt;/em&gt;_vidid, v.name AS&lt;br/&gt;
v_&lt;em&gt;name, s2.sobid AS s2&lt;/em&gt;&lt;em&gt;sobid, s2.cod_s AS s2&lt;/em&gt;_cod_s, s2.cod_oi AS&lt;br/&gt;
s2_&lt;em&gt;cod_oi, s2.name AS s2&lt;/em&gt;&lt;em&gt;name, n.npid AS n&lt;/em&gt;&lt;em&gt;npid, n.name AS n&lt;/em&gt;_name,&lt;br/&gt;
n.sid AS n__sid, MAX(p.card_date) AS md FROM gragdans g INNER JOIN&lt;br/&gt;
prib p ON g.grid = p.grid LEFT JOIN streets s ON p.strid = s.strid&lt;br/&gt;
LEFT JOIN viddoc v ON p.vidid = v.vidid LEFT JOIN sobit s2 ON p.sobid&lt;br/&gt;
= s2.sobid LEFT JOIN npunkt n ON s.npid = n.npid WHERE (g.grid in (4,&lt;br/&gt;
13, 19, 20)) group by fam HAVING p.card_date=md&lt;/p&gt;

&lt;p&gt;This query run fine and give me what i need.&lt;/p&gt;

&lt;p&gt;Doctrine dont use &apos;md&apos; alias instead it convert it to &apos;p__0&apos; &lt;/p&gt;</description>
                <environment>Windows XP sp3 </environment>
            <key id="11692">DC-802</key>
            <summary>Alias in select and having</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="skyranger">Vasiliy Altunin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 22:39:58 +0000</created>
                <updated>Sat, 7 Aug 2010 15:39:30 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-747] Sequence name of build process is different to the one used in UnitOfWorks (based on DC521 with updated TestCase) </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-747</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&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;</description>
                <environment>doctrine 1.2.4, symfony 1.4, snow leopard, php 5.3.1, postgresql 8.3</environment>
            <key id="11512">DC-747</key>
            <summary>Sequence name of build process is different to the one used in UnitOfWorks (based on DC521 with updated TestCase) </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="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 05:56:12 +0000</created>
                <updated>Thu, 17 Jun 2010 06:47:38 +0000</updated>
                                    <version>1.2.3</version>
                <version>1.2.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13351" author="enrico" created="Thu, 17 Jun 2010 06:25:45 +0000"  >&lt;p&gt;Here is the test updated with the current ticket number.&lt;/p&gt;</comment>
                    <comment id="13352" author="enrico" created="Thu, 17 Jun 2010 06:37:36 +0000"  >&lt;p&gt;Updated. Now it should work/not work as expected.&lt;/p&gt;</comment>
                    <comment id="13353" author="enrico" created="Thu, 17 Jun 2010 06:47:38 +0000"  >&lt;p&gt;This isn&apos;t a blocker anymore because of the workaround i&apos;ve found.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;remove autoincrement&lt;/li&gt;
	&lt;li&gt;add sequence name manually&lt;/li&gt;
&lt;/ul&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, sequence: authority_a_id }
&lt;p&gt;name: &lt;/p&gt;
{ type: string }</comment>
                </comments>
                    <attachments>
                    <attachment id="10665" name="DC747TestCase.php" size="2827" author="enrico" created="Thu, 17 Jun 2010 06:37:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-921] The ability to add WITH ROLLUP to a group by in a query</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-921</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I figured it would be handy to have a WITH ROLLUP be add able to the group by clause.&lt;/p&gt;

&lt;p&gt;I added this feature but I can&apos;t post the patch because my patches are starting to run together - the syntax with in the generated patch would also contain parts of other patches I have posted to jira but have not yet been included in the doctrine svn.&lt;/p&gt;

&lt;p&gt;I still wanted to make this post because it will give me a ticket number to base my test cases around.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP XAMP</environment>
            <key id="12084">DC-921</key>
            <summary>The ability to add WITH ROLLUP to a group by in a query</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Nov 2010 04:04:29 +0000</created>
                <updated>Thu, 18 Nov 2010 03:19:47 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14699" author="willf1976" created="Tue, 9 Nov 2010 22:29:28 +0000"  >&lt;p&gt;In order to illustrate what this patch fixes I am posting my test case for the patch below&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;AS IS&quot;&lt;/span&gt; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * &amp;lt;http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org&amp;gt;.
&lt;/span&gt; */

/**
 * Doctrine_Ticket_DC921_TestCase
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
 * @author      Will Ferrer
 * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt; * @category    &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; Relational Mapping
 * @link        www.doctrine-project.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Ticket_DC921_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase 
{
  
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testAggregateValueMappingSupportsLeftJoinsWithRollUp()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();

        $q-&amp;gt;select(&apos;MAX(u.name), u.*, p.*&apos;)-&amp;gt;from(&apos;User u&apos;)-&amp;gt;leftJoin(&apos;u.Phonenumber p&apos;)-&amp;gt;groupby(&apos;u.id&apos;);
		$q-&amp;gt;setWithRollUp(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP&apos;);
    }

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14773" author="willf1976" created="Thu, 18 Nov 2010 03:19:47 +0000"  >&lt;p&gt;I have updated my implemenation of this feature. Here is the new test case:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&amp;lt;?php
/*
 *  $Id$
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * &lt;span class=&quot;code-quote&quot;&gt;&quot;AS IS&quot;&lt;/span&gt; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * &amp;lt;http:&lt;span class=&quot;code-comment&quot;&gt;//www.doctrine-project.org&amp;gt;.
&lt;/span&gt; */

/**
 * Doctrine_Ticket_DC921_TestCase
 *
 * @&lt;span class=&quot;code-keyword&quot;&gt;package&lt;/span&gt;     Doctrine
 * @author      Will Ferrer
 * @license     http:&lt;span class=&quot;code-comment&quot;&gt;//www.opensource.org/licenses/lgpl-license.php LGPL
&lt;/span&gt; * @category    &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; Relational Mapping
 * @link        www.doctrine-project.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Ticket_DC921_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase 
{
  
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testAggregateValueMappingSupportsLeftJoinsWithRollUp()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();

        $q-&amp;gt;select(&apos;MAX(u.name), u.*, p.*&apos;)-&amp;gt;from(&apos;User u&apos;)-&amp;gt;leftJoin(&apos;u.Phonenumber p&apos;)-&amp;gt;groupby(&apos;u.id&apos;);
		$q-&amp;gt;withRollUp();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &apos;SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP&apos;);
    }
	
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testAggregateValueMappingSupportsLeftJoinsWithRollUpDql()
    {
        $q = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Query();
        $q-&amp;gt;parseDqlQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP&quot;&lt;/span&gt;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getSqlQuery(), &apos;SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id, p.id AS p__id, p.phonenumber AS p__phonenumber, p.entity_id AS p__entity_id, MAX(e.name) AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0) GROUP BY e.id WITH ROLLUP&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($q-&amp;gt;getDql(), &apos;SELECT MAX(u.name), u.*, p.* FROM User u LEFT JOIN u.Phonenumber p GROUP BY u.id WITH ROLLUP&apos;);
    }
	
	


}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-968] I18n and PostgreSQL and DmVersionable</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-968</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using PHP 5.3.2 and PostgreSQL 8.4.5, Diem passed all checks in green - OK.&lt;/p&gt;

&lt;p&gt;I started with &quot;A week of Diem Ipsum&quot; and all went ok until I reached building of blog engine. Blog engine example fails in step: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;php symfony doctrine:migrate&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with error message:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;The following errors occurred:

    * SQLSTATE[42830]: Invalid foreign key: 7 ERROR: there is no unique constraint matching given keys &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; referenced table &lt;span class=&quot;code-quote&quot;&gt;&quot;article_translation&quot;&lt;/span&gt;. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;ALTER TABLE article_translation_version ADD CONSTRAINT article_translation_version_id_article_translation_id FOREIGN KEY (id) REFERENCES article_translation(id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_image ON article (image)&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_author ON article (author)&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_translation_id ON article_translation (id)&quot;&lt;/span&gt;
    * SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: &lt;span class=&quot;code-quote&quot;&gt;&quot;CREATE INDEX article_translation_version_id ON article_translation_version (id)&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I removed i18n support in blog engine example and after that migrate went ok. But in Admin interface when I wanted to add&lt;br/&gt;
blog article, although Diem confirmed it saved article, article would not show up in the list, I checked db table, it was empty also.&lt;br/&gt;
Further, if I try to loremize, for 1 fixture I get no error but table is again empty, and for more fixtures then 1, Diem reports error:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Again I reviewed the model and removed DmVersionable, migrated again and after that I could loremize or create articles without errors.&lt;/p&gt;

&lt;p&gt;Additionally, not related directly to this blog engine example but doctrine related, I noticed errors in Diem Admin interface&lt;br/&gt;
itself when I try to access System-&amp;gt;Configuration-&amp;gt;Settings . If I access System settings over link &lt;br/&gt;
admin_dev.php/system/configuration/settings/index it shows settings. But when I click on &lt;br/&gt;
dmin_dev.php/system/configuration in menu path and after again to settings &lt;br/&gt;
admin_dev.php/system/configuration/settings/index, error is generated:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;500 | Internal Server Error | Doctrine_Connection_Pgsql_Exception
SQLSTATE[08P01]: &amp;lt;&amp;gt;: 7 ERROR: bind message supplies 1 parameters, but prepared statement &lt;span class=&quot;code-quote&quot;&gt;&quot;pdo_stmt_00000008&quot;&lt;/span&gt; requires 2&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;Are this bugs corrected?&lt;/p&gt;


</description>
                <environment>PHP 5.3.2, PostgreSQL 8.4.5, Diem 5.1.x</environment>
            <key id="12061">DC-968</key>
            <summary>I18n and PostgreSQL and DmVersionable</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sasha">Sasha</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Nov 2010 04:39:37 +0000</created>
                <updated>Tue, 15 Feb 2011 15:39:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12054">DC-911</key>
            <summary>A way of checking if a model has been loaded via the loaded loadModels method</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Nov 2010 20:17:39 +0000</created>
                <updated>Tue, 2 Nov 2010 20:23:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14660" author="willf1976" created="Tue, 2 Nov 2010 20:18:33 +0000"  >&lt;p&gt;Changed the name of the method to modelLoaded (seemed more appropriate)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10844" name="DC_911_fix.patch" size="2676" author="willf1976" created="Tue, 2 Nov 2010 20:23:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-904] Doctrine_Query (execute / fetchOne) memory leak</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-904</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve created new symfony 1.4.8 project:&lt;/p&gt;

&lt;p&gt;$ ./symfony -V&lt;br/&gt;
symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib)&lt;/p&gt;

&lt;p&gt;$ php -v&lt;br/&gt;
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies&lt;br/&gt;
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans&lt;/p&gt;

&lt;p&gt;and set the database schema as follows:&lt;/p&gt;

&lt;p&gt;$ cat config/doctrine/schema.yml &lt;br/&gt;
Example:&lt;br/&gt;
  columns:&lt;br/&gt;
    col1: string(255)&lt;br/&gt;
    col2: string(255)&lt;br/&gt;
    col3: string(255)&lt;br/&gt;
    col4: string(255)&lt;br/&gt;
    col5: string(255)&lt;br/&gt;
    col6: string(255)&lt;/p&gt;

&lt;p&gt;I created a task that contains a Doctrine_query call &lt;/p&gt;

&lt;p&gt;(...)&lt;br/&gt;
protected function execute($arguments = array(), $options = array())&lt;br/&gt;
{&lt;br/&gt;
  // initialize the database connection&lt;br/&gt;
  $databaseManager = new sfDatabaseManager($this-&amp;gt;configuration);&lt;br/&gt;
  $connection = $databaseManager-&amp;gt;getDatabase($options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;connection&amp;#39;&amp;#93;&lt;/span&gt;)-&amp;gt;getConnection();&lt;/p&gt;

&lt;p&gt;  while(1)&lt;br/&gt;
  {&lt;br/&gt;
    $m = xdebug_memory_usage();&lt;br/&gt;
    $q = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;from(&apos;Example&apos;);&lt;br/&gt;
    $o = $q-&amp;gt;fetchOne();&lt;/p&gt;

&lt;p&gt;    if (false !== $o))&lt;/p&gt;
    {
      $o-&amp;gt;free(true);
    }
&lt;p&gt;    unset($q, $o);&lt;/p&gt;

&lt;p&gt;    printf(&quot;Delta: %s Value: %s\n&quot;, &lt;br/&gt;
        xdebug_memory_usage()-$m,&lt;br/&gt;
        xdebug_memory_usage()&lt;br/&gt;
    );&lt;br/&gt;
  }&lt;br/&gt;
}&lt;br/&gt;
(...)&lt;/p&gt;

&lt;p&gt;Unfortunately, memory usage is increasing:&lt;br/&gt;
./symfony leak&lt;br/&gt;
Delta: 3285264 Value: 10651596&lt;br/&gt;
Delta: 12944 Value: 10664448&lt;br/&gt;
Delta: 12952 Value: 10677308&lt;br/&gt;
Delta: 12932 Value: 10690148&lt;br/&gt;
Delta: 12932 Value: 10702988&lt;br/&gt;
Delta: 12932 Value: 10715828&lt;br/&gt;
Delta: 12932 Value: 10728668&lt;br/&gt;
Delta: 12932 Value: 10741508&lt;br/&gt;
Delta: 12932 Value: 10754348&lt;br/&gt;
Delta: 12932 Value: 10767188&lt;/p&gt;

&lt;p&gt;Tested with and without data in database - result is the same.&lt;/p&gt;</description>
                <environment>$ ./symfony -V&lt;br/&gt;
symfony version 1.4.8 (/home/marcin.dryka/htdocs/leak/lib/vendor/symfony/lib)&lt;br/&gt;
&lt;br/&gt;
$ php -v&lt;br/&gt;
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55) &lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans&lt;br/&gt;
&lt;br/&gt;
Ubuntu Server (lucid)</environment>
            <key id="12042">DC-904</key>
            <summary>Doctrine_Query (execute / fetchOne) memory leak</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drymek">Marcin Dryka</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Oct 2010 09:24:05 +0000</created>
                <updated>Fri, 3 Dec 2010 02:51:53 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>3</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14892" author="stc6895" created="Fri, 3 Dec 2010 01:18:50 +0000"  >&lt;p&gt;i found this bug too.&lt;/p&gt;

&lt;p&gt;$rcs = $query-&amp;gt;execute(array(),\Doctrine_Core::HYDRATE_ON_DEMAND);&lt;br/&gt;
		$query-&amp;gt;free();&lt;br/&gt;
		//write to new table&lt;br/&gt;
		foreach ($rcs as $rc)&lt;/p&gt;
{
			$new = $table-&amp;gt;create($rc-&amp;gt;toArray());
			$new-&amp;gt;save();
			$new-&amp;gt;free(true); //free memory
			$rc-&amp;gt;free(true);
		}

&lt;p&gt;hydrate not cause memory leak&lt;/p&gt;

&lt;p&gt;bug hydrate record will cause leak&lt;/p&gt;

&lt;p&gt;so iterate Doctrine_collection will cause memory leak&lt;/p&gt;
</comment>
                    <comment id="14893" author="drymek" created="Fri, 3 Dec 2010 02:51:53 +0000"  >&lt;p&gt;Changing hydration doesn&apos;t work for me. Same result for:&lt;br/&gt;
HYDRATE_ON_DEMAND&lt;br/&gt;
HYDRATE_RECORD&lt;br/&gt;
HYDRATE_ARRAY&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-875] One-to-many relationship returns Doctrine_Record instead of Doctrine_Collection</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-875</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve run into a bit of a snag in my application where a relationship defined as a one-to-many relationship returns a model object (instance of Doctrine_Record) instead of a Doctrine_Collection when I try to access it as $model-&amp;gt;RelatedComponent[] = $child1. This, of course, yields an exception like so:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Doctrine_Exception: Add is not supported for AuditLogProperty&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#0 path\library\Doctrine\Access.php(131): Doctrine_Access-&amp;gt;add(Object(AuditLogProperty))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#1 path\application\models\Article.php(58): Doctrine_Access-&amp;gt;offsetSet(NULL, Object(AuditLogProperty))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#2 path\library\Doctrine\Record.php(354): Article-&amp;gt;postInsert(Object(Doctrine_Event))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#3 path\library\Doctrine\Connection\UnitOfWork.php(576): Doctrine_Record-&amp;gt;invokeSaveHooks(&apos;post&apos;, &apos;insert&apos;, Object(Doctrine_Event))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#4 path\library\Doctrine\Connection\UnitOfWork.php(81): Doctrine_Connection_UnitOfWork-&amp;gt;insert(Object(Article))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#5 path\library\Doctrine\Record.php(1718): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(Article))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#6 path\application\modules\my-page\controllers\ArticleController.php(26): Doctrine_Record-&amp;gt;save()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#7 path\library\Zend\Controller\Action.php(513): MyPage_ArticleController-&amp;gt;createAction()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#8 path\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action-&amp;gt;dispatch(&apos;createAction&apos;)&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#9 path\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(Zend_Controller_Request_Http),&lt;/tt&gt; &lt;tt&gt;Object(Zend_Controller_Response_Http))&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#10 path\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front-&amp;gt;dispatch()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#11 path\library\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()&lt;/tt&gt;&lt;br/&gt;
    &lt;tt&gt;#12 path\public\index.php(11): Zend_Application-&amp;gt;run()&lt;/tt&gt;&lt;br/&gt;
    {{#13 &lt;/p&gt;
{main}
&lt;p&gt;}}&lt;/p&gt;

&lt;p&gt;This is what my yaml-schema looks like (excerpt):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;AuditLogEntry:
  tableName: audit_log_entries
  actAs:
    Timestampable:
      updated: {disabled: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
  columns:
    user_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    type: {type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    mode: {type: string(16)}
    article_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    comment_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    question_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    answer_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    message_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
  indexes:
#   Must index autoincrementing id-column since it&apos;s a compound primary key and 
#   the auto-incrementing column is not the first column and we use InnoDB.
    id: {fields: [id]}
    type: {fields: [type, mode]}
  relations:
    User:
      local: user_id
      foreign: user_id
      foreignAlias: AuditLogs
      type: one
      onDelete: CASCADE
      onUpdate: CASCADE
AuditLogProperty:
  tableName: audit_log_properties
  columns:
    auditlog_id: {type: integer(8), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    prop_id: {type: integer(2), unsigned: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: 1}
    name: {type: string(255), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}
    value: {type: string(1024)}
  relations:
    AuditLogEntry:
      local: auditlog_id
      foreign: id
      type: one
      foreignType: many
      foreignAlias: Properties
      onDelete: CASCADE
      onUpdate: CASCADE
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, if we look at the generated class-files, it looks fine:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;/**
 * @property integer $user_id
 * @property integer $id
 * @property string $type
 * @property string $mode
 * @property integer $article_id
 * @property integer $comment_id
 * @property integer $question_id
 * @property integer $answer_id
 * @property integer $message_id
 * @property integer $news_comment_id
 * @property User $User
 * @property Doctrine_Collection $Properties
 * @property Doctrine_Collection $Notifications
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseAuditLogEntry &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record

/**
 * @property integer $auditlog_id
 * @property integer $prop_id
 * @property string $name
 * @property string $value
 * @property AuditLogEntry $AuditLogEntry
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class BaseAuditLogProperty &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, when I later try to add properties I get the exception posted in the beginning of the question:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;$auditLog = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AuditLogEntry();
$prop1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AuditLogProperty();
$prop1-&amp;gt;name = &apos;title&apos;;
$prop1-&amp;gt;value = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;Content-&amp;gt;title;
$prop2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AuditLogProperty();
$prop2-&amp;gt;name = &apos;length&apos;;
$prop2-&amp;gt;value = count($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;Content-&amp;gt;plainText);
$auditLog-&amp;gt;Properties[] = $prop1;
$auditLog-&amp;gt;Properties[] = $prop2;
$auditLog-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If I do the following:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;var_dump(get_class($auditLog-&amp;gt;Properties));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I get that &lt;em&gt;Properties&lt;/em&gt; is of type &lt;em&gt;AuditLogProperty&lt;/em&gt;, instead of &lt;em&gt;Doctrine&amp;#95;Collection&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I use version 1.2.3 of Doctrine.&lt;/p&gt;</description>
                <environment>WAMP:&lt;br/&gt;
Windows 7 - 64bit&lt;br/&gt;
Apache 2.2&lt;br/&gt;
PHP 5.3.1&lt;br/&gt;
MySQL 5.1.41</environment>
            <key id="11965">DC-875</key>
            <summary>One-to-many relationship returns Doctrine_Record instead of Doctrine_Collection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="patrik.akerstrand">Patrik &#197;kerstrand</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Sep 2010 08:22:37 +0000</created>
                <updated>Wed, 14 Sep 2011 23:01:49 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16476" author="twencl" created="Wed, 14 Sep 2011 23:01:49 +0000"  >&lt;p&gt;I am having the same issue and it is killing my application. Using your example, when I call:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;var_dump(get_class($auditLog-&amp;gt;Properties));&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;... and there are no AuditLogProperty records, I would expect either an empty Doctrine_Collection or null, but instead I get a new instance of AuditLogProperty with null values for the properties. &lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-869] calling getLastModified() after saving the object without any modifications returns the last modified fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-869</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;_resetModified() function in Record.php fails to reset $this-&amp;gt;_lastModified the second time the object is saved. &lt;/p&gt;
</description>
                <environment>symfony-1.4.6</environment>
            <key id="11930">DC-869</key>
            <summary>calling getLastModified() after saving the object without any modifications returns the last modified fields</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="artworx">Keszeg Alexandru</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Sep 2010 09:02:08 +0000</created>
                <updated>Fri, 17 Sep 2010 09:02:08 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-866] Bug In Debian &quot;Can&apos;t parse dsn..&quot;!</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-866</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;config dsn: sqlite:///root/db3.db&lt;/p&gt;

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

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

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

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

&lt;p&gt;but in debian it will be fail.&lt;/p&gt;</description>
                <environment>Debian4  PHP 5.3.1</environment>
            <key id="11915">DC-866</key>
            <summary>Bug In Debian &quot;Can&apos;t parse dsn..&quot;!</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="stc6895">sonic wang</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Sep 2010 07:44:46 +0000</created>
                <updated>Wed, 15 Sep 2010 09:10:03 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-856] Doctrine_Core::getPath() not working when inside phar, due to a bug in php</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-856</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It seems that there is a bug in php, and realpath doesn&apos;t work when path is inside of phar archive.&lt;br/&gt;
function Doctrine_Core::getPath()&lt;br/&gt;
        if ( ! self::$_path) &lt;/p&gt;
{
          self::$_path = realpath(dirname(__FILE__) . &apos;/..&apos;);
        }

&lt;p&gt;can be easily changed to &lt;br/&gt;
        if ( ! self::$_path) &lt;/p&gt;
{
          self::$_path = dirname(dirname(__FILE__));
        }</description>
                <environment></environment>
            <key id="11877">DC-856</key>
            <summary>Doctrine_Core::getPath() not working when inside phar, due to a bug in php</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mvrhov">Miha Vrhovnik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Sep 2010 06:36:39 +0000</created>
                <updated>Tue, 4 Jan 2011 06:19:21 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15105" author="ishtanzar" created="Tue, 4 Jan 2011 06:19:21 +0000"  >&lt;p&gt;&lt;a href=&quot;http://bugs.php.net/bug.php?id=52769&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/bug.php?id=52769&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-854] having not work as expected and described</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-854</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;    $this-&amp;gt;q1 = Doctrine_Query::create()&lt;br/&gt;
      -&amp;gt;select(&apos;m.questionaire&apos;)&lt;br/&gt;
      -&amp;gt;addSelect(&apos;m.aszero&apos;)&lt;br/&gt;
      -&amp;gt;addSelect(&apos;COUNT(f.id) as bref&apos;)&lt;br/&gt;
      -&amp;gt;from(&apos;machine m&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;m.relations r ON r.machine_id=m.id&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;r.ref f ON f.id=r.ref_id AND f.part_number LIKE &quot;B%&quot;&apos;)&lt;br/&gt;
      -&amp;gt;groupBy(&apos;m.questionaire&apos;)&lt;br/&gt;
      -&amp;gt;having(&apos;bref=0&apos;)&lt;br/&gt;
    ;&lt;br/&gt;
is producing &lt;/p&gt;

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


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

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

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

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

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

&lt;p&gt;I use symfony 1.4 and not sure if doctrine is 1...&lt;/p&gt;</description>
                <environment></environment>
            <key id="11871">DC-854</key>
            <summary>having not work as expected and described</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="malutanpetronel">Petronel MALUTAN</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Sep 2010 06:48:13 +0000</created>
                <updated>Thu, 2 Sep 2010 06:48:13 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

</description>
                <environment></environment>
            <key id="11859">DC-850</key>
            <summary>Error  in Doctrine method execute() </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 18:38:10 +0000</created>
                <updated>Tue, 31 Aug 2010 18:41:31 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14205" author="jwage" created="Tue, 31 Aug 2010 18:41:31 +0000"  >&lt;p&gt;Can you provide some more information?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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


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

&lt;p&gt;How to use in such a case ?&lt;/p&gt;</description>
                <environment>Symfony 1.4 </environment>
            <key id="11865">DC-853</key>
            <summary>I am using symfony 1.4</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="malutanpetronel">Petronel MALUTAN</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Sep 2010 11:27:20 +0000</created>
                <updated>Thu, 2 Sep 2010 14:58:05 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14226" author="jwage" created="Wed, 1 Sep 2010 14:48:22 +0000"  >&lt;p&gt;What is the SQL: syntax you are using here? That is definitely not something that is &quot;supported&quot;&lt;/p&gt;</comment>
                    <comment id="14230" author="malutanpetronel" created="Thu, 2 Sep 2010 03:39:50 +0000"  >&lt;p&gt;Dear Jonathan&lt;/p&gt;

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<item>
            <title>[DC-844] DataDict for MySQL excludes the possibility to have an actual floating point column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-844</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Extracted from Doctrine/DataDict/Mysql.php:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;Mysql.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&apos;:
                $length = !empty($field[&apos;length&apos;]) ? $field[&apos;length&apos;] : 18;
                $scale = !empty($field[&apos;scale&apos;]) ? $field[&apos;scale&apos;] : $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;FLOAT(&apos;.$length.&apos;, &apos;.$scale.&apos;)&apos;;
            &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; &apos;&lt;span class=&quot;code-object&quot;&gt;double&lt;/span&gt;&apos;:
                $length = !empty($field[&apos;length&apos;]) ? $field[&apos;length&apos;] : 18;
                $scale = !empty($field[&apos;scale&apos;]) ? $field[&apos;scale&apos;] : $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;If the user does not specify length and decimal places, MySQL creates a floating point number. However Doctrine behavior forces FLOATs and DOUBLEs to be fixed-width.&lt;/p&gt;</description>
                <environment>Not environment dependent</environment>
            <key id="11835">DC-844</key>
            <summary>DataDict for MySQL excludes the possibility to have an actual floating point column</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rgonzalez">Roberto Gonz&#225;lez</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2010 05:46:47 +0000</created>
                <updated>Fri, 27 Aug 2010 05:46:47 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1024] i am executing </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1024</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$query = new Doctrine_Query();&lt;br/&gt;
					$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,c.country_id,c.country_name&apos;)    &lt;br/&gt;
						  //$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,ea.Country&apos;)&lt;br/&gt;
						  -&amp;gt;from(&apos;Entities e&apos;)&lt;br/&gt;
						  -&amp;gt;leftJoin(&apos;e.EntityAddresses ea ON ea.entity_id = e.entity_id AND ea.address_type =&quot;M&quot;&apos;)&lt;br/&gt;
						 -&amp;gt;leftJoin(&apos;ea.Country c ON ea.country = c.country_id&apos;)&lt;br/&gt;
						  -&amp;gt;leftJoin(&apos;e.ActiveFactories s&apos;)&lt;br/&gt;
						  -&amp;gt;where(&apos;e.status=1&apos;);&lt;br/&gt;
						  if(!empty($alpha))&lt;/p&gt;
						  {	
							$query-&amp;gt;andWhere(&quot;e.entity_name like &apos;&quot;.$alpha.&quot;%&apos;&quot;);
						  }
&lt;p&gt;						  $query-&amp;gt;andWhere(&quot;s.company_id=&quot;.$parentId)&lt;br/&gt;
						  -&amp;gt;andWhere(&quot;e.entity_type=2&quot;)&lt;br/&gt;
						  -&amp;gt;andWhere(&apos;s.status=1&apos;)&lt;br/&gt;
						  -&amp;gt;groupBy(&apos;e.entity_id&apos;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="12844">DC-1024</key>
            <summary>i am executing </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rajani">cherukuri</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Jul 2011 15:07:21 +0000</created>
                <updated>Tue, 26 Jul 2011 20:35:33 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1002] Typos in filename and php tags</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1002</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Two typos in Doctrine files prevents usage of symfony core_compile.yml system, or any similar compiler system :&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;According to its class name, &quot;Doctrine_Validator_HtmlColor&quot;, the file &quot;Doctrine/Validator/Htmlcolor.php&quot;, should be named &quot;HtmlColor.php&quot; (note the uppercase &quot;C&quot; of &quot;Color&quot;)&lt;/li&gt;
	&lt;li&gt;The php tag of the file &quot;Doctrine/Locking/Exception.php&quot; is uppercased. It should be &quot;&amp;lt;?php&quot; instead of &quot;&amp;lt;?PHP&quot;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12610">DC-1002</key>
            <summary>Typos in filename and php tags</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nervo">nervo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 May 2011 22:35:32 +0000</created>
                <updated>Mon, 2 May 2011 22:35:32 +0000</updated>
                                    <version>1.2.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-966] Default Order By incorrectly propagating to relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-966</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Symfony Version 1.4.9 ORM: Doctrine&lt;/p&gt;

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

&lt;p&gt;Table1:&lt;br/&gt;
    actAs:&lt;br/&gt;
        Timestampable: ~&lt;br/&gt;
    options:&lt;br/&gt;
        orderBy: sort_order ASC&lt;br/&gt;
    columns:&lt;br/&gt;
        name: &lt;/p&gt;
{ string(255), notnull: true }
&lt;p&gt; sort_order: &lt;/p&gt;
{ string(255), notnull: true }

&lt;p&gt;Table2:&lt;br/&gt;
    columns:&lt;br/&gt;
        table1_id: &lt;/p&gt;
{ integer, notnull: true }
&lt;p&gt; value: &lt;/p&gt;
{ string(255), notnull: true }
&lt;p&gt;    relations:&lt;br/&gt;
        Table1: &lt;/p&gt;
{ local: table1_id, foreign: id, foreignAlias: Table2 }

&lt;p&gt;This generates models and I can see the following: BaseTable?1.class.php: $this-&amp;gt;option(&apos;sort_order&apos;, &apos;sort_order ASC&apos;);&lt;/p&gt;

&lt;p&gt;BaseTable?2.class.php: No option for sort_order&lt;/p&gt;

&lt;p&gt;But when I run the following, I get errors: Doctine::getTable(&apos;Table1&apos;)&lt;del&gt;&amp;gt;createQuery(&apos;t&apos;)&lt;/del&gt;&amp;gt;leftJoin(&apos;t.Table2 t2&apos;).execute();&lt;/p&gt;

&lt;p&gt;Error: Column not found: 1054 Unknown column &apos;t2.sort_order&apos; in &apos;order clause&apos;&lt;/p&gt;

&lt;p&gt;Looking at the sql executed, it included t1.sort_order ASC, but also incorrectly added t2.sort_order ASC as well even though it was never defined anywhere.&lt;/p&gt;

&lt;p&gt;I am unsure if this is a Doctrine problem or a symfony one, so I will post i on both bug tracking systems. &lt;/p&gt;</description>
                <environment>Windows 7 WAMP, PHP 5.3, MySQL 5.1.36, Apache 2.2.11</environment>
            <key id="12381">DC-966</key>
            <summary>Default Order By incorrectly propagating to relations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="f00dmonsta">Jason Yang</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Feb 2011 02:20:27 +0000</created>
                <updated>Sat, 12 Feb 2011 02:20:27 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-957] MSSQL doctrine inner join group by problem</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-957</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#group-by,-having-clauses&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/dql-doctrine-query-language/en#group-by,-having-clauses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
    -&amp;gt;select(&apos;u.username&apos;)&lt;br/&gt;
    -&amp;gt;addSelect(&apos;COUNT(p.id) as num_phonenumbers&apos;)&lt;br/&gt;
    -&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
    -&amp;gt;leftJoin(&apos;u.Phonenumbers p&apos;)&lt;br/&gt;
    -&amp;gt;groupBy(&apos;u.id&apos;);&lt;/p&gt;

&lt;p&gt;SELECT &lt;br/&gt;
u.id AS u__id, &lt;br/&gt;
u.username AS u__username, &lt;br/&gt;
COUNT(p.id) AS p__0 &lt;br/&gt;
FROM user u &lt;br/&gt;
LEFT JOIN phonenumber p ON u.id = p.user_id &lt;br/&gt;
GROUP BY u.id&lt;/p&gt;

&lt;p&gt;i should create&lt;/p&gt;

&lt;p&gt;SELECT &lt;br/&gt;
COUNT(p.id) AS p__0 &lt;br/&gt;
FROM user u &lt;br/&gt;
LEFT JOIN phonenumber p ON u.id = p.user_id &lt;br/&gt;
GROUP BY u.id&lt;/p&gt;


&lt;p&gt;MSSQL doesnt support this use of group by sql. Id have to be in aggregrate function or  group by.  I do not need id but doctrine creates it in sql.&lt;/p&gt;

&lt;p&gt;&quot;invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.&quot;&lt;/p&gt;</description>
                <environment>mssql, doctrine 1.2.3 , symfony</environment>
            <key id="12313">DC-957</key>
            <summary>MSSQL doctrine inner join group by problem</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mehmetuysal">Mehmet Uysal</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Jan 2011 16:28:24 +0000</created>
                <updated>Thu, 20 Jan 2011 16:28:24 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-954] tinyint(1) with default value in schema.yml generates blank default value, gives SQLSTATE[42000]</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-954</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;doing a &lt;br/&gt;
doctrine:build --all --and-load&lt;br/&gt;
with a schema.yml of&lt;/p&gt;

&lt;p&gt;Foo:&lt;br/&gt;
  tableName: foo&lt;br/&gt;
  options:&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    bar:&lt;br/&gt;
      type: tinyint(1)&lt;br/&gt;
      default: 0&lt;/p&gt;

&lt;p&gt;results in a blank value generated for the default keyword, and the following error:&lt;/p&gt;

&lt;p&gt;  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos; PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB&apos; at line 1. Failing Query: &quot;CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB&quot;. Failing Query: CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB &lt;/p&gt;

&lt;p&gt;I&apos;ve also tried combinations of tinyint, tinyint(4), single-quoting the default value, and different default values.&lt;/p&gt;

&lt;p&gt;Changing the type to int makes the issue disappear&lt;/p&gt;</description>
                <environment>Win7 64-bit&lt;br/&gt;
Netbeans 6.9.1&lt;br/&gt;
Symfony 1.4.8</environment>
            <key id="12288">DC-954</key>
            <summary>tinyint(1) with default value in schema.yml generates blank default value, gives SQLSTATE[42000]</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="bluescrubbie">Colin Stuart</reporter>
                        <labels>
                    </labels>
                <created>Sun, 9 Jan 2011 13:41:36 +0000</created>
                <updated>Sun, 9 Jan 2011 15:13:04 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-953] Doctrine fails when using link() on OneToMany because of failing save</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-953</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have continually run into a very particular bug when using OneToMany relationships between Doctrine tables. When attempting to call &quot;link()&quot; to generate a relationship between records in related tables, Doctrine attempts to set the ID of the &quot;one&quot; portion of the record to 0, then save it.&lt;/p&gt;

&lt;p&gt;This is best demonstrated by the sample YML and PHP that I have attached. It establishes a OneToMany relationship where the &quot;one&quot; table has another foreign key constraint. This causes the DB to trigger a foreign key constraint error when Doctrine tries to set the ID to 0, making the error easier to see.&lt;/p&gt;

&lt;p&gt;From looking into the relevant sections of the codebase, the following appears to be happening:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Calling &quot;link&quot; properly adds the relationship to the &quot;many&quot; record.&lt;/li&gt;
	&lt;li&gt;Calling &quot;save&quot; triggers the saving of the &quot;many&quot; record and all associated records.&lt;/li&gt;
	&lt;li&gt;With the &quot;one&quot; record now listed as an associated record, its own &quot;save&quot; function is called as a result.&lt;/li&gt;
	&lt;li&gt;Its &quot;save&quot; function works properly, except that for some reason, the ID key is not present in the $_data internal array (but oddly is present in the $_id array, allowing it to be returned in other places).&lt;/li&gt;
	&lt;li&gt;Seeing a difference, Doctrine attempts to execute an &quot;UPDATE&quot; query setting the ID to 0.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;ve made it this far in looking into it, but for the life of me I can&apos;t figure out what is triggering the identifier being reset in this case. I should note, however, that it happens consistently in every such situation on every server I&apos;ve tested it on.&lt;/p&gt;</description>
                <environment>PHP 5.2.10, MySQL database connection</environment>
            <key id="12279">DC-953</key>
            <summary>Doctrine fails when using link() on OneToMany because of failing save</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="slvreagle23">Buster Neece</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Jan 2011 20:47:27 +0000</created>
                <updated>Tue, 4 Jan 2011 21:43:39 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15107" author="slvreagle23" created="Tue, 4 Jan 2011 21:43:39 +0000"  >&lt;p&gt;Further research into the issue has revealed the exact area where the problem is being caused:&lt;/p&gt;

&lt;p&gt;Doctrine_Collection (272): Function &quot;setReference&quot;, called from Doctrine_Relation_ForeignKey (80).&lt;/p&gt;

&lt;p&gt;For each of the elements in the collection (in this case, the related items), that function is setting the &quot;reference field&quot; value to the record being related to. Apparently, it&apos;s getting the field names confused, because it&apos;s overwriting &quot;id&quot; with a reference to the entire related object, which has a different ID.&lt;/p&gt;

&lt;p&gt;I can&apos;t tell if this is only an issue when both the relation tables use the same identifier (&quot;id&quot;), but this is surely common enough to warrant a fix.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10903" name="test.php" size="408" author="slvreagle23" created="Tue, 4 Jan 2011 20:47:27 +0000" />
                    <attachment id="10904" name="test.yml" size="1162" author="slvreagle23" created="Tue, 4 Jan 2011 20:47:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-951] Error in generating the field size and error in the generation of the date fields  for postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-951</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;collaboration of vtamara@pasosdejesus.org    and  jeronimo0000@gmail.com           &lt;/p&gt;


&lt;p&gt;While we developed a tool with symfony 1.4 and postgresql database we found errors in the generated schema.yml which I describe below&lt;/p&gt;

&lt;p&gt;1 - Error in generating of field size of varchars&lt;br/&gt;
2 - Error in the generation of date fields&lt;/p&gt;

&lt;p&gt;We found the following solution&lt;/p&gt;


&lt;p&gt;&amp;#8212; Doctrine/Import/Pgsql.php.orig      2010-12-23 17:48:00.160271000 -0500&lt;br/&gt;
+++ Doctrine/Import/Pgsql.php   2010-12-23 18:01:59.252271002 -0500&lt;br/&gt;
@@ -168,11 +168,14 @@&lt;br/&gt;
         $columns     = array();&lt;br/&gt;
         foreach ($result as $key =&amp;gt; $val) {&lt;br/&gt;
             $val = array_change_key_case($val, CASE_LOWER);&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if (strtolower($val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt;) === &apos;character varying&apos;) {&lt;br/&gt;
+            if (strtolower($val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt;) === &apos;varchar&apos;) 
{
                 // get length from varchar definition
                 $length = preg_replace(&apos;~.*\(([0-9]*)\).*~&apos;, &apos;$1&apos;, $val[&apos;complete_type&apos;]);
                 $val[&apos;length&apos;] = $length;
             }
&lt;p&gt;+           if ($val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;type&amp;#39;&amp;#93;&lt;/span&gt; == &apos;date&apos;) &lt;/p&gt;
{
+               $val[&apos;type&apos;] = $val[&apos;complete_type&apos;] = &apos;timestamp&apos;; 
+            }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;             $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val);&lt;/p&gt;





</description>
                <environment>apacha2, linux, Symfony 1.4</environment>
            <key id="12252">DC-951</key>
            <summary>Error in generating the field size and error in the generation of the date fields  for postgres</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Dec 2010 12:16:23 +0000</created>
                <updated>Fri, 24 Dec 2010 12:16:23 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-942] fromArray makes unnessesary cals to database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-942</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I do toArray(true) on record with realtions and later fromArray($array, true) on with same data unnessesary calls to database are made.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$message = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Message();
$message-&amp;gt;Sender = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User(); &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; i leave out &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; line sender will first get loaded from database and then overwritten with provided data
&lt;/span&gt;$message-&amp;gt;Receiver = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();   &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; i leave out &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; line receiver will first get loaded from database and then overwritten with provided data
&lt;/span&gt;$message-&amp;gt;fromArray($data);

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

&lt;p&gt;In Doctrine_Record::fromArray()&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($deep &amp;amp;&amp;amp; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getTable()-&amp;gt;hasRelation($key)) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$key) {                                           --&amp;gt; data gets loaded from db here, refreshRelated is not even executed.
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;refreshRelated($key);
    }
...
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this desired behavour? Wouldnt it be smarter to create empty object automaticly instead of loading it from db?&lt;br/&gt;
Also have look at &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1434&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/ticket/1434&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12187">DC-942</key>
            <summary>fromArray makes unnessesary cals to database</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ihff">Ivo V&#245;sa</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Dec 2010 05:16:41 +0000</created>
                <updated>Fri, 3 Dec 2010 05:16:41 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-939] Patch for Doctrine .....  to identify in some cases autoincremented fields in oracle</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-939</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Patch for Doctrine .....  to identify in some cases autoincremented&lt;br/&gt;
fields.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Solution found thanks to Vladimir Tamara - vtamara AT pasosdejesus DOT org&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Doctrine/Import/Oracle.php&lt;/p&gt;

&lt;p&gt;   // Heuristic to check autoincremented fields.&lt;br/&gt;
        // We check if there is a trigger on the field.&lt;br/&gt;
           // We could also check if there is a sequence on the field.&lt;br/&gt;
           // Side effect: slower generation of scheme&lt;br/&gt;
           $q = &quot;SELECT * FROM all_trigger_cols WHERE&lt;br/&gt;
           table_name=&apos;$table&apos; AND column_name=&apos;&quot; . $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;            $res2 = $this-&amp;gt;conn-&amp;gt;fetchColumn($q);&lt;br/&gt;
           if (count($res2) &amp;gt; 0) &lt;/p&gt;
{
               $descr[$val[&apos;column_name&apos;]][&apos;autoincrement&apos;] = true;
           }

&lt;p&gt;        }&lt;/p&gt;

&lt;p&gt;        return $descr;&lt;/p&gt;</description>
                <environment>PHP Version 5.2.4-2ubuntu5.10 &lt;br/&gt;
Copyright (c) 1997-2007 The PHP Group&lt;br/&gt;
Oracle database 10gR2&lt;br/&gt;
Symfony 1.4.4</environment>
            <key id="12164">DC-939</key>
            <summary>Patch for Doctrine .....  to identify in some cases autoincremented fields in oracle</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="alexander">Edwin Alexander Herrera Saavedra</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 17:30:22 +0000</created>
                <updated>Fri, 24 Dec 2010 12:06:55 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15015" author="alexander" created="Fri, 24 Dec 2010 12:06:55 +0000"  >&lt;p&gt;when new tables are created, the auto-increment is shown in all fields of the table in the schema, to avoid this problem has generated the following improvements to a validation of the auto-increment column is only when the primary key&lt;/p&gt;

&lt;p&gt;Solution found thanks to&lt;br/&gt;
Vladimir Tamara - vtamara AT pasosdejesus DOT org&lt;br/&gt;
and Alexander Herrera&lt;/p&gt;

&lt;p&gt;            if($descr[$val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;==1){&lt;br/&gt;
            // Heuristic to check autoincremented fields.&lt;br/&gt;
	    // We check if there is a trigger on the field.&lt;br/&gt;
	    // We could also check if there is a sequence on the field.&lt;br/&gt;
	    // Side effect: slower generation of scheme&lt;br/&gt;
            //SELECT * FROM ALL_CONS_COLUMNS WHERE CONSTRAINT_NAME LIKE &apos;%TS_DIS_REG_PK%&apos;  AND COLUMN_NAME=&apos;FECHA_PROC&apos;;&lt;br/&gt;
            $q=&quot;SELECT * FROM ALL_CONS_COLUMNS WHERE CONSTRAINT_NAME LIKE &apos;%&quot;.$table.&quot;_PK%&apos; AND COLUMN_NAME=&apos;&quot;.$val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;.&quot;&apos;&lt;/p&gt;

&lt;p&gt;                    &quot;;&lt;br/&gt;
           // echo $descr[$val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;primary&amp;#39;&amp;#93;&lt;/span&gt;.&quot;\n&quot;;&lt;br/&gt;
	    $s = &quot;SELECT * FROM all_trigger_cols WHERE table_name=&apos;$table&apos; AND column_name=&apos;&quot; . $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;column_name&amp;#39;&amp;#93;&lt;/span&gt; . &quot;&apos;&quot;;&lt;br/&gt;
           //echo $q.&quot;\n&quot;;&lt;br/&gt;
            $res2 = $this-&amp;gt;conn-&amp;gt;fetchColumn($q);&lt;br/&gt;
            $res3 = $this-&amp;gt;conn-&amp;gt;fetchColumn($s);&lt;br/&gt;
	    if (count($res2) &amp;gt; 0 &amp;amp;&amp;amp; count($res3)&amp;gt;0) &lt;/p&gt;
{
                $descr[$val[&apos;column_name&apos;]][&apos;autoincrement&apos;] = true;
	    }
&lt;p&gt;            }&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1038] Missing Foreign Key Constraint in SQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1038</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have the problem, that a foreign key constraint is not created in the SQL schema. This occurs, when the primary key is not the column &apos;id&apos;. &lt;/p&gt;

&lt;p&gt;Here is an example:&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
    columns:&lt;br/&gt;
        username:&lt;br/&gt;
            type: string(30)&lt;br/&gt;
            notnull: false&lt;br/&gt;
        email:&lt;br/&gt;
            type: string(80)&lt;br/&gt;
            notnull: true&lt;br/&gt;
        gender:&lt;br/&gt;
            type: enum&lt;br/&gt;
            values: &lt;span class=&quot;error&quot;&gt;&amp;#91;0,m,f&amp;#93;&lt;/span&gt;&lt;br/&gt;
            notblank: true&lt;br/&gt;
            notnull: true&lt;br/&gt;
        birthday:&lt;br/&gt;
            type: date&lt;/p&gt;

&lt;p&gt;Address:&lt;br/&gt;
    columns:&lt;br/&gt;
        user_id:&lt;br/&gt;
            type: integer(4)&lt;br/&gt;
            unsigned: 1&lt;br/&gt;
            notnull: true&lt;br/&gt;
            primary: true&lt;br/&gt;
        some_data:&lt;br/&gt;
            type: string(100)&lt;br/&gt;
    relations:&lt;br/&gt;
        User:&lt;br/&gt;
            local: user_id&lt;br/&gt;
            foreign: id&lt;br/&gt;
            foreignType: one&lt;/p&gt;

&lt;p&gt;The foreign key from contacts to users is not created in der SQL schema. But if I delete the attribute &apos;primary&apos; at the column &apos;user_id&apos; (and a primary key &apos;id&apos; will generated), everything is okay.&lt;/p&gt;

&lt;p&gt;Can you help me please?&lt;/p&gt;

&lt;p&gt;With kind regards&lt;br/&gt;
Stephan&lt;/p&gt;</description>
                <environment></environment>
            <key id="13041">DC-1038</key>
            <summary>Missing Foreign Key Constraint in SQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kiefer">Stephan</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Sep 2011 20:33:25 +0000</created>
                <updated>Sat, 24 Sep 2011 20:33:25 +0000</updated>
                                    <version>1.2.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1033] [PATCH] Use multibyte version of strtolower</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1033</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While trying to develop a new Symfony frontend to an existing database - whcih unfortunately contains non-ascii character names - I ran into a lot of problems where non-ascii characters had been mangled.&lt;br/&gt;
After installing XDebug and digging into the issue I found that the use of strtolower on the column names was the issue, since it&apos;s not safe to use on UTF-8 strings.&lt;br/&gt;
I replaced all calls to strtolower with mb_strtolower and UTF-8 encoding which solved my issue. I don&apos;t know if that is the correct way of doing it or if there is a better way.&lt;br/&gt;
I saw one other use of mb_strtolower in doctrine and it was guarded with an if function exists... Also it might be an issue in other files as well...&lt;br/&gt;
I provide my patch file incase it is of any use.&lt;/p&gt;</description>
                <environment>PHP 5.3.7, Symfony 1.4.13</environment>
            <key id="12979">DC-1033</key>
            <summary>[PATCH] Use multibyte version of strtolower</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="flojon">Jonas Flod&#233;n</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Aug 2011 21:28:54 +0000</created>
                <updated>Sun, 28 Aug 2011 21:43:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16398" author="flojon" created="Sun, 28 Aug 2011 21:43:03 +0000"  >&lt;p&gt;Here is a Git pull request with the same patch:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/pull/39&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/pull/39&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11060" name="0001-Use-multibyte-version-of-strtolower.patch" size="2809" author="flojon" created="Sun, 28 Aug 2011 21:28:55 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1023] i am executing doctrine type query i am geting error  please gave me reply my query  i am typed in descrition field</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1023</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$query = new Doctrine_Query();&lt;br/&gt;
$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,c.country_id,c.country_name&apos;)&lt;br/&gt;
//$query-&amp;gt;select(&apos;e.entity_name,e.entity_id,s.id,s.parent_id,e.ffc_entity_id,ea.Country&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;Entities e&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.EntityAddresses ea ON ea.entity_id = e.entity_id AND ea.address_type =&quot;M&quot;&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;ea.Country c ON ea.country = c.country_id&apos;)&lt;br/&gt;
-&amp;gt;leftJoin(&apos;e.ActiveFactories s&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;e.status=1&apos;);&lt;br/&gt;
if(!empty($alpha))&lt;br/&gt;
{&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;e.entity_name like &apos;&quot;.$alpha.&quot;%&apos;&quot;);&lt;br/&gt;
}&lt;br/&gt;
$query-&amp;gt;andWhere(&quot;s.company_id=&quot;.$parentId)&lt;br/&gt;
-&amp;gt;andWhere(&quot;e.entity_type=2&quot;)&lt;br/&gt;
-&amp;gt;andWhere(&apos;s.status=1&apos;)&lt;br/&gt;
-&amp;gt;groupBy(&apos;e.entity_id&apos;);&lt;/p&gt;</description>
                <environment></environment>
            <key id="12850">DC-1023</key>
            <summary>i am executing doctrine type query i am geting error  please gave me reply my query  i am typed in descrition field</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rajani">cherukuri</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Jul 2011 15:08:48 +0000</created>
                <updated>Tue, 26 Jul 2011 20:35:03 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1046] Connection MSSQL replaceBoundParamsWithInlineValuesInQuery</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1046</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;We found a bug in Doctrine1 MSSQL Connection.&lt;br/&gt;
When you would like to use the following functionality: find(One)By(p1,p2)&lt;br/&gt;
if you use the old functionality (Symfony 1.4 support it) like this: findBy(&quot;idAnddata&quot;, array(&quot;id&quot; =&amp;gt; ..., &quot;date&quot; =&amp;gt; ..)), you got an MSSQL error, because the values wasn&apos;t changed.&lt;/p&gt;

&lt;p&gt;Please find the patch for it, I hope it helps to you as well.&lt;/p&gt;

&lt;p&gt;Kind regards&lt;br/&gt;
Peter&lt;/p&gt;</description>
                <environment>Revision: 104&lt;br/&gt;
</environment>
            <key id="13272">DC-1046</key>
            <summary>Connection MSSQL replaceBoundParamsWithInlineValuesInQuery</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="eisi">Peter Eisenberg</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Dec 2011 13:01:23 +0000</created>
                <updated>Thu, 15 Dec 2011 13:39:29 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16988" author="eisi" created="Thu, 15 Dec 2011 13:39:29 +0000"  >&lt;p&gt;Small changes:&lt;br/&gt;
Unfortunately the notice wasn&apos;t set in my test environment, and I didn&apos;t realized this small error:&lt;/p&gt;

&lt;p&gt;please use the following instead of the original: &lt;br/&gt;
$replacement = &apos;is_null(\$value) ? \&apos;NULL\&apos; : \$this-&amp;gt;quote(\$params&lt;span class=&quot;error&quot;&gt;&amp;#91;\&amp;#39;\\1\&amp;#39;&amp;#93;&lt;/span&gt;)&apos;;&lt;/p&gt;

&lt;p&gt;another case you got the following error: Use of undefined constant xxx - assumed xxx. &lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Peter&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11130" name="replaceBoundParamsWithInlineValuesInQuery.patch" size="660" author="eisi" created="Thu, 15 Dec 2011 13:01:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1043] Error:&quot;When using..ATTR_AUTO_ACCESSOR_OVERRIDE you cannot.. name &quot;data&quot; ...&quot; when running doctrine:build-schema ... except  I&apos;m NOT using that word</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1043</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Was able to resolve this - see comment below - but still think it counts as a bug since the source of the error is so unclear&lt;/p&gt;

&lt;p&gt;Hello,&lt;br/&gt;
I&apos;m familiarizing myself with symfony at this point, but doctrine seems like a very accessible ORM tool overall. This install will also use the apostrophe plugin though that is more a client request and it is seeming to complicate a lot of issues from what I can see. Right now, I am just trying to create some db tables in schema.yml and build them with doctrine. When running $ php symfony doctrine:build-schema I get the following error: When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name &quot;data&quot; because it is reserved by Doctrine. You must choose another field name.&lt;/p&gt;

&lt;p&gt;Which would be clear enough except I&apos;m NOT using &quot;data&quot; as a field name in my schema file: here&apos;s what I&apos;m using:&lt;/p&gt;

&lt;p&gt;sfTravelLodgingLocationsType:&lt;br/&gt;
   columns:&lt;br/&gt;
      lodging_name: &lt;/p&gt;
{ type: string(255) }
&lt;p&gt;      lodging_code: &lt;/p&gt;
{ type: string(255) }

&lt;p&gt;sfTravelLodgingLocations:&lt;br/&gt;
   columns:&lt;br/&gt;
      lodging_type_code: &lt;/p&gt;
{ type: integer, notnull: true }
&lt;p&gt;      name: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      address: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      city: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      distance: &lt;/p&gt;
{ type: integer, notnull: true }
&lt;p&gt;      phone: &lt;/p&gt;
{ type: string(255), notnull: true }
&lt;p&gt;      known_2b_sold_out: &lt;/p&gt;
{ type: boolean, notnull: true, default: 0 }
&lt;p&gt;   relations:&lt;br/&gt;
      Travel_Lodging_LocationsType: &lt;/p&gt;
{ local: type_id, foreign: id }

&lt;p&gt;I&apos;m assuming this is a misnamed error call ... I have found a few references to that same error in other threads but none that resolve it&lt;/p&gt;</description>
                <environment>Mac OSX 10.6.8 running MAMP Pro 2.0.5 with PHP 5.3.6 ... this is a local symfony install which is also using the apostrophe cms. </environment>
            <key id="13231">DC-1043</key>
            <summary>Error:&quot;When using..ATTR_AUTO_ACCESSOR_OVERRIDE you cannot.. name &quot;data&quot; ...&quot; when running doctrine:build-schema ... except  I&apos;m NOT using that word</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shotdsherrif">Maurice Stephens</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Nov 2011 21:32:10 +0000</created>
                <updated>Thu, 1 Dec 2011 02:01:12 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16936" author="shotdsherrif" created="Thu, 1 Dec 2011 01:59:12 +0000"  >&lt;p&gt;I was able to find a way to override the ATTR_AUTO_ACCESSOR_OVERRIDE with a method in the appConfiguration.class.php file&lt;/p&gt;

&lt;p&gt;based on this thread ... &lt;a href=&quot;http://stackoverflow.com/questions/7266293/attr-auto-accessor-override&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/7266293/attr-auto-accessor-override&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But it is still a difficult error to troubleshoot ... not clear on what the reserved keyword &quot;data&quot; had to do with it ... considering I wasn&apos;t even using it in the schema&lt;/p&gt;

&lt;p&gt;Would be interested in finding some resources that go into detail on the implications of the command line context that symfony relies on&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-982] Options for building models aren&apos;t forwarded from CLI to Manager instance</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-982</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I.e.: generate_models_options and classPrefix option isn&apos;t forwared from CLI configuration to create table task (which uses the Manager&apos;s options).&lt;/p&gt;</description>
                <environment></environment>
            <key id="12448">DC-982</key>
            <summary>Options for building models aren&apos;t forwarded from CLI to Manager instance</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="maciej.strzelecki">Maciej Strzelecki</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Mar 2011 08:39:10 +0000</created>
                <updated>Fri, 4 Mar 2011 08:39:10 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1054]  SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;b.title&apos; in &apos;field list&apos;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1054</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;this is the my table creation .&lt;/p&gt;

&lt;p&gt;CREATE TABLE billboard(id BIGINT AUTO_INCREMENT,title VARCHAR (255),country_id BIGINT,zone_id BIGINT,place VARCHAR(255),occassion VARCHAR(255),itinerary VARCHAR(255),created_at DATETIME NOT NULL,description TEXT NOT NULL,PRIMARY KEY(id)) ENGINE=INNODB;&lt;/p&gt;



&lt;p&gt; public static function getInstance()&lt;/p&gt;
    {
        return Doctrine_Core::getTable(&apos;Billboard&apos;);
    }

&lt;p&gt; this is the my Doctrine Table&lt;/p&gt;

&lt;p&gt;   // public function getBillboardsForAUser($userId, $limit, $offset=0)&lt;br/&gt;
   public function getBillboardsForAUser($userId,$limit,$offset=0)&lt;br/&gt;
    {&lt;br/&gt;
              $query = $this-&amp;gt;createQuery(&apos;b&apos;)&lt;br/&gt;
              -&amp;gt;where(&apos;b.title=?&apos;,$title);&lt;br/&gt;
                // -&amp;gt;where(&apos;b.owner_id = ?&apos;, $userId);&lt;br/&gt;
        $followings = Doctrine::getTable(&apos;Follow&apos;)-&amp;gt;getAllFollowing($userId);&lt;br/&gt;
        foreach($followings as $following)&lt;/p&gt;
{
            $query-&amp;gt;orWhere(&apos;b.owner_id = ? &apos;,$following-&amp;gt;getOwnerId());
            $query-&amp;gt;orWhere(&apos;b.poster_id = ? &apos;,$following-&amp;gt;getOwnerId());
        }
&lt;p&gt;        $query-&amp;gt;orderBy(&apos;b.created_at DESC&apos;)&lt;br/&gt;
              -&amp;gt;limit($limit)&lt;br/&gt;
              -&amp;gt;offset($offset);&lt;br/&gt;
        return $query-&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;plz help me what is the problem.&lt;/p&gt;</description>
                <environment>window vista</environment>
            <key id="13582">DC-1054</key>
            <summary> SQLSTATE[42S22]: Column not found: 1054 Unknown column &apos;b.title&apos; in &apos;field list&apos;</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="suriyakala">suriyakala</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Mar 2012 02:10:05 +0000</created>
                <updated>Sat, 31 Mar 2012 06:58:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17694" author="beberlei" created="Sat, 31 Mar 2012 06:58:41 +0000"  >&lt;p&gt;Doctrine 1, not 2 ticket.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-449] Duplicate entry integrity constraint error when updating Searchable record with indexed fields from a template</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-449</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have 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;&amp;lt;?php
class JS_Page &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;page&apos;);
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumns(array(
			&apos;id&apos; =&amp;gt; array(
				&apos;type&apos;		=&amp;gt; &apos;integer&apos;,
				&apos;length&apos;	=&amp;gt; 4,
				&apos;primary&apos;	=&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
				&apos;autoincrement&apos;	=&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
			),
			&apos;content&apos; =&amp;gt; array(
				&apos;type&apos;		=&amp;gt; &apos;array&apos;,
				&apos;length&apos;	=&amp;gt; 65536,
				&apos;notnull&apos;	=&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
				&apos;&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;&apos;	=&amp;gt; array(),
			),
		));
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; JS_Template_Meta());
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;Searchable&apos;, array(
			&apos;fields&apos;	=&amp;gt; array(&apos;title&apos;, &apos;description&apos;, &apos;keywords&apos;),
			&apos;tableName&apos;	=&amp;gt; &apos;page_index&apos;,
		));
	}
}

class JS_Template_Meta &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Template
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumns(array(
			&apos;title&apos; =&amp;gt; array(
				&apos;type&apos;		=&amp;gt; &apos;string&apos;,
				&apos;length&apos;	=&amp;gt; 255,
				&apos;notnull&apos;	=&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
			),
			&apos;description&apos; =&amp;gt; array(
				&apos;type&apos;		=&amp;gt; &apos;string&apos;,
			),
			&apos;keywords&apos; =&amp;gt; array(
				&apos;type&apos;		=&amp;gt; &apos;string&apos;,
				&apos;length&apos;	=&amp;gt; 255,
			),
		));
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When a Page record is updated I get this error:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &apos;application-title-0-3&apos; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; key 1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I only index fields from Page it works.&lt;/p&gt;

&lt;p&gt;I tracked this down to the code in Doctrine_Search that deletes the existing indexed data before re-indexing a record (I&apos;m not using batchUpdate). For reasons I don&apos;t understand the DELETE query is not executing correctly before re-indexing, and so any unchanged data is being added to the index twice, causing the error.&lt;/p&gt;

&lt;p&gt;I managed to work around this by adding my own template and listener before Searchable, with a preSave event that deletes the index 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;...
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; JS_Template_Searchable());
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;Searchable&apos;, array(
			&apos;fields&apos;	=&amp;gt; array(&apos;title&apos;, &apos;description&apos;, &apos;keywords&apos;),
			&apos;tableName&apos;	=&amp;gt; &apos;page_index&apos;,
		));
...

class JS_Template_Searchable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Template
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
	{
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;addListener(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; JS_Template_Searchable_Listener());
	}
}

class JS_Template_Searchable_Listener &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record_Listener
{
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preSave(Doctrine_Event $event)
	{
		$invoker = $event-&amp;gt;getInvoker();
		$class = get_class($invoker) . &apos;Index&apos;;
		$query = Doctrine_Query::create()
			-&amp;gt;delete()
			-&amp;gt;from(&lt;span class=&quot;code-quote&quot;&gt;&quot;{$class} i&quot;&lt;/span&gt;)
			-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;i.id = ?&quot;&lt;/span&gt;, $invoker[&apos;id&apos;])
			-&amp;gt;execute();
	}
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Obviously that&apos;s an ugly hack, but it works.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10775">DC-449</key>
            <summary>Duplicate entry integrity constraint error when updating Searchable record with indexed fields from a template</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jacksleight">Jack Sleight</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Jan 2010 10:56:49 +0000</created>
                <updated>Mon, 25 Jan 2010 10:58:24 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-432] ::isValidType fails when input format is different from php default format</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-432</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In Validator::isValidType():&lt;br/&gt;
    return (string)$var == strval(floatval($var));&lt;/p&gt;

&lt;p&gt;floatval($var) returns only the integer part if the decimal character is anything other than &quot;.&quot;. &lt;br/&gt;
Therefore this evaluation fails. &lt;/p&gt;

&lt;p&gt;I&apos;ve added a small function &apos;ParseFloat&apos; which takes locale settings into consideration. &lt;br/&gt;
There might be a better solution.&lt;/p&gt;
</description>
                <environment>Windows XP (XAMPP Apache) &amp;amp; Linux </environment>
            <key id="10736">DC-432</key>
            <summary>::isValidType fails when input format is different from php default format</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonr">J&#243;n Ragnarsson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Jan 2010 15:13:12 +0000</created>
                <updated>Tue, 8 Jun 2010 16:55:41 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13213" author="jwage" created="Tue, 8 Jun 2010 16:55:41 +0000"  >&lt;p&gt;Can you provide the changes as patch?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10289" name="Validator.php" size="7696" author="jonr" created="Fri, 15 Jan 2010 15:13:12 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-427] Record Hydration error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-427</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;schema.yml &lt;/p&gt;

&lt;p&gt;CheCategory:&lt;br/&gt;
  options:&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
    NestedSet: ~&lt;br/&gt;
  columns:    &lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
CheItem:&lt;br/&gt;
  options:&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
  columns:&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
    category_id:&lt;br/&gt;
      type: integer(12)    &lt;br/&gt;
  relations:&lt;br/&gt;
    CheItemPhoto:&lt;br/&gt;
      type: many&lt;br/&gt;
      local: id&lt;br/&gt;
      foreign: item_id&lt;br/&gt;
    CheItemAttribute:&lt;br/&gt;
      type: many&lt;br/&gt;
      local: id&lt;br/&gt;
      foreign: item_id&lt;br/&gt;
    CheCategory:&lt;br/&gt;
      local: category_id&lt;br/&gt;
      foreign: id&lt;/p&gt;

&lt;p&gt;CheAttribute:&lt;br/&gt;
  options:&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
    attr_type:&lt;br/&gt;
      type: integer(2)    &lt;br/&gt;
    label:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
    sort_order:&lt;br/&gt;
      type: integer(5)&lt;br/&gt;
      default: 9999&lt;br/&gt;
  relations:&lt;br/&gt;
    CheItemAttribute:      &lt;br/&gt;
      local: id&lt;br/&gt;
      foreign: attribute_id&lt;/p&gt;

&lt;p&gt;CheItemAttribute:&lt;br/&gt;
  options:&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    item_id:&lt;br/&gt;
      type: integer(12)&lt;br/&gt;
    attr_value:&lt;br/&gt;
      type: clob&lt;br/&gt;
    attribute_id:&lt;br/&gt;
      type: integer(12)&lt;br/&gt;
  relations:&lt;br/&gt;
    CheItem:&lt;br/&gt;
      local: item_id&lt;br/&gt;
      foreign: id&lt;br/&gt;
    CheAttribute:&lt;br/&gt;
      local: attribute_id&lt;br/&gt;
      foreign: id&lt;/p&gt;

&lt;p&gt;CheItemPhoto:&lt;br/&gt;
  options:&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
  columns:&lt;br/&gt;
    item_id:&lt;br/&gt;
      type: integer(12)&lt;br/&gt;
    basefile:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
    caption:&lt;br/&gt;
      type: string(255)&lt;br/&gt;
    is_default:&lt;br/&gt;
      type: boolean&lt;br/&gt;
      default: false&lt;br/&gt;
  relations:&lt;br/&gt;
    CheItem:&lt;br/&gt;
      local: item_id&lt;br/&gt;
      foreign: id&lt;/p&gt;

&lt;p&gt;fixtures.yml&lt;/p&gt;

&lt;p&gt;CheAttribute:&lt;br/&gt;
  Attr_price:&lt;br/&gt;
    name: Price&lt;br/&gt;
    label: price&lt;br/&gt;
    sort_order: 1&lt;br/&gt;
    attr_type: &amp;lt;?php echo CheAttribute::ATTR_STRING.&quot;\n&quot; ?&amp;gt;&lt;br/&gt;
  Attr_desc:&lt;br/&gt;
    name: Desc&lt;br/&gt;
    label: desc&lt;br/&gt;
    sort_order: 2&lt;br/&gt;
    attr_type: &amp;lt;?php echo CheAttribute::ATTR_HTML.&quot;\n&quot; ?&amp;gt;&lt;/p&gt;

&lt;p&gt;CheCategory:&lt;br/&gt;
  Cat_0:&lt;br/&gt;
    name: Items category&lt;br/&gt;
    children:&lt;br/&gt;
      Cat_1:&lt;br/&gt;
        name: Cups&lt;br/&gt;
        children:&lt;br/&gt;
          Cat_2:&lt;br/&gt;
            name: Beer&lt;br/&gt;
          Cat_3:&lt;br/&gt;
            name: Tea&lt;br/&gt;
            children:&lt;br/&gt;
              Cat_5:&lt;br/&gt;
                name: China&lt;br/&gt;
              Cat_6:&lt;br/&gt;
                name: Russian&lt;br/&gt;
          Cat_4:&lt;br/&gt;
            name: Coffee&lt;/p&gt;

&lt;p&gt;CheItem:&lt;br/&gt;
  Item_8:&lt;br/&gt;
    name: Vobla&lt;br/&gt;
    CheCategory: Cat_1&lt;br/&gt;
  Item_1:&lt;br/&gt;
    name: Vobla2&lt;br/&gt;
    CheCategory: Cat_2&lt;/p&gt;

&lt;p&gt;CheItemAttribute:&lt;br/&gt;
  Ite_attr_0:&lt;br/&gt;
    CheItem: Item_1&lt;br/&gt;
    CheAttribute: Attr_price&lt;br/&gt;
    attr_value: 10&lt;br/&gt;
  Ite_attr_1:&lt;br/&gt;
    CheItem: Item_1&lt;br/&gt;
    CheAttribute: Attr_desc&lt;br/&gt;
    attr_value: abcsdd&lt;br/&gt;
  Ite_attr_2:&lt;br/&gt;
    CheItem: Item_8&lt;br/&gt;
    CheAttribute: Attr_price&lt;br/&gt;
    attr_value: 123&lt;br/&gt;
  Ite_attr_3:&lt;br/&gt;
    CheItem: Item_8&lt;br/&gt;
    CheAttribute: Attr_desc&lt;br/&gt;
    attr_value: test&lt;/p&gt;

&lt;p&gt;code:&lt;/p&gt;

&lt;p&gt;$b =  Doctrine::getTable(&quot;CheAttribute&quot;)&lt;del&gt;&amp;gt;createQuery(&quot;A2&quot;)&lt;/del&gt;&amp;gt;leftJoin(&quot;A2.CheItemAttribute IA2 WITH IA2.item_id = ?&quot;, 2)&lt;del&gt;&amp;gt;addOrderBy(&quot;A2.sort_order ASC&quot;)&lt;/del&gt;&amp;gt;execute();    &lt;/p&gt;

&lt;p&gt;    var_dump($b&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;del&gt;&amp;gt;getCheItemAttribute()&lt;/del&gt;&amp;gt;getAttrValue());&lt;/p&gt;



&lt;p&gt;    $tb =  Doctrine::getTable(&quot;CheAttribute&quot;)&lt;del&gt;&amp;gt;createQuery(&quot;A&quot;)&lt;/del&gt;&amp;gt;leftJoin(&quot;A.CheItemAttribute IA WITH IA.item_id = ?&quot;, 1)&lt;del&gt;&amp;gt;addOrderBy(&quot;A.sort_order ASC&quot;)&lt;/del&gt;&amp;gt;execute();   &lt;/p&gt;

&lt;p&gt;    var_dump($tb&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;del&gt;&amp;gt;getCheItemAttribute()&lt;/del&gt;&amp;gt;getAttrValue());&lt;br/&gt;
    exit();&lt;/p&gt;

&lt;p&gt;in browser i see:&lt;/p&gt;

&lt;p&gt;string &apos;10&apos; (length=2)&lt;/p&gt;

&lt;p&gt;string &apos;10&apos; (length=2)&lt;/p&gt;

&lt;p&gt;but expected:&lt;/p&gt;

&lt;p&gt;10&lt;/p&gt;

&lt;p&gt;123&lt;/p&gt;

&lt;p&gt;With hydration Array &amp;amp; Scalar hydrated data is ok. &lt;/p&gt;






</description>
                <environment>Ubuntu 9.04&lt;br/&gt;
Apache 2.2.9 &lt;br/&gt;
PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009 19:14:44)&lt;br/&gt;
Copyright (c) 1997-2008 The PHP Group&lt;br/&gt;
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans&lt;br/&gt;
MySQL 5.0.75-0ubuntu10.2 (Ubuntu)&lt;br/&gt;
Symfony 1.4.1</environment>
            <key id="10729">DC-427</key>
            <summary>Record Hydration error</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mixadior">Diordienko Mykhail</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jan 2010 19:50:59 +0000</created>
                <updated>Thu, 14 Jan 2010 19:50:59 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-426] Doctrine incorrectly assigns a NULL value to primary key fields</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-426</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;in my project (MySQL 5.x, PHP 5.2.x), I use a combined primary key which looks as follows:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;hasColumn(&quot;guid&quot;, 		&quot;string&quot;, 	32,		array(&apos;primary&apos; =&amp;gt; true));&lt;br/&gt;
$this-&amp;gt;hasColumn(&quot;revision&quot;, 	&quot;integer&quot;, 	4,		array(&apos;primary&apos; =&amp;gt; true));&lt;br/&gt;
$this-&amp;gt;hasColumn(&quot;language&quot;, 	&quot;string&quot;, 	32,		array(&apos;primary&apos; =&amp;gt; true));&lt;/p&gt;

&lt;p&gt;My project automatically initializes the GUID and revision fields, but language is left empty. Doctrine assumes that NULL is a good value, and uses the NULL value after saving an object to reload it. This results in the following statement, generated by the find()-Method within Table.php:&lt;/p&gt;

&lt;p&gt;SELECT b.guid AS b_&lt;em&gt;guid, b.revision AS b&lt;/em&gt;&lt;em&gt;revision, b.language AS b&lt;/em&gt;&lt;em&gt;language, b.active AS b&lt;/em&gt;&lt;em&gt;active, b.title AS b&lt;/em&gt;&lt;em&gt;title, b.content AS b&lt;/em&gt;&lt;em&gt;content, b.category AS b&lt;/em&gt;_category FROM blog_entry b WHERE (b.guid = &apos;505f1a2d13864fa4aef461aa1b5b37a3&apos; AND b.revision = &apos;1&apos; AND b.language = NULL)&lt;/p&gt;

&lt;p&gt;Since MySQL does not allow NULL values in primary keys, MySQL uses an empty string (&apos;&apos;). Doctrine should also use an empty string as default value if the primary key consists of a string, OR issue a warning that MySQL does not allow NULL values in primary keys. The problem with this &quot;bug&quot; is that problems occur in situations where you do not expect them, for example, when storing objects.&lt;/p&gt;

&lt;p&gt;If a test case is required, just tell me and I&apos;ll prepare one.&lt;/p&gt;

&lt;p&gt;Thanks and best regards,&lt;br/&gt;
Timo&lt;/p&gt;</description>
                <environment></environment>
            <key id="10728">DC-426</key>
            <summary>Doctrine incorrectly assigns a NULL value to primary key fields</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="alek202">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jan 2010 17:25:56 +0000</created>
                <updated>Thu, 14 Jan 2010 17:25:56 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-417] Unexpected results with equal many-to-many relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-417</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;print_r&apos;s before refresh represent what i hoped to get and after that what was inserted into db.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;INSERT INTO match_reference (match_id, user_id) VALUES (?, ?)
Array
(
    [0] =&amp;gt; 2
    [1] =&amp;gt; 1
)


UPDATE match_reference SET match_id = ? WHERE user_id = ? AND match_id = ?
Array
(
    [0] =&amp;gt; 1
    [1] =&amp;gt; 1
    [2] =&amp;gt; 2
)


INSERT INTO match_reference (match_id, user_id) VALUES (?, ?)
Array
(
    [0] =&amp;gt; 3
    [1] =&amp;gt; 2
)


INSERT INTO match_reference (match_id, user_id) VALUES (?, ?)
Array
(
    [0] =&amp;gt; 4
    [1] =&amp;gt; 2
)
Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 2
            [username] =&amp;gt; 2
        )

)
Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 1
            [username] =&amp;gt; 1
        )

    [1] =&amp;gt; Array
        (
            [id] =&amp;gt; 3
            [username] =&amp;gt; 3
        )

    [2] =&amp;gt; Array
        (
            [id] =&amp;gt; 4
            [username] =&amp;gt; 4
        )

)
Array
(
)
Array
(
    [0] =&amp;gt; Array
        (
            [id] =&amp;gt; 3
            [username] =&amp;gt; 3
        )

    [1] =&amp;gt; Array
        (
            [id] =&amp;gt; 4
            [username] =&amp;gt; 4
        )

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


&lt;p&gt;schema/schema.yml&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;---
User:
  columns:
    username: string(255)
  relations:
    Matches:
      class: User
      local: user_id
      foreign: match_id
      refClass: MatchReference
      equal: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      cascade: [delete]

MatchReference:
  columns:
    user_id:
      type: integer
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    match_id:
      type: integer
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;index.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;require_once(&apos;config.php&apos;);

Doctrine::loadModels(&apos;models&apos;);

Doctrine_Query::create()
    -&amp;gt;delete(&apos;User&apos;)
    -&amp;gt;execute();

Doctrine_Query::create()
    -&amp;gt;delete(&apos;MatchReference&apos;)
    -&amp;gt;execute();

$u1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$u1-&amp;gt;id = $u1-&amp;gt;username = 1;
$u1-&amp;gt;save();

$u2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$u2-&amp;gt;id = $u2-&amp;gt;username = 2;
$u2-&amp;gt;save();

$u3 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$u3-&amp;gt;id = $u3-&amp;gt;username = 3;
$u3-&amp;gt;save();

$u4 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
$u4-&amp;gt;id = $u4-&amp;gt;username = 4;
$u4-&amp;gt;save();

$profiler = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Connection_Profiler();
Doctrine_Manager::getInstance()-&amp;gt;getCurrentConnection()-&amp;gt;addListener($profiler);

$user_1 = Doctrine::getTable(&apos;User&apos;)-&amp;gt;find(1);

$matches = Doctrine_Query::create()
    -&amp;gt;from(&apos;User&apos;)
    -&amp;gt;whereIn(&apos;id&apos;, array(2))
    -&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);

$match = $matches[0];

$user_1-&amp;gt;link(&apos;Matches&apos;, array($match[&apos;id&apos;]));
$user_1-&amp;gt;save();

$user_2 = Doctrine::getTable(&apos;User&apos;)-&amp;gt;find(2);

$matches = Doctrine_Query::create()
-&amp;gt;from(&apos;User&apos;)
-&amp;gt;whereIn(&apos;id&apos;, array(3, 4))
-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);

foreach ($matches as $match) {
    $user_2-&amp;gt;link(&apos;Matches&apos;, array($match[&apos;id&apos;]));
}

$user_2-&amp;gt;save();

foreach ($profiler as $event) {
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array($event-&amp;gt;getName(), array(&apos;execute&apos;)) &amp;amp;&amp;amp; preg_match(&apos;/^(INSERT|UPDATE)/&apos;, $event-&amp;gt;getQuery())) {
        echo print_r($event-&amp;gt;getQuery(), &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;) . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
        echo print_r($event-&amp;gt;getParams(), &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;) . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n\n&quot;&lt;/span&gt;;
    }
}

print_r($user_1-&amp;gt;Matches-&amp;gt;toArray());
print_r($user_2-&amp;gt;Matches-&amp;gt;toArray());

$user_1-&amp;gt;refresh(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
$user_2-&amp;gt;refresh(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);

print_r($user_1-&amp;gt;Matches-&amp;gt;toArray());
print_r($user_2-&amp;gt;Matches-&amp;gt;toArray());

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.2.10-2ubuntu6.3 with Suhosin-Patch 0.9.7 (cli) (built: Nov 26 2009 14:52:57) &lt;br/&gt;
MySQL 5.0.84-0.dotdeb.0&lt;br/&gt;
Doctrine-1.1.6-Sandbox</environment>
            <key id="10712">DC-417</key>
            <summary>Unexpected results with equal many-to-many relations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ihff">Ivo V&#245;sa</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 16:52:08 +0000</created>
                <updated>Thu, 14 Jan 2010 13:05:39 +0000</updated>
                                    <version>1.1.6</version>
                <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11364" author="ihff" created="Mon, 11 Jan 2010 17:23:57 +0000"  >&lt;p&gt;Just tested it on 1.2.1 with same results.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-401] Doctrine_Query-&gt;load crashes with additional ending whitespace in JOIN </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-401</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;following will lead to an error:&lt;/p&gt;

&lt;p&gt;-&amp;gt;leftJoin(&apos;alias.RelatedTable alias2  WITH .....&apos;)&lt;/p&gt;

&lt;p&gt;The problem is the additional whitespace behind alias2.&lt;br/&gt;
On line 1682 in Doctrine_Query class file:&lt;/p&gt;

&lt;p&gt;$tmp            = explode(&apos; &apos;, $path);&lt;/p&gt;

&lt;p&gt;will create an array of 3 elements where the last one is empty but will be used as empty alias mapping after foreach from line 1698.&lt;/p&gt;

</description>
                <environment></environment>
            <key id="10689">DC-401</key>
            <summary>Doctrine_Query-&gt;load crashes with additional ending whitespace in JOIN </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="cmi">Christian Michel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Jan 2010 11:54:52 +0000</created>
                <updated>Wed, 6 Jan 2010 12:02:40 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-396] Add timezone support for time and timestamp datatype in PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-396</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Please add support for the types of time with timezone and timestamp with timezone in the Doctrine when using PostgreSQL.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10681">DC-396</key>
            <summary>Add timezone support for time and timestamp datatype in PostgreSQL</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="phprus">Vladislav</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jan 2010 10:01:12 +0000</created>
                <updated>Sun, 19 Aug 2012 05:29:02 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18526" author="alepot" created="Sun, 19 Aug 2012 01:58:16 +0000"  >&lt;p&gt;I came across this problem because I prefer to store timezone information instead of local dates. &lt;/p&gt;

&lt;p&gt;I believe this is resolved by the attached patch, which patches the Timestampable template and it&apos;s listener to create and maintain &apos;timestamp with timezone&apos; in Postgresql.&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="11313" name="timestampable.diff" size="2567" author="alepot" created="Sun, 19 Aug 2012 05:26:16 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-356] Error in self referencing (nest relations) and tableName.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-356</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have this schema:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Interface&lt;br/&gt;
Interfaz: &lt;br/&gt;
  tableName:        YT_INTERFAZ&lt;br/&gt;
  columns:&lt;br/&gt;
    cinterfaz:        
{ type: integer, notnull: true, primary: true, autoincrement: true }
&lt;p&gt;  relations:&lt;br/&gt;
    Conexiones:&lt;br/&gt;
      class: Interfaz&lt;br/&gt;
      local: cinterfazsrc&lt;br/&gt;
      foreign: cinterfazdst&lt;br/&gt;
      refClass: Conexion&lt;br/&gt;
      equal: true&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;#Link&lt;br/&gt;
Conexion:&lt;br/&gt;
  tableName:        YT_CONEXION&lt;br/&gt;
  columns:&lt;br/&gt;
    cinterfazsrc:      &lt;/p&gt;
{ type: integer, primary: true }
&lt;p&gt;    cinterfazdst:      &lt;/p&gt;
{ type: integer, primary: true }

&lt;p&gt;When I try to get $interfaz-&amp;gt;Conexiones, I get this message:&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: yt_interfaz in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 288&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 289&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getFieldName() on a non-object in /home/sergio/Proyectos/syc/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php on line 290&lt;/p&gt;

&lt;p&gt;But If I remove tableName fields in schema declaration, it works perfectly. The name of tableName don&apos;t matters, if you use it, it fails.&lt;/p&gt;</description>
                <environment>Linux, php 5.2.10, apache 2.2.12</environment>
            <key id="10609">DC-356</key>
            <summary>Error in self referencing (nest relations) and tableName.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="perseo">Sergio Gomez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Dec 2009 12:07:46 +0000</created>
                <updated>Thu, 17 Jan 2013 01:16:07 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15310" author="kweij" created="Tue, 15 Feb 2011 08:15:12 +0000"  >&lt;p&gt;Same story over here. Same error with the following non-equal nest relation:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;&amp;lt;?php

class TXCRDataNodeCRDataNode &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; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;x_CRDataNode_CRDataNode&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;childNodeID&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; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;parentNodeID&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; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setUp() {
        parent::setUp();
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;TCRDataNode as child&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;childNodeID&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;dataNodeID&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;TCRDataNode as parent&apos;, array(
             &apos;local&apos; =&amp;gt; &apos;parentNodeID&apos;,
             &apos;foreign&apos; =&amp;gt; &apos;dataNodeID&apos;));
    }
}

class TCRDataNode &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; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;CRDataNode&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;dataNodeID&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; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;value&apos;, &apos;string&apos;, 255, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;length&apos; =&amp;gt; 255,
             &apos;fixed&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;unsigned&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
             ));
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;TCRDataNode as childNodes&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;parentNodeID&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;childNodeID&apos;,
            &apos;refClass&apos; =&amp;gt; &apos;TXCRDataNodeCRDataNode&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;TCRDataNode as parentNodes&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;childNodeID&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;parentNodeID&apos;,
            &apos;refClass&apos; =&amp;gt; &apos;TXCRDataNodeCRDataNode&apos;));
    }
}

$dn = Doctrine_Core::getTable(&apos;TCRDataNode&apos;)-&amp;gt;find(5300);

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;.. and then when I ..&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;&amp;lt;?php

$pn = $dn-&amp;gt;parentNodes;

?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;.. it goes like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice: Undefined index: crdatanode in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 288&lt;/p&gt;

&lt;p&gt;Notice: Undefined index: in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 289&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function getFieldName() on a non-object in /home/shared/library/doctrine_1.2.2/Doctrine/Hydrator/Graph.php on line 290&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Using Doctrine 1.2.2&lt;/p&gt;

&lt;p&gt;It seemed like the same thing as presented in the &lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models:relationships:join-table-associations:self-referencing-nest-relations#non-equal-nest-relations&quot; class=&quot;external-link&quot;&gt;documentation&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15331" author="kweij" created="Thu, 17 Feb 2011 09:34:20 +0000"  >&lt;p&gt;This aching issue - as I traced the cord back to the wall - appears to originate from the fact that I use UPPERCASES in the names of my databas tables. When I user all lowercases: no problem. Hence it worked on my WAMP server (Windows just lowercases it all). Even when I so much as start the entity-table which an UPPERCASE: bang! Fatal error.&lt;/p&gt;

&lt;p&gt;This is not logical and, I presume, is a definite bug.&lt;/p&gt;

&lt;p&gt;Please, oh please fix this ..&lt;/p&gt;</comment>
                    <comment id="17528" author="dannykopping" created="Tue, 6 Mar 2012 08:39:37 +0000"  >&lt;p&gt;As Klaas mentions, this function incorrectly assumes that all databases will be named using lowercase letters.&lt;/p&gt;

&lt;p&gt;The problem arises in the following line:&lt;br/&gt;
$cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt; = $this-&amp;gt;_tableAliases&lt;span class=&quot;error&quot;&gt;&amp;#91;strtolower(implode(&amp;#39;__&amp;#39;, $e))&amp;#93;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;If one removes the &quot;strtolower&quot; function call, it will work for tables named with uppercase letters, but this is obviously quite an inelegant solution.&lt;/p&gt;

&lt;p&gt;Could you suggest an alternative solution? I&apos;ll be happy to make the change, test it and issue a pull request in GitHub&lt;/p&gt;</comment>
                    <comment id="17529" author="dannykopping" created="Tue, 6 Mar 2012 13:01:44 +0000"  >&lt;p&gt;I&apos;ve just tested this scenario in as many different possible combinations as I could think of (all tables uppercase/PascalCase, all tables lowercase, some Pascal, some lowercase) and just by removing the &quot;strtolower&quot; function, the issue seems to be resolved.&lt;/p&gt;</comment>
                    <comment id="19333" author="jklehr" created="Thu, 17 Jan 2013 01:16:07 +0000"  >&lt;p&gt;We&apos;ve encountered this as well, tried a lot of different things in our models/schema to get around it, but nothing worked.&lt;/p&gt;

&lt;p&gt;Made a test case here: &lt;a href=&quot;https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php&quot; class=&quot;external-link&quot;&gt;https://github.com/diablomedia/doctrine1/blob/master/tests/Ticket/DC356TestCase.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modified the doctrine core as suggested by Danny, but this change causes other Doctrine test to fail (Particularly tests/TableTestCase.php).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-344] Trouble with auto including generate Base class with specifik name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-344</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have found a problem during testing example model on page &lt;a href=&quot;http://www.doctrine-project.org/documentation/cookbook/1_1/en/code-igniter-and-doctrine&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/cookbook/1_1/en/code-igniter-and-doctrine&lt;/a&gt; . A use YAML model with object name UserGroup and call method Doctrine_Core::createTablesFromModels(&apos;models&apos;); process faling with error:&lt;/p&gt;

&lt;p&gt;Fatal error: Class &apos;BaseUserGroup&apos; not found in /sourcepath/models/UserGroup.php on line 13&lt;/p&gt;

&lt;p&gt;Generate model file included abstract class BaseUserGroup exist and is OK. If I include BaseUserGroup manuly or rename object &quot;UserGroup&quot; on &quot;UserGroups&quot; everithing work fine. I thing here is a problem with autoloding base class with specifik name.&lt;/p&gt;

&lt;p&gt;Here is my code example:&lt;/p&gt;

&lt;p&gt;Doctrine_Core::dropDatabases();&lt;br/&gt;
Doctrine_Core::createDatabases();&lt;br/&gt;
Doctrine_Core::generateModelsFromYaml(&apos;sourcepath/yaml/model.yml&apos;, &apos;models&apos;);&lt;br/&gt;
Doctrine_Core::createTablesFromModels(&apos;models&apos;);&lt;/p&gt;


&lt;p&gt;Trouble shotting YAML model is:&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
UserGroup:&lt;br/&gt;
  columns:&lt;br/&gt;
    user_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
    group_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;/p&gt;</description>
                <environment>Linux, Ubuntu 9.04 64b</environment>
            <key id="10591">DC-344</key>
            <summary>Trouble with auto including generate Base class with specifik name</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="havelkaondrej">Havelka Ondrej</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2009 09:20:54 +0000</created>
                <updated>Sun, 21 Mar 2010 00:34:59 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>3</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11298" author="silent_hill_dev" created="Sat, 26 Dec 2009 19:40:52 +0000"  >&lt;p&gt;Same problem here following the same example of the 1.2 tutorial.&lt;/p&gt;</comment>
                    <comment id="11634" author="m.olszewski" created="Mon, 8 Feb 2010 19:14:40 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;ve stumbled upon the same problem and I think I know where the issue is.&lt;/p&gt;

&lt;p&gt;So Doctrine_Core::createTablesFromModels() calls Doctrine_Export::exportSchema() which in turn calls Doctrine_Core::loadModels().&lt;/p&gt;

&lt;p&gt;Doctrine_Core::loadModels() uses RecursiveIteratorIterator and iterates over all found files.&lt;/p&gt;

&lt;p&gt;Now I think the order of files returned by RecursiveIteratorIterator is not always the same (depends on OS, filenames and cosmic radiation &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; ), but the most important thing here is that class files from &apos;modules/generated&apos; directory (as in examples) ARE NOT included before subclasses derived from generated classes. This means that Doctrine_Core::autoload() fails to load classes from &apos;modules/generated&apos; directory, exactly this check fails:&lt;/p&gt;

&lt;p&gt;if (0 !== stripos($className, &apos;Doctrine_&apos;) || class_exists($className, false) || interface_exists($className, false))&lt;/p&gt;

&lt;p&gt;as base class is not starting with &apos;Doctrine_&apos; and is not yet loaded.&lt;/p&gt;

&lt;p&gt;To fix it properly the algorithm for loading modules must be changed to first include &apos;modules/generated&apos; classes and then rest of classes. I am not sure but maybe Core::autoload() might be changed to include base classes properly.&lt;/p&gt;


&lt;p&gt;QUICK WORKAROUND:&lt;br/&gt;
As a quick workaround I&apos;ve changed parameters in call to createTablesFromModels() to:&lt;/p&gt;

&lt;p&gt;Doctrine_Core::createTablesFromModels(array(&apos;models/generated&apos;,&apos;models&apos;));&lt;/p&gt;

&lt;p&gt;as createTablesFromModels() can accept array of directories.&lt;/p&gt;


&lt;p&gt;Hope this helps you, please let me know if you need any more information. Thanks!&lt;/p&gt;</comment>
                    <comment id="11635" author="sacho" created="Tue, 9 Feb 2010 01:38:32 +0000"  >&lt;p&gt;You are missing the model autoloader(&lt;a href=&quot;http://www.doctrine-project.org/upgrade/1_2#Models%20Autoloading&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/upgrade/1_2#Models%20Autoloading&lt;/a&gt;), which was added in 1.2&lt;/p&gt;

&lt;p&gt;That should fix the problem with conservative autoloading.&lt;/p&gt;</comment>
                    <comment id="11637" author="m.olszewski" created="Tue, 9 Feb 2010 11:54:06 +0000"  >&lt;p&gt;I&apos;ve tried registering modelsAutoload() and it works superb in this case for both aggressive and conservative loading.&lt;/p&gt;

&lt;p&gt;It is a shame that it is not mentioned in 1.2 PDF I&apos;ve got - it&apos;d make life easier for some people &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;Thanks for your help.&lt;/p&gt;</comment>
                    <comment id="12418" author="cublt" created="Sun, 21 Mar 2010 00:34:59 +0000"  >&lt;p&gt;i am a new user to doctrine and i hit this brick wall. this bug report was all that saved me, and it is a bit misleading. my test results are below. in the end i found a combination that worked, but this seems like a glaring bug especially since the pdf takes the user right down a path that fails completely in all cases (default aggressive loading, doesn&apos;t work for me at all).&lt;/p&gt;

&lt;p&gt;i am using a pear loaded version 1.2 on ubuntu&lt;/p&gt;

&lt;p&gt;here are my test results:&lt;br/&gt;
---------------------------------------------------------------------------------------------------&lt;br/&gt;
case 1: load models right after generating them, without modelsAutoLoad() call: SUCCESS/FAIL varies&lt;br/&gt;
---------------------------------------------------------------------------------------------------&lt;br/&gt;
in doctrine_bootstrap.php file: &lt;br/&gt;
&amp;lt;?&lt;br/&gt;
require_once(&apos;lib/vendor/doctrine/Doctrine.php&apos;);&lt;br/&gt;
spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));&lt;br/&gt;
$manager = Doctrine_Manager::getInstance();&lt;br/&gt;
$conn = Doctrine_Manager::connection(&apos;mysql:// DSN REMOVED &apos;,&apos;doctrine&apos;);&lt;/p&gt;

&lt;p&gt;in test.php:&lt;br/&gt;
&amp;lt;?&lt;br/&gt;
require_once(&apos;doctrine_bootstrap.php&apos;);&lt;br/&gt;
Doctrine_Core::generateModelsFromDb(&apos;models&apos;, array(&apos;doctrine&apos;), array(&apos;generateTableClasses&apos; =&amp;gt; true));&lt;br/&gt;
Doctrine_Core::loadModels(&apos;models&apos;);&lt;/p&gt;



&lt;p&gt;---------------------------------------------------------------------------------------------------&lt;br/&gt;
case 2: load models after they have already been generated, without modelsAutoLoad() call: FAIL&lt;br/&gt;
---------------------------------------------------------------------------------------------------&lt;br/&gt;
in doctrine_bootstrap.php file: &lt;br/&gt;
&amp;lt;?&lt;br/&gt;
require_once(&apos;lib/vendor/doctrine/Doctrine.php&apos;);&lt;br/&gt;
spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));&lt;br/&gt;
$manager = Doctrine_Manager::getInstance();&lt;br/&gt;
$conn = Doctrine_Manager::connection(&apos;mysql:// DSN REMOVED &apos;,&apos;doctrine&apos;);&lt;/p&gt;

&lt;p&gt;in test.php:&lt;br/&gt;
&amp;lt;?&lt;br/&gt;
// note: all model classes are in ./models and ./models/generated&lt;br/&gt;
require_once(&apos;doctrine_bootstrap.php&apos;);&lt;br/&gt;
Doctrine_Core::loadModels(&apos;models&apos;);&lt;/p&gt;




&lt;p&gt;---------------------------------------------------------------------------------------------------&lt;br/&gt;
case 3: load models after they have already been generated, with the modelsAutoLoad() call and default aggressive setting: FAIL&lt;br/&gt;
---------------------------------------------------------------------------------------------------&lt;br/&gt;
in doctrine_bootstrap.php file: &lt;br/&gt;
&amp;lt;?&lt;br/&gt;
require_once(&apos;lib/vendor/doctrine/Doctrine.php&apos;);&lt;br/&gt;
spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));&lt;br/&gt;
$manager = Doctrine_Manager::getInstance();&lt;br/&gt;
$conn = Doctrine_Manager::connection(&apos;mysql:// DSN REMOVED &apos;,&apos;doctrine&apos;);&lt;/p&gt;

&lt;p&gt;spl_autoload_register(array(&apos;Doctrine_Core&apos;, &apos;modelsAutoload&apos;));&lt;/p&gt;

&lt;p&gt;in test.php:&lt;br/&gt;
&amp;lt;?&lt;br/&gt;
// note: all model classes are in ./models and ./models/generated&lt;br/&gt;
require_once(&apos;doctrine_bootstrap.php&apos;);&lt;br/&gt;
Doctrine_Core::loadModels(&apos;models&apos;);&lt;/p&gt;




&lt;p&gt;---------------------------------------------------------------------------------------------------&lt;br/&gt;
case 4: load models after they have already been generated, with the modelsAutoLoad() call and conservative loading: SUCCESS&lt;br/&gt;
---------------------------------------------------------------------------------------------------&lt;br/&gt;
in doctrine_bootstrap.php file: &lt;br/&gt;
&amp;lt;?&lt;br/&gt;
require_once(&apos;lib/vendor/doctrine/Doctrine.php&apos;);&lt;br/&gt;
spl_autoload_register(array(&apos;Doctrine&apos;, &apos;autoload&apos;));&lt;br/&gt;
$manager = Doctrine_Manager::getInstance();&lt;br/&gt;
$conn = Doctrine_Manager::connection(&apos;mysql:// DSN REMOVED &apos;,&apos;doctrine&apos;);&lt;/p&gt;

&lt;p&gt;$manager-&amp;gt;setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);&lt;br/&gt;
spl_autoload_register(array(&apos;Doctrine_Core&apos;, &apos;modelsAutoload&apos;));&lt;/p&gt;

&lt;p&gt;in test.php:&lt;br/&gt;
&amp;lt;?&lt;br/&gt;
// note: all model classes are in ./models and ./models/generated&lt;br/&gt;
require_once(&apos;doctrine_bootstrap.php&apos;);&lt;br/&gt;
Doctrine_Core::loadModels(&apos;models&apos;);&lt;/p&gt;

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

<item>
            <title>[DC-328] Multi-table query (left-join) problem in the Doctrine_Hydrator_Graph class</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-328</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I tried below code. It must be return 2 records, but It returned 1 record. I traced  Doctrine and found to reason in &lt;br/&gt;
Doctrine_Hydrator_Graph class line 165 ( $identifierMap&lt;span class=&quot;error&quot;&gt;&amp;#91;$rootAlias&amp;#93;&lt;/span&gt;[$id&lt;span class=&quot;error&quot;&gt;&amp;#91;$rootAlias&amp;#93;&lt;/span&gt;] = $this-&amp;gt;getLastKey($result); ) When couple $rootAlias not get record.&lt;/p&gt;

&lt;p&gt;I attached my data and code. Is it problem?!&lt;/p&gt;

&lt;p&gt;  77         $q = Doctrine_Query::create();&lt;br/&gt;
  78         $q-&amp;gt;select(&quot;r.post_id as id, p.title as title, p.slug as slug, p.created_on as created_on&quot;)-&amp;gt;&lt;br/&gt;
  79             from(&quot;Relations r&quot;)-&amp;gt;&lt;br/&gt;
  80                 leftJoin(&quot;r.Taxonomies t&quot;)-&amp;gt;&lt;br/&gt;
  81                 leftJoin(&quot;t.Marks m&quot;)-&amp;gt;&lt;br/&gt;
  82                 leftJoin(&quot;r.Posts p&quot;)-&amp;gt;&lt;br/&gt;
  83             where(&quot;m.slug = ?&quot;, $slug)-&amp;gt;&lt;br/&gt;
  84                 andWhere(&quot;m.status = ?&quot;, self::PUBLISH)-&amp;gt;&lt;br/&gt;
  85                 andWhere(&quot;p.status = ?&quot;, self::PUBLISH)-&amp;gt;&lt;br/&gt;
  86                 andWhere(&quot;t.status = ?&quot;, self::PUBLISH)-&amp;gt;&lt;br/&gt;
  87                 andWhere(&quot;t.type = ?&quot;, self::CATEGORY)-&amp;gt;&lt;br/&gt;
  88             orderBy(&quot;p.created_on desc&quot;);&lt;/p&gt;

</description>
                <environment>Ubuntu 9.10 Linux / PHP 5.2.x / Apache2 / Mysql 5</environment>
            <key id="10565">DC-328</key>
            <summary>Multi-table query (left-join) problem in the Doctrine_Hydrator_Graph class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="meddah">Hasan Ozgan</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Dec 2009 18:13:37 +0000</created>
                <updated>Fri, 4 Dec 2009 18:13:37 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10212" name="hasanozgan_com.sql" size="116050" author="meddah" created="Fri, 4 Dec 2009 18:13:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-293] Implement a self-reference class mechanism without the usage of associative classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-293</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Equals to summary&lt;/p&gt;</description>
                <environment>Ubuntu 9.10, Eclipse</environment>
            <key id="10511">DC-293</key>
            <summary>Implement a self-reference class mechanism without the usage of associative classes</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ruigoncalves">Rui Miguel Gon&#231;alves</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Nov 2009 17:59:51 +0000</created>
                <updated>Wed, 25 Nov 2009 17:59:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-292] no migrations diff on template change</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-292</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;the generate-migrations-diff does not create migrations if the template changes fields on the model.&lt;/p&gt;

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

&lt;p&gt;File:&lt;br/&gt;
  tableName: files&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Eeecore_Record_File&lt;br/&gt;
  actAs:&lt;br/&gt;
    Fileable:&lt;/p&gt;


&lt;p&gt;The Fileable Template does the following... (the &quot;fileFields&quot; option stores a couple of fields to add to the model)&lt;/p&gt;

&lt;p&gt;public function setTableDefinition()&lt;br/&gt;
	{&lt;/p&gt;

&lt;p&gt;			foreach ($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fileFields&amp;#39;&amp;#93;&lt;/span&gt; as $key =&amp;gt; $field)&lt;/p&gt;
{
				$this-&amp;gt;hasColumn($field[&apos;name&apos;], $field[&apos;type&apos;], $field[&apos;length&apos;], $field[&apos;options&apos;]);
                         }
&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;everything works fine on generate-migrations-models (the initial migrations)... but if we change something on the &quot;fileFields&quot; the generate-migrations-diff call doesn&apos;t do anything. We have to rebuild all migrations or write a new migration by hand.&lt;/p&gt;

</description>
                <environment></environment>
            <key id="10508">DC-292</key>
            <summary>no migrations diff on template change</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jensen83">Christian Jaentsch</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Nov 2009 13:45:09 +0000</created>
                <updated>Mon, 1 Mar 2010 19:44:09 +0000</updated>
                                    <version>1.2.0-RC1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11061" author="jwage" created="Mon, 7 Dec 2009 19:59:56 +0000"  >&lt;p&gt;I added coverage for this issue and it is working as expected. I compare two schemas:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Article:
  columns:
    title: string(255)
    body: clob
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and I compare it to this one:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Article:
  actAs: [Timestampable]
  columns:
    title: string(255)
    body: clob
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And now I do 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;        $migration = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Migration(dirname(__FILE__) . &apos;/DC292/migrations&apos;);
        $diff = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine_Migration_Diff(dirname(__FILE__) . &apos;/DC292/from.yml&apos;, dirname(__FILE__) . &apos;/DC292/to.yml&apos;, $migration);
        $changes = $diff-&amp;gt;generateChanges();
        print_r($changes);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It has this in the array:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    [created_columns] =&amp;gt; Array
        (
            [article] =&amp;gt; Array
                (
                    [created_at] =&amp;gt; Array
                        (
                            [notnull] =&amp;gt; 1
                            [type] =&amp;gt; timestamp
                            [length] =&amp;gt; 25
                        )

                    [updated_at] =&amp;gt; Array
                        (
                            [notnull] =&amp;gt; 1
                            [type] =&amp;gt; timestamp
                            [length] =&amp;gt; 25
                        )

                )

        )

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="11082" author="jensen83" created="Tue, 8 Dec 2009 13:42:45 +0000"  >&lt;p&gt;The problem does not occur if you compare 2 schemas while one has a certain template and the other not.&lt;/p&gt;

&lt;p&gt;In my case the problem occurs when the 2 schemas both already have the same template definition but in one case the template itself has changed (e.g. injects one more field into the database table of a certain model via setTableDefinition).&lt;/p&gt;</comment>
                    <comment id="11097" author="jwage" created="Tue, 8 Dec 2009 18:03:35 +0000"  >&lt;p&gt;When I test that it works as well. Can you show some kind of reproducible test case?&lt;/p&gt;</comment>
                    <comment id="11930" author="jwage" created="Mon, 1 Mar 2010 19:44:09 +0000"  >&lt;p&gt;Maybe you could add a test case for this?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-278] Invalid qubquery generated if using oracle adapter instead of pdo_oci</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-278</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine generates the following invalid subquery if oracle adapter is used (same query is generated corret if pdo_oci is used):&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT &quot;s2&quot;.&quot;code&quot; &lt;br/&gt;
FROM &quot;spend_category&quot; &quot;s2&quot; &lt;br/&gt;
INNER JOIN &quot;company_spend_category&quot; &quot;c4&quot; ON (&quot;s2&quot;.&quot;code&quot; = &quot;c4&quot;.&quot;spendcategory_code&quot;) &lt;br/&gt;
INNER JOIN &quot;company&quot; &quot;c3&quot; ON &quot;c3&quot;.&quot;code&quot; = &quot;c4&quot;.&quot;company_code&quot; &lt;br/&gt;
WHERE &quot;s2&quot;.&quot;code&quot; = &apos;19000000&apos; &lt;br/&gt;
AND &quot;c3&quot;.&quot;is_deleted&quot; IS NOT NULL &lt;br/&gt;
AND &quot;s2&quot;.&quot;is_deleted&quot; IS NOT NULL &lt;br/&gt;
ORDER BY &quot;c3&quot;.&quot;name&quot; desc&lt;/p&gt;

&lt;p&gt;The problem is that the order by column is not part of the selected columns.&lt;/p&gt;

&lt;p&gt;Sample dql statement to reproduce this error:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;pageAllPager = new Doctrine_Pager(&lt;br/&gt;
        $q = Doctrine_Query::create()&lt;br/&gt;
                -&amp;gt;select(&apos;c.code, c.name, c.is_activated, c.is_deleted, sc.code&apos;)&lt;br/&gt;
                -&amp;gt;from(&apos;SpendCategory sc&apos;)&lt;br/&gt;
                -&amp;gt;innerJoin(&apos;sc.Companies c&apos;)&lt;br/&gt;
                -&amp;gt;where(&quot;sc.code = &apos;$spendcategory&apos;&quot;)&lt;br/&gt;
                -&amp;gt;addWhere(&apos;c.is_deleted IS NOT NULL&apos;)&lt;br/&gt;
                -&amp;gt;addWhere(&apos;sc.is_deleted IS NOT NULL&apos;)&lt;br/&gt;
                -&amp;gt;orderBy($orderBy)&lt;br/&gt;
                -&amp;gt;setHydrationMode(Doctrine::HYDRATE_ARRAY),&lt;br/&gt;
                $page,&lt;br/&gt;
                $resultsPerPage);&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>Linux, Oracle 10g</environment>
            <key id="10491">DC-278</key>
            <summary>Invalid qubquery generated if using oracle adapter instead of pdo_oci</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tom808">Thomas Wahle</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 18:03:28 +0000</created>
                <updated>Wed, 9 Jun 2010 13:02:31 +0000</updated>
                                                    <fixVersion>1.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10827" author="jwage" created="Mon, 23 Nov 2009 23:37:04 +0000"  >&lt;p&gt;I believe this is fixed now in the latest Doctrine 1.2. Can you test and confirm?&lt;/p&gt;</comment>
                    <comment id="10855" author="tom808" created="Tue, 24 Nov 2009 21:51:23 +0000"  >&lt;p&gt;It is not fixed with 1.2 RC1&lt;/p&gt;

&lt;p&gt;Same sql wich work fine with pdo_oci generates an error using the oracle adapter&lt;/p&gt;

&lt;p&gt;&amp;lt;p&amp;gt;&lt;br/&gt;
    &amp;lt;b&amp;gt;Message:&amp;lt;/b&amp;gt; ORA-01791: Kein mit SELECT ausgew&#228;hlter Ausdruck : SELECT s.code AS s_&lt;em&gt;code, c.code AS c&lt;/em&gt;&lt;em&gt;code, c.name AS c&lt;/em&gt;&lt;em&gt;name, c.is_activated AS c&lt;/em&gt;&lt;em&gt;is_activated, c.is_deleted AS c&lt;/em&gt;_is_deleted FROM spend_category s INNER JOIN company_spend_category c2 ON (s.code = c2.spendcategory_code) INNER JOIN company c ON c.code = c2.company_code WHERE s.code IN (SELECT a.code FROM ( SELECT DISTINCT s2.code FROM spend_category s2 INNER JOIN company_spend_category c4 ON (s2.code = c4.spendcategory_code) INNER JOIN company c3 ON c3.code = c4.company_code WHERE s2.code = &apos;37000000&apos; AND c3.is_deleted IS NOT NULL AND s2.is_deleted IS NOT NULL ORDER BY c3.name desc ) a WHERE ROWNUM &amp;lt;= 10) AND (s.code = &apos;37000000&apos; AND c.is_deleted IS NOT NULL AND s.is_deleted IS NOT NULL) ORDER BY c.name desc. &lt;/p&gt;

&lt;p&gt;Failing Query: &quot;SELECT s.code AS s_&lt;em&gt;code, c.code AS c&lt;/em&gt;&lt;em&gt;code, c.name AS c&lt;/em&gt;&lt;em&gt;name, c.is_activated AS c&lt;/em&gt;&lt;em&gt;is_activated, c.is_deleted AS c&lt;/em&gt;_is_deleted FROM spend_category s INNER JOIN company_spend_category c2 ON (s.code = c2.spendcategory_code) INNER JOIN company c ON c.code = c2.company_code WHERE s.code IN (SELECT a.code FROM ( SELECT DISTINCT s2.code FROM spend_category s2 INNER JOIN company_spend_category c4 ON (s2.code = c4.spendcategory_code) INNER JOIN company c3 ON c3.code = c4.company_code WHERE s2.code = &apos;37000000&apos; AND c3.is_deleted IS NOT NULL AND s2.is_deleted IS NOT NULL ORDER BY c3.name desc ) a WHERE ROWNUM &amp;lt;= 10) AND (s.code = &apos;37000000&apos; AND c.is_deleted IS NOT NULL AND s.is_deleted IS NOT NULL) ORDER BY c.name desc&quot;&amp;lt;/p&amp;gt;&lt;/p&gt;</comment>
                    <comment id="10856" author="jwage" created="Tue, 24 Nov 2009 21:53:02 +0000"  >&lt;p&gt;I can&apos;t reproduce the issue in a test case. Can you help me with that? When I test what you&apos;re describing I get the results that are expected.&lt;/p&gt;</comment>
                    <comment id="10862" author="tom808" created="Wed, 25 Nov 2009 09:39:55 +0000"  >&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;if i undestand the last comment correctly this issue will be fixed in 1.2 RC2.&lt;/p&gt;

&lt;p&gt;I have reviewed lots of existing test cases but did not find an example where pdo_oci or oracle adapter is used.&lt;/p&gt;

&lt;p&gt;Can you please forward the test case you have created for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-278&quot; title=&quot;Invalid qubquery generated if using oracle adapter instead of pdo_oci&quot;&gt;DC-278&lt;/a&gt; to me? I will  use this as a template for any further issues and hopefuly reduce your efforts.&lt;/p&gt;

&lt;p&gt;Kind regards&lt;br/&gt;
Tom&lt;/p&gt;

&lt;p&gt;&amp;gt; Jonathan H. Wage updated &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-278&quot; title=&quot;Invalid qubquery generated if using oracle adapter instead of pdo_oci&quot;&gt;DC-278&lt;/a&gt;:&lt;br/&gt;
&amp;gt; --------------------------------&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt;    Fix Version/s: 1.2.0-RC2&lt;br/&gt;
&amp;gt;                       (was: 1.2.0-RC1)&lt;/p&gt;

</comment>
                    <comment id="11160" author="tom808" created="Thu, 10 Dec 2009 14:50:55 +0000"  >&lt;p&gt;I do believe that I have found the reason and it is still an issue with Doctrine 1.2.1 &lt;/p&gt;

&lt;p&gt;Doctrine generate the following subquery which is processed in Doctrine_Query:: getLimitSubquery(). &lt;/p&gt;

&lt;p&gt;SELECT b.id FROM &lt;br/&gt;
	(&lt;br/&gt;
		SELECT a.*, ROWNUM AS doctrine_rownum FROM	&lt;br/&gt;
		(&lt;br/&gt;
			SELECT DISTINCT i.id, i.lft &lt;br/&gt;
			FROM item i &lt;br/&gt;
			INNER JOIN oum o ON i.oum_id = o.id AND (o.is_deleted IS NOT NULL) &lt;br/&gt;
			INNER JOIN item_type i2 ON i.type_id = i2.id AND (i2.is_deleted IS NOT NULL)&lt;br/&gt;
			INNER JOIN item_translation i3 ON i.id = i3.id &lt;br/&gt;
			LEFT JOIN attachment a ON i.id = a.item_id AND (a.is_deleted = 0) &lt;br/&gt;
			WHERE i.bundling_id = ? &lt;br/&gt;
			ORDER BY i.lft &lt;br/&gt;
		) a  &lt;br/&gt;
	) b &lt;br/&gt;
WHERE doctrine_rownum BETWEEN 3 AND 4&lt;/p&gt;


&lt;p&gt;This function replaces the table alias names. It looks like that the first occurance of &quot;a&quot; is detected and the inner alias for table attachment &quot;a&quot; is replaced by &quot;a2&quot; - that&apos;s fine. But also the outer table alias &quot;a&quot; is replaced by &quot;a2&quot; The result will be&lt;/p&gt;

&lt;p&gt;SELECT b.id FROM &lt;br/&gt;
	(&lt;br/&gt;
		SELECT a.*, ROWNUM AS doctrine_rownum FROM	&lt;br/&gt;
		(&lt;br/&gt;
			&lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;&lt;br/&gt;
			LEFT JOIN attachment a2 ON i.id = a2.item_id AND (a2.is_deleted = 0) &lt;br/&gt;
			WHERE i.bundling_id = ? &lt;br/&gt;
			ORDER BY i.lft &lt;br/&gt;
		) a2 &#61663; !!!!!!  &lt;br/&gt;
	) b &lt;/p&gt;

&lt;p&gt;&#8222;a&quot; is selected but the alias has been changed to &#8222;a2&quot; and this will cause an sql error.&lt;/p&gt;

&lt;p&gt;It looks like that this bug will only raise if a table is used in the subquery which starts with an &quot;a&quot;&lt;/p&gt;</comment>
                    <comment id="11176" author="tom808" created="Fri, 11 Dec 2009 16:47:18 +0000"  >&lt;p&gt;As a workaround i have change &quot;a&quot; to &quot;x&quot; in the Doctrine_Connection_Oracle::_createLimitSubquery()&lt;/p&gt;

&lt;p&gt;As far as no table in our projekt starts with character &quot;x&quot; this works fine for me.&lt;/p&gt;

&lt;p&gt;By the way: Shouldn&apos;t it be $this-&amp;gt;quoteIdentifier(&apos;a&apos;) . &apos;.&lt;b&gt;&apos; instead of just a.&lt;/b&gt; ??&lt;/p&gt;

&lt;p&gt;original code:&lt;br/&gt;
                    $query = &apos;SELECT b.&apos;.$column.&apos; FROM ( &apos;.&lt;br/&gt;
                                 &apos;SELECT a.*, ROWNUM AS doctrine_rownum FROM ( &apos;&lt;br/&gt;
                                   . $query . &apos; ) &apos; . $this-&amp;gt;quoteIdentifier(&apos;a&apos;) . &apos; &apos;.&lt;br/&gt;
                              &apos; ) &apos; . $this-&amp;gt;quoteIdentifier(&apos;b&apos;) . &apos; &apos;.&lt;br/&gt;
                              &apos;WHERE doctrine_rownum BETWEEN &apos; . $min .  &apos; AND &apos; . $max;&lt;/p&gt;

&lt;p&gt;modified code:&lt;br/&gt;
                    $query = &apos;SELECT b.&apos;.$column.&apos; FROM ( &apos;.&lt;br/&gt;
                                 &apos;SELECT x.*, ROWNUM AS doctrine_rownum FROM ( &apos;&lt;br/&gt;
                                   . $query . &apos; ) &apos; . $this-&amp;gt;quoteIdentifier(&apos;x&apos;) . &apos; &apos;.&lt;br/&gt;
                              &apos; ) &apos; . $this-&amp;gt;quoteIdentifier(&apos;b&apos;) . &apos; &apos;.&lt;br/&gt;
                              &apos;WHERE doctrine_rownum BETWEEN &apos; . $min .  &apos; AND &apos; . $max;&lt;/p&gt;</comment>
                    <comment id="13195" author="jwage" created="Tue, 8 Jun 2010 15:01:45 +0000"  >&lt;p&gt;Can you provide the change that fixes the problem for you as a diff so we can test it?&lt;/p&gt;</comment>
                    <comment id="13244" author="tom808" created="Wed, 9 Jun 2010 03:37:49 +0000"  >&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;long time with no hear from you. Hope you are well!&lt;/p&gt;

&lt;p&gt;I am sorry, we did not fix this bug really. As writte above we have just implemented a work around by choosing a different character (&quot;x&quot; instead of &quot;a&quot;) for the name of the generated sub query alias. This works fine with our data model (no table starts with &quot;x&quot;) but may cause the same error with other data models.&lt;/p&gt;

&lt;p&gt;At all: There was too much trouble in this project last year. Due to this we made the decision to go ahead with pdo_oci to finish the project in time.&lt;/p&gt;

&lt;p&gt;Kind regards&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                    <comment id="13254" author="jwage" created="Wed, 9 Jun 2010 13:02:31 +0000"  >&lt;p&gt;I&apos;ll leave this open if someone runs across the same problem, a test case showing the issue would help with pin pointing the problem area in the code.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-185] The pessimistic offline locking manager locks the entire table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-185</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Scenario: &lt;br/&gt;
    $entity = Doctrine::getTable(&apos;Steps&apos;)-&amp;gt;find($pID);&lt;br/&gt;
    $lockingManager = new Doctrine_Locking_Manager_Pessimistic( Doctrine_Manager::connection()  );&lt;br/&gt;
    $lockingManager-&amp;gt;releaseAgedLocks(300);&lt;br/&gt;
    $gotLock = $lockingManager-&amp;gt;getLock($entity, &apos;user1&apos; ); &lt;/p&gt;

&lt;p&gt;Running this code locks the entire table &quot;Steps&quot;, and not just the record. &lt;/p&gt;

&lt;p&gt;in the table &quot;doctrine_lock_tracking&quot;, in the fields: &quot;object_type&quot; and &quot;object_key&quot;  are saved in this case: &quot;Steps&quot; and &quot;IDStep&quot;. &lt;br/&gt;
I think that here must be saved &quot;Steps&quot; and &quot;120&quot; (the value of IDStep). &lt;/p&gt;
</description>
                <environment>Windows XP, WampServer Version 2.0&lt;br/&gt;
</environment>
            <key id="10336">DC-185</key>
            <summary>The pessimistic offline locking manager locks the entire table</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fbrussa">Fabian Brussa</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Nov 2009 18:33:58 +0000</created>
                <updated>Thu, 13 Dec 2012 13:12:52 +0000</updated>
                                    <version>1.1.4</version>
                <version>1.1.5</version>
                <version>1.2.3</version>
                                                        <due></due>
                    <votes>7</votes>
                        <watches>7</watches>
                        <comments>
                    <comment id="10736" author="fbrussa" created="Wed, 18 Nov 2009 16:01:48 +0000"  >&lt;p&gt;Is anybody looking into this issue ?&lt;/p&gt;</comment>
                    <comment id="10755" author="jwage" created="Wed, 18 Nov 2009 22:05:55 +0000"  >&lt;p&gt;Can you provide a test case that shows the issue? It is hard to look into the issue without a test to run &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; When I look at the code and our tests everything is passing and fine so I am not sure what your issue could be. Re-open if you have more information to provide.&lt;/p&gt;</comment>
                    <comment id="10774" author="fbrussa" created="Thu, 19 Nov 2009 12:14:42 +0000"  >&lt;p&gt;ok, I attach the test case&lt;/p&gt;</comment>
                    <comment id="10994" author="fbrussa" created="Thu, 3 Dec 2009 19:51:20 +0000"  >&lt;p&gt;Have you already been able to look at the testcase ??&lt;/p&gt;</comment>
                    <comment id="11385" author="fbrussa" created="Thu, 14 Jan 2010 19:48:41 +0000"  >&lt;p&gt;Any news ??&lt;/p&gt;</comment>
                    <comment id="13413" author="leszczu" created="Fri, 25 Jun 2010 10:15:21 +0000"  >&lt;p&gt;This issue is still valid for Doctrine 1.2. Doctrine_Locking_Manager_Pessimistic is &lt;b&gt;UNUSABLE&lt;/b&gt; without this bug fixed!&lt;/p&gt;</comment>
                    <comment id="13496" author="markus.woessner" created="Fri, 2 Jul 2010 05:26:05 +0000"  >&lt;p&gt;Having a look at &quot;Doctrine_Locking_Manager_Pessimistic::getLock()&quot; it becomes clear what causes this misbehaviour:&lt;/p&gt;

&lt;div class=&quot;code panel&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 getLock(Doctrine_Record $record, $userIdent)
    {
        $objectType = $record-&amp;gt;getTable()-&amp;gt;getComponentName();
        $key        = $record-&amp;gt;getTable()-&amp;gt;getIdentifier();

        $gotLock = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
        $time = time();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_array($key)) {
            &lt;span class=&quot;code-comment&quot;&gt;// Composite key
&lt;/span&gt;            $key = implode(&apos;|&apos;, $key);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            $dbh = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh();
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;beginTransaction();

            $stmt = $dbh-&amp;gt;prepare(&apos;INSERT INTO &apos; . $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_lockTable
                                  . &apos; (object_type, object_key, user_ident, timestamp_obtained)&apos;
                                  . &apos; VALUES (:object_type, :object_key, :user_ident, :ts_obtained)&apos;);

            $stmt-&amp;gt;bindParam(&apos;:object_type&apos;, $objectType);
            $stmt-&amp;gt;bindParam(&apos;:object_key&apos;, $key);
            $stmt-&amp;gt;bindParam(&apos;:user_ident&apos;, $userIdent);
            $stmt-&amp;gt;bindParam(&apos;:ts_obtained&apos;, $time);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is NO hint about the Record&apos;s identifier VALUE but only about the identifier&apos;s NAME (mostly &quot;id&quot;) which appears to be redundant information. Instead of ...&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $key = $record-&amp;gt;getTable()-&amp;gt;getIdentifier();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;..there should be something like ..&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        $key = $record-&amp;gt;get($record-&amp;gt;getTable()-&amp;gt;getIdentifier());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In case of composite keys a string concatenation, prefixed by identifier&apos;s name might work but I would recommend using &quot;md5()&quot; on resulting value to limit its length since field &quot;object_key&quot; is limited to 250 chars.&lt;/p&gt;</comment>
                    <comment id="13497" author="branleb" created="Fri, 2 Jul 2010 10:49:03 +0000"  >&lt;p&gt;Based on the previous comment by Markus W&#246;&#223;ner i created a patch for  row based locking.&lt;/p&gt;

&lt;p&gt;It concatenates the PK fields and their values to a string and calculates the sha-1 hash as a unique string representing that record. This string is then used as key so that we&apos;ll only lock the single Record and not the whole table.&lt;/p&gt;

&lt;p&gt;I hope you&apos;ll give this patch a try - It solved this problem for me.&lt;/p&gt;</comment>
                    <comment id="13498" author="markus.woessner" created="Fri, 2 Jul 2010 17:18:56 +0000"  >&lt;p&gt;I applied patch from Mr. Florian Zumkeller-Quast and provided testcase didn&apos;t fail anymore. I think this should do it. By the way I find it strange that this issue isn&apos;t already fixed. I guess locking is not very much used by Doctrine users.&lt;/p&gt;</comment>
                    <comment id="16895" author="jeromeweb" created="Mon, 21 Nov 2011 10:29:51 +0000"  >&lt;p&gt;I applied patch too and it works now. I guess too that nobody use Lockings but when you use it ... without the patch it fails.&lt;/p&gt;</comment>
                    <comment id="19131" author="greg0ire" created="Thu, 13 Dec 2012 13:12:52 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-984&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-984&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10174" name="DC185TestCase.php" size="1952" author="fbrussa" created="Thu, 19 Nov 2009 12:15:52 +0000" />
                    <attachment id="10688" name="row_based_locking.patch" size="3262" author="branleb" created="Fri, 2 Jul 2010 10:49:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-81] Using WITH in combinations with LIMIT returns unexpected results</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-81</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I try to limit left joined records with an additional WITH clause, it seems to be bugged when also specifying a LIMIT.&lt;/p&gt;

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

&lt;p&gt;FROM Transporter t LEFT JOIN t.Profile p LEFT JOIN t.Requests r WITH (r.distributor_id = ?) WHERE t.is_active = ? ORDER BY p.company_country, p.company_name LIMIT 20&lt;/p&gt;

&lt;p&gt;This returns me 0 results, while removing the LIMIT (or the WITH) will return me 2 results.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6.1</environment>
            <key id="10143">DC-81</key>
            <summary>Using WITH in combinations with LIMIT returns unexpected results</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gerryvdm">Gerry Vandermaesen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Oct 2009 07:59:08 +0000</created>
                <updated>Tue, 15 Jun 2010 10:15:33 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10420" author="jwage" created="Mon, 2 Nov 2009 22:35:55 +0000"  >&lt;p&gt;Sorry this is just not enough information to produce the problem. I ran some basic tests looking for what you pointed out but I didn&apos;t see any issues. Plus our tests cover this functionality so I imagine that if it were broke we&apos;d get some failures. However, I could be wrong so if you could re-open and provide a failing test case for us that would help with getting it fixed.&lt;/p&gt;</comment>
                    <comment id="12688" author="gerryvdm" created="Fri, 16 Apr 2010 05:27:46 +0000"  >&lt;p&gt;I actually ran into this problem once again in another problem.&lt;/p&gt;

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

&lt;p&gt;Story:&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;/p&gt;

&lt;p&gt;Picture:&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    story_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    is_selected:&lt;br/&gt;
      type: boolean&lt;br/&gt;
      notnull: true&lt;br/&gt;
      default: false&lt;br/&gt;
  relations:&lt;br/&gt;
    Story:&lt;br/&gt;
      foreignAlias: Pictures&lt;br/&gt;
      local: story_id&lt;br/&gt;
      foreign: id&lt;br/&gt;
      type: one&lt;br/&gt;
      foreignType: many&lt;br/&gt;
      onDelete: CASCADE&lt;/p&gt;

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

&lt;p&gt;Doctrine_Query::create()&lt;br/&gt;
	-&amp;gt;from(&apos;Story s&apos;)&lt;br/&gt;
	-&amp;gt;leftJoin(&apos;s.Pictures p WITH p.is_selected = ?&apos;, true)&lt;br/&gt;
	-&amp;gt;where(&apos;s.id = ?&apos;, 5)&lt;br/&gt;
	-&amp;gt;limit(10);&lt;/p&gt;

&lt;p&gt;Outputted SQL:&lt;/p&gt;

&lt;p&gt;SELECT  &quot;s&quot;.&quot;id&quot; AS &quot;s_&lt;em&gt;id&quot;, &quot;s&quot;.&quot;first_name&quot; AS &quot;s&lt;/em&gt;&lt;em&gt;first_name&quot;, &quot;s&quot;.&quot;last_name&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;last_name&quot;, &quot;s&quot;.&quot;country&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;country&quot;, &quot;s&quot;.&quot;email&quot; AS &quot;s&lt;/em&gt;&lt;em&gt;email&quot;, &quot;s&quot;.&quot;content&quot; AS &quot;s&lt;/em&gt;&lt;em&gt;content&quot;, &quot;s&quot;.&quot;title&quot; AS &quot;s&lt;/em&gt;&lt;em&gt;title&quot;, &quot;s&quot;.&quot;summary&quot; AS &quot;s&lt;/em&gt;&lt;em&gt;summary&quot;, &quot;s&quot;.&quot;is_published&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;is_published&quot;, &quot;s&quot;.&quot;is_rejected&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;is_rejected&quot;, &quot;s&quot;.&quot;is_promoted&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;is_promoted&quot;, &quot;s&quot;.&quot;published_at&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;published_at&quot;, &quot;s&quot;.&quot;created_at&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;created_at&quot;, &quot;s&quot;.&quot;updated_at&quot; AS  &quot;s&lt;/em&gt;&lt;em&gt;updated_at&quot;, &quot;p&quot;.&quot;id&quot; AS &quot;p&lt;/em&gt;&lt;em&gt;id&quot;, &quot;p&quot;.&quot;story_id&quot; AS &quot;p&lt;/em&gt;&lt;em&gt;story_id&quot;, &quot;p&quot;.&quot;filename_original&quot; AS  &quot;p&lt;/em&gt;&lt;em&gt;filename_original&quot;, &quot;p&quot;.&quot;filename_large&quot; AS &quot;p&lt;/em&gt;&lt;em&gt;filename_large&quot;, &quot;p&quot;.&quot;filename_thumb&quot; AS &quot;p&lt;/em&gt;&lt;em&gt;filename_thumb&quot;, &quot;p&quot;.&quot;mime_type&quot; AS  &quot;p&lt;/em&gt;&lt;em&gt;mime_type&quot;, &quot;p&quot;.&quot;is_selected&quot; AS  &quot;p&lt;/em&gt;&lt;em&gt;is_selected&quot;, &quot;p&quot;.&quot;created_at&quot; AS  &quot;p&lt;/em&gt;&lt;em&gt;created_at&quot;, &quot;p&quot;.&quot;updated_at&quot; AS  &quot;p&lt;/em&gt;_updated_at&quot; FROM &quot;story&quot; &quot;s&quot; LEFT JOIN &quot;picture&quot; &quot;p&quot; ON &quot;s&quot;.&quot;id&quot; = &quot;p&quot;.&quot;story_id&quot; AND (&quot;p&quot;.&quot;is_selected&quot; = &apos;1&apos;) WHERE &quot;s&quot;.&quot;id&quot; IN (SELECT  DISTINCT &quot;s2&quot;.&quot;id&quot; FROM &quot;story&quot; &quot;s2&quot; LEFT JOIN &quot;picture&quot; &quot;p2&quot; ON &quot;s2&quot;.&quot;id&quot; = &quot;p2&quot;.&quot;story_id&quot; AND (&quot;p2&quot;.&quot;is_selected&quot; = &apos;5&apos;) WHERE &quot;s2&quot;.&quot;id&quot; = &apos;1&apos; ORDER BY &quot;s2&quot;.&quot;published_at&quot; DESC LIMIT  10) AND (&quot;s&quot;.&quot;id&quot; = &apos;5&apos;) ORDER BY  &quot;s&quot;.&quot;published_at&quot; DESC&lt;/p&gt;

&lt;p&gt;Notice the WHERE &quot;s2&quot;.&quot;id&quot; = &apos;1&apos; !&lt;/p&gt;</comment>
                    <comment id="13194" author="jwage" created="Tue, 8 Jun 2010 15:01:06 +0000"  >&lt;p&gt;Can you provide a test case we can run?&lt;/p&gt;</comment>
                    <comment id="13327" author="gerryvdm" created="Tue, 15 Jun 2010 10:15:33 +0000"  >&lt;p&gt;I could not figure out what test to write but I did narrow the problem down.&lt;/p&gt;

&lt;p&gt;It seems that the order of the generated SQL clauses does not match the order of the passed parameters, so in the final SQL query the values are mixed up. You can actually see that happening in the SQL query above. I also noticed there a special cases hardcoded in the code for MySQL and PgSQL as far as these &quot;limit subqueries&quot; go, so that might be another reason why you havent bumped into problem before. I was using an SQLite driver.&lt;/p&gt;

&lt;p&gt;I suppose something goes wrong in the SQL generation, but I don&apos;t know the core good enough to find out where exactly it does go wrong, so I&apos;m afraid I can&apos;t attach a test case, but it should be easy to reproduce now anyway.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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


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

&lt;p&gt;leads to : SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: Column not found: 1054 Unknown column &apos;a.localidad_id&apos; in &apos;on clause&apos;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11313">DC-661</key>
            <summary>Subquery Doctrine Couldn&apos;t find class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="guinsel">Mauro E.</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 May 2010 04:28:31 +0000</created>
                <updated>Tue, 8 Jun 2010 14:09:05 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13175" author="jwage" created="Tue, 8 Jun 2010 13:37:10 +0000"  >&lt;p&gt;You are using table names in your query and not model names.&lt;/p&gt;

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

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

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

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

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

<item>
            <title>[DC-643] Doctrine_Collection problem duplicate record</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-643</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;blockquote&gt;
&lt;p&gt;$oVideo	= Doctrine_Core::getTable (&quot;Model_Video&quot;)-&amp;gt;find (500);&lt;br/&gt;
$oVideo	= new Model_Video ();&lt;br/&gt;
$oVideo-&amp;gt;assignIdentifier (500);&lt;/p&gt;

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

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

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

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

&lt;p&gt;Doctrine create a relation between the video and tag. It doesn&apos;t update it. &lt;br/&gt;
If the relation already exists into the database, Doctrine create an other record, or the DB throw an integrity error if you have constraint.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11257">DC-643</key>
            <summary>Doctrine_Collection problem duplicate record</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Apr 2010 09:53:22 +0000</created>
                <updated>Thu, 22 Apr 2010 09:53:22 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-609] Symfony doctrine doesnt save an M:M table if one of the tables is in a 1:1 relationship with another table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-609</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Symfony doctrine doesnt save an M:M table if one of the tables is in a 1:1 relationship with another table. Refer to Screen.png for ER diagram.&lt;/p&gt;

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

&lt;p&gt;You will notice in Screen shot 2010-03-31 at 3.30.56 AM.png, an item is selected in &quot;Amenities list&quot;. When the form is submitted, everything saves in the db except for the item in the &quot;Amenities list&quot; (Screen shot 2010-03-31 at 3.31.37 AM.png)&lt;/p&gt;
</description>
                <environment>MAC, Symfony PHP framework</environment>
            <key id="11154">DC-609</key>
            <summary>Symfony doctrine doesnt save an M:M table if one of the tables is in a 1:1 relationship with another table</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="krz">Chris F</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Mar 2010 15:42:04 +0000</created>
                <updated>Wed, 31 Mar 2010 06:39:54 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12528" author="krz" created="Wed, 31 Mar 2010 06:39:54 +0000"  >&lt;p&gt;The problem could be because i am embedding a form that has a M:M relation with another table.&lt;/p&gt;

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

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

&lt;p&gt;The patch at: &lt;a href=&quot;http://trac.symfony-project.org/ticket/5867&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/5867&lt;/a&gt; doesnt work. How can we fix this?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10532" name="Ad.yml" size="1766" author="krz" created="Tue, 30 Mar 2010 15:44:27 +0000" />
                    <attachment id="10534" name="Amenity.yml" size="303" author="krz" created="Tue, 30 Mar 2010 15:44:27 +0000" />
                    <attachment id="10533" name="Housing.yml" size="1001" author="krz" created="Tue, 30 Mar 2010 15:44:27 +0000" />
                    <attachment id="10535" name="HousingAmenity.yml" size="560" author="krz" created="Tue, 30 Mar 2010 15:44:39 +0000" />
                    <attachment id="10530" name="Screen shot 2010-03-31 at 3.30.56 AM.png" size="26945" author="krz" created="Tue, 30 Mar 2010 15:42:04 +0000" />
                    <attachment id="10531" name="Screen shot 2010-03-31 at 3.31.37 AM.png" size="28450" author="krz" created="Tue, 30 Mar 2010 15:42:04 +0000" />
                    <attachment id="10529" name="Screen.png" size="42709" author="krz" created="Tue, 30 Mar 2010 15:42:04 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-585] Hydrate Array does not return full array, when Hydrate Scalar does</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-585</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Description : Upon hydrating as array I will receive one row returned.  If I am to hydrate as Scalar, I will get 200+ rows.  Also, if i echo the sql ($q-&amp;gt;getSqlQuery()) and run that raw, it will also return around 200+ rows.&lt;/p&gt;


&lt;p&gt;$q = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;select(&apos;DISTINCT(co.name) AS field, co.name AS value&apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;Model_Country co&apos;)&lt;br/&gt;
            -&amp;gt;leftJoin(&apos;co.City ci&apos;);&lt;/p&gt;

&lt;p&gt;//here we will get only the first row&lt;br/&gt;
$results = $q-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY);&lt;/p&gt;

&lt;p&gt;//Here we will get all 200+ rows&lt;br/&gt;
$results = $q-&amp;gt;execute(array(), Doctrine::HYDRATE_SCALAR);&lt;/p&gt;

&lt;p&gt;I have yet to dig to deep into this, but if it is indeed a bug, my guess is it is in Doctrine_Hydrator_Graph::hydrateResultSet()&lt;/p&gt;

&lt;p&gt;I can provide more data if needed.&lt;/p&gt;
</description>
                <environment>OS : Ubuntu 9.04&lt;br/&gt;
PHP : PHP 5.2.6-3ubuntu4.5</environment>
            <key id="11085">DC-585</key>
            <summary>Hydrate Array does not return full array, when Hydrate Scalar does</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="solomonjames">James Solomon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2010 14:36:24 +0000</created>
                <updated>Fri, 2 Mar 2012 17:44:46 +0000</updated>
                                                                            <due></due>
                    <votes>4</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="12339" author="solomonjames" created="Thu, 18 Mar 2010 15:22:52 +0000"  >&lt;p&gt;I have found this in the google group, and he provides more detailed info, and appears to be the same exact issue : &lt;a href=&quot;http://groups.google.com/group/doctrine-user/msg/8e4a8a673428fff0&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/msg/8e4a8a673428fff0&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="12340" author="solomonjames" created="Thu, 18 Mar 2010 17:30:26 +0000"  >&lt;p&gt;seems to be another similar issue here : &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-328&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-328&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13013" author="jagalan" created="Wed, 19 May 2010 12:15:32 +0000"  >&lt;p&gt;I&apos;m having that problem and I taked a look into the code, found this:&lt;/p&gt;

&lt;p&gt;I have a query that looks like this:&lt;br/&gt;
 $q = Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;select(&apos;af.id as id, af.user_id as user&apos;)&lt;br/&gt;
-&amp;gt;from(&apos;ActivityFeed af&apos;)&lt;br/&gt;
-&amp;gt;innerJoin(&apos;af.user as afu&apos;)&lt;br/&gt;
-&amp;gt;orderBy(&apos;af.time DESC&apos;);&lt;/p&gt;

&lt;p&gt;The sql query without aliases in SELECT or without join is built that way:&lt;br/&gt;
SELECT a.id AS a_&lt;em&gt;id, a.user_id AS a&lt;/em&gt;_user_id ... -&amp;gt; This is returning all the records&lt;/p&gt;

&lt;p&gt;The sql query with aliases in SELECT is built that way:&lt;br/&gt;
SELECT a.id AS a_&lt;em&gt;0, a.user_id AS a&lt;/em&gt;_1 FROM ... -&amp;gt; This is returning only one record&lt;/p&gt;

&lt;p&gt;In Doctrine_Hydrator_Graph::_gatherRowData, line 288 there&apos;s the following call:&lt;/p&gt;

&lt;p&gt;$fieldName = $table-&amp;gt;getFieldName($last);&lt;br/&gt;
Where $last is the last part of the column alias, for example &quot;0&quot; in &quot;a__0&quot;. This way the call asks the table for the name of the &quot;0&quot; field and the table returns &quot;0&quot; so I think we&apos;re not getting the right field name (it must be &quot;id&quot;).&lt;/p&gt;

&lt;p&gt;I&apos;m not understanding the whole hydration process but replacing&lt;/p&gt;

&lt;p&gt;$fieldName = $table-&amp;gt;getFieldName($last);&lt;/p&gt;

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

&lt;p&gt;if(isset($this-&amp;gt;_queryComponents[ $cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;agg&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;br/&gt;
              $fieldName = $table-&amp;gt;getFieldName($this-&amp;gt;_queryComponents[ $cache&lt;span class=&quot;error&quot;&gt;&amp;#91;$key&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;dqlAlias&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;agg&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$last&amp;#93;&lt;/span&gt;);&lt;br/&gt;
} else {&lt;br/&gt;
                $fieldName = $table-&amp;gt;getFieldName($last);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;solves the problem almost in my case.&lt;/p&gt;

&lt;p&gt;Hope it will help to solve the issue. &lt;/p&gt;</comment>
                    <comment id="13190" author="jwage" created="Tue, 8 Jun 2010 14:39:57 +0000"  >&lt;p&gt;It seems the suggested change causes many failures in our test suite. Can you give it a try and confirm?&lt;/p&gt;</comment>
                    <comment id="13721" author="ben.davies" created="Wed, 28 Jul 2010 12:45:51 +0000"  >&lt;p&gt;Just commenting to say that I can confirm this bug exists. It&apos;s happening for me too.  &lt;br/&gt;
I will try and dig deeper when I have some time.&lt;/p&gt;</comment>
                    <comment id="14129" author="jagalan" created="Sat, 28 Aug 2010 10:42:31 +0000"  >&lt;p&gt;As the error is located in Doctrine_Hydrator_Graph, HYDRATE_RECORD has the same behaviour.&lt;/p&gt;

&lt;p&gt;I&apos;m trying to find a solution.&lt;/p&gt;</comment>
                    <comment id="14194" author="ben.davies" created="Tue, 31 Aug 2010 10:21:15 +0000"  >&lt;p&gt;This only occurs if your alias your identifier field.&lt;br/&gt;
Doctrine needs to know which field is the identifier to hydrate records.&lt;br/&gt;
The identifier aliases is formed to x__0, and then, as other commented has found.&lt;br/&gt;
Doctrine then has no way of determining which field is the identifier.&lt;/p&gt;</comment>
                    <comment id="14569" author="enrico" created="Fri, 15 Oct 2010 04:03:09 +0000"  >&lt;p&gt;Hi everybody,&lt;/p&gt;

&lt;p&gt;we really need a unit test here. The provided patch breaks all aliased queries in our application. I will provide a patch and it hopefully solves your problem Juan. If not, please provide more information or add another test-method to the provided unit test.&lt;/p&gt;

&lt;p&gt;I had to rewrite some of the unit tests cause the order of the fields in the generated sql statement has changed due the provided patch.&lt;/p&gt;

&lt;p&gt;Enrico&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine1/commit/e3ae69c2260dae6dfbceb4e24138b2379f3da2e6#commitcomment-169495&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/commit/e3ae69c2260dae6dfbceb4e24138b2379f3da2e6#commitcomment-169495&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/estahn/doctrine1/tree/DC-585&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/tree/DC-585&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15444" author="loops" created="Fri, 4 Mar 2011 03:56:07 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;


&lt;p&gt;I have a little issue with this bug report...&lt;/p&gt;

&lt;p&gt;I&apos;m currently using Doctrine 1.2 at revision 7691, and I&apos;ve encounter a bug when select the primary key of a model with a custom alias (typically &lt;em&gt;$query-&amp;gt;addSelect( &apos;r.id as my_id&apos; )&lt;/em&gt;), the issue was that Doctrine automatically add &lt;em&gt;`r`.```id``` AS `r&lt;/em&gt;_&lt;em&gt;1`&lt;/em&gt; to the select clause, in addition to the correct &lt;em&gt;`r`.`id` AS `r&lt;/em&gt;_&lt;em&gt;1`&lt;/em&gt; part.&lt;/p&gt;

&lt;p&gt;So, I&apos;ve browse the code to finally found where does this strange thing comes from, and I&apos;ve found it on Doctrine_Query::parseSelect() method, just at the line 663:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;                // Fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-585&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-585&lt;/a&gt;&lt;br/&gt;
                // Add selected columns to pending fields&lt;br/&gt;
                if (preg_match(&apos;/^(&lt;span class=&quot;error&quot;&gt;&amp;#91;^\(&amp;#93;&lt;/span&gt;+)\.(\&apos;?)(.*?)(\&apos;?)$/&apos;, $expression, $field)) {&lt;br/&gt;
                    $this-&amp;gt;_pendingFields&lt;span class=&quot;error&quot;&gt;&amp;#91;$componentAlias&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = $field&lt;span class=&quot;error&quot;&gt;&amp;#91;3&amp;#93;&lt;/span&gt;;&lt;br/&gt;
                }&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;So I&apos;m wonder : where does this patch is related to this bug report?&lt;/p&gt;


&lt;p&gt;Whatever, the bug I&apos;ve encounter is very simple : the regular expression that extract the field name takes care about &lt;em&gt;&apos;&lt;/em&gt; but not &lt;em&gt;&#180;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You will find a patch for the bug &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-585&quot; title=&quot;Hydrate Array does not return full array, when Hydrate Scalar does&quot;&gt;DC-585&lt;/a&gt;-b in a few minutes... This patch just make the regular expression taking account of &lt;em&gt;&apos;&lt;/em&gt; and &lt;em&gt;&#180;&lt;/em&gt; and also remove all useless parentheses in expression (by this way PCRE get less matches to capture and we can earn some precious microseconds).&lt;/p&gt;

&lt;p&gt;Also, this patch should be completed because the query still have two &lt;em&gt;`r`.`id` AS `r&lt;/em&gt;_&lt;em&gt;1`&lt;/em&gt; parts, that may cause some other issues with some databases...&lt;/p&gt;

&lt;p&gt;IMPORTANT NOTE: The previous revision 7674 of Doctrine_Query does not cause the bug encounter with the few lines of code above, just because they were not there. They really must be review.&lt;/p&gt;



&lt;p&gt;Loops&lt;/p&gt;</comment>
                    <comment id="15750" author="loops" created="Thu, 28 Apr 2011 05:03:36 +0000"  >&lt;p&gt;Damn, the bug above was corrected during a few weeks and comes back with the new branch of Doctrine 1.2.14.&lt;/p&gt;

&lt;p&gt;Does anybody can re-apply the corrective patch (renamed &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-585&quot; title=&quot;Hydrate Array does not return full array, when Hydrate Scalar does&quot;&gt;DC-585&lt;/a&gt;-c), please ?&lt;/p&gt;

&lt;p&gt;I repeat it agin, but these few lines of code really need to be review.&lt;/p&gt;

&lt;p&gt;Loops&lt;/p&gt;</comment>
                    <comment id="17241" author="knagode" created="Fri, 13 Jan 2012 20:08:54 +0000"  >&lt;p&gt;I also have this problem .. Anyone know howt o fix it?&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;execute(array(), Doctrine::HYDRATE_ARRAY); // returns one row only&lt;br/&gt;
$query-&amp;gt;execute(array(), Doctrine::HYDRATE_RECORD); // returns one row only&lt;/p&gt;

&lt;p&gt;$query-&amp;gt;execute(array(), Doctrine::HYDRATE_SCALAR); // returns result as expected&lt;/p&gt;</comment>
                    <comment id="17242" author="knagode" created="Sat, 14 Jan 2012 00:40:36 +0000"  >&lt;p&gt;I found solution for my  problem: &lt;/p&gt;

&lt;p&gt;Table had ID field but it was not primary key.  When I deleted this column, doctrine started to work as expected. &lt;/p&gt;</comment>
                    <comment id="17491" author="lacton" created="Fri, 2 Mar 2012 17:44:46 +0000"  >&lt;p&gt;I have run into the same issue.&lt;/p&gt;

&lt;p&gt;Using the default hydration, I get only one record.&lt;/p&gt;

&lt;p&gt;Using &quot;$query-&amp;gt;execute(array(), Doctrine::HYDRATE_SCALAR);&quot;, I get all the expected records.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10950" name="Doctrine-DC-585-b.patch" size="721" author="loops" created="Fri, 4 Mar 2011 04:04:39 +0000" />
                    <attachment id="10976" name="Doctrine-DC-585-c.patch" size="718" author="loops" created="Thu, 28 Apr 2011 05:18:22 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-519] -&gt;where() add parentheses </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-519</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have this method&lt;/p&gt;

&lt;p&gt;public function getOpenBalances()&lt;/p&gt;
	{
		$q = $this-&amp;gt;createQuery(&apos;a&apos;)
			-&amp;gt;select(&apos;a.*&apos;)
			-&amp;gt;where(&apos;a.invoice_id IN (
				SELECT ac.invoice_id
				FROM AccountingCustomers ac 
				GROUP BY ac.invoice_id
				HAVING (SUM(ac.dedit) - SUM(ac.credit)) &amp;gt; 0)&apos;);
return $q-&amp;gt;execute();
	}

&lt;p&gt;and yhis is the error generated in symfony:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42601&amp;#93;&lt;/span&gt;: Syntax error: 7 ERROR: syntax error at or near &quot;)&quot; at character 456. Failing Query: &quot;SELECT a.id AS a_&lt;em&gt;id, a.customer_id AS a&lt;/em&gt;&lt;em&gt;customer_id, a.invoice_id AS a&lt;/em&gt;&lt;em&gt;invoice_id, a.credit AS a&lt;/em&gt;&lt;em&gt;credit, a.duedate AS a&lt;/em&gt;&lt;em&gt;duedate, a.debit AS a&lt;/em&gt;&lt;em&gt;debit, a.paymentdate AS a&lt;/em&gt;&lt;em&gt;paymentdate, a.note AS a&lt;/em&gt;&lt;em&gt;note, a.created_at AS a&lt;/em&gt;&lt;em&gt;created_at, a.updated_at AS a&lt;/em&gt;&lt;em&gt;updated_at FROM accounting_customers a WHERE (a.invoice_id IN (SELECT a2.invoice_id AS a2&lt;/em&gt;_invoice_id FROM accounting_customers a2 GROUP BY a2.invoice_id HAVING (SUM(ac.dedit) - SUM(a2.credi))) &amp;gt; 0))&quot;&lt;/p&gt;

&lt;p&gt;At the end ther is a parentheses that the code haven&apos;t.  ))) &amp;gt; 0))&lt;/p&gt;

&lt;p&gt;and another problem is that  SUM(ac.credit) is changed in SUM(a2.credi) &lt;/p&gt;


</description>
                <environment></environment>
            <key id="10941">DC-519</key>
            <summary>-&gt;where() add parentheses </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gsplsn71">Alessandro Gaspari</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Feb 2010 12:49:32 +0000</created>
                <updated>Tue, 23 Feb 2010 12:51:49 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-496] Doctrine should warn when a columns / table name match a reserved word</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-496</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Today i looked for quite a long time why doctrine doesn&apos;t acte like i wish...&lt;/p&gt;

&lt;p&gt;it turns out that it was because of a column named &apos;system_id&apos;... doctrine use this for internal use.&lt;/p&gt;

&lt;p&gt;no pbm with that, but please notify users that they will experience pbm when a column or table name match X or Y or Z.&lt;/p&gt;

&lt;p&gt;i&apos;ve experienced pbm with : table_name, system_id, and some other id too.&lt;/p&gt;</description>
                <environment>Linux / ALL</environment>
            <key id="10879">DC-496</key>
            <summary>Doctrine should warn when a columns / table name match a reserved word</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="emerzh">Brice Maron</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Feb 2010 13:58:37 +0000</created>
                <updated>Fri, 12 Feb 2010 13:58:37 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-838] &quot;Primary columns are implied to be notnull in Doctrine&quot; but are not</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-838</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine says : &quot;Primary columns are implied to be notnull in Doctrine&quot; (line 563 in lib/Doctrine/Import/Builder.php)&lt;/p&gt;

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

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

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


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

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


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

&lt;p&gt;~ Jonathan&lt;/p&gt;</description>
                <environment>Latest doctrine git commit: bfa24eb68640c412ff6115103ba044bbe1b4333b&lt;br/&gt;
Ubuntu 10.4 x64&lt;br/&gt;
MySQL server 5.1.41-3ubuntu12.6&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11818">DC-838</key>
            <summary>&quot;Primary columns are implied to be notnull in Doctrine&quot; but are not</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jonathan.dh">Jonathan Melnick (Doghouse Media)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Aug 2010 06:09:43 +0000</created>
                <updated>Tue, 24 Aug 2010 21:15:23 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;There is no relation between those 2 tables. You can solve it by creating a default SQL query. But my guess is that this shouldn&apos;t be the right way.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11828">DC-842</key>
            <summary>Alias linking wrong</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sjaakmans">Sjaakmans</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 03:06:21 +0000</created>
                <updated>Thu, 26 Aug 2010 03:06:21 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;Please add the ability to specify where the new column goes to this function:&lt;br/&gt;
Doctrine_Migration::addColumn(). &lt;/p&gt;</description>
                <environment></environment>
            <key id="11815">DC-837</key>
            <summary>Add support for AFTER in migration addColumn function</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="exien">Exien</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Aug 2010 14:44:31 +0000</created>
                <updated>Mon, 23 Aug 2010 15:18:39 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14035" author="jwage" created="Mon, 23 Aug 2010 15:18:39 +0000"  >&lt;p&gt;I understand your desire to want to control where a column is added but to use words like &quot;imperative&quot; and &quot;useless&quot; is crazy! Where the column goes is in no way a blocker or major problem. If someone wants this bad enough and provides a patch we can consider including it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

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

&lt;p&gt;Instead of num_replies being assigned to each Posts[] object, it is only being assigned once to the Forum object, rendering it totally useless.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11760">DC-817</key>
            <summary>Nested aggregate fields do not hydrate to the right object</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="patcomwiz">Patrick Nagurny</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Aug 2010 23:07:55 +0000</created>
                <updated>Thu, 12 Aug 2010 23:07:55 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-907] when I delete fields from a table in oracle 10g and I execute build schema keeps bringing me those same fields that no longer exist.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-907</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a table in oracle that i was using but I had to change it so i remove some fields and add others when i run the task buils schema it generates the file schema.yml it  created the new fields added but  continued to bringing those field who had been eliminated and no longer existed in the database, it generates an  error because the file schema.yml are those field  but the database does not ...&lt;/p&gt;</description>
                <environment></environment>
            <key id="11688">DC-907</key>
            <summary>when I delete fields from a table in oracle 10g and I execute build schema keeps bringing me those same fields that no longer exist.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jeronimo0000">fernando guerrero</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Jul 2010 10:06:04 +0000</created>
                <updated>Sun, 31 Oct 2010 07:13:05 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14396" author="beberlei" created="Wed, 15 Sep 2010 16:36:13 +0000"  >&lt;p&gt;Is this a Doctrine 1 or 2 bug? Is this a caching issue maybe?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;l221&lt;br/&gt;
// Norwegian characters&lt;br/&gt;
          &apos;&#197;&apos;=&amp;gt;&apos;Aa&apos;,&apos;&#198;&apos;=&amp;gt;&apos;Ae&apos;,&apos;&#216;&apos;=&amp;gt;&apos;O&apos;,&apos;&#230;&apos;=&amp;gt;&apos;a&apos;,&apos;&#248;&apos;=&amp;gt;&apos;o&apos;,&apos;&#229;&apos;,&apos;aa&apos;&lt;br/&gt;
          );&lt;/p&gt;</description>
                <environment></environment>
            <key id="11632">DC-790</key>
            <summary>Doctrine_Inflector::unaccent() Problem with array keys for Norwegian characters</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bat">bat</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Jul 2010 04:58:52 +0000</created>
                <updated>Fri, 16 Jul 2010 05:04:04 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-782] Generated SQL for indexes is faulty</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-782</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We have the following YAML:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Yaml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;User:
  columns:
    id:
      type: integer
      unsigned: 1
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    username: 
      type: string(255)
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  indexes:
    username_index:
      fields:
        username:
          type: unique
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The resulting record-class looks like this, which is still fine:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Class&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setTableName(&apos;users&apos;);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(
             &apos;type&apos; =&amp;gt; &apos;integer&apos;,
             &apos;unsigned&apos; =&amp;gt; 1,
             &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             ));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;username&apos;, &apos;string&apos;, 255, array(
             &apos;type&apos; =&amp;gt; &apos;string&apos;,
             &apos;notnull&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
             &apos;length&apos; =&amp;gt; &apos;255&apos;,
             ));
 

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

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

&lt;p&gt;But the resulting SQL looks like this, which is faulty because of the Array stuff at the index:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;SQL&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt; (&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; BIGSERIAL, &lt;span class=&quot;code-quote&quot;&gt;&quot;username&quot;&lt;/span&gt; VARCHAR(255) NOT NULL, PRIMARY KEY(&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;));
CREATE INDEX &lt;span class=&quot;code-quote&quot;&gt;&quot;username_index&quot;&lt;/span&gt; ON &lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt; (&lt;span class=&quot;code-quote&quot;&gt;&quot;Array&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>LAMP, PHP 5.2.6, PostgreSQL 8.3</environment>
            <key id="11613">DC-782</key>
            <summary>Generated SQL for indexes is faulty</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tc77">Christian Schmitz</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Jul 2010 07:53:50 +0000</created>
                <updated>Sun, 11 Jul 2010 07:53:50 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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


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

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


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

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

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

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



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

&lt;p&gt;SELECT dst_entity_id FROM entity_relation WHERE src_entity_id = &apos;1&apos; AND type = &apos;owner&apos;&lt;/p&gt;</description>
                <environment>PHP Version 5.3.0&lt;br/&gt;
System 	Windows NT ZEUS 5.1 build 2600 (Windows XP Professional Service Pack 3) i586 &lt;br/&gt;
symfony version 1.4.6-DEV&lt;br/&gt;
sfDoctrinePlugin revision 29679</environment>
            <key id="11551">DC-765</key>
            <summary>Incorrect query for inherited many-to-many relation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jmiridis">Jorgo Miridis</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 22:43:32 +0000</created>
                <updated>Thu, 24 Jun 2010 22:43:32 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;N.B. As far as I can see, SQL Server doesn&apos;t support the release of savepoints, so I&apos;ve just stubbed that method out.&lt;/p&gt;</description>
                <environment>Windows XP&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11542">DC-761</key>
            <summary>MSSQL Server: No support for transaction savepoints </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 06:06:01 +0000</created>
                <updated>Thu, 24 Jun 2010 06:06:01 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10678" name="doctrine_transaction_mssql_savepoints.patch" size="1403" author="craigmarvelley" created="Thu, 24 Jun 2010 06:06:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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




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

</description>
                <environment>ubuntu, apache, symfony version 1.4.4</environment>
            <key id="11532">DC-756</key>
            <summary>Cannot use named parameters in a &apos;limit(&apos;:max&apos;) clause</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 01:01:11 +0000</created>
                <updated>Tue, 7 Sep 2010 17:10:38 +0000</updated>
                                                    <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13410" author="gearond" created="Thu, 24 Jun 2010 20:58:58 +0000"  >&lt;p&gt;I noticed an error in the code, which does not solve the problem, only confuse whomever works on it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;  Please add &lt;/p&gt;

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

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

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

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

&lt;p&gt;I attach a diff file with the changes I did, hope it helps&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10779" name="DC-756.partial.patch" size="2068" author="jagalan" created="Tue, 7 Sep 2010 17:10:38 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

</description>
                <environment>mysql 5.1.40, php 5.3.1</environment>
            <key id="11514">DC-748</key>
            <summary>Warning: implode(): Invalid arguments passed in /Doctrine/Table.php on line on line 922</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="victorgugo">Victor Paladiychuk</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 08:43:21 +0000</created>
                <updated>Thu, 17 Jun 2010 08:43:21 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10666" name="Table.php" size="94728" author="victorgugo" created="Thu, 17 Jun 2010 08:43:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

&lt;p&gt;Is there any way to control this behavior?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11463">DC-723</key>
            <summary>String = 512 becomes TEXT</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jun 2010 23:50:18 +0000</created>
                <updated>Wed, 9 Jun 2010 13:04:27 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13255" author="jwage" created="Wed, 9 Jun 2010 13:04:27 +0000"  >&lt;p&gt;No, it is not possible right now. The portable Doctrine types and lengths are converted to certain types for the different databases. In Doctrine2 you can specify the SQL that will create your column in the mapping if you desire something more customize or database specific&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

&lt;p&gt;Thanks in advice.&lt;br/&gt;
Greetings!&lt;/p&gt;</description>
                <environment>LAMP over Ubuntu 10.04</environment>
            <key id="11462">DC-722</key>
            <summary>String(512) is being implemented as TEXT instead varchar(512) on MySQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mateo">Mateo Tibaquir&#225;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jun 2010 23:49:39 +0000</created>
                <updated>Tue, 8 Jun 2010 23:49:39 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-970] Diff Tool doesn&apos;t generate the down() method if a field attribute is changed in YAML</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-970</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Diff Tool doesn&apos;t generate the down() method if a field attribute is changed in YAML. Below is an example&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;scheme.yaml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    email:
      type: string(255)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: solid;&quot;&gt;&lt;b&gt;scheme2.yaml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    email:
      type: string(160)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;And below is the generated migration class (down() method is missing): &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;1239898949_Version39.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;class Version39 &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;changeColumn(&apos;support_tickets&apos;, &apos;email&apos;, &apos;string&apos;, &apos;160&apos;, array(
             &apos;fixed&apos; =&amp;gt; &apos;0&apos;,
             &apos;unsigned&apos; =&amp;gt; &apos;&apos;,
             &apos;primary&apos; =&amp;gt; &apos;&apos;,
             &apos;notnull&apos; =&amp;gt; &apos;&apos;,
             &apos;autoincrement&apos; =&amp;gt; &apos;&apos;,
             ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function down()
    {

    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment>Doctrine 1.2 </environment>
            <key id="12096">DC-970</key>
            <summary>Diff Tool doesn&apos;t generate the down() method if a field attribute is changed in YAML</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="tbayrak">taha bayrak</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Nov 2010 12:39:14 +0000</created>
                <updated>Thu, 7 Apr 2011 05:43:56 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15706" author="66ton99" created="Thu, 7 Apr 2011 05:43:56 +0000"  >&lt;p&gt;How I can see &quot;changeColumn&quot; doesn&apos;t work in the &quot;down&quot; section&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-905] Fields with foreign key shouldn&apos;t require definition</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-905</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sample schema attached.&lt;/p&gt;

&lt;p&gt;Now, keeping attached schema in mind. &lt;/p&gt;

&lt;p&gt;We have core tables that lots of other tables refer via foreign keys to them, like user, company, etc. &lt;/p&gt;

&lt;p&gt;We need to explicitly define foreign keys (like user_id) &quot;definitely same as&quot; User.id on each table. By design, this seems unnecessary, and has load on refactoring processes, ie. type change on User.id. &lt;/p&gt;

&lt;p&gt;Doctrine is already parsing foreign relations from schema, It can use parent table field definition (User.id) in refering table fields (user_id) and on the schema user_id can be defined as:&lt;/p&gt;

&lt;p&gt;user_id: ~&lt;/p&gt;</description>
                <environment></environment>
            <key id="12041">DC-905</key>
            <summary>Fields with foreign key shouldn&apos;t require definition</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="lashae">Alaattin Kahramanlar</reporter>
                        <labels>
                    </labels>
                <created>Fri, 29 Oct 2010 07:51:21 +0000</created>
                <updated>Sun, 31 Oct 2010 03:31:51 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10832" name="schema.yml" size="1383" author="lashae" created="Fri, 29 Oct 2010 07:53:41 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-900] HYDRATE_SINGLE_SCALAR option always returns false </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-900</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I notice that the fetchone with HYDRATE_SINGLE_SCALAR option always returns false as the return to the $collection object is a string type, this is returned by the hydrateResultSet with driver mode set to 6 (I assume this is for scalar values)&lt;/p&gt;

&lt;p&gt;My code is a two table query with which returns a string of &quot;10&quot; (g.id in query below) and returns false because it is not a doctrine collection, I did check the doctrine examples and it seems to be the way its used. Not sure if its the doctrine version issue with symfony, my code or an actual bug&lt;/p&gt;

&lt;p&gt;        $q = Doctrine_Core::getTable(&apos;ClipGroup&apos;)&lt;br/&gt;
                        -&amp;gt;createQuery(&apos;g&apos;)&lt;br/&gt;
                        -&amp;gt;select(&apos;g.id&apos;)&lt;br/&gt;
                        -&amp;gt;leftJoin(&apos;g.sfGuardUser u&apos;)&lt;br/&gt;
                        -&amp;gt;Where(&apos;g.completed_at IS NULL&apos;)&lt;br/&gt;
                        -&amp;gt;andWhere(&apos;g.expires_at &amp;gt; ?&apos;, date(&apos;Y-m-d H:i:s&apos;, time()))&lt;br/&gt;
                        -&amp;gt;andWhere(&apos;u.id = ?&apos;, $userId);&lt;br/&gt;
        return $q-&amp;gt;fetchOne(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);&lt;/p&gt;

&lt;p&gt; I am using doctrine included in symfony 1.4.3, here is the comment on the Query.php file  * @version     $Revision: 6792 $, &lt;br/&gt;
    public function fetchOne($params = array(), $hydrationMode = null)&lt;br/&gt;
    {&lt;br/&gt;
        $collection = $this-&amp;gt;execute($params, $hydrationMode);&lt;/p&gt;

&lt;p&gt;        if (count($collection) === 0) &lt;/p&gt;
{
            return false;
        }

&lt;p&gt;        if ($collection instanceof Doctrine_Collection) &lt;/p&gt;
{
            return $collection-&amp;gt;getFirst();
        }
&lt;p&gt; else if (is_array($collection)) &lt;/p&gt;
{
            return array_shift($collection);
        }

&lt;p&gt;        return false;&lt;br/&gt;
    }&lt;/p&gt;

&lt;p&gt;Hydrator.php - returns a string * @version     $Revision: 3192 $&lt;/p&gt;

&lt;p&gt;    public function hydrateResultSet($stmt, $tableAliases)&lt;/p&gt;
    {
        $driver = $this-&amp;gt;getHydratorDriver($this-&amp;gt;_hydrationMode, $tableAliases);
        $result = $driver-&amp;gt;hydrateResultSet($stmt);

        return $result;
    }</description>
                <environment>Ubuntu Linux Karmic, Apache 2, Symfony 1.4.3</environment>
            <key id="12029">DC-900</key>
            <summary>HYDRATE_SINGLE_SCALAR option always returns false </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="junaid">Junaid Ebrahim</reporter>
                        <labels>
                    </labels>
                <created>Sat, 23 Oct 2010 17:32:53 +0000</created>
                <updated>Sat, 23 Oct 2010 18:24:25 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-901] Several test cases using CRLF endings</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-901</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi there. I&apos;m finding several test cases that are using CRLF line endings, instead of the standard UNIX LF line endings as it seems the rest of the codebase uses.&lt;/p&gt;

&lt;p&gt;The test case files are as follows:&lt;/p&gt;

&lt;p&gt;tests/Ticket/2158TestCase.php&lt;br/&gt;
tests/Ticket/2251TestCase.php&lt;br/&gt;
tests/Ticket/2334TestCase.php&lt;br/&gt;
This is causing my git pull on the doctrine 1 github repository to fail due to so called &quot;unmerged&quot; files, and has rendered my git submodule for doctrine just about useless.&lt;/p&gt;

&lt;p&gt;I&apos;d appreciate it if someone would run a fromdos on these files and commit them.&lt;/p&gt;</description>
                <environment>Windows 7 x86_64, PHP 5.3</environment>
            <key id="12031">DC-901</key>
            <summary>Several test cases using CRLF endings</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="obsidian">Damian Bushong</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Oct 2010 10:09:25 +0000</created>
                <updated>Sun, 24 Oct 2010 10:09:25 +0000</updated>
                                    <version>1.2.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-883] Help for Test CLI does not list available test groups</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-883</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The CLI Test Runner is supposed to print a list of available test groups when used with the --help parameter, but this fails as the Doctrine_Test::run() method erroneously expects php sort() to return an array rather than a boolean.&lt;/p&gt;

&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/acoulton/doctrine1/tree/DC-883&quot; class=&quot;external-link&quot;&gt;http://github.com/acoulton/doctrine1/tree/DC-883&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11993">DC-883</key>
            <summary>Help for Test CLI does not list available test groups</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="andrewcoulton">Andrew Coulton</reporter>
                        <labels>
                    </labels>
                <created>Sun, 10 Oct 2010 18:44:36 +0000</created>
                <updated>Sun, 10 Oct 2010 18:51:17 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1017] Floats persisted in the database are retrieve as strings.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1017</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Someone complained about symfony padding 0&apos;s after floats &lt;a href=&quot;http://stackoverflow.com/questions/6650786/remove-extra-decimal-place-in-float-datatype-on-symfony/6663829&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/6650786/remove-extra-decimal-place-in-float-datatype-on-symfony/6663829&lt;/a&gt; , I think it&apos;s a doctrine problem, since the doctrine:dql task seems to have the same problem:&lt;/p&gt;

&lt;p&gt;&amp;gt;&amp;gt; doctrine  executing dql query&lt;br/&gt;
DQL: FROM UcVideoAspect&lt;br/&gt;
found 1 results&lt;br/&gt;
-&lt;br/&gt;
  id: &apos;1&apos;&lt;br/&gt;
  video_id: null&lt;br/&gt;
  pixel_ratio: &apos;12.50&apos;&lt;br/&gt;
  width: null&lt;br/&gt;
  height: null&lt;/p&gt;

&lt;p&gt;Here, pixel ratio is defined as a float in the schema.yml file&lt;br/&gt;
Getting the property from a transient object returns a float, while getting it from the db returns a string.&lt;/p&gt;</description>
                <environment>Ubuntu 64 bits, php 5.3</environment>
            <key id="12817">DC-1017</key>
            <summary>Floats persisted in the database are retrieve as strings.</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="greg0ire">Gr&#233;goire Paris</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jul 2011 12:11:53 +0000</created>
                <updated>Tue, 12 Jul 2011 12:11:53 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-976] Invalid long constraint name</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-976</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When the constraint&apos;s name is too long, a shorter one is generated using information such as the name of the database. If the database&apos;s name begins with a numeric value, the constraint name also begins with a numeric value which results in an invalid constraint name.&lt;/p&gt;</description>
                <environment>OS: Linux&lt;br/&gt;
Soft platform: Symfony 1.4.8, mysql5</environment>
            <key id="12407">DC-976</key>
            <summary>Invalid long constraint 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mxs">S&#233;bastien Rannou</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Feb 2011 12:46:21 +0000</created>
                <updated>Sat, 19 Feb 2011 12:47:26 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10943" name="constraint_name.patch" size="483" author="mxs" created="Sat, 19 Feb 2011 12:46:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-959] DSN style problems in documentation 1.2</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-959</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This page:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/introduction-to-connections/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/introduction-to-connections/en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;states the DSN can either be provided as an associative array or as a string, but it&apos;s not true, specially if you&apos;re doing lazy connection, because this type of connection only accepts doctrine dsn style and it doesn&apos;t seem to know how to handle unix socket type connections (is it correct?).&lt;/p&gt;

&lt;p&gt;I would suggest the manual clarify that lazy connection will only accept string type dsn and also will &lt;b&gt;not&lt;/b&gt; accept socket connections.&lt;/p&gt;

&lt;p&gt;Related links:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/1eecb07a2f6df447/3e74857c3a076939?lnk=gst&amp;amp;q=dsn#3e74857c3a076939&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/1eecb07a2f6df447/3e74857c3a076939?lnk=gst&amp;amp;q=dsn#3e74857c3a076939&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-647&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-647&lt;/a&gt;&lt;/p&gt;</description>
                <environment>MAMP</environment>
            <key id="12326">DC-959</key>
            <summary>DSN style problems in documentation 1.2</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="duli">Luis Felipe</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Jan 2011 21:28:26 +0000</created>
                <updated>Tue, 25 Jan 2011 21:28:26 +0000</updated>
                                    <version>1.2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-947] getRandom() method for Doctrine_Table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-947</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Consider adding this method into Doctrine_Table&lt;/p&gt;

&lt;p&gt;public static function getRandom()&lt;br/&gt;
{&lt;br/&gt;
    return&lt;br/&gt;
    self::getInstance()-&amp;gt;createQuery()			&lt;br/&gt;
        -&amp;gt;select(&apos;*, RANDOM() as rand&apos;)&lt;br/&gt;
        -&amp;gt;limit(1)&lt;br/&gt;
        -&amp;gt;orderBy(&apos;rand&apos;)&lt;br/&gt;
        -&amp;gt;fetchOne();&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;It is portable and very useful.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12205">DC-947</key>
            <summary>getRandom() method for 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="maxtsepkov">ddead profile</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 05:42:23 +0000</created>
                <updated>Wed, 8 Dec 2010 05:42:23 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-945] Doctrine_Query::create()-&gt;where(&apos;table.field =&apos;) unexpectedly returns a result</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-945</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While firing the following query with Doctrine, I did not expect Doctrine to return me a record, however, even though there is a syntax error (in my opinion) it gave me the first record of the table.&lt;/p&gt;

&lt;p&gt;$q = \Doctrine_Query::create()&lt;br/&gt;
-&amp;gt;from(&apos;User u&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;u.Id =&apos;, $userId);&lt;/p&gt;

&lt;p&gt;$r = $q-&amp;gt;fetchOne();&lt;/p&gt;

&lt;p&gt;Note that the question mark in the where method is ommitted. This will return a User model with an Id of 1.&lt;/p&gt;

&lt;p&gt;I would expect this to generate an invalid SQL statement (or even fail to pass the DQL validation). &lt;/p&gt;

&lt;p&gt;Giving the first record doesn&apos;t seem to be appropriate in my opinion.&lt;/p&gt;</description>
                <environment>PHP 5.3.0</environment>
            <key id="12198">DC-945</key>
            <summary>Doctrine_Query::create()-&gt;where(&apos;table.field =&apos;) unexpectedly returns a result</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="johnhuijbers">John Huijbers</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Dec 2010 09:06:07 +0000</created>
                <updated>Tue, 7 Dec 2010 03:16:02 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1059] Generate Entity From Database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1059</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Problem already report here : &lt;a href=&quot;https://github.com/symfony/symfony/issues/5617#issuecomment-8934524&quot; class=&quot;external-link&quot;&gt;https://github.com/symfony/symfony/issues/5617#issuecomment-8934524&lt;/a&gt;&lt;br/&gt;
But the idea is, on generation of entity from database MySQL, Int and Tinyint type are tranform as booelan.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14074">DC-1059</key>
            <summary>Generate Entity From 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="draeli">Draeli</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 Sep 2012 17:07:01 +0000</created>
                <updated>Thu, 27 Sep 2012 17:07:01 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-990] Values not escaped</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-990</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When I save inputs from a form, special characters such as single quotes are inserted into the mysql database without being escaped.  It&apos;s my understanding that doctrine uses PDO and PDO should handle this escaping automatically, but it is not.  Is there a configuration setting that I can set with doctrine to enable this? &lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Nick&lt;/p&gt;</description>
                <environment>windows and linux OS, mysql database</environment>
            <key id="12501">DC-990</key>
            <summary>Values not escaped</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="knford">Nick Bartlett</reporter>
                        <labels>
                    </labels>
                <created>Sat, 26 Mar 2011 16:14:15 +0000</created>
                <updated>Sat, 26 Mar 2011 16:14:15 +0000</updated>
                                    <version>1.2.0</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-422] Using the ON_DEMAND hydrator a warning a thrown on the last iterator of a foreach</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-422</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Used in a symfony project code similar to the following throws a warning on the last iteration of the foreach&lt;/p&gt;

&lt;p&gt;    $currentQuery = Doctrine_Query::create()&lt;br/&gt;
            -&amp;gt;from(&apos;article a&apos;);&lt;/p&gt;

&lt;p&gt;    $result = $currentQuery-&amp;gt;execute(array(), Doctrine_Core::HYDRATE_ON_DEMAND);&lt;/p&gt;

&lt;p&gt;    foreach ($result as $article) &lt;/p&gt;
{
      echo $article-&amp;gt;getId();
    }


&lt;p&gt;The warnings are  located in the connection profiler.&lt;/p&gt;

&lt;p&gt;symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineConnectionProfiler.class.php on line 196&lt;/p&gt;

&lt;p&gt;Warning: join(): Invalid arguments passed in symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineConnectionProfiler.class.php on line 141&lt;/p&gt;

&lt;p&gt;I&apos;m unsure how best to fix it. As far as I can tell there is an issue regarding the call to the iterator rewind at the end of the foreach. &lt;/p&gt;

&lt;p&gt;Doctrine_Connection_Statement-&amp;gt;execute(???) symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Collection/OnDemand.php:71&lt;/p&gt;</description>
                <environment>os x 10.6, php 5.3.1</environment>
            <key id="10720">DC-422</key>
            <summary>Using the ON_DEMAND hydrator a warning a thrown on the last iterator of a foreach</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="arnaud">Arnaud Limbourg</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Jan 2010 13:04:33 +0000</created>
                <updated>Sun, 5 Dec 2010 07:50:19 +0000</updated>
                                    <version>1.2.1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11916" author="jwage" created="Mon, 1 Mar 2010 18:23:40 +0000"  >&lt;p&gt;Sorry, we&apos;re gonna need some more information to be able to do anything for this ticket.&lt;/p&gt;</comment>
                    <comment id="13201" author="jwage" created="Tue, 8 Jun 2010 15:20:55 +0000"  >&lt;p&gt;Is this issue a symfony one and not a Doctrine problem? It is hard to tell.&lt;/p&gt;</comment>
                    <comment id="14909" author="snpy" created="Sun, 5 Dec 2010 07:44:58 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;It&apos;s partially both - symfony doesn&apos;t protect itself from NULL params (default value), however when use Doctrine_Core::PORTABILITY_EMPTY_TO_NULL then Doctrine will also generate the same warning.&lt;/p&gt;

&lt;p&gt;Btw - symfony does throw this issue only when logging is enabled.&lt;/p&gt;

&lt;p&gt;This is a trace tail when when using OnDemand hydrator with foreach.&lt;/p&gt;

&lt;p&gt;21	1.1271	26883400	LessonTable-&amp;gt;copyTeacherData( )	../actions.class.php:54&lt;br/&gt;
22	1.1604	27817624	Doctrine_Collection_OnDemand-&amp;gt;rewind( )	../OnDemand.php:0&lt;br/&gt;
23	1.1604	27784376	Doctrine_Connection_Statement-&amp;gt;execute( )	../OnDemand.php:71&lt;br/&gt;
24	1.1605	27785616	Doctrine_EventListener_Chain-&amp;gt;preStmtExecute( )	../Statement.php:231&lt;br/&gt;
25	1.1605	27785616	sfDoctrineConnectionProfiler-&amp;gt;preStmtExecute( )	../Chain.php:494&lt;br/&gt;
26	1.1606	27788152	sfDoctrineConnectionProfiler::fixParams( )	../sfDoctrineConnectionProfiler.class.php:146&lt;/p&gt;

&lt;p&gt;Suggested patch attached.&lt;br/&gt;
We&apos;re always expecting $params parameter to be an array, hence array() as default value.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10886" name="Doctrine_Connection_Statement.patch" size="856" author="snpy" created="Sun, 5 Dec 2010 07:50:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-969] When I add a text field to a mysql table the migration code generated fails</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-969</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am using a database designed using schema.yml with a MySql Server.&lt;/p&gt;

&lt;p&gt;When I add a field of type text the generated code for the migrations (using diff) is as follows:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, &apos;&apos;, array(&lt;br/&gt;
             &apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;Which produces a MySQL error like this:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;)&apos; at line 1. Failing Query: &quot;ALTER TABLE &amp;lt;tableName&amp;gt; ADD &amp;lt;fieldName&amp;gt; text()&quot;&lt;/p&gt;

&lt;p&gt;The solution I found was to manipulate manually the generated class to use an addColumn like this:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, null, array(&lt;br/&gt;
             &apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;Which would generate an SQL statement like this:&lt;/p&gt;

&lt;p&gt;ALTER TABLE &amp;lt;tableName&amp;gt; ADD &amp;lt;fieldName&amp;gt; text&lt;/p&gt;

&lt;p&gt;Which works fine with MySQL, don&apos;t know about other RDBMS&lt;/p&gt;</description>
                <environment>Linux, Symfony 1.4, Doctrine 1.2</environment>
            <key id="11333">DC-969</key>
            <summary>When I add a text field to a mysql table the migration code generated fails</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="mchojrin">Mauro Chojrin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 May 2010 09:51:58 +0000</created>
                <updated>Wed, 23 Feb 2011 14:24:35 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15365" author="siegfried1e" created="Wed, 23 Feb 2011 14:24:35 +0000"  >&lt;p&gt;My understanding is that you need to put a size to the text so it will choose between tinytext, text, mediumtext, bigtext, so instead of &lt;br/&gt;
$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, &apos;&apos;, array(&lt;br/&gt;
&apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
));&lt;br/&gt;
use &lt;br/&gt;
$this-&amp;gt;addColumn(&apos;&amp;lt;tableName&amp;gt;&apos;, &apos;&amp;lt;fieldName&amp;gt;, &apos;text&apos;, &apos;&amp;lt;somenumber&amp;gt;&apos;, array(&lt;br/&gt;
&apos;notnull&apos; =&amp;gt; &apos;&apos;,&lt;br/&gt;
));&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-805] Test fails randomly (race condition?)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-805</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;During one of my test builds, one of the test cases failed, probably because of a race condition:&lt;/p&gt;

&lt;p&gt;Doctrine_Ticket_1441_TestCase : method testTest failed on line 60 &lt;br/&gt;
 Value1: array (&lt;br/&gt;
  0 =&amp;gt; &apos;test&apos;,&lt;br/&gt;
  1 =&amp;gt; &apos;2010-07-10 02:21:34&apos;,&lt;br/&gt;
  2 =&amp;gt; &apos;jwage&apos;,&lt;br/&gt;
) &lt;br/&gt;
 != &lt;br/&gt;
 Value2: array (&lt;br/&gt;
  0 =&amp;gt; &apos;test&apos;,&lt;br/&gt;
  1 =&amp;gt; &apos;2010-07-10 02:21:35&apos;,&lt;br/&gt;
  2 =&amp;gt; &apos;jwage&apos;,&lt;br/&gt;
) &lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Federico&lt;/p&gt;</description>
                <environment>Debian Lenny 5.0</environment>
            <key id="11700">DC-805</key>
            <summary>Test fails randomly (race condition?)</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="fgimenez">Federico Gimenez Nieto</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Jul 2010 06:24:01 +0000</created>
                <updated>Sat, 31 Jul 2010 06:24:01 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-772] Different test results in different debian boxes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-772</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have two different debian boxes, in one of them all test pass but in the other (a very basic system with just the essential packages installed) i get:&lt;/p&gt;

&lt;p&gt;Doctrine_Search_TestCase........................................................failed&lt;/p&gt;

&lt;p&gt;Unexpected Doctrine_Record_UnknownPropertyException thrown in &lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine_Search_TestCase&amp;#93;&lt;/span&gt; with message &lt;span class=&quot;error&quot;&gt;&amp;#91;Unknown record property / related component &amp;quot;SearchTestIndex&amp;quot; on &amp;quot;SearchTest&amp;quot;&amp;#93;&lt;/span&gt; in /home/fgimenez/doctrine/Doctrine-1.2.2/lib/Doctrine/Record/Filter/Standard.php on line 55&lt;/p&gt;

&lt;p&gt;#0 /home/fgimenez/doctrine/Doctrine-1.2.2/lib/Doctrine/Record.php(1382): Doctrine_Record_Filter_Standard-&amp;gt;filterGet(Object(SearchTest), &apos;SearchTestIndex&apos;)&lt;br/&gt;
#1 /home/fgimenez/doctrine/Doctrine-1.2.2/lib/Doctrine/Record.php(1337): Doctrine_Record-&amp;gt;_get(&apos;SearchTestIndex&apos;, true)&lt;br/&gt;
#2 /home/fgimenez/doctrine/Doctrine-1.2.2/lib/Doctrine/Access.php(72): Doctrine_Record-&amp;gt;get(&apos;SearchTestIndex&apos;)&lt;br/&gt;
#3 /home/fgimenez/doctrine/Doctrine-1.2.2/tests/SearchTestCase.php(48): Doctrine_Access-&amp;gt;__get(&apos;SearchTestIndex&apos;)&lt;br/&gt;
#4 /home/fgimenez/doctrine/Doctrine-1.2.2/tests/DoctrineTest/UnitTestCase.php(158): Doctrine_Search_TestCase-&amp;gt;testBuildingOfSearchRecordDefinition()&lt;br/&gt;
#5 /home/fgimenez/doctrine/Doctrine-1.2.2/tests/DoctrineTest/GroupTest.php(75): UnitTestCase-&amp;gt;run()&lt;br/&gt;
#6 /home/fgimenez/doctrine/Doctrine-1.2.2/tests/DoctrineTest.php(183): GroupTest-&amp;gt;run(Object(DoctrineTest_Reporter_Cli), &apos;&apos;)&lt;br/&gt;
#7 /home/fgimenez/doctrine/Doctrine-1.2.2/tests/run.php(320): DoctrineTest-&amp;gt;run()&lt;br/&gt;
#8 &lt;/p&gt;
{main}

&lt;p&gt;I&apos;ve been trying to determine which is the package that is installed in one box but not in the other and that make the Doctrine_Search_TestCase test pass, no luck so far (same php and sqlite configuration in both environments).&lt;/p&gt;

&lt;p&gt;Any hint on this is highly appreciated, cheers &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;Federico&lt;/p&gt;</description>
                <environment>Debian Lenny 5.0</environment>
            <key id="11575">DC-772</key>
            <summary>Different test results in different debian boxes</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="fgimenez">Federico Gimenez Nieto</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Jun 2010 12:31:24 +0000</created>
                <updated>Sun, 1 Aug 2010 06:34:11 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13751" author="fgimenez" created="Sun, 1 Aug 2010 03:29:09 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;In other words, what are the minimum requirements to run doctrine successfully, including the tests? After uploading the debian package of doctrine to the archive there have been some errors regarding the tests on a clean environment with just the packages php5-cli and php5-sqlite (and its dependencies) installed, see &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;. This used to work on other boxes.&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://people.debian.org/~lucas/logs/2010/07/31/doctrine_1.2.2-1_lsid64.buildlog&quot; class=&quot;external-link&quot;&gt;http://people.debian.org/~lucas/logs/2010/07/31/doctrine_1.2.2-1_lsid64.buildlog&lt;/a&gt;&lt;/p&gt;

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

<item>
            <title>[DC-734] With loading &quot;conservative&quot; or &quot;PEAR&quot;, Doctrine_Core::loadModels returns different results for identical calls</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-734</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; sorry &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; I changed issue subject, please have a look at the first comment&lt;/p&gt;</description>
                <environment>Mac OS X 10.5, MAMP 1.9, PHP 5.2.13&lt;br/&gt;
Doctrine SVN 1.2 r.7676</environment>
            <key id="11489">DC-734</key>
            <summary>With loading &quot;conservative&quot; or &quot;PEAR&quot;, Doctrine_Core::loadModels returns different results for identical calls</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gx">Guilliam X</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 12:28:01 +0000</created>
                <updated>Tue, 15 Jun 2010 10:57:00 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13322" author="gx" created="Tue, 15 Jun 2010 06:20:36 +0000"  >&lt;p&gt;Actually I have some interrogations about the way how &lt;em&gt;loadModels()&lt;/em&gt; works...&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;If using conservative or PEAR loading, in the directory listing loop:
	&lt;ul&gt;
		&lt;li&gt;if a class doesn&apos;t exist, it is loaded and added to the array to be returned, without verification (because you can&apos;t analyse a class that doesn&apos;t exist...);&lt;/li&gt;
		&lt;li&gt;but if it already exists, it is not loaded, and it is only added to the returned array if it is a &quot;valid model class&quot;.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So, with our &quot;Foo + BaseFoo&quot; example, the first call to &lt;tt&gt;loadModels(&apos;models&apos;)&lt;/tt&gt; returns an array with &lt;em&gt;both &apos;Foo&apos; and &apos;BaseFoo&apos;&lt;/em&gt;. Now if you instantiate class Foo, thanks to modelsAutoload() both classes Foo and BaseFoo will then exist. Then, a 2nd call to &lt;tt&gt;loadModels(&apos;models&apos;)&lt;/tt&gt; will return an array with &lt;em&gt;only &apos;Foo&apos;&lt;/em&gt; because BaseFoo did not pass at l. 691. So loadModels() is not deterministic...&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;del&gt;If using aggressive loading, each found file is included immediatly (so, the class he defined now exists),&lt;/del&gt;
	&lt;ol&gt;
		&lt;li&gt;&lt;del&gt;then I see some &quot;hack&quot; for the possible &quot;birth&quot; of core classes (Doctrine_Access, Doctrine_Record_Abstract and Doctrine_Record in my debug session), but that also allows multiple classes definitions in a single model file, or a file defining a class with an arbitrary classname regardless of filename! This drastically differs form other loading modes!&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;Then the(each) newly-existing class is not loaded nor added to the result unless it is a valid model; this is a big difference too!&lt;/del&gt;&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;IMHO:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;del&gt;although aggressive loading isn&apos;t meant to be used for production, it shouldn&apos;t differ &lt;em&gt;that much&lt;/em&gt; (we should be able to switch loading mode without it causes issues)&lt;/del&gt;&lt;/li&gt;
	&lt;li&gt;if loading mode is other than &quot;aggressive&quot;, loadModels() should &lt;em&gt;always&lt;/em&gt; (not only on first call) return &lt;b&gt;all&lt;/b&gt; the models found (recursively) in given directory(ies). If you want an array with only &quot;valid models&quot;, either use &lt;em&gt;getLoadedModels()&lt;/em&gt; (after loadModels()), or filter the return of loadModels() with &lt;em&gt;filterInvalidModels()&lt;/em&gt; (which is already used in Doctrine_Export, Doctrine_Export_Schema, ...)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; oh my... I just found this in documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Aggressive model loading is the default model loading method and is very simple, it will look for all files with a .php extension and will include it. &lt;em&gt;Doctrine can not satisfy any inheritance and if your models extend another model, it cannot include them in the correct order&lt;/em&gt; so it is &lt;em&gt;up to you&lt;/em&gt; to make sure all dependencies are satisfied in each class.&lt;/p&gt;

&lt;p&gt;With aggressive model loading &lt;em&gt;you can have multiple classes per file&lt;/em&gt; and the file name is &lt;em&gt;not required&lt;/em&gt; to be related to the name of the class inside of the file.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;However I still think that loadModels() should return the same array for 2 same (subsequent) calls...&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;</comment>
                    <comment id="13328" author="gx" created="Tue, 15 Jun 2010 10:57:00 +0000"  >&lt;p&gt;Attached a suggestion of patch that gives loadModels &lt;span class=&quot;error&quot;&gt;&amp;#91;different but&amp;#93;&lt;/span&gt; deterministic behaviors for both aggressive and non-aggressive loadings:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;agressive: will always return only names of &quot;valid&quot; models&lt;/li&gt;
	&lt;li&gt;other: will always return all names of loaded models (see previous comment for getting only &quot;valid&quot; ones)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="10654" name="DC-734.patch" size="787" author="gx" created="Tue, 15 Jun 2010 10:57:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-729] Doctrine_Parser_Xml numeric key in array</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-729</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I convert array with numeric keys to xml and recived error message&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Warning: SimpleXMLElement::addChild() &lt;span class=&quot;error&quot;&gt;&amp;#91;simplexmlelement.addchild&amp;#93;&lt;/span&gt;: Element name is required in /home/vital/projects/hino/lib/vendor/symfony-1.4.3/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/Xml.php on line 74&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;array&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;array&lt;br/&gt;
  &apos;id&apos; =&amp;gt; string &apos;25&apos; (length=2)&lt;br/&gt;
  &apos;count&apos; =&amp;gt; int 3&lt;br/&gt;
  &apos;cost&apos; =&amp;gt; float 68135.27&lt;br/&gt;
  &apos;user_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
  &apos;profile_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
  &apos;created_at&apos; =&amp;gt; string &apos;2010-06-12 14:59:52&apos; (length=19)&lt;br/&gt;
  &apos;OrderProductList&apos; =&amp;gt; &lt;br/&gt;
    array&lt;br/&gt;
      0 =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          &apos;id&apos; =&amp;gt; string &apos;56&apos; (length=2)&lt;br/&gt;
          &apos;count&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
          &apos;cost&apos; =&amp;gt; string &apos;9511.82&apos; (length=7)&lt;br/&gt;
          &apos;user_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
          &apos;code_1c&apos; =&amp;gt; string &apos;2399&apos; (length=4)&lt;br/&gt;
          &apos;catalog_number&apos; =&amp;gt; string &apos;0446537150&apos; (length=10)&lt;br/&gt;
          &apos;shot_name&apos; =&amp;gt; string &apos;PAD KIT, DISC BRAKE&apos; (length=19)&lt;br/&gt;
          &apos;name&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;vin&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;engine_model&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;status_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
          &apos;transport_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
          &apos;order_id&apos; =&amp;gt; string &apos;25&apos; (length=2)&lt;br/&gt;
          &apos;Order&apos; =&amp;gt; boolean false&lt;br/&gt;
      1 =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          &apos;id&apos; =&amp;gt; string &apos;57&apos; (length=2)&lt;br/&gt;
          &apos;count&apos; =&amp;gt; int 1&lt;br/&gt;
          &apos;cost&apos; =&amp;gt; float 55787.49&lt;br/&gt;
          &apos;user_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
          &apos;code_1c&apos; =&amp;gt; string &apos;2629&apos; (length=4)&lt;br/&gt;
          &apos;catalog_number&apos; =&amp;gt; string &apos;4405037040&apos; (length=10)&lt;br/&gt;
          &apos;shot_name&apos; =&amp;gt; string &apos;ACTUATOR ASSY, BRAKE&apos; (length=20)&lt;br/&gt;
          &apos;name&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;vin&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;engine_model&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;status_id&apos; =&amp;gt; int 1&lt;br/&gt;
          &apos;transport_id&apos; =&amp;gt; int 1&lt;br/&gt;
          &apos;order_id&apos; =&amp;gt; string &apos;25&apos; (length=2)&lt;br/&gt;
          &apos;Order&apos; =&amp;gt; boolean false&lt;br/&gt;
      2 =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          &apos;id&apos; =&amp;gt; string &apos;58&apos; (length=2)&lt;br/&gt;
          &apos;count&apos; =&amp;gt; string &apos;4&apos; (length=1)&lt;br/&gt;
          &apos;cost&apos; =&amp;gt; float 2835.96&lt;br/&gt;
          &apos;user_id&apos; =&amp;gt; string &apos;1&apos; (length=1)&lt;br/&gt;
          &apos;code_1c&apos; =&amp;gt; string &apos;2224&apos; (length=4)&lt;br/&gt;
          &apos;catalog_number&apos; =&amp;gt; string &apos;S156071562&apos; (length=10)&lt;br/&gt;
          &apos;shot_name&apos; =&amp;gt; string &apos;ELEMENT SET&apos; (length=11)&lt;br/&gt;
          &apos;name&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;vin&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;engine_model&apos; =&amp;gt; string &apos;&apos; (length=0)&lt;br/&gt;
          &apos;status_id&apos; =&amp;gt; int 1&lt;br/&gt;
          &apos;transport_id&apos; =&amp;gt; int 1&lt;br/&gt;
          &apos;order_id&apos; =&amp;gt; string &apos;25&apos; (length=2)&lt;br/&gt;
          &apos;Order&apos; =&amp;gt; boolean false&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;in doctrine/Doctrine/Parser/Xml.php on line 74&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$key = preg_replace(&apos;/&lt;span class=&quot;error&quot;&gt;&amp;#91;^a-z&amp;#93;&lt;/span&gt;/i&apos;, &apos;&apos;, $key);&lt;/p&gt;

&lt;p&gt;            if (is_array($value) &amp;amp;&amp;amp; ! empty($value)) {&lt;br/&gt;
                $node = $xml-&amp;gt;addChild($key);&lt;/p&gt;
&lt;/blockquote&gt; 

&lt;p&gt;$key = preg_replace(&apos;/&lt;span class=&quot;error&quot;&gt;&amp;#91;^a-z&amp;#93;&lt;/span&gt;/i&apos;, &apos;&apos;, $key); from 69 line conver numeric key into empty string&lt;/p&gt;



</description>
                <environment></environment>
            <key id="11478">DC-729</key>
            <summary>Doctrine_Parser_Xml numeric key in array</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="codeninja">Vitaliy Mayorov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Jun 2010 01:47:24 +0000</created>
                <updated>Sat, 12 Jun 2010 01:47:24 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-915] The PHP code is invalid in the &quot;Create Table&quot; example; there are missing commas in the array definition.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-915</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/migrations/en#writing-migration-classes:available-operations:create-table&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/migrations/en#writing-migration-classes:available-operations:create-table&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The PHP code is invalid in the &quot;Create Table&quot; example; there are missing commas in the array definition.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12060">DC-915</key>
            <summary>The PHP code is invalid in the &quot;Create Table&quot; example; there are missing commas in the array definition.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mattalexx">Matt Alexander</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Nov 2010 14:37:03 +0000</created>
                <updated>Wed, 7 Sep 2011 18:58:56 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16449" author="johnkary" created="Wed, 7 Sep 2011 18:58:56 +0000"  >&lt;p&gt;Submitted pull request with fixes:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1-documentation/pull/1&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1-documentation/pull/1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10842" name="2010-11-02_123641.png" size="13713" author="mattalexx" created="Tue, 2 Nov 2010 14:37:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1019] **REMOVED SPAM**</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1019</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;*&lt;b&gt;REMOVED SPAM&lt;/b&gt;*&lt;/p&gt;</description>
                <environment>**REMOVED SPAM**</environment>
            <key id="12830">DC-1019</key>
            <summary>**REMOVED SPAM**</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="yahwehyahweh">betty akamissnigger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jul 2011 15:32:01 +0000</created>
                <updated>Tue, 23 Aug 2011 18:08:40 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16372" author="roychri" created="Tue, 23 Aug 2011 18:08:40 +0000"  >&lt;p&gt;This issue was filled with spam text so I removed it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1042] submitted form accidentally - PLEASE DELETE</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1042</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This was accidentally submitted before being complete ... This one can be deleted ... sorry&lt;/p&gt;</description>
                <environment></environment>
            <key id="13230">DC-1042</key>
            <summary>submitted form accidentally - PLEASE DELETE</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shotdsherrif">Maurice Stephens</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Nov 2011 21:20:19 +0000</created>
                <updated>Wed, 30 Nov 2011 21:34:39 +0000</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16934" author="shotdsherrif" created="Wed, 30 Nov 2011 21:34:39 +0000"  >&lt;p&gt;This was accidentally submitted before being complete ... This one can be deleted ... sorry&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-804] Files&apos; date set to epoch</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-804</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;The date for all the files in the 1.2.2 tarball is set to 1970-01-01.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Federico&lt;/p&gt;</description>
                <environment></environment>
            <key id="11699">DC-804</key>
            <summary>Files&apos; date set to epoch</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="fgimenez">Federico Gimenez Nieto</reporter>
                        <labels>
                    </labels>
                <created>Sat, 31 Jul 2010 06:20:51 +0000</created>
                <updated>Sat, 31 Jul 2010 06:20:51 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-731] [Source code format] Transform indent tabs into 4 spaces, and trim trailing spaces</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-731</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have read that Doctrine source code is wanted not to use tabs for indentation / alignement;&lt;br/&gt;
and trailing spaces / tabs are useless and polluting.&lt;br/&gt;
I made some funny 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;

&lt;p&gt;G.X&lt;/p&gt;</description>
                <environment>Doctrine SVN 1.2 revision 7676</environment>
            <key id="11480">DC-731</key>
            <summary>[Source code format] Transform indent tabs into 4 spaces, and trim trailing spaces</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gx">Guilliam X</reporter>
                        <labels>
                    </labels>
                <created>Sat, 12 Jun 2010 11:25:45 +0000</created>
                <updated>Wed, 16 Jun 2010 06:06:01 +0000</updated>
                                    <version>1.2.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13325" author="gx" created="Tue, 15 Jun 2010 06:56:53 +0000"  >&lt;p&gt;Edited the patch with &quot;branches/1.2&quot; as root&lt;/p&gt;

&lt;p&gt;(I won&apos;t provide a test case but they all run without failure after patching)&lt;/p&gt;</comment>
                    <comment id="13332" author="gx" created="Wed, 16 Jun 2010 06:06:01 +0000"  >&lt;p&gt;Converted patch to Unix-like EOL style&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10655" name="DC-731.patch" size="234157" author="gx" created="Wed, 16 Jun 2010 06:06:01 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>