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

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DBAL+AND+fixVersion+%3D+%222.1%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DBAL+AND+fixVersion+%3D+%222.1%22+ORDER+BY+updated+DESC%2C+priority+DESC%2C+created+ASC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="22" total="22"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DBAL-136] OCI8 Driver MUST support connections by SERVICE_NAME</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-136</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;The existing oci8 driver connection only supports connections from database name configuraton.&lt;br/&gt;
It will be very good if is possible set a connection by service name.&lt;/p&gt;

&lt;p&gt;Take a look in this DSN:&lt;/p&gt;

&lt;p&gt;(DESCRIPTION=    (ADDRESS=      (PROTOCOL=TCP)      (HOST=192.168.0.1)      (PORT=1521)    )    (CONNECT_DATA=      (SERVICE_NAME=TH01)    )  )&lt;/p&gt;

&lt;p&gt;More info:&lt;br/&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/43866/how-sid-is-different-from-service-name-in-oracle-tnsnames-ora&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/43866/how-sid-is-different-from-service-name-in-oracle-tnsnames-ora&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12835">DBAL-136</key>
            <summary>OCI8 Driver MUST support connections by SERVICE_NAME</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="yourwebmaker">Daniel Lima</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jul 2011 21:25:37 +0000</created>
                <updated>Thu, 18 Aug 2011 20:48:51 +0000</updated>
                    <resolved>Thu, 18 Aug 2011 20:46:49 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                            <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="12887">DBAL-141</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-148] Foreign key creation fails with MySQL 5.1.54</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-148</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;doctrine orm:schema-tool:create&lt;/p&gt;

&lt;p&gt;returns &lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;PDOException&amp;#93;&lt;/span&gt;                                                                                                                                                                                                          &lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;Position(id)&apos; at line 1  &lt;/p&gt;

&lt;p&gt;The problem seem to be that the create commande creates the following SQL syntax&lt;br/&gt;
ALTER TABLE Job ADD FOREIGN KEY (position_id) REFERENCES Position(id);&lt;/p&gt;

&lt;p&gt;which doesn&apos;t work. If I use the following (added a space between Postion and (id) in the end) it works.&lt;br/&gt;
ALTER TABLE Job ADD FOREIGN KEY (position_id) REFERENCES Position (id);&lt;/p&gt;

&lt;p&gt;Patch for AbstractPlatform.php attached.&lt;/p&gt;</description>
                <environment>MySQL 5.1.54, PHP 5.3.5, Ubuntu 11.04, Zend Framework 1.11.10</environment>
            <key id="12926">DBAL-148</key>
            <summary>Foreign key creation fails with MySQL 5.1.54</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="frecon">Frej Connolly</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Aug 2011 15:06:49 +0000</created>
                <updated>Thu, 18 Aug 2011 20:16:54 +0000</updated>
                    <resolved>Thu, 18 Aug 2011 20:16:54 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16354" author="beberlei" created="Thu, 18 Aug 2011 20:16:54 +0000"  >&lt;p&gt;Fixed and merged 2.1.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11055" name="git_commit_9242fb332baaaeb81be4.txt" size="373" author="frecon" created="Tue, 16 Aug 2011 15:29:49 +0000" />
                    <attachment id="11053" name="Job.php" size="884" author="frecon" created="Tue, 16 Aug 2011 15:06:49 +0000" />
                    <attachment id="11054" name="orm_schema-tool_create--dump-sql.txt" size="1234" author="frecon" created="Tue, 16 Aug 2011 15:06:49 +0000" />
                    <attachment id="11052" name="Position.php" size="376" author="frecon" created="Tue, 16 Aug 2011 15:06:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-134] Doctrine\DBAL\Connection::query() no logging</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-134</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Doctrine\DBAL\Connection::query() does not use SqlLogger.&lt;/p&gt;

&lt;p&gt;I guess it may be fixed like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function query()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;connect();

        $args = func_get_args();

        $logger = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getConfiguration()-&amp;gt;getSQLLogger();
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($logger) {
            $logger-&amp;gt;startQuery($args[0]);
        }

        $statement = call_user_func_array(array($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_conn, &apos;query&apos;), $args);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($logger) {
            $logger-&amp;gt;stopQuery();
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $statement;
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12747">DBAL-134</key>
            <summary>Doctrine\DBAL\Connection::query() no logging</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="chebba">Kirill chEbba Chebunin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Jun 2011 11:49:05 +0000</created>
                <updated>Tue, 28 Jun 2011 20:47:37 +0000</updated>
                    <resolved>Tue, 28 Jun 2011 20:47:37 +0000</resolved>
                            <version>2.0.6</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16095" author="beberlei" created="Tue, 28 Jun 2011 20:47:37 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-135] Index::overrules() does not detect pks overruling unique indexes</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-135</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description></description>
                <environment></environment>
            <key id="12750">DBAL-135</key>
            <summary>Index::overrules() does not detect pks overruling unique indexes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Jun 2011 16:34:56 +0000</created>
                <updated>Sun, 26 Jun 2011 16:35:26 +0000</updated>
                    <resolved>Sun, 26 Jun 2011 16:35:26 +0000</resolved>
                            <version>2.0.6</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16074" author="beberlei" created="Sun, 26 Jun 2011 16:35:26 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/doctrine/dbal/commit/2cb22496a732029373d98ff9e4d54a7187ee9bb8&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/commit/2cb22496a732029373d98ff9e4d54a7187ee9bb8&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-126] schema-tool creates primary keys as unique constraints</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-126</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;The schema tool calls AbstractPlatform::getCreateIndexSQL() to create new indexes. When the index is primary, this creates a unique key instead.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12704">DBAL-126</key>
            <summary>schema-tool creates primary keys as unique constraints</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="arnaud-lb">arnaud-lb</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Jun 2011 12:21:00 +0000</created>
                <updated>Sun, 26 Jun 2011 11:22:54 +0000</updated>
                    <resolved>Sun, 26 Jun 2011 11:22:54 +0000</resolved>
                            <version>2.0.5</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16062" author="k-fish" created="Sat, 25 Jun 2011 09:40:26 +0000"  >&lt;p&gt;While the description here is very sparse, I think it is about the following problem.&lt;/p&gt;

