<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 13:29:13 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=labels+%3D+dql&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=labels+%3D+dql</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="21" total="21"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-2470] Sql Server error in createQuery using ORDER BY and setMaxResults</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2470</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When executing&lt;/p&gt;

&lt;p&gt;$query = $em-&amp;gt;createQuery(&lt;br/&gt;
			&apos;SELECT m.nombre, m.fechainicio, m.fechafin FROM Bundle:Medicion m&lt;br/&gt;
			JOIN m.estudio e&lt;br/&gt;
			JOIN e.cliente c&lt;br/&gt;
			JOIN c.usuarios u&lt;br/&gt;
			WHERE u.id = :id&lt;br/&gt;
			ORDER BY m.fechainicio DESC&apos;)&lt;br/&gt;
			-&amp;gt;setMaxResults(12)&lt;br/&gt;
			&lt;del&gt;&amp;gt;setParameter(&apos;id&apos;, $user&lt;/del&gt;&amp;gt;getId());&lt;/p&gt;

&lt;p&gt;Get the following error:&lt;/p&gt;

&lt;p&gt;An exception occurred while executing &apos;SELECT * FROM (SELECT m0_.NOMBRE AS NOMBRE0, m0_.FECHAINICIO AS FECHAINICIO1, m0_.FECHAFIN AS FECHAFIN2, ROW_NUMBER() OVER (ORDER BY FECHAINICIO1 DESC) AS doctrine_rownum FROM MEDICION m0_ WITH (NOLOCK) INNER JOIN ESTUDIO e1_ ON m0_.ESTUDIO_ID = e1_.ID INNER JOIN CLIENTE c2_ ON e1_.CLIENTE_ID = c2_.ID INNER JOIN USUARIO u3_ ON c2_.ID = u3_.CLIENTE_ID WHERE u3_.ID = ?) AS doctrine_tbl WHERE doctrine_rownum BETWEEN 1 AND 12&apos; with params &lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S22&amp;#93;&lt;/span&gt;: &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 11.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;El nombre de columna &apos;FECHAINICIO1&apos; no es v&#225;lido.&lt;/p&gt;

&lt;p&gt;Attached the BD model&lt;/p&gt;

&lt;p&gt;regards&lt;br/&gt;
Jonnatan Oyarz&#250;n&lt;/p&gt;</description>
                <environment>Windows 7,  Apache 2 (xampp 1.8.1), PHP 5.4.7, Symfony 2.2.1</environment>
            <key id="14989">DDC-2470</key>
            <summary>Sql Server error in createQuery using ORDER BY and setMaxResults</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>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="jonsxaero">Jonnatan Oyarz&#250;n</reporter>
                        <labels>
                        <label>dql</label>
                        <label>sqlserver</label>
                    </labels>
                <created>Fri, 24 May 2013 16:27:41 +0000</created>
                <updated>Fri, 24 May 2013 16:27:41 +0000</updated>
                                    <version>2.4</version>
                <version>2.3.4</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="11611" name="BD.png" size="320773" author="jonsxaero" created="Fri, 24 May 2013 16:27:41 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2452] Additional `WITH` condition in joins between JTI roots cause invalid SQL to be produced</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2452</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Given a simple Joined Table Inheritance like 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;
/**
 * @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;) @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;JOINED&quot;&lt;/span&gt;)
 * @DiscriminatorColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;discr&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
 * @DiscriminatorMap({&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;DDC2452Foo&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt; = &lt;span class=&quot;code-quote&quot;&gt;&quot;DDC2452Bar&quot;&lt;/span&gt;})
 */
class DDC2452Foo
{
    /** @Id @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;) @GeneratedValue */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
}

/** @Entity @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;) */
class DDC2452Bar &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; DDC2452Foo
{
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Following 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 foo1 FROM DDC2452Foo foo1 JOIN DDC2452Foo foo2 WITH 1=1&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will produce broken SQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SELECT
    f0_.id AS id0, f0_.discr AS discr1 
FROM 
    foo f0_ 
LEFT JOIN bar b1_ 
    ON f0_.id = b1_.id 
LEFT JOIN foo f2_ 
LEFT JOIN bar b3_ 
    ON f2_.id = b3_.id 
    ON (1 = 1)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(please note the duplicate `ON` in the SQL)&lt;/p&gt;

&lt;p&gt;That is caused because of the SQL walker producing the JTI filter with already the `ON` clause in it.&lt;/p&gt;

&lt;p&gt;That happens because the JTI join conditions are added in &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/2.4.0-BETA2/lib/Doctrine/ORM/Query/SqlWalker.php#L823-L825&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/blob/2.4.0-BETA2/lib/Doctrine/ORM/Query/SqlWalker.php#L823-L825&lt;/a&gt; (`walkRangeVariableDeclaration`), while the additional defined `WITH` conditions are considered in `walkJoinAssociationDeclaration` later on.&lt;/p&gt;

&lt;p&gt;Added a test case and fix at &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/668&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/668&lt;/a&gt;&lt;/p&gt;</description>
                <environment>irrelevant</environment>
            <key id="14958">DDC-2452</key>
            <summary>Additional `WITH` condition in joins between JTI roots cause invalid SQL to be produced</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="ocramius">Marco Pivetta</reporter>
                        <labels>
                        <label>dql</label>
                        <label>sql-walker</label>
                    </labels>
                <created>Thu, 16 May 2013 14:05:48 +0000</created>
                <updated>Thu, 16 May 2013 16:23:40 +0000</updated>
                                    <version>Git Master</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2347] Refresh Uniqueidentifier ID from mssql of inserted Entity in doctrine2.3</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2347</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I don&apos;t want you to report something that isn&apos;t a bug.&lt;br/&gt;
But I read about problems with doctrine2 and mssql uniqueid&apos;s.&lt;br/&gt;
So First I asked a question at stackoverflow. No one could help me, and the only one who gave me a comment thought the same then me, that it looks like a bug.&lt;/p&gt;

&lt;p&gt;If it isn&apos;t a bug I&apos;m very sorry for this issue report.&lt;/p&gt;

&lt;p&gt;Issue as reported in &lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/15368082/refresh-uniqueidentifier-id-from-mssql-of-inserted-entity-in-doctrine2&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/15368082/refresh-uniqueidentifier-id-from-mssql-of-inserted-entity-in-doctrine2&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Windows Server 2008 R2, Apache 2.2, Doctrine 2.3, PHP 5.4</environment>
            <key id="14689">DDC-2347</key>
            <summary>Refresh Uniqueidentifier ID from mssql of inserted Entity in doctrine2.3</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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ok3n0b1">Lucas Senn</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Wed, 13 Mar 2013 07:58:36 +0000</created>
                <updated>Wed, 13 Mar 2013 08:11:55 +0000</updated>
                                    <version>2.3.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2268] Lexer error using string functions inside CASE WHEN</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2268</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When using the CASE WHEN expression in DQL a Lexer error is thrown if the THEN condition uses a FunctionsReturningStrings function. For example, the following query is valid in SQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; t.*, CASE WHEN LENGTH(t.myfield) &amp;lt;&amp;gt; 0 THEN CONCAT(t.myfield, t.myfield2) ELSE t.myfield2 END as mycasefield &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; mytable AS t&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, if the CONCAT function is used in DQL the exception is raised.&lt;/p&gt;</description>
                <environment>Windows 8 64bit, IIS Express 8, PHP 5.4.9</environment>
            <key id="14443">DDC-2268</key>
            <summary>Lexer error using string functions inside CASE WHEN</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="vecchia">Stefano</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Sat, 2 Feb 2013 14:13:42 +0000</created>
                <updated>Sat, 2 Feb 2013 19:55:03 +0000</updated>
                    <resolved>Sat, 2 Feb 2013 19:55:02 +0000</resolved>
                            <version>2.3.2</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19454" author="fabio.bat.silva" created="Sat, 2 Feb 2013 19:55:03 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/1627fc95965a3e2e3894fcf7e524eb0eaa9d0ddd&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/1627fc95965a3e2e3894fcf7e524eb0eaa9d0ddd&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2254] Exporting and restoring a query.</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2254</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When you have a queryBuilder and you want to break it down using getDQLParts, You can&apos;t restore it by looping over the parts and adding them.&lt;/p&gt;