&lt;p&gt;When a primary key is to be created for MySQL, the statement generated is&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ADD UNIQUE INDEX PRIMARY ON foo (bar)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This fails with MySQL stating primary is an invalid name. Since &quot;ADD INDEX&quot; is mapped to &quot;ALTER TABLE&quot; anyway, I just made that&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ALTER TABLE foo ADD PRIMARY KEY (bar)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;which works fine. Also&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;DROP INDEX primary ON foo&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;doesn&apos;t work, unless I quote primary (since it is a reserved word), but there&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ALTER TABLE foo DROP PRIMARY KEY&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;seems better as well.&lt;/p&gt;</comment>
                    <comment id="16070" author="beberlei" created="Sun, 26 Jun 2011 11:22:54 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-123] Add Ability to Unset SQL Logger in Configuration</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-123</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Add the ability to remove the SQL logger after it has been set on the configuration.&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 setSQLLogger(SQLLogger $logger)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

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

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setSQLLogger(SQLLogger $logger = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or another function could be added to disable the logger.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12639">DBAL-123</key>
            <summary>Add Ability to Unset SQL Logger in Configuration</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mridgway">Michael Ridgway</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 May 2011 20:28:54 +0000</created>
                <updated>Sun, 19 Jun 2011 09:47:56 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 09:47:56 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15879" author="mridgway" created="Tue, 24 May 2011 18:18:32 +0000"  >&lt;p&gt;Added pull request for making the parameter default to null:  &lt;a href=&quot;https://github.com/doctrine/dbal/pull/26&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/26&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16029" author="beberlei" created="Sun, 19 Jun 2011 09:47:56 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-113] The Sequence class lacks last value / start value</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-113</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;The Sequence class only has _initalValue which means that when a sequence is altered (by DROP and CREATE) the existing last_value, aka existing sequence ID is lost and the first attempt on flushing a new record results in a pkey exception.&lt;/p&gt;

&lt;p&gt;This result in the sequence counter starting all over.&lt;/p&gt;

&lt;p&gt;This can be handled by setting _initalValue to whatever is the last sequence value but since it is also used for setting MINVALUE this may not be a good idea. They should be split. &lt;/p&gt;

&lt;p&gt;Not sure what name to use, last_value is from postgresql but I&apos;m sure others use different names.&lt;/p&gt;</description>
                <environment>Linux / Postgresql</environment>
            <key id="12580">DBAL-113</key>
            <summary>The Sequence class lacks last value / start value</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="thomasez">Thomas Lundquist</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Apr 2011 06:26:01 +0000</created>
                <updated>Sun, 19 Jun 2011 09:34:14 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 09:34:05 +0000</resolved>
                            <version>2.0.4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15965" author="ddebernardy" created="Wed, 8 Jun 2011 17:09:50 +0000"  >&lt;p&gt;Not sure if this is entirely relevant to the question, but you can get the full details on a sequence by selecting * from it:&lt;/p&gt;


&lt;p&gt;test=# select * from test_id_seq;&lt;br/&gt;
 sequence_name | last_value | start_value | increment_by |      max_value      | min_value | cache_value | log_cnt | is_cycled | is_called &lt;br/&gt;
--------------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;-----------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;------------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;-------------------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;---------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;-----------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;-------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---------&lt;del&gt;+&lt;/del&gt;----------&lt;br/&gt;
 test_id_seq   |          1 |           1 |            1 | 9223372036854775807 |         1 |           1 |       0 | f         | t&lt;br/&gt;
(1 row)&lt;/p&gt;</comment>
                    <comment id="16026" author="beberlei" created="Sun, 19 Jun 2011 09:34:05 +0000"  >&lt;p&gt;Fixed by using ALTER SEQUENCE which only changes the increment.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-112] Sequence alteration does not alter.</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-112</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>
&lt;p&gt;When the schema diff decides there are differences between the existing SEQUENCE and the &quot;new&quot; one it alters the SEQUENCE by a DROP and then a CREATE.&lt;/p&gt;

&lt;p&gt;The CREATE is done with the fromSchema as a base which results in a no-changed SEQUENCE. &lt;/p&gt;

&lt;p&gt;Line 102 in Doctrine/DBAL/Schema/Comparator.php  uses fromSchema but shuld have been using toSchema or just $sequence&lt;/p&gt;

&lt;p&gt;This will fix the immediate issue but still require the sequence name being the same.&lt;/p&gt;</description>
                <environment>Linux &amp;amp; Postgesql</environment>
            <key id="12579">DBAL-112</key>
            <summary>Sequence alteration does not alter.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="thomasez">Thomas Lundquist</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Apr 2011 06:05:38 +0000</created>
                <updated>Sun, 19 Jun 2011 09:33:42 +0000</updated>
                    <resolved>Sun, 19 Jun 2011 09:33:42 +0000</resolved>
                            <version>2.0.4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16025" author="beberlei" created="Sun, 19 Jun 2011 09:33:42 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-130] Add tests for modify limit query functionality</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-130</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description></description>
                <environment></environment>
            <key id="12722">DBAL-130</key>
            <summary>Add tests for modify limit query functionality</summary>
                <type id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/subtask_alternate.png">Sub-task</type>
                    <parent id="12395">DBAL-93</parent>
                        <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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Jun 2011 19:12:11 +0000</created>
                <updated>Fri, 17 Jun 2011 21:20:28 +0000</updated>
                    <resolved>Fri, 17 Jun 2011 21:20:28 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-93] [ORACLE] Speed improvement of mechanism for limiting query results</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-93</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Currently the mechanism for limiting query results in Oracle is suboptimal.&lt;/p&gt;