&lt;p&gt;This is what I am doing:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$parts = $qb-&amp;gt;getDQLParts();

&lt;span class=&quot;code-comment&quot;&gt;// save the parts and use them in a different environment.
&lt;/span&gt;
$newQb = $em-&amp;gt;createQueryBuilder();
foreach ($parts as $name =&amp;gt; $part) {
  $newQb-&amp;gt;add($name, $part);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>OSX</environment>
            <key id="14406">DDC-2254</key>
            <summary>Exporting and restoring a query.</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>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="nousefreak">Dries De Peuter</reporter>
                        <labels>
                        <label>dql</label>
                        <label>rebuild</label>
                        <label>restore</label>
                        <label>save</label>
                    </labels>
                <created>Wed, 23 Jan 2013 20:02:34 +0000</created>
                <updated>Sat, 4 May 2013 11:43:53 +0000</updated>
                                    <version>Git Master</version>
                <version>2.3.2</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19363" author="nousefreak" created="Wed, 23 Jan 2013 20:21:11 +0000"  >&lt;p&gt;I wrote a test showing the issue.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a&quot; class=&quot;external-link&quot;&gt;https://github.com/NoUseFreak/doctrine2/commit/8574b79fd3d245532bbe7e310c5cbe083892057a&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="20205" author="beberlei" created="Sat, 4 May 2013 11:43:53 +0000"  >&lt;p&gt;This is not a bug, because restoring queries is not yet a feature of the QueryBuilder. Marking as possible improvement for future.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2240] Inconsistent querying for parameter type (from ClassMetadata) between using Find/FindBy and DoctrineQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2240</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>
&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have stumbled on a problem were querying the same data with different methods (findBy and DQL) retrieves different results.&lt;/p&gt;

&lt;p&gt;I have extended the Doctrine\DBAL\Types\DateTimeType with my own type&lt;br/&gt;
BVD\PetroleumBundle\DoctrineExtensions\DBAL\Types\UTCDateTimeType,&lt;/p&gt;

&lt;p&gt;which I attach.&lt;br/&gt;
I expect, that whenever we deal with an entity that has a property of this type, both convertToDatabaseValue() (whenever we access the DB, conversion from DateTime to a string)  and convertToPHPValue() (whenever the result from DB query is returned back, conversion from string to DateTime) have to be executed.&lt;/p&gt;

&lt;p&gt;It is important, as the single purpose of convertToDatabaseValue() is to perform conversion of the incoming DateTime to the UTC timezone prior to conversion to string,&lt;br/&gt;
and then whenever we convert the DB value to DateTime to set it&apos;s timezone not to default value (server local timezone), but to UTC (as the values are stored in UTC).&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
Query:&lt;br/&gt;
$entity = $em-&amp;gt;getRepository(&apos;BVDPetroleumBundle:FuelCardTransaction&apos;)-&amp;gt;findOneBy(array(&apos;id&apos; =&amp;gt; $id, &apos;processed_datetime&apos; =&amp;gt; new \DateTime(&apos;2011-03-10 23:58:37&apos;)));&lt;/p&gt;

&lt;p&gt;as you see, DateTime object is created without DateTimeZone set, which makes it employ the server&apos;s default timezone (say EST).&lt;/p&gt;

&lt;p&gt;Entity has this property registered as:&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@ORM\Column(type=&quot;utcdatetime&quot;)&lt;br/&gt;
     */&lt;br/&gt;
    public $processed_datetime;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And this datatype is registered with Doctrine through Symfony2 configuration:&lt;br/&gt;
doctrine:&lt;br/&gt;
    dbal:&lt;br/&gt;
        types: &lt;br/&gt;
            utcdatetime: BVD\PetroleumBundle\DoctrineExtensions\DBAL\Types\UTCDateTimeType&lt;/p&gt;


&lt;p&gt;Whenever I query the DB, prior to SQL generation, DateTime is getting converted to UTC by UTCDateTimeType#convertToDatabaseValue(), and becomes:&lt;br/&gt;
&apos;2011-03-10 23:58:37&apos; (EST) -&amp;gt; &apos;2011-03-11 04:58:37&apos; (UTC).&lt;br/&gt;
Then, whenever the object is retrieved back, I expect that UTCDateTimeType#convertToPHPValue() is used to set the correct timezone information&lt;br/&gt;
on the created DateTime object: &apos;2011-03-11 04:58:37&apos; (UTC).&lt;br/&gt;
This is the correct behaviour that is expected, and is correctly achieved by using findBy methods to retrieve data:&lt;/p&gt;

&lt;p&gt;$entity = $em-&amp;gt;getRepository(&apos;BVDPetroleumBundle:FuelCardTransaction&apos;)-&amp;gt;findOneBy(array(&apos;id&apos; =&amp;gt; $id, &apos;processed_datetime&apos; =&amp;gt; new \DateTime(&apos;2011-03-10 23:58:37&apos;)));&lt;/p&gt;

&lt;p&gt;But, when the DQL is used to issue the same query:&lt;/p&gt;

&lt;p&gt;$queryBuilder = $em-&amp;gt;createQueryBuilder()&lt;del&gt;&amp;gt;select(&apos;a&apos;)&lt;/del&gt;&amp;gt;from(&apos;BVDPetroleumBundle:FuelCardTransaction&apos;,&apos;a&apos;)&lt;br/&gt;
-&amp;gt;where(&apos;a.id = :transaction_id&apos;)&lt;br/&gt;
-&amp;gt;andWhere(&quot;a.processed_datetime = :datetime&quot;)&lt;br/&gt;
-&amp;gt;setParameter(&apos;transaction_id&apos;, $id)&lt;br/&gt;
-&amp;gt;setParameter(&quot;datetime&quot;, new \DateTime(&apos;2011-03-10 23:58:37&apos;));&lt;br/&gt;
$entity = $queryBuilder-&amp;gt;getQuery()-&amp;gt;getOneOrNullResult();&lt;/p&gt;

&lt;p&gt;Doctrine\DBAL\Types\DateTimeType#convertToDatabaseValue() is getting executed for &apos;processed_datetime&apos;, instead of &lt;br/&gt;
BVD\PetroleumBundle\DoctrineExtensions\DBAL\Types\UTCDateTimeType,&lt;/p&gt;

&lt;p&gt;and the conversion doesn&apos;t happen, so the query doesn&apos;t return the result, that really exists in DB.&lt;/p&gt;

&lt;p&gt;I attach two methods traces, so it&apos;s easier to identify the problem: whenever the findBy is used, and whenever the DQL is used.&lt;br/&gt;
I have managed to trace it to the way how both methods retrieve their $types arrays.&lt;/p&gt;

&lt;p&gt;The reason it succeeds when used with findBy methods:&lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister#load() is used to retrieve the data.&lt;br/&gt;
The $types property that holds the type information (&apos;utcdatetime&apos;) is formed by calling&lt;br/&gt;
BasicEntityPersister#expandParameters($criteria), and in the process of analyzing incoming parameters it queries the entity metadata (@ORM\Column(type=&quot;utcdatetime&quot;)),&lt;br/&gt;
stored in BasicEntityPersister#$_class property. (method BasicEntityPersister#getType())&lt;br/&gt;
Then it&apos;s able to match type &apos;utcdatetime&apos; to class BVD\PetroleumBundle\DoctrineExtensions\DBAL\Types\UTCDateTimeType&lt;/p&gt;

&lt;p&gt;The reason it fails with DQL:&lt;br/&gt;
It seems that with DQL, it doesn&apos;t query the entity metadata (@ORM\Column(type=&quot;utcdatetime&quot;)) to derive property type. This mechanism leads the type to be recognized as simply &apos;datetime&apos;, and the standard handler Doctrine\DBAL\Types\DateTimeType is used instead:&lt;/p&gt;

&lt;p&gt;The $types (which has &apos;datetime&apos; instead of &apos;utcdatetime&apos;) array is getting formed in&lt;br/&gt;
Doctrine\ORM\Query#_doExecute(): &lt;br/&gt;
list($sqlParams, $types) = $this-&amp;gt;processParameterMappings($paramMappings); &lt;/p&gt;

&lt;p&gt;in Doctrine\ORM\Query#processParameterMappings($paramMappings) &lt;br/&gt;
Doctrine\ORM\Query#processParameterValue($parameter-&amp;gt;getValue()) is called to convert parameter from Object to string.&lt;/p&gt;

&lt;p&gt;in Doctrine\ORM\AbstractQuery#processParameterValue($value) for object of class DateTime I would expect this to be executed:&lt;br/&gt;
case is_object($value) &amp;amp;&amp;amp; $this-&amp;gt;_em-&amp;gt;getMetadataFactory()-&amp;gt;hasMetadataFor(ClassUtils::getClass($value)):&lt;br/&gt;
  return $this-&amp;gt;convertObjectParameterToScalarValue($value);  &lt;/p&gt;

&lt;p&gt;but it&apos;s not, and the DateTime is returned out of it, and in Doctrine\ORM\Query\processParameterMappings $type is getting set to $parameter-&amp;gt;getType() (&apos;datetime&apos;)&lt;/p&gt;


&lt;p&gt;Please confirm/contradict the issue. Right now for workaround, whenever I use DQL, have to explicitly set the timezone of DateTime prior to issuing a query.&lt;/p&gt;

&lt;p&gt;From Russia with love,&lt;br/&gt;
Slavik&lt;/p&gt;</description>
                <environment></environment>
            <key id="14380">DDC-2240</key>
            <summary>Inconsistent querying for parameter type (from ClassMetadata) between using Find/FindBy and DoctrineQL</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="slavik2121">Slavik Derevyanko</reporter>
                        <labels>
                        <label>ClassMetadata</label>
                        <label>dql</label>
                    </labels>
                <created>Fri, 11 Jan 2013 23:26:13 +0000</created>
                <updated>Fri, 8 Feb 2013 14:36:22 +0000</updated>
                    <resolved>Sun, 13 Jan 2013 08:34:23 +0000</resolved>
                            <version>2.3.1</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19283" author="slavik2121" created="Fri, 11 Jan 2013 23:57:05 +0000"  >&lt;p&gt;I realized, that with DQL,&lt;br/&gt;
the default type &apos;datetime&apos; of Doctrine\ORM\Query\Parameter for DateTime objects&lt;br/&gt;
is getting set&lt;br/&gt;
by Doctrine\ORM\Query\ParameterTypeInferer#inferType(),&lt;/p&gt;

&lt;p&gt;and that it&apos;s possible to set the type as a third parameter:&lt;/p&gt;

&lt;p&gt;        $queryBuilder = $em-&amp;gt;createQueryBuilder()&lt;br/&gt;
            -&amp;gt;select(&apos;a&apos;)&lt;br/&gt;
            -&amp;gt;from(&apos;BVDPetroleumBundle:FuelCardTransaction&apos;,&apos;a&apos;)&lt;br/&gt;
            -&amp;gt;where(&apos;a.id = :transaction_id&apos;)&lt;br/&gt;
            -&amp;gt;andWhere(&quot;a.processed_datetime = :datetime&quot;)&lt;br/&gt;
            -&amp;gt;setParameter(&apos;transaction_id&apos;, $id)&lt;br/&gt;
            -&amp;gt;setParameter(&quot;datetime&quot;, new \DateTime(&apos;2011-03-10 23:58:37&apos;), &apos;utcdatetime&apos;);&lt;/p&gt;

&lt;p&gt;It seems, this is worth noting in the documentation.&lt;/p&gt;
</comment>
                    <comment id="19287" author="beberlei" created="Sat, 12 Jan 2013 09:13:06 +0000"  >&lt;p&gt;Verified, but I don&apos;t know how to fix it without breaking BC.&lt;/p&gt;

&lt;p&gt;As a workaround you can convert the value yourself in your code, not the nicest solution, but when wrapped in a function call of your own, it shouldn&apos;t be to invasive.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=guilhermeblanco&quot; class=&quot;user-hover&quot; rel=&quot;guilhermeblanco&quot;&gt;Guilherme Blanco&lt;/a&gt; any idea what to do? &lt;/p&gt;</comment>
                    <comment id="19293" author="guilhermeblanco" created="Sat, 12 Jan 2013 15:55:54 +0000"  >&lt;p&gt;There&apos;s a way currently to fix this issue.&lt;br/&gt;
Of course that we lack of some direct support, but you can take advantage of a second method to fix your problem.&lt;/p&gt;

&lt;p&gt;Currently, &lt;tt&gt;setParameter&lt;/tt&gt; only accepts key, value, type as arguments, creating its own Query\Parameter.&lt;br/&gt;
But if you look at &lt;tt&gt;setParameters&lt;/tt&gt; receiving an ArrayCollection, it doesn&apos;t create the Parameter. This is where you can take advantage.&lt;/p&gt;

&lt;p&gt;Ideally, any Type could convert back and forth from DB to PHP value. During a query, the algorithm should apply also. But if we do this change, we will introduce a BC break. To solve the issue, you&apos;ll have to create your own Parameter.&lt;/p&gt;

&lt;p&gt;From the Doctrine perspective, we only need to support $key to be a class too. If it&apos;s a class, replace the value in the collection of parameters. This is the required change in our codebase.&lt;br/&gt;
But until this gets done, &lt;tt&gt;setParameters&lt;/tt&gt; is already compatible with the solution.&lt;/p&gt;

&lt;p&gt;All you have to do is create a class that extends Query\Parameter, then apply your required changes when doing getValue or during object construction. Then use the method I mentioned to inject an ArrayCollection of Parameters and everything will work. =)&lt;/p&gt;</comment>
                    <comment id="19295" author="beberlei" created="Sun, 13 Jan 2013 08:34:23 +0000"  >&lt;p&gt;Same as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2224&quot; title=&quot;convertToDatabaseValueSQL() is not honored for DQL query parameters&quot;&gt;&lt;del&gt;DDC-2224&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19487" author="beberlei" created="Fri, 8 Feb 2013 09:58:55 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-574&amp;#93;&lt;/span&gt; was opened&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/574&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/574&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19496" author="slavik2121" created="Fri, 8 Feb 2013 14:36:22 +0000"  >&lt;p&gt;Great, thanks!&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="14350">DDC-2224</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11371" name="DoctrineQL methods trace.png" size="162532" author="slavik2121" created="Fri, 11 Jan 2013 23:26:14 +0000" />
                    <attachment id="11372" name="findBy methods trace.png" size="143909" author="slavik2121" created="Fri, 11 Jan 2013 23:26:14 +0000" />
                    <attachment id="11370" name="UTCDateTimeType.php" size="2101" author="slavik2121" created="Fri, 11 Jan 2013 23:26:13 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2223] unable to use scalar function when a scalar expression is expected</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2223</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;the DQL Parser don&apos;t parse properly functions when a ScalarExpression is needed like of all case functions.&lt;/p&gt;

&lt;p&gt;In fact first function token is interpreted as a T_IDENTIFIER and enter on line 1663 of Doctrine\ORM\Query\Parser class. in search of math operator, when not found this case considere that the token is a row element with no consid&#233;ration of the functions procession treated after.&lt;/p&gt;

&lt;p&gt;fix of this bug consist to enclose the line 1672 by a if (!$this-&amp;gt;_isFunction()).&lt;/p&gt;</description>
                <environment>(not affected by this bug)</environment>
            <key id="14349">DDC-2223</key>
            <summary>unable to use scalar function when a scalar expression is expected</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="alexises">Alexis Lameire</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Fri, 4 Jan 2013 13:21:34 +0000</created>
                <updated>Fri, 4 Jan 2013 13:21:34 +0000</updated>
                                    <version>Git Master</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2205] Negative Values in Case Then expressions</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2205</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;DQL Expression: &lt;/p&gt;

&lt;p&gt;SELECT (CASE WHEN t.id = 1 THEN -1 ELSE t.id END) FROM Table t&lt;/p&gt;

&lt;p&gt;Gives an error:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 32: Error: Unexpected &apos;-&apos;&lt;/p&gt;

&lt;p&gt;It doesn&apos;t seem to like the negative number.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14320">DDC-2205</key>
            <summary>Negative Values in Case Then expressions</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="ibiryukov">Ilya Biryukov</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Tue, 18 Dec 2012 00:18:52 +0000</created>
                <updated>Fri, 21 Dec 2012 12:03:45 +0000</updated>
                    <resolved>Fri, 21 Dec 2012 12:03:45 +0000</resolved>
                            <version>2.3.1</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19166" author="fabio.bat.silva" created="Fri, 21 Dec 2012 12:03:45 +0000"  >&lt;p&gt;Fixed : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/8b5e4a9a52670992b85e7223d255b98cf77a35a3&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/8b5e4a9a52670992b85e7223d255b98cf77a35a3&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2204] Order by With Equals is not supported</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2204</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The sample query (I want to bring a specific item to the top of the list).&lt;br/&gt;