&lt;p&gt;Doctrine uses the following pseudo SQL statement to limit query results:&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; b.* &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; (
   &lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; a.*, ROWNUM AS doctrine_rownum &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; (
      $query
  ) a
) b
&lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; doctrine_rownum BETWEEN $min AND $max
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It&apos;s much faster to use the following:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; (
  &lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; a.*, rownum AS doctrine_rownum &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt; {
    $query
  ) a &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; rownum &amp;lt;= $max
) &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; doctrine_rownum &amp;gt;= $min
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The updated code in DBAL/Platforms/OraclePlatform.php would look like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function modifyLimitQuery($query, $limit, $offset = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
{
	$limit = (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) $limit;
	$offset = (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) $offset;
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (preg_match(&apos;/^\s*SELECT/i&apos;, $query)) {
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! preg_match(&apos;/\sFROM\s/i&apos;, $query)) {
			$query .= &lt;span class=&quot;code-quote&quot;&gt;&quot; FROM dual&quot;&lt;/span&gt;;
		}
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($limit &amp;gt; 0) {
			$max = $offset + $limit;
			$column = &apos;*&apos;;
			&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset &amp;gt; 0) {
				$min = $offset + 1;
				$query = &apos;SELECT * FROM (SELECT a.&apos; . $column . &apos;, rownum AS doctrine_rownum FROM (&apos; . 
						 $query . 
						 &apos;) a WHERE rownum &amp;lt;= &apos; . $max . &apos;) WHERE doctrine_rownum &amp;gt;= &apos; . $min;
			} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
				$query = &apos;SELECT a.&apos;.$column.&apos; FROM (&apos; . $query .&apos;) a WHERE ROWNUM &amp;lt;= &apos; . $max;
			}
		}
	}
	&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $query;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the current implementation the request for fairly complicated query selecting data from multiple tables one of which reaches 2 million rows takes 5.98 seconds comparing to 1.64 with the proposed one.&lt;/p&gt;

&lt;p&gt;In addition It would be nice to have the min and max values as SQL query parameters so that Oracle&apos;s internal caching mechanisms could take part, but I&apos;m aware of the fact that it would not be so easy to implement.&lt;/p&gt;</description>
                <environment>any</environment>
            <key id="12395">DBAL-93</key>
            <summary>[ORACLE] Speed improvement of mechanism for limiting query results</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="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="cicovec">Martin Ivi&#269;i&#269;</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 08:34:31 +0000</created>
                <updated>Fri, 17 Jun 2011 21:20:15 +0000</updated>
                    <resolved>Fri, 17 Jun 2011 21:20:15 +0000</resolved>
                            <version>2.0.1</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Platforms</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16008" author="beberlei" created="Fri, 17 Jun 2011 21:20:15 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
            <subtask id="12722">DBAL-130</subtask>
        </subtasks>
        </item>

<item>
            <title>[DBAL-12] Add Doctrine\DBAL\SQLQuery package with simple Query Objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-12</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;We should add a Query Objects package to Doctrine\DBAL. This won&apos;t necessarily be used with Doctrine\ORM, however it could be really helpful to people that only plan to use Doctrine\DBAL and not the ORM.&lt;/p&gt;

&lt;p&gt;Requirements:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Add Query Objects for all types of SELECT, INSERT, UPDATE, DELETE&lt;/li&gt;
	&lt;li&gt;Fluent Interface&lt;/li&gt;
	&lt;li&gt;Make use of Platform to abstract limit subquery and expressions&lt;/li&gt;
	&lt;li&gt;Add factory method on Doctrine\DBAL\Connection&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;API Ideas:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;For the INSERT, UPDATE, DELETE I like the approach taken by eZ Components: &lt;a href=&quot;http://www.ezcomponents.org/docs/api/trunk/introduction_Database.html#query-abstraction&quot; class=&quot;external-link&quot;&gt;http://www.ezcomponents.org/docs/api/trunk/introduction_Database.html#query-abstraction&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;For the SELECT I find Zend_Db_Select much more usable: &lt;a href=&quot;http://framework.zend.com/manual/en/zend.db.select.html&quot; class=&quot;external-link&quot;&gt;http://framework.zend.com/manual/en/zend.db.select.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Are there query objects in other languages that could help here?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11264">DBAL-12</key>
            <summary>Add Doctrine\DBAL\SQLQuery package with simple Query Objects</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 24 Apr 2010 07:31:21 +0000</created>
                <updated>Sun, 15 May 2011 17:23:13 +0000</updated>
                    <resolved>Sun, 15 May 2011 17:23:13 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13296" author="beberlei" created="Sun, 13 Jun 2010 10:30:54 +0000"  >&lt;p&gt;Discussions on the API:&lt;/p&gt;

&lt;p&gt;First observations/requirements:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Identifiers are NEVER quoted by the SQL Query Object&lt;/li&gt;
	&lt;li&gt;A query object cannot ever be as efficient as our Persisters building SQL in a custom way&lt;/li&gt;
	&lt;li&gt;A SQL Query instance is only an Object with an internal stack of SQL parts, it should not have any logic whatsoever&lt;/li&gt;
	&lt;li&gt;A SQL Query instance is a stack for bound params and values, i.e. it should work towards prepared statements and not inline and quote values (like Zend_Db_Select)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Questions:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Should we allow methods to accept either array or string? Or streamline API to allow only one? select(string) + selectAll(array)?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Binding values:&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;$sql-&amp;gt;bindValue(1); &lt;span class=&quot;code-comment&quot;&gt;// adds 1 to the bind stack and returns a &lt;span class=&quot;code-quote&quot;&gt;&quot;:doctrineValue$inc&quot;&lt;/span&gt; string