mysql&amp;gt; select * from Language order by name=&apos;English&apos; desc, name asc limit 5;&lt;br/&gt;
&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; id &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; name     &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;---&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 82 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; English  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 73 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Albanian &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 74 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Arabic   &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 75 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Armenian &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 76 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Bengali  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

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

&lt;p&gt;In theory, the code below should generate the same query.&lt;br/&gt;
$repository-&amp;gt;createQueryBuilder(&apos;p&apos;)&lt;br/&gt;
-&amp;gt;addOrderBy(&quot;p.name=&apos;english&apos;&quot;, &apos;desc&apos;)&lt;br/&gt;
-&amp;gt;addOrderBy(&apos;p.name&apos;, &apos;asc&apos;);&lt;/p&gt;

&lt;p&gt;In practice, an exception is thrown.&lt;br/&gt;
Doctrine\ORM\Query\QueryException: &lt;span class=&quot;error&quot;&gt;&amp;#91;Syntax Error&amp;#93;&lt;/span&gt; line 0, col 67: Error: Expected end of string, got &apos;=&apos; (uncaught exception) at /vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 44 &lt;/p&gt;

&lt;p&gt;Attached, SQL dump for the table &amp;amp; data&lt;/p&gt;</description>
                <environment>SQL construct tested on postgres 9.0, mysql 5.5, and sqlite 3.</environment>
            <key id="14318">DDC-2204</key>
            <summary>Order by With Equals is not supported</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ibiryukov">Ilya Biryukov</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Mon, 17 Dec 2012 20:39:59 +0000</created>
                <updated>Sat, 22 Dec 2012 13:19:16 +0000</updated>
                    <resolved>Sat, 22 Dec 2012 13:19:16 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19172" author="beberlei" created="Sat, 22 Dec 2012 13:19:16 +0000"  >&lt;p&gt;Its supported by including the condition in the SELECT clause, aliasing it, then using it. You might need to use &quot;AS HIDDEN name&quot; to prevent it from appearing in the result&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11364" name="Language.sql" size="1756" author="ibiryukov" created="Mon, 17 Dec 2012 20:39:59 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2185] Better explain DQL &quot;WITH&quot; and implications for the collection filtering API</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2185</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Available documentation is a bit thin regarding the &quot;WITH&quot; clause on JOIN expressions. Only a single example is provided in&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WITH seems to allow to only &quot;partially&quot; load a collection, so the collection in memory does not fully represent the associations available in the database.&lt;/p&gt;

&lt;p&gt;The resulting collection is marked as &quot;initialized&quot; and it seems there is no way to tell later on whether/how (with which expression) the collection has been initialized.&lt;/p&gt;

&lt;p&gt;When using the collection filtering API, the &quot;initialized&quot; flag on the collection will lead to in-memory processing. If a collection has been loaded WITH a restricting clause and another filter is applied later, results may not be what one might expect.&lt;/p&gt;

&lt;p&gt;I assume this is by design (no idea how the collection could be &quot;partially&quot; loaded and behave correctly under all conditions), so filing it as a documentation issue.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14291">DDC-2185</key>
            <summary>Better explain DQL &quot;WITH&quot; and implications for the collection filtering API</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mpdude">Matthias Pigulla</reporter>
                        <labels>
                        <label>collection</label>
                        <label>documentation</label>
                        <label>dql</label>
                        <label>filtering</label>
                    </labels>
                <created>Tue, 4 Dec 2012 11:35:02 +0000</created>
                <updated>Mon, 17 Dec 2012 14:07:03 +0000</updated>
                                    <version>2.2</version>
                                                <component>Documentation</component>
                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="19153" author="mpdude" created="Mon, 17 Dec 2012 14:07:03 +0000"  >&lt;p&gt;An additional observation:&lt;/p&gt;

&lt;p&gt;If you eager-load a collection using WITH, for the resulting entities that collection is marked as initialized as described above.&lt;/p&gt;

&lt;p&gt;Should you happen to come across the same entity during hydration in another (later) context where you explicitly eager load the same association &lt;b&gt;without&lt;/b&gt; the WITH restriction (or with another one), the collection on that (existing) entity won&apos;t be re-initialized and still contains the associated objects found during the first query.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2155] problem with DQL and cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2155</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have a problem when I get database records through a query DQL&lt;br/&gt;
  and then they are changed by another application&lt;br/&gt;
If I repeat the query, Doctrine always return the first value, not the current value of the base&lt;/p&gt;

&lt;div class=&quot;code panel&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

&lt;span class=&quot;code-comment&quot;&gt;// bootstrap
&lt;/span&gt;
$cache = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Cache\ArrayCache();
$config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine\ORM\Configuration();
$config-&amp;gt;setQueryCacheImpl($cache);
$conn = array(
				&apos;dbname&apos; =&amp;gt; $database_name,
				&apos;user&apos; =&amp;gt; $cnx_user,
				&apos;password&apos; =&amp;gt; $cnx_pass,
				&apos;host&apos; =&amp;gt; $cnx_host,
				&apos;driver&apos; =&amp;gt; $cnx_type,
				&apos;charset&apos; =&amp;gt; &apos;utf8&apos;,
				&apos;driverOptions&apos; =&amp;gt; array( 1002 =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;SET NAMES &apos;utf8&apos;&quot;&lt;/span&gt; )
				);

			$em = Doctrine\ORM\EntityManager::create($conn, $config);




&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;){
   $dql = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT s from Register s WHERE s.id = 1&quot;&lt;/span&gt;;
   $query = $em-&amp;gt;createQuery($dql);
&lt;span class=&quot;code-comment&quot;&gt;// the next line is optional, produces same result
&lt;/span&gt;   $query-&amp;gt;useResultCache(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
   $res = $query-&amp;gt;getResult();
   $orm = reset($res);
   	
   echo &lt;span class=&quot;code-quote&quot;&gt;&quot; regiter id :&quot;&lt;/span&gt;.$orm-&amp;gt;getId().&lt;span class=&quot;code-quote&quot;&gt;&quot;  field &quot;&lt;/span&gt;$orm-&amp;gt;getText().&lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I run this code in a terminal, and then edit the registry (field text), but the terminal still shows the same result&lt;/p&gt;</description>
                <environment>linux , php 5.4.8, mysql 5.5.28</environment>
            <key id="14243">DDC-2155</key>
            <summary>problem with DQL and cache</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gabrielnn77">gabriel sancho</reporter>
                        <labels>
                        <label>cache</label>
                        <label>dql</label>
                    </labels>
                <created>Sun, 18 Nov 2012 22:57:30 +0000</created>
                <updated>Sun, 25 Nov 2012 11:59:34 +0000</updated>
                    <resolved>Sun, 25 Nov 2012 11:59:34 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19048" author="beberlei" created="Sun, 25 Nov 2012 11:59:34 +0000"  >&lt;p&gt;Doctrine uses an IdentityMap pattern which leads to this issue.&lt;/p&gt;

&lt;p&gt;You need to call &quot;EntityManager#clear()&quot; to clean the in memory cache of Doctrine and fetch records from the database again. or call &quot;EntityManager#refresh($entity)&quot;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2148] Many-to-many not working with interface</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2148</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;First off, here&apos;s a pastie with all the code and mappings involved, and a stacktrace: &lt;a href=&quot;http://pastie.org/5372087&quot; class=&quot;external-link&quot;&gt;http://pastie.org/5372087&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not sure if this a bug or not, but I think that according to the docs this should work - in a vendor bundle I have an entity defining a unidirectional many-to-many relation to an interface: the entity is Group and defines a many-to-many relation to a UserInterface, which is resolved correctly in the app configuration (as the many-to-one relations using it in the other entities of this vendor bundle work fine).&lt;/p&gt;

&lt;p&gt;I&apos;m going by these docs:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://symfony.com/doc/master/cookbook/doctrine/resolve_target_entity.html&quot; class=&quot;external-link&quot;&gt;http://symfony.com/doc/master/cookbook/doctrine/resolve_target_entity.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, when adding a user to a group, I&apos;m getting a weird error:&lt;/p&gt;

&lt;p&gt;An exception occurred while executing &apos;INSERT INTO acme_group_user (group_id, user_id) VALUES (?, ?)&apos; with params &lt;/p&gt;
{&quot;1&quot;:2,&quot;2&quot;:1,&quot;3&quot;:2,&quot;4&quot;:1}
&lt;p&gt;:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY093&amp;#93;&lt;/span&gt;: Invalid parameter number: number of bound variables does not match number of tokens&lt;/p&gt;

&lt;p&gt;For some reason it&apos;s adding 4 parameters to the statement instead of 2.&lt;/p&gt;

&lt;p&gt;Oddly enough, the query generation works perfectly fine when I replace the interface in the mapping with the actual final entity. But that wasn&apos;t the point of the exercise... &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 need to use the interface there.&lt;/p&gt;

&lt;p&gt;Also, in other entities in that GroupBundle which are referencing the UserInterface using a different relation type, i.e. many-to-one, the relations work perfectly fine.&lt;/p&gt;

&lt;p&gt;The schema validates as well, using doctrine:schema:validate in the console.&lt;/p&gt;</description>
                <environment>Linux, PHP 5.3.10, Symfony 2.2</environment>
            <key id="14231">DDC-2148</key>
            <summary>Many-to-many not working with interface</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="userfriendly">Moritz Kraft</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Fri, 16 Nov 2012 09:55:13 +0000</created>
                <updated>Thu, 22 Nov 2012 14:28:35 +0000</updated>
                    <resolved>Thu, 22 Nov 2012 14:28:35 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.2</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18994" author="ocramius" created="Fri, 16 Nov 2012 09:59:07 +0000"  >&lt;p&gt;&quot;many-to-many TO a mapped superclass&quot;? I don&apos;t think relations TO mapped superclasses are supported in any way... A mapped superclass should never appear in a `targetEntity` mapping.&lt;/p&gt;

&lt;p&gt;Could you please re-formulate the description of the issue? There is no mapped superclass in your examples &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="18995" author="userfriendly" created="Fri, 16 Nov 2012 11:30:37 +0000"  >&lt;p&gt;You are of course right. Edited the issue description/title.&lt;/p&gt;

&lt;p&gt;It is a blocker for us, btw., not minor - being able to use a many-to-many relation there is rather central to the code of our app. I&apos;m not seeing a workaround, easy or otherwise.&lt;/p&gt;</comment>
                    <comment id="18999" author="ocramius" created="Fri, 16 Nov 2012 13:23:32 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=userfriendly&quot; class=&quot;user-hover&quot; rel=&quot;userfriendly&quot;&gt;Moritz Kraft&lt;/a&gt; yes, but it is not a blocker for the next release &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; Will restore prio.&lt;/p&gt;</comment>
                    <comment id="19002" author="userfriendly" created="Fri, 16 Nov 2012 13:38:51 +0000"  >&lt;p&gt;Ah right, yeah, that makes sense. &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; Thank you!&lt;/p&gt;</comment>
                    <comment id="19023" author="userfriendly" created="Thu, 22 Nov 2012 14:27:39 +0000"  >&lt;p&gt;Fixed in 1b5f051 - thanks Benjamin!&lt;/p&gt;</comment>
                    <comment id="19024" author="userfriendly" created="Thu, 22 Nov 2012 14:28:35 +0000"  >&lt;p&gt;Fixed in 2.3 branch, backported to 2.2 as well&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2119] Problem with inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS </title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2119</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I tried to create inheritance entities with save policy table per class.&lt;br/&gt;
Simple fileds was created normally, but a field with ManyToOne type was lost.&lt;/p&gt;

&lt;p&gt;I had found a solution.&lt;/p&gt;

&lt;p&gt;In Doctrine\ORM\Tools\SchemaTool&lt;br/&gt;
...&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function _gatherRelationsSql($class, $table, $schema)
    {
        foreach ($class-&amp;gt;associationMappings as $fieldName =&amp;gt; $mapping) {

           &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;])) { // - old version
&lt;/span&gt;
	/**
             * SSW
             * It&apos;s the solution
             */
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;]) &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeNone() &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeTablePerClass() ) {
                &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
            }            

            $foreignClass = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;targetEntity&apos;]);
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it was enough. In DQL query a simple query was made wrong.&lt;/p&gt;