&lt;/span&gt;$sql-&amp;gt;bindParam($foo, PDO::PARAM_INT); &lt;span class=&quot;code-comment&quot;&gt;// the same as before, with additional type binding&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Building a Select clause A:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$sql-&amp;gt;select(array(&apos;foo&apos;, &apos;bar&apos;, &apos;baz&apos;)); &lt;span class=&quot;code-comment&quot;&gt;// SELECT foo, bar, baz
&lt;/span&gt;$sql-&amp;gt;select(array(&apos;foo&apos; =&amp;gt; &apos;foo1&apos;, &apos;bar&apos; =&amp;gt; &apos;bar2&apos;, &apos;baz&apos; =&amp;gt; &apos;baz3&apos;)); &lt;span class=&quot;code-comment&quot;&gt;// SELECT foo AS foo1, bar AS bar2, baz AS baz3&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Building a Select clause B:&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;$sql-&amp;gt;select(&apos;foo&apos;)-&amp;gt;select(&apos;bar&apos;)-&amp;gt;select(&apos;baz&apos;); &lt;span class=&quot;code-comment&quot;&gt;// SELECT foo, bar, baz
&lt;/span&gt;$sql-&amp;gt;select(&apos;foo&apos;, &apos;f&apos;); &lt;span class=&quot;code-comment&quot;&gt;// SELECT foo AS f&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Building the From clause A:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$sql-&amp;gt;from(&apos;foo&apos;); &lt;span class=&quot;code-comment&quot;&gt;// FROM foo
&lt;/span&gt;$sql-&amp;gt;from(&apos;foo&apos;, &apos;f&apos;); &lt;span class=&quot;code-comment&quot;&gt;// FROM foo f
&lt;/span&gt;$sql-&amp;gt;from(&apos;foo&apos;, &apos;f&apos;, array(&apos;foo&apos;)); &lt;span class=&quot;code-comment&quot;&gt;// SELECT foo FROM foo f&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Building the From Clause B:&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;$sql-&amp;gt;from(&apos;foo&apos;); &lt;span class=&quot;code-comment&quot;&gt;// FROM foo
&lt;/span&gt;$sql-&amp;gt;from(array(&apos;foo&apos;)); &lt;span class=&quot;code-comment&quot;&gt;// FROM foo
&lt;/span&gt;$sql-&amp;gt;from(array(&apos;f&apos; =&amp;gt; &apos;foo&apos;)); &lt;span class=&quot;code-comment&quot;&gt;// FROM foo f
&lt;/span&gt;$sql-&amp;gt;from(array(&apos;f&apos; =&amp;gt; &apos;foo&apos;), array(&apos;foo&apos;)); &lt;span class=&quot;code-comment&quot;&gt;// SELECT foo FROM foo f&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Building a Join clause (obviously depends on the From syntax also for a consistent approach):&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 join($table, $alias, $onClause, $cols);
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function join($table, $onClause, $cols);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Join Method Names: joinInner, joinLeft, joinRight (Zend) OR innerJoin, leftJoin, rightJoin (Zeta)?&lt;/p&gt;

&lt;p&gt;Where Syntax:&lt;/p&gt;