&lt;p&gt;I had found a solution again.&lt;br/&gt;
In Doctrine\ORM\Query\SqlWalker&lt;br/&gt;
...&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function walkSelectExpression($selectExpression)
...

                &lt;span class=&quot;code-comment&quot;&gt;// original =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;])){
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// It&apos;s the solution
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($mapping[&apos;inherited&apos;]) &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeNone() &amp;amp;&amp;amp; !$class-&amp;gt;isInheritanceTypeTablePerClass()) {
                    $tableName = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_em-&amp;gt;getClassMetadata($mapping[&apos;inherited&apos;])-&amp;gt;table[&apos;name&apos;];
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                    $tableName = $class-&amp;gt;table[&apos;name&apos;];
                }
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This problems are topical for inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS. &lt;/p&gt;

&lt;p&gt;I don&apos;t know, may be my solutions are wrong. But some programmers want to correctly work with INHERITANCE_TYPE_TABLE_PER_CLASS.&lt;/p&gt;

&lt;p&gt;Sorry for my english.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14189">DDC-2119</key>
            <summary>Problem with inheritance type:  INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_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="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sergsw">SergSW</reporter>
                        <labels>
                        <label>dql</label>
                        <label>schematool</label>
                    </labels>
                <created>Sat, 3 Nov 2012 18:57:00 +0000</created>
                <updated>Mon, 8 Apr 2013 20:43:37 +0000</updated>
                                    <version>2.1</version>
                                                <component>DQL</component>
                <component>Tools</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18924" author="fabio.bat.silva" created="Mon, 5 Nov 2012 22:17:32 +0000"  >&lt;p&gt;Hi SergSW &lt;/p&gt;

&lt;p&gt;Could you try to write a failing test case ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="18950" author="sergsw" created="Tue, 6 Nov 2012 23:55:43 +0000"  >&lt;p&gt;SSW/TestBundle with the problem&lt;/p&gt;</comment>
                    <comment id="18951" author="sergsw" created="Wed, 7 Nov 2012 00:06:03 +0000"  >&lt;p&gt;I install the Symfony v2.0.18. and made small TestBundle.&lt;br/&gt;
I made schema database, by CLI &quot;console doctrine:schema:update --force&quot;&lt;br/&gt;
Result: Database schema updated successfully!&lt;br/&gt;
But I saw that I lost a field &apos;user_id&apos; in a table &apos;AttachTree&apos; (see Attach)&lt;/p&gt;</comment>
                    <comment id="18952" author="sergsw" created="Wed, 7 Nov 2012 00:06:32 +0000"  >&lt;p&gt;MySQL dump&lt;/p&gt;</comment>
                    <comment id="18971" author="beberlei" created="Mon, 12 Nov 2012 14:33:25 +0000"  >&lt;p&gt;Adjusted example formatting, don&apos;t apologize for your English, thanks for the report!&lt;/p&gt;</comment>
                    <comment id="19176" author="beberlei" created="Mon, 24 Dec 2012 09:08:14 +0000"  >&lt;p&gt;What version of 2.1 are you using? We don&apos;t actually support 2.1 anymore. Inheritance has always worked as used in hundrets of unit-tests, this changes look quite major a bug to have been missed before. I can&apos;t really explain whats happening here.&lt;/p&gt;</comment>
                    <comment id="19371" author="ocramius" created="Wed, 23 Jan 2013 21:36:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=sergsw&quot; class=&quot;user-hover&quot; rel=&quot;sergsw&quot;&gt;SergSW&lt;/a&gt; news?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11345" name="dump.sql" size="4947" author="sergsw" created="Wed, 7 Nov 2012 00:06:32 +0000" />
                    <attachment id="11344" name="SSWTestBundle.rar" size="5526" author="sergsw" created="Tue, 6 Nov 2012 23:55:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2105] Error when rendering DQL query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2105</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I&apos;m using Doctrine with Symfony 2.1. Everything was working OK in Symfony 2.0 so I think I was using Doctrine 2.2. Now I&apos;m using Doctrine 2.3-dev (packagist) and when I run the following query in a EntityRepository:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$em-&amp;gt;createQuery(&apos;SELECT u, tc FROM XBundle:X tc JOIN tc.usuario u JOIN tc.tax t WHERE tc.timestamp &amp;gt;= :date_from AND tc.timestamp &amp;lt;= :date_to AND t.type = :x GROUP BY tc.usuario&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nothing happens, getResult() just returns array(0){}&lt;/p&gt;

&lt;p&gt;I&apos;ve done \Doctrine\Common\Util\Debug::dump($query); and this is the result:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
object(stdClass)#487 (18) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;__CLASS__&quot;&lt;/span&gt;]=&amp;gt;
  string(18) &lt;span class=&quot;code-quote&quot;&gt;&quot;Doctrine\ORM\Query&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;_state&quot;&lt;/span&gt;]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;_dql&quot;&lt;/span&gt;]=&amp;gt;
  string(180) &quot;SELECT u, tc FROM XBundle:X tc JOIN tc.usuario u JOIN tc.tax t WHERE tc.timestamp &amp;gt;= :date_from AND tc.timestamp Marcos:project marcos$ 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;As you can see something happens because the dql query got cropped and seems like Doctrine is not working properly...&lt;/p&gt;

&lt;p&gt;If I change &apos;WHERE tc.timestamp &amp;gt;= :date_from AND tc.timestamp &amp;lt;= :date_to&apos; for &apos;WHERE tc.timestamp BETWEEN :date_from AND :date_to&apos;, then the query is run without any problem and the debug dump function shows a complete debug of $query.&lt;/p&gt;
</description>
                <environment>Mac OS X Mountain Lion&lt;br/&gt;
PHP 5.3.14 (cli)</environment>
            <key id="14170">DDC-2105</key>
            <summary>Error when rendering DQL query</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="marcosgdf">Marcos Garc&#237;a</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Fri, 26 Oct 2012 11:38:14 +0000</created>
                <updated>Sun, 23 Dec 2012 00:04:48 +0000</updated>
                    <resolved>Sun, 23 Dec 2012 00:04:48 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18896" author="fabio.bat.silva" created="Mon, 29 Oct 2012 11:47:22 +0000"  >&lt;p&gt;Hi Marcos,&lt;/p&gt;

&lt;p&gt;Could you try to add a failing test case ?&lt;/p&gt;

&lt;p&gt;Thanks ...&lt;/p&gt;</comment>
                    <comment id="19173" author="marcosgdf" created="Sun, 23 Dec 2012 00:04:23 +0000"  >&lt;p&gt;Hi Fabio,&lt;/p&gt;

&lt;p&gt;I&apos;ve updated Doctrine and now it seems that everything works OK...&lt;/p&gt;

&lt;p&gt;Thank you for your time... (and sorry) :S&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2076] Optimization for MEMBER OF</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2076</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Currently, using MEMBER OF for a ManyToMany collection does a join on the table of the related entity, whereas all it needs is in the join table.&lt;/p&gt;

&lt;p&gt;Using the following 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-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; p &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; Player p
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; NOT :team MEMBER OF p.targetedBy
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the current generated SQL:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; NOT EXISTS (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; 1 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; player_team p1_ INNER JOIN Team t2_ ON p1_.team_id = t2_.id &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; p1_.player_id = p0_.id AND t2_.id = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;whereas it could drop the join:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; NOT EXISTS (&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; 1 &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; player_team p1_ &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; p1_.player_id = p0_.id AND p1_.team_id = ?)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14126">DDC-2076</key>
            <summary>Optimization for MEMBER OF</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>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="stof">Christophe Coevoet</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Sun, 14 Oct 2012 08:43:09 +0000</created>
                <updated>Sun, 14 Oct 2012 08:43:09 +0000</updated>
                                    <version>Git Master</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2052] Custom tree walkers are not allowed to add new components to the query</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2052</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Custom tree walkers have freedom in modifying the AST but when you try to add a new query component (i.e. new join in walkSelectStatement() ) to the AST then the SqlWalker throws an exception because it does not has the new component in its _queryComponents array. I see two possible ways to resolve this:&lt;br/&gt;
1. Modify the Parser class in order to allow tree walkers to modify queryComponents and pass changed queryComponents to the SqlWalker&lt;br/&gt;
2. Improve SqlWalker so it can extract and prepare needed information about queryComponent based on AST when it does not have them.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14085">DDC-2052</key>
            <summary>Custom tree walkers are not allowed to add new components to the query</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="chives">&#321;ukasz Cybula</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Tue, 2 Oct 2012 13:30:45 +0000</created>
                <updated>Tue, 14 May 2013 18:18:10 +0000</updated>
                                    <version>2.3</version>
                                <fixVersion>2.4</fixVersion>
                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18789" author="beberlei" created="Sat, 6 Oct 2012 09:07:58 +0000"  >&lt;p&gt;Ok this is much more complicated to allow then i thought. The problem is that the QueryComponents are passed by value, as an array, not by reference. That prevents changing them because this change wouldn&apos;t be visible in the output walker.&lt;/p&gt;

&lt;p&gt;I can add a method to allow this in the OutputWalker for now, but generally this requires a bigger refactoring on the Query Components.&lt;/p&gt;</comment>
                    <comment id="18790" author="beberlei" created="Sat, 6 Oct 2012 09:15:39 +0000"  >&lt;p&gt;Added setQueryComponent() in SQL Walker to allow modification in output walker.&lt;/p&gt;</comment>
                    <comment id="18805" author="chives" created="Mon, 8 Oct 2012 10:47:08 +0000"  >&lt;p&gt;I&apos;m afraid that this doesn&apos;t solve the initial problem at all. I&apos;ll try to describe it in more details to show what I mean. Suppose we have two doctrine extensions each of which contain its own tree walker. Each of these tree walkers need to modify AST and add new component to it (joined with some component already existing in the query). The first problem is that each tree walker has its own queryComponents array which is not passed between them, although they not necessary need to use queryComponents - they could use only AST. The second, bigger problem is that the Parser class does not know anything about modifications of queryComponents in tree walkers and cannot pass modified version to the OutputWalker. The goal of submitting this issue was to allow adding new components to the query in tree walkers which is not achievable by your fix. I think it may be the first step in the right direction. Maybe TreeWalkerAdapter should have public method getQueryComponents() which would be used by the Parser to pass modified queryComponents between different tree walkers and finally to the OutputWalker ? This would not break backward compatibility and solve this issue. What do you think about it?&lt;/p&gt;</comment>
                    <comment id="18806" author="chives" created="Mon, 8 Oct 2012 13:43:37 +0000"  >&lt;p&gt;I&apos;ve tried to implement the solution mentioned in previous comment but it&apos;s also not so clean and easy as I thought. Each tree walker (including TreeWalkerChain) would have to implement getQueryComponents() and setQueryComponent($alias, array $component) methods. The same with SqlWalker, so the TreeWalker interface should have these methods, which would break BC in some way (walkers that do not inherit from SqlWalker or TreeWalkerAdapter will fail to compile). So maybe my first solution (PR #464) is not so bad for now? In the future queryComponents could be replaced by a special object or could be passed by a reference to allow modifications.&lt;/p&gt;</comment>
                    <comment id="20247" author="beberlei" created="Thu, 9 May 2013 15:32:15 +0000"  >&lt;p&gt;Marked as improvement as its not a bug.&lt;/p&gt;

&lt;p&gt;A solution might probably implement an object holding all the QueryComponent, implementing ArrayAccess. So that way the state can be shared.&lt;/p&gt;</comment>
                    <comment id="20379" author="ocramius" created="Tue, 14 May 2013 18:02:22 +0000"  >&lt;p&gt;Just hit this while developing an ast walker... Will look into it too since I need it more than soon.&lt;/p&gt;</comment>
                    <comment id="20380" author="ocramius" created="Tue, 14 May 2013 18:17:26 +0000"  >&lt;p&gt;As a VERY UGLY workaround, I used a static variable and a custom sql walker in combination with my AST walker.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

namespace Comcom\Versioning\ORM\Query;


use Doctrine\ORM\Query\SqlWalker;

class WorkaroundSqlWalker &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; SqlWalker
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($query, $parserResult, array $queryComponents)
    {
        parent::__construct($query, $parserResult, $queryComponents);

        foreach (VersionWalker::$additionalAliases as $alias =&amp;gt; $value) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setQueryComponent($alias, $value);
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2032] DQL fails for Joined Inheritance with Associations on child classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2032</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I have the following object hierarchy:&lt;/p&gt;

&lt;p&gt;Clazz A with Joined Table Inheritance&lt;br/&gt;
Clazz B extends A &lt;br/&gt;
Clazz C extends A with an association (n:1) to D&lt;br/&gt;
Clazz D&lt;/p&gt;

&lt;p&gt;I am doing a DQL query &apos;SELECT u FROM A u&apos;&lt;/p&gt;

&lt;p&gt;If I just have As and Bs in the DB everything is fine. But I there is a C in there I get the following error:&lt;/p&gt;

&lt;p&gt;Notice: Trying to get property of non-object in X:\Zend_Workspace\goalio_application\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 479&lt;/p&gt;

&lt;p&gt;Fatal error: Call to a member function fetch() on a non-object in X:\Zend_Workspace\goalio_application\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php on line 148&lt;/p&gt;

&lt;p&gt;When I debug the _rsm of the Hydrator is null when trying to hydrate the row for C. &lt;/p&gt;

&lt;p&gt;Any ideas?&lt;/p&gt;</description>
                <environment>Windows XAMPP</environment>
            <key id="14040">DDC-2032</key>
            <summary>DQL fails for Joined Inheritance with Associations on child classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="pdobrigkeit">Philipp Dobrigkeit</reporter>
                        <labels>
                        <label>dql</label>
                    </labels>
                <created>Sat, 15 Sep 2012 16:47:09 +0000</created>
                <updated>Fri, 21 Sep 2012 18:34:28 +0000</updated>
                    <resolved>Fri, 21 Sep 2012 18:30:44 +0000</resolved>
                            <version>2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18682" author="pdobrigkeit" created="Wed, 19 Sep 2012 10:31:04 +0000"  >&lt;p&gt;Ok, it doesn&apos;t seem related to inheritance. Have the same problem now as well with a Join DQL query.&lt;/p&gt;

&lt;p&gt;Foo (1:n) Bar&lt;br/&gt;
Bar (1:n) Baz&lt;/p&gt;

&lt;p&gt;SELECT c FROM Foo c INNER JOIN c.bar cj WITH cj.id IN(1)&lt;/p&gt;

&lt;p&gt;Gives me the same error as above when it tries to hydrate Bar&lt;/p&gt;</comment>
                    <comment id="18692" author="pdobrigkeit" created="Fri, 21 Sep 2012 18:30:44 +0000"  >&lt;p&gt;Ok, further investigations on my part have found the problem to be somewhere else entirely... Not sure yet if it is a bug, but the problem arises because during the hydration my application does another query, which uses the same hydrator object and thus does cleanup before the initial query is complete. That results in the _rsm being null when the original hydration continues. Will see if that can be fixed in my application.&lt;/p&gt;</comment>
                    <comment id="18693" author="ocramius" created="Fri, 21 Sep 2012 18:34:28 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=pdobrigkeit&quot; class=&quot;user-hover&quot; rel=&quot;pdobrigkeit&quot;&gt;Philipp Dobrigkeit&lt;/a&gt; this is known. You have to pass a custom hydrator to the new query if you use DQL during PostLoad events.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2021] Array Data in Member OF</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2021</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi.&lt;br/&gt;
First sorry for my bad english.&lt;br/&gt;
In &lt;br/&gt;
SELECT u.id FROM CmsUser u WHERE :groupId MEMBER OF u.groups&lt;br/&gt;
DQL we can&apos;t use Array of groupId like&lt;/p&gt;</description>
                <environment></environment>
            <key id="14024">DDC-2021</key>
            <summary>Array Data in Member OF</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>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="vahid4134">vahid sohrabloo</reporter>
                        <labels>
                        <label>array</label>
                        <label>dql</label>
                    </labels>
                <created>Sun, 9 Sep 2012 09:10:02 +0000</created>
                <updated>Sun, 9 Sep 2012 09:10:02 +0000</updated>
                                    <version>2.2.3</version>
                                                <component>DQL</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DCOM-185] DQL errors when attempting to use GROUP BY MAX(field)</title>
                <link>http://www.doctrine-project.org/jira/browse/DCOM-185</link>
                <project id="10043" key="DCOM">Doctrine Common</project>
                        <description>&lt;p&gt;Attempting to run DQL similar to:&lt;br/&gt;