&lt;p&gt;This is pretty difficult and i prefer the approach from ORM\QueryBuilder:&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;$sql-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo = ?&quot;&lt;/span&gt;);
$sql-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo = ?&quot;&lt;/span&gt;, $foo); &lt;span class=&quot;code-comment&quot;&gt;// allow &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;? its Zend_Db_Select syntax
&lt;/span&gt;$sql-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo = &quot;&lt;/span&gt; . $sql-&amp;gt;bindParam($foo));
$sql-&amp;gt;where($sql-&amp;gt;expr()-&amp;gt;eq(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;, $sql-&amp;gt;bindParam($foo));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For an OR on the main level:&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;$sql-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo = ?&quot;&lt;/span&gt;)-&amp;gt;orWhere(&lt;span class=&quot;code-quote&quot;&gt;&quot;bar = ?&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For a nested condition:&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;$sql-&amp;gt;where(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo = ? OR bar = ? OR baz = ?&quot;&lt;/span&gt;);
$sql-&amp;gt;where($sql-&amp;gt;expr()-&amp;gt;or(
    $sql-&amp;gt;expr()-&amp;gt;eq(&lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;, $sql-&amp;gt;bindParam($foo)),
    $sql-&amp;gt;expr()-&amp;gt;eq(&lt;span class=&quot;code-quote&quot;&gt;&quot;bar&quot;&lt;/span&gt;, $sql-&amp;gt;bindParam($bar)),
    $sql-&amp;gt;expr()-&amp;gt;eq(&lt;span class=&quot;code-quote&quot;&gt;&quot;baz&quot;&lt;/span&gt;, $sql-&amp;gt;bindParam($baz)),
));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is an Expression class that has control flow and sql functions, using a platform internally for vendor specific sql.&lt;/p&gt;

&lt;p&gt;Execution or Preparing the 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;$stmt = $sql-&amp;gt;prepare();
$sql-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Comments?&lt;/p&gt;</comment>
                    <comment id="13308" author="romanb" created="Mon, 14 Jun 2010 09:28:02 +0000"  >&lt;p&gt;The usage of bindValue/bindParam is very confusing to me. It should be in-line with PDO where the only difference is whether the parameter is bound by value (the value of the variable gets bound at the point of the method call) or by reference (the value of the variable gets bound at the point the statement is executed).&lt;/p&gt;</comment>
                    <comment id="13319" author="beberlei" created="Tue, 15 Jun 2010 03:13:34 +0000"  >&lt;p&gt;How would that look like in your opinion? This is what Zend_Db_Select gets wrong...&lt;/p&gt;</comment>
                    <comment id="13320" author="romanb" created="Tue, 15 Jun 2010 03:42:21 +0000"  >&lt;p&gt;Well I would say either having bindValue/bindParam but with the same semantics as PDO or trashing both and just having setParameter, like we do in the ORM, that binds the value at the time of the invocation, intuitively.&lt;br/&gt;
I would go with the latter as I have yet to find a real use-case for bindParam (binding &quot;by reference&quot;).&lt;/p&gt;

&lt;p&gt;The only &quot;wrong&quot; direction here IMHO is to reuse PDOs names but give them a completely different meaning.&lt;/p&gt;

&lt;p&gt;I would just go with setParameter($key, $value, &lt;span class=&quot;error&quot;&gt;&amp;#91;$type = PDO::PARAM_STR&amp;#93;&lt;/span&gt;).&lt;/p&gt;

&lt;p&gt;I might be missing something though because I dont really understand the bindValue/bindParam examples given in your comments, i.e. I dont understand why it &quot;generates&quot; a key. Can you show a &quot;real&quot; example usage in a query?&lt;/p&gt;</comment>
                    <comment id="13421" author="beberlei" created="Sat, 26 Jun 2010 12:15:05 +0000"  >&lt;p&gt;But how would that bind stuff work with sub selects?&lt;/p&gt;

&lt;p&gt;Say you do:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$sub = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SelectQuery();
$sub-&amp;gt;select(&apos;a&apos;)-&amp;gt;from(&apos;subtable&apos;)-&amp;gt;where(&apos;b = ?&apos;)
$root = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SelectQuery();
$root-&amp;gt;select(&apos;b&apos;)-&amp;gt;from(&apos;root&apos;)-&amp;gt;where(&apos;b IN (&apos; . $sub . &apos; )&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="15043" author="beberlei" created="Tue, 28 Dec 2010 09:31:15 +0000"  >&lt;p&gt;Assigned to Guilherme for 2.1&lt;/p&gt;</comment>
                    <comment id="15858" author="beberlei" created="Sun, 15 May 2011 17:23:13 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

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

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

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

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

&lt;p&gt;Secondly, `Connection::setCharset()` should be modified for MySQL to throw an exception, since the character set is only safely setable using the DSN with PDO.  This is a limitation of the driver and could be asked as a feature request for the PHP core.  Either that, or a big warning should be put on the documentation of the API to indicate the unsafe character set change&lt;/p&gt;</description>
                <environment>MySQL Drivers</environment>
            <key id="12569">DBAL-111</key>
            <summary>MySQL Driver possibly subject to sql injections with PDO::quote()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="ircmaxell">Anthony Ferrara</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Apr 2011 18:52:18 +0000</created>
                <updated>Sat, 14 May 2011 07:24:48 +0000</updated>
                    <resolved>Sat, 14 May 2011 07:24:48 +0000</resolved>
                            <version>2.0.0-BETA2</version>
                <version>2.0.0-BETA3</version>
                <version>2.0.0-BETA4</version>
                <version>2.0.0-RC1-RC3</version>
                <version>2.0-RC4</version>
                <version>2.0-RC5</version>
                <version>2.0</version>
                <version>2.0.1</version>
                <version>2.0.2</version>
                <version>2.0.3</version>
                <version>2.0.4</version>
                <version>2.0.5</version>
                <version>2.1</version>
                                <fixVersion>2.0.4</fixVersion>
                <fixVersion>2.0.5</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15740" author="ircmaxell" created="Tue, 19 Apr 2011 13:30:41 +0000"  >&lt;p&gt;Note: issued same bug report for Doctrine1 as it&apos;s also affected: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-998&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-998&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15753" author="ircmaxell" created="Fri, 29 Apr 2011 20:39:41 +0000"  >&lt;p&gt;Also note that prepared statements in PDO will suffer the same bug since PDO always emulates prepared statements for the mysql driver (even though it fully supports them in the source).  See: &lt;a href=&quot;http://bugs.php.net/bug.php?id=54638&quot; class=&quot;external-link&quot;&gt;http://bugs.php.net/bug.php?id=54638&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15845" author="beberlei" created="Sat, 14 May 2011 07:24:48 +0000"  >&lt;p&gt;Fixed, updated the docs&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-107] Graphviz Schema Visitor</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-107</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;We should include a Graphviz Schema Visitor.&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Display Tables and Columns&lt;/li&gt;
	&lt;li&gt;Highlight Primary Keys&lt;/li&gt;
	&lt;li&gt;Connect tables through foreign keys&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="12546">DBAL-107</key>
            <summary>Graphviz Schema Visitor</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Apr 2011 16:13:26 +0000</created>
                <updated>Thu, 7 Apr 2011 17:32:45 +0000</updated>
                    <resolved>Thu, 7 Apr 2011 17:32:45 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15712" author="beberlei" created="Thu, 7 Apr 2011 17:32:45 +0000"  >&lt;p&gt;Implemented&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-56] Ship a compatibility wrapper like MDB2</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-56</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Database Portability is expensive but often necessary. We should support the important Compatibility Layer Options that MDB2 has:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pear.php.net/manual/en/package.database.mdb2.intro-portability.php&quot; class=&quot;external-link&quot;&gt;http://pear.php.net/manual/en/package.database.mdb2.intro-portability.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following I think are doable:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Empty to Nulls&lt;/li&gt;
	&lt;li&gt;Change Case of Field-Assocs&lt;/li&gt;
	&lt;li&gt;Oracle RTRIM for Chars&lt;/li&gt;
	&lt;li&gt;Num Rows &quot;hack&quot; for Oracle &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/li&gt;
	&lt;li&gt;Delete Count (Some vendors rewrite a DELETE tablename into a TRUNCATE and dont report the delete count)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There should be a class extending &quot;Doctrine\DBAL\Connection&quot; making use of the &apos;wrapperClass&apos; option. Two new classes are necessary:&lt;/p&gt;

&lt;p&gt;Doctrine\DBAL\Portability\Connection&lt;br/&gt;
Doctrine\DBAL\Portability\Statement&lt;/p&gt;</description>
                <environment></environment>
            <key id="11961">DBAL-56</key>
            <summary>Ship a compatibility wrapper like MDB2</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Sep 2010 14:13:33 +0000</created>
                <updated>Sat, 5 Mar 2011 16:19:21 +0000</updated>
                    <resolved>Sat, 5 Mar 2011 16:19:21 +0000</resolved>
                            <version>2.0.0-BETA4</version>
                                <fixVersion>2.1</fixVersion>
                                <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15463" author="beberlei" created="Sat, 5 Mar 2011 16:19:21 +0000"  >&lt;p&gt;Implemented.&lt;/p&gt;

&lt;p&gt;To use define the following three parameters:&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;$params = array();
&lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;$params[&apos;wrapperClass&apos;] = &apos;Doctrine\DBAL\Portability\Connection&apos;;
$params[&apos;portability&apos;] = Doctrine\DBAL\Portability\Connection::PORTABILITY_ALL;
$params[&apos;fetch_case&apos;] = \PDO::CASE_LOWER;
$conn = DriverManager::getConnection($params, $config, $evm);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This mode probably hits performance pretty hard,but it allows you to write code that works with all the quirks of fetching values from all database vendors.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-78] Native support for parameter lists</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-78</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Prerequisites:&lt;/p&gt;

&lt;p&gt;1. Detection of this mode has to be super-fast. It should not have an auto-detection but should be triggered explicitly.&lt;br/&gt;
2. This mode cannot be supported after $conn-&amp;gt;prepare(). It is only viable for $conn-&amp;gt;executeQuery() or $conn-&amp;gt;executeUpdate().&lt;/p&gt;

&lt;p&gt;Case 1: Positional&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;$stmt = $conn-&amp;gt;executeQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a.id FROM articles a WHERE a.id IN (?) AND a.foo = ?&quot;&lt;/span&gt;,
    array($paramList, $foo), array( Connection::PARAM_ARRAY =&amp;gt; PDO::PARAM_INT) , PDO:PARAM_STR ),
    Connection::FLAG_EXPAND_ARRAYS
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Would internally, right before execution, be rewritten to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$c = count($paramList); &lt;span class=&quot;code-comment&quot;&gt;// 3!
&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a.id FROM articles a WHERE a.id IN (?, ?, ?) AND a.foo = ?&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Case 2: Named&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;$stmt = $conn-&amp;gt;executeQuery(&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a.id FROM articles a WHERE a.id IN (:id) AND a.foo = :bar&quot;&lt;/span&gt;,
    array(&apos;id&apos; =&amp;gt; $paramList, &apos;bar&apos; =&amp;gt; $foo),
    array( array(Connection::PARAM_ARRAY =&amp;gt; PDO::PARAM_INT), PDO::PARAM_STR ),
    Connection::FLAG_EXPAND_ARRAYS
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Would internally, right before execution, be rewritten to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$c = count($paramList); &lt;span class=&quot;code-comment&quot;&gt;// 3!
&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT a.id FROM articles a WHERE a.id IN (:id1, :id2, :id3) AND a.foo = :bar&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12250">DBAL-78</key>
            <summary>Native support for parameter lists</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Dec 2010 05:41:35 +0000</created>
                <updated>Sat, 5 Mar 2011 10:51:22 +0000</updated>
                    <resolved>Sat, 5 Mar 2011 10:51:22 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15459" author="beberlei" created="Sat, 5 Mar 2011 10:02:45 +0000"  >&lt;p&gt;Implementing this for Named parameters is not really possible without re-parsing the query after every replacement just because the named parameters can occur more then once and this messes with the positions.&lt;/p&gt;</comment>
                    <comment id="15460" author="beberlei" created="Sat, 5 Mar 2011 10:10:58 +0000"  >&lt;p&gt;Using arrays as param list is a very bad idea performance wise (and also code handling).&lt;/p&gt;

&lt;p&gt;Algorithm now:&lt;/p&gt;

&lt;p&gt;1. New Constants Connection::PARAM_INT_ARRAY and PARAM_STR_ARRAY, being apart by Connection::ARRAY_TYPE_OFFSET from their PDO::PARAM_STR and PDO:PARAM_INT plain values.&lt;br/&gt;
2. Detect if there is one _ARRAY param. If not abort expansion (complexity O(T)) where T is the number of types.&lt;br/&gt;
3. Parse SQL statement for positional needle =&amp;gt; character position&lt;br/&gt;
4. Iterate param list and inline arrays values&lt;/p&gt;
</comment>
                    <comment id="15461" author="beberlei" created="Sat, 5 Mar 2011 10:51:22 +0000"  >&lt;p&gt;Implemented in &lt;a href=&quot;https://github.com/doctrine/dbal/commit/df50f44a179028a3e30dcab02cd3ff33cc4f8498&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/commit/df50f44a179028a3e30dcab02cd3ff33cc4f8498&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-45] Add CLI tool that checks for Reserved Keywords</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-45</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Add a CLI tool that checks for reserved keywords in your current schema (for other databases vendors) to support cross vendor portability.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11857">DBAL-45</key>
            <summary>Add CLI tool that checks for Reserved Keywords</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 18:00:11 +0000</created>
                <updated>Sun, 27 Feb 2011 03:45:40 +0000</updated>
                    <resolved>Sun, 27 Feb 2011 03:45:40 +0000</resolved>
                            <version>2.1</version>
                                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15402" author="beberlei" created="Sun, 27 Feb 2011 03:45:40 +0000"  >&lt;p&gt;Implemented.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12431">DBAL-96</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-79] Add Schema\Table::hasPrimaryKey method</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-79</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Currently the name of the primary key is internal to the Table instance so there is no way to check if the table has a primary key without getting all the indexes and iterating over them.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12268">DBAL-79</key>
            <summary>Add Schema\Table::hasPrimaryKey method</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Dec 2010 17:05:13 +0000</created>
                <updated>Sat, 26 Feb 2011 16:11:38 +0000</updated>
                    <resolved>Sat, 26 Feb 2011 16:11:38 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15399" author="beberlei" created="Sat, 26 Feb 2011 16:11:38 +0000"  >&lt;p&gt;This is fixed in trunk.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-88] MySqlPlatform not escaping table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-88</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Methods in the MySql Platform that use the table name are not escaping the table name.  This causes problems when your table name is the same as a reserved word in MySql.  Example:&lt;/p&gt;


&lt;p&gt;    public function getListTableConstraintsSQL($table)&lt;/p&gt;
    {
        return &apos;SHOW INDEX FROM &apos; . $table;
    }

&lt;p&gt;If my table name is User this method will fail and cause a SQL error because the word User is a reserved word in MySql.  You need to escape the table name with backticks to prevent these errors.  Example:&lt;/p&gt;


&lt;p&gt;    public function getListTableConstraintsSQL($table)&lt;/p&gt;
    {
        return &apos;SHOW INDEX FROM `&apos; . $table . &apos;`&apos;;
    }

&lt;p&gt;I encountered this problem while reverse engineering my existing MySql database.  I&apos;ve attached a fixed version that solved my reverse engineering problems.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12373">DBAL-88</key>
            <summary>MySqlPlatform not escaping table names</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="jreed">James Reed</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Feb 2011 16:37:36 +0000</created>
                <updated>Sat, 26 Feb 2011 15:56:34 +0000</updated>
                    <resolved>Sat, 26 Feb 2011 15:56:34 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Platforms</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15277" author="beberlei" created="Fri, 11 Feb 2011 17:14:11 +0000"  >&lt;p&gt;Duplicate of DDC-976&lt;/p&gt;</comment>
                    <comment id="15288" author="beberlei" created="Sat, 12 Feb 2011 14:40:59 +0000"  >&lt;p&gt;This issue is not a duplicate, only related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-91&quot; title=&quot;orm:convert-mapping SchemaException on Postgres reserved words&quot;&gt;&lt;del&gt;DBAL-91&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="15398" author="beberlei" created="Sat, 26 Feb 2011 15:56:34 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="12290">DBAL-91</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10936" name="MySqlPlatform.php" size="20047" author="jreed" created="Thu, 10 Feb 2011 16:37:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-84] Long string fields are being silently changed to 255 characters in the schema</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-84</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;I have an entity like this:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/**
 * @orm:Entity
 */
class Product
{
    /**
     * @orm:Id
     * @orm:Column(name=&quot;Merchant&quot;,type=&quot;string&quot;,length=50)
     */
    protected $merchant;

    /**
     * @orm:Column(name=&quot;Name&quot;,type=&quot;string&quot;,length=500)
     */
    protected $name;
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When I change the length of $name field to 4000 it updates the schema like it is supposed to:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;php.exe -f console doctrine:schema:update --dump-sql&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;ALTER TABLE product CHANGE Name Name VARCHAR(4000) NOT NULL&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;But when I change the length to 5000 it just silently without any warning uses value 255 instead:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;php.exe -f console doctrine:schema:update --dump-sql&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;ALTER TABLE product CHANGE Name Name VARCHAR(&lt;font color=&quot;red&quot;&gt;255&lt;/font&gt;) NOT NULL&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;I had to look into actual table definition using mysql browser to find this issue because doctrine doesn&apos;t even warn about it. This could lead to some pretty serious bugs!&lt;/p&gt;</description>
                <environment></environment>
            <key id="12339">DBAL-84</key>
            <summary>Long string fields are being silently changed to 255 characters in the schema</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="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="extesy">Oleg Anashkin</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Jan 2011 17:19:37 +0000</created>
                <updated>Sun, 20 Feb 2011 17:13:00 +0000</updated>
                    <resolved>Sun, 20 Feb 2011 17:13:00 +0000</resolved>
                            <version>2.0</version>
                <version>2.0.1</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15354" author="beberlei" created="Sun, 20 Feb 2011 17:13:00 +0000"  >&lt;p&gt;Fixed in master and 2.0.x&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-42] Use column comments for further Doctrine Type Inference </title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-42</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Any custom type could use vendors column comment functionalities to allow more details on the specific type of a column that can be used inside the &quot;listTableColumns()&quot; method.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11759">DBAL-42</key>
            <summary>Use column comments for further Doctrine Type Inference </summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Aug 2010 17:13:00 +0000</created>
                <updated>Sun, 20 Feb 2011 04:39:12 +0000</updated>
                    <resolved>Sun, 20 Feb 2011 04:39:12 +0000</resolved>
                                            <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15340" author="beberlei" created="Fri, 18 Feb 2011 16:28:14 +0000"  >&lt;p&gt;MySQL, postfix column with &quot;COMMENT &apos;The KEY obviously&apos;&quot;&lt;/p&gt;

&lt;p&gt;Postgres, COMMENT syntax (another SQL statement, narf!): &lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/sql-comment.html&quot; class=&quot;external-link&quot;&gt;http://www.postgresql.org/docs/8.3/static/sql-comment.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oracle, COMMENT syntax (another SQL statement): &lt;a href=&quot;http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_4009.htm&quot; class=&quot;external-link&quot;&gt;http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_4009.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sqlite: Nada&lt;/p&gt;

&lt;p&gt;Mssql: (woah this is ugly) &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms180047.aspx&quot; class=&quot;external-link&quot;&gt;http://msdn.microsoft.com/en-us/library/ms180047.aspx&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15351" author="beberlei" created="Sun, 20 Feb 2011 04:39:12 +0000"  >&lt;p&gt;Implemented for Oracle, PostgreSQL and MySQL.&lt;/p&gt;

&lt;p&gt;Now for Array and Object types a Column Comment is appended of the format &quot;(DC2Type:$type)&quot; which is parsed when reading from the database.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12376">DBAL-90</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-91] orm:convert-mapping SchemaException on Postgres reserved words</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-91</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;While execuiting &lt;/p&gt;

&lt;p&gt;  doctrine orm:convert-mapping --from-database yml /tmp/test.yml&lt;/p&gt;

&lt;p&gt;I get presented an error&lt;/p&gt;

&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\DBAL\Schema\SchemaException&amp;#93;&lt;/span&gt;&lt;br/&gt;
  Invalid index-name tablename_&quot;input&quot;_idx given, has to be &lt;span class=&quot;error&quot;&gt;&amp;#91;a-zA-Z0-9_&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The index &quot;type&quot; is quoted because this is a reserved word in Postgres. for example see the following definition:&lt;/p&gt;

&lt;p&gt;FOREIGN KEY (something) REFERENCES somethings(id) ON UPDATE CASCADE&lt;br/&gt;
FOREIGN KEY (another) REFERENCES anothers(id) ON UPDATE CASCADE&lt;br/&gt;
FOREIGN KEY (&quot;type&quot;) REFERENCES logtypes(id) ON UPDATE CASCADE&lt;/p&gt;

&lt;p&gt;Only type will be quoted because it is a reserved word.&lt;/p&gt;</description>
                <environment>CentOs 5.5, Postgres 8.1.22</environment>
            <key id="12290">DBAL-91</key>
            <summary>orm:convert-mapping SchemaException on Postgres reserved words</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="emilw">Emil</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Jan 2011 09:02:23 +0000</created>
                <updated>Sat, 12 Feb 2011 14:39:41 +0000</updated>
                    <resolved>Sat, 12 Feb 2011 14:39:41 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.2</fixVersion>
                <fixVersion>2.1</fixVersion>
                                <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15117" author="beberlei" created="Mon, 10 Jan 2011 09:16:00 +0000"  >&lt;p&gt;You have to quote with `` in Doctrine. That is translated to the underyling vendor quotation signs.&lt;/p&gt;</comment>
                    <comment id="15119" author="emilw" created="Mon, 10 Jan 2011 10:44:39 +0000"  >&lt;p&gt;@benjamin this considers a mapping error from database (Postgres) to YAML through the doctrine commandline tool, I do not think your comment is relevant for this issue.&lt;/p&gt;</comment>
                    <comment id="15120" author="beberlei" created="Tue, 11 Jan 2011 04:12:40 +0000"  >&lt;p&gt;@Emil it is, are you quoting the reserved word in the YML file using `` ? DBAL has some logic to fix escaping in these cases.&lt;/p&gt;</comment>
                    <comment id="15121" author="emilw" created="Tue, 11 Jan 2011 04:21:54 +0000"  >&lt;p&gt;@benjamin uhm, I might be baffled with the complexity of Doctrine or just plain wrong. But I&apos;m trying to create a YML file from my database. How can I be making a mistake in the YML file with quotes? &lt;/p&gt;

&lt;p&gt;The error message is presented because the Dcotrine ORM module tries to generate index names on columns, based on the database schema, but fails because the returned names (from the database schema) contain quotes (because they are reserved words).&lt;/p&gt;</comment>
                    <comment id="15122" author="beberlei" created="Tue, 11 Jan 2011 05:42:29 +0000"  >&lt;p&gt;Sorry, now i get it. I didnt relaize the usecase you were applying. Yes you are right &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="15173" author="beberlei" created="Sun, 23 Jan 2011 14:30:48 +0000"  >&lt;p&gt;Can you give me an Example Postgresql Schema with DDL SQL that produces this error?&lt;/p&gt;</comment>
                    <comment id="15244" author="emilw" created="Thu, 10 Feb 2011 05:24:52 +0000"  >&lt;p&gt;These are the table creation for a test table which is able to reproduce the error.&lt;/p&gt;</comment>
                    <comment id="15245" author="emilw" created="Thu, 10 Feb 2011 05:27:49 +0000"  >&lt;p&gt;I hope this is enough information. The attached SQL reproduces the following error:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;doctrine orm:convert-mapping --from-database yml /tmp/test.yml&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;  &lt;span class=&quot;error&quot;&gt;&amp;#91;Doctrine\DBAL\Schema\SchemaException&amp;#93;&lt;/span&gt;&lt;br/&gt;
  Invalid index-name something_&quot;input&quot;_idx given, has to be &lt;span class=&quot;error&quot;&gt;&amp;#91;a-zA-Z0-9_&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;orm:convert-mapping &lt;span class=&quot;error&quot;&gt;&amp;#91;--filter=&amp;quot;...&amp;quot;&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;--from-database&amp;#93;&lt;/span&gt; [-&lt;del&gt;extend&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;quot;...&amp;quot;&amp;#93;&lt;/span&gt;] [&lt;/del&gt;-num-spaces&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;quot;...&amp;quot;&amp;#93;&lt;/span&gt;] &lt;span class=&quot;error&quot;&gt;&amp;#91;-h|--help&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;-q|--quiet&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;-v|--verbose&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;-V|--version&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;-a|--ansi&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;-n|--no-interaction&amp;#93;&lt;/span&gt; command to-type dest-path&lt;/p&gt;
</comment>
                    <comment id="15284" author="beberlei" created="Sat, 12 Feb 2011 12:54:42 +0000"  >&lt;p&gt;I can&apos;t reproduce it &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Can you run the command with --verbose ? Additionally in lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php can you var_dump() $metadata after line 119?&lt;/p&gt;</comment>
                    <comment id="15285" author="beberlei" created="Sat, 12 Feb 2011 13:01:28 +0000"  >&lt;p&gt;Ok i could reproduce it now. Input is not a keyword for me though, type also not. Coudl reproduce it with &quot;table&quot;&lt;/p&gt;</comment>
                    <comment id="15286" author="beberlei" created="Sat, 12 Feb 2011 13:06:54 +0000"  >&lt;p&gt;Ok, this is a DBAL issue.&lt;/p&gt;</comment>
                    <comment id="15287" author="beberlei" created="Sat, 12 Feb 2011 14:39:41 +0000"  >&lt;p&gt;This is fixed and will be included in 2.0.2&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="12373">DBAL-88</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10935" name="test-creation.sql" size="248" author="emilw" created="Thu, 10 Feb 2011 05:24:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DBAL-80] Connection::_bindTypedValues() error when $types[0] is null</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-80</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;When $types&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; = null (default) then _bindTypedValues starts with the wrong offset and binds the wrong types against the wrong params.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12273">DBAL-80</key>
            <summary>Connection::_bindTypedValues() error when $types[0] is null</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 Jan 2011 12:02:04 +0000</created>
                <updated>Sat, 1 Jan 2011 16:08:29 +0000</updated>
                    <resolved>Sat, 1 Jan 2011 16:08:29 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.1</fixVersion>
                <fixVersion>2.1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15084" author="beberlei" created="Sat, 1 Jan 2011 16:08:29 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>