SELECT a FROM ClassName a GROUP BY MAX(a.depth)&lt;/p&gt;

&lt;p&gt;Throws error:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Semantical Error&amp;#93;&lt;/span&gt; line 0, col 250 near &apos;MAX(ao.depth)&apos;: Error: Cannot group by undefined identification or result variable.&lt;/p&gt;


&lt;p&gt;Per docs, MAX is allowed within GROUP BY: &lt;a href=&quot;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#aggregate-functions&quot; class=&quot;external-link&quot;&gt;http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#aggregate-functions&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;If this error is due to some omission on my part, then perhaps the docs should be extended to show a valid GROUP BY MAX() usage, or the error message expanded for a better hint.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14730">DCOM-185</key>
            <summary>DQL errors when attempting to use GROUP BY MAX(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="intel352">Jon Langevin</reporter>
                        <labels>
                        <label>dql</label>
                        <label>groupby</label>
                        <label>max</label>
                    </labels>
                <created>Tue, 26 Mar 2013 22:41:29 +0000</created>
                <updated>Tue, 26 Mar 2013 22:41:29 +0000</updated>
                                    <version>2.3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-402] Fatal error: Uncaught exception</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-402</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Fatal error: Uncaught exception &apos;Doctrine\DBAL\Driver\OCI8\OCI8Exception&apos; with message &apos;ORA-00904: &lt;span class=&quot;code-quote&quot;&gt;&quot;T0&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;ID&quot;&lt;/span&gt;: invalid identifier&apos; in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php on line 28 Doctrine\DBAL\Driver\OCI8\OCI8Exception: ORA-00904: &lt;span class=&quot;code-quote&quot;&gt;&quot;T0&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;ID&quot;&lt;/span&gt;: invalid identifier in /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php on line 28

Call Stack: 0.0002 665368
1. {main}() /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/tools/sandbox/index.php:0 0.3389 6023864
2. Doctrine\ORM\EntityManager-&amp;gt;find() /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/tools/sandbox/index.php:71 0.3514 8264024
3. Doctrine\ORM\Persisters\BasicEntityPersister-&amp;gt;load() /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/lib/Doctrine/ORM/EntityManager.php:444 0.3521 8413576 
4. Doctrine\DBAL\Connection-&amp;gt;executeQuery() /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php:725 0.3532 8625920
5. Doctrine\DBAL\Driver\OCI8\OCI8Statement-&amp;gt;execute() /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/www/doctrine/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php:635 Variables in local scope (#5): $hasZeroIndex = *uninitialized* $key = *uninitialized* $params = NULL $ret = FALSE $val = *uninitialized* 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="14337">DBAL-402</key>
            <summary>Fatal error: Uncaught exception</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="userua">Ruslan</reporter>
                        <labels>
                        <label>dql</label>
                        <label>oracle</label>
                    </labels>
                <created>Sat, 29 Dec 2012 13:03:19 +0000</created>
                <updated>Mon, 8 Apr 2013 18:23:52 +0000</updated>
                                                                    <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19225" author="beberlei" created="Sun, 6 Jan 2013 09:37:59 +0000"  >&lt;p&gt;Format code sample&lt;/p&gt;</comment>
                    <comment id="19938" author="beberlei" created="Thu, 4 Apr 2013 17:01:08 +0000"  >&lt;p&gt;What is wrong here? The error alone is not very helpful&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-397] PostgreSQL - getDateTimeTzFormatString()</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-397</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;In: &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The function:&lt;/p&gt;

&lt;p&gt;    getDateTimeTzFormatString()&lt;/p&gt;

&lt;p&gt;only returns one datetime format:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

    /**
     * {@inheritDoc}
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getDateTimeTzFormatString()
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;Y-m-d H:i:sO&apos;; // original format
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;Y-m-d H:i:s.uO&apos;; &lt;span class=&quot;code-comment&quot;&gt;// format also needed
&lt;/span&gt;    }


&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the error I get using the original format:&lt;/p&gt;

&lt;p&gt;    Could not convert database value &quot;2012-12-07 16:01:52.580789-05&quot; to Doctrine Type datetimetz. Expected format: Y-m-d H:i:s.O&lt;/p&gt;

&lt;p&gt;If I use this format: &apos;Y-m-d H:i:s.uO&apos; it works.&lt;/p&gt;




</description>
                <environment>PostgreSQL Database</environment>
            <key id="14308">DBAL-397</key>
            <summary>PostgreSQL - getDateTimeTzFormatString()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ppafford">Phill Pafford</reporter>
                        <labels>
                        <label>datetime</label>
                        <label>dql</label>
                        <label>format</label>
                        <label>postgresql</label>
                    </labels>
                <created>Wed, 12 Dec 2012 14:15:20 +0000</created>
                <updated>Mon, 17 Dec 2012 15:21:20 +0000</updated>
                    <resolved>Sun, 16 Dec 2012 11:36:02 +0000</resolved>
                            <version>2.3.1</version>
                                                <component>Platforms</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19126" author="ppafford" created="Wed, 12 Dec 2012 14:16:38 +0000"  >&lt;p&gt;adding html tags for code to display correctly &lt;/p&gt;</comment>
                    <comment id="19139" author="beberlei" created="Sun, 16 Dec 2012 11:36:02 +0000"  >&lt;p&gt;DateTimeTz is created as &apos;TIMESTAMP(0) WITH TIME ZONE&apos; on DBAL. If you have &apos;TIMESTAMP(6) WITH TIME ZONE&apos; instead, then you have to create your own datatye.&lt;/p&gt;</comment>
                    <comment id="19154" author="ppafford" created="Mon, 17 Dec 2012 15:19:53 +0000"  >&lt;p&gt;Why would this be a new data type? I understand how to fix the problem with creating my own data type to handle the formatting issue and would even suggest just overriding the data type with &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

        Type::overrideType(&apos;datetimetz&apos;, &apos;Doctrine\DBAL\Types\VarDateTimeType&apos;);
    Type::overrideType(&apos;datetime&apos;, &apos;Doctrine\DBAL\Types\VarDateTimeType&apos;);

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But it&apos;s not a new data type, it&apos;s a formatting issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>