<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed Jun 19 20:03:48 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=fixVersion+%3D+%222.0.7%22+AND+project+%3D+DBAL&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=fixVersion+%3D+%222.0.7%22+AND+project+%3D+DBAL</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="4" total="4"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<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-132] wrong mysql dump generation for foreign keys</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-132</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;Problem in methods Doctrine\DBAL\Platforms\AbstractPlatform::getDropForeignKeySQL() and Doctrine\DBAL\Platforms\AbstractPlatform::getCreateForeignKeySQL()&lt;/p&gt;

&lt;p&gt;This methods do not receive FK name and don&apos;t put it in sql dump. While executing dump, mysql autogenerate FK names, but at the migration generation moment doctrine knowns nothing about them.&lt;/p&gt;

&lt;p&gt;I think, doctrine must generate this names and put it into the schema.&lt;/p&gt;

&lt;p&gt;Autogenerated migrations in mysql with fk are unusable.&lt;/p&gt;

&lt;p&gt;Doctrine migrations:migrate in current doctrine version:&lt;br/&gt;
up:&lt;br/&gt;
ALTER TABLE Catalog_Field ADD CONSTRAINT FOREIGN KEY (groupId) REFERENCES Catalog_FieldGroup(id)&lt;br/&gt;
down:&lt;br/&gt;
ALTER TABLE Catalog_Field DROP FOREIGN KEY&lt;/p&gt;

&lt;p&gt;should be:&lt;br/&gt;
up:&lt;br/&gt;
ALTER TABLE Catalog_Field ADD CONSTRAINT Catalog_Field_ibfk_2 FOREIGN KEY (groupId) REFERENCES Catalog_FieldGroup(id)&lt;br/&gt;
down:&lt;br/&gt;
ALTER TABLE Catalog_Field DROP FOREIGN KEY catalog_Field_ibfk_2&lt;/p&gt;


&lt;p&gt;see: &lt;a href=&quot;https://github.com/doctrine/migrations/issues/32&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/migrations/issues/32&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/migrations/issues/35&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/migrations/issues/35&lt;/a&gt;&lt;/p&gt;</description>
                <environment>PHP 5.3.3-7+squeeze1 with Suhosin-Patch, Debian GNU/Linux 6.0.1 (squeeze)&lt;br/&gt;
</environment>
            <key id="12735">DBAL-132</key>
            <summary>wrong mysql dump generation for foreign keys</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="zerkalica">Stefan Zerkalica</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Jun 2011 08:05:39 +0000</created>
                <updated>Sun, 31 Jul 2011 12:10:53 +0000</updated>
                    <resolved>Sun, 31 Jul 2011 12:10:53 +0000</resolved>
                            <version>2.0.5</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16253" author="beberlei" created="Sun, 31 Jul 2011 12:10:53 +0000"  >&lt;p&gt;Fixed&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-82] orderBy(), setFirstResult() bug with MSSQL Server</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-82</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;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;QueryBuilder&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;		$query = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createQueryBuilder(&apos;account&apos;)
					  -&amp;gt;select(&apos;account&apos;)
					  -&amp;gt;orderBy(&apos;account.id&apos;, &apos;DESC&apos;)
					  -&amp;gt;getQuery();

                $result = $query-&amp;gt;setMaxResults($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;resultsPerPage+1)
        							-&amp;gt;setFirstResult($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;offset)
        							-&amp;gt;getResult();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The above, when using &quot;setFirstResult&quot; and &quot;orderBy&quot; (like that), results in an error like so:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier &lt;span class=&quot;code-quote&quot;&gt;&quot;t0_.id&quot;&lt;/span&gt; could not be bound.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With a statement that looks something like so:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;WITH outer_tbl AS (SELECT ROW_NUMBER() OVER (ORDER BY t0_.id DESC) AS &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine_rownum&quot;&lt;/span&gt;,   ...&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason the error is occurring is because you apparently need to use the &quot;alias&quot; (e.g, SELECT t0_.id AS id0) &quot;id0&quot; in the &quot;ORDER BY&quot; clause.&lt;/p&gt;

&lt;p&gt;So query will run with no problems if t0_.id as id0&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;WITH outer_tbl AS (SELECT ROW_NUMBER() OVER (ORDER BY id0 DESC) AS &lt;span class=&quot;code-quote&quot;&gt;&quot;doctrine_rownum&quot;&lt;/span&gt;,   ...&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It looks like this behavior might only occur with Microsoft SQL Server, but it is a bug.&lt;/p&gt;

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

&lt;p&gt;If you go into: &lt;br/&gt;
Doctrine\DBAL\Platforms\MsSqlPlatform&lt;/p&gt;

&lt;p&gt;Find: &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;$over = preg_replace(&apos;/\&lt;span class=&quot;code-quote&quot;&gt;&quot;[^,]*\&quot;&lt;/span&gt;.\&lt;span class=&quot;code-quote&quot;&gt;&quot;([^,]*)\&quot;&lt;/span&gt;/i&apos;, &apos;&lt;span class=&quot;code-quote&quot;&gt;&quot;inner_tbl&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;$1&quot;&lt;/span&gt;&apos;, $orderby);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Add before:&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;                    # Get Columns
                    $columns = array();
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(preg_match_all(&apos;/([a-zA-Z][0-9]+_\.[a-zA-Z0-9\-_]+)\sAS\s([a-zA-Z0-9\-\_]+)/&apos;, $query, $matched)) {
                        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;($i=0; $i&amp;lt;count($matched[1]); ++$i)
                        {
                            $columns[$matched[1][$i]] = $matched[2][$i];
                        }
                    }
                    
                    # Replace columns with their alias in the &lt;span class=&quot;code-quote&quot;&gt;&quot;orderby&quot;&lt;/span&gt; statement
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(preg_match_all(&apos;/([a-zA-Z][0-9]+_\.[a-zA-Z0-9\-_]+)\s/i&apos;, $orderby, $matches)) {
                        foreach($matches[1] as $column) 
                        {
                            $orderby = preg_replace(&apos;/&apos;.$column.&apos;/&apos;, $columns[$column], $orderby);
                        }
                    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Obviously this is a really ugly hack, but this resolves it.&lt;/p&gt;</description>
                <environment>Windows 7, Apache2, PHP 5.3.5, Microsoft SQL Server 2008</environment>
            <key id="12306">DBAL-82</key>
            <summary>orderBy(), setFirstResult() bug with MSSQL Server</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/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="juokaz">Juozas Kaziukenas</assignee>
                                <reporter username="aarondm">Aaron DM</reporter>
                        <labels>
                    </labels>
                <created>Sun, 16 Jan 2011 13:34:04 +0000</created>
                <updated>Sun, 31 Jul 2011 10:20:54 +0000</updated>
                    <resolved>Sun, 31 Jul 2011 10:20:54 +0000</resolved>
                            <version>2.0</version>
                                <fixVersion>2.0.7</fixVersion>
                <fixVersion>2.1.1</fixVersion>
                                <component>Platforms</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15146" author="aarondm" created="Sun, 16 Jan 2011 14:09:16 +0000"  >&lt;p&gt;Added the ugly hack fix.&lt;/p&gt;</comment>
                    <comment id="15172" author="beberlei" created="Sun, 23 Jan 2011 14:29:05 +0000"  >&lt;p&gt;Assigned to Juozas.&lt;/p&gt;</comment>
                    <comment id="15807" author="minxuan.guo" created="Thu, 5 May 2011 07:53:21 +0000"  >&lt;p&gt;Thanks Aaron DM&lt;/p&gt;

&lt;p&gt;Your code works perfectly&lt;/p&gt;</comment>
                    <comment id="16033" author="jmfontaine" created="Mon, 20 Jun 2011 08:54:27 +0000"  >&lt;p&gt;I am experiencing this bug too. Is there a way to get it fixed anytime soon? Maybe in the 2.1 release.&lt;/p&gt;</comment>
                    <comment id="16052" author="aarondm" created="Fri, 24 Jun 2011 18:50:21 +0000"  >&lt;p&gt;Here is what I think, a proper fix for this.&lt;/p&gt;

&lt;p&gt;I re-wrote the query however it works the same and is pretty much the exact same in performance (from couple of tests I&apos;ve done looking at profiler) + it fixes the issues regarding this ticket.&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;    /**
     * Adds an adapter-specific LIMIT clause to the SELECT statement.
     *
     * @param string $query
     * @param mixed $limit
     * @param mixed $offset
     * @link http:&lt;span class=&quot;code-comment&quot;&gt;//lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html
&lt;/span&gt;     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function doModifyLimitQuery($query, $limit, $offset = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($limit &amp;gt; 0) {
            $count = intval($limit);
            $offset = intval($offset);

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

            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($offset == 0) {
                $query = preg_replace(&apos;/^SELECT\s/i&apos;, &apos;SELECT TOP &apos; . $count . &apos; &apos;, $query);
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                $orderby = stristr($query, &apos;ORDER BY&apos;);

                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$orderby) {
                    $over = &apos;ORDER BY (SELECT 0)&apos;;
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                    $over = preg_replace(&apos;/\&lt;span class=&quot;code-quote&quot;&gt;&quot;[^,]*\&quot;&lt;/span&gt;.\&lt;span class=&quot;code-quote&quot;&gt;&quot;([^,]*)\&quot;&lt;/span&gt;/i&apos;, &apos;&lt;span class=&quot;code-quote&quot;&gt;&quot;inner_tbl&quot;&lt;/span&gt;.&lt;span class=&quot;code-quote&quot;&gt;&quot;$1&quot;&lt;/span&gt;&apos;, $orderby);
                }

                &lt;span class=&quot;code-comment&quot;&gt;// Remove ORDER BY clause from $query
&lt;/span&gt;                $query = preg_replace(&apos;/\s+ORDER BY(.*)/&apos;, &apos;&apos;, $query);
                $query = preg_replace(&apos;/SELECT\s/&apos;, &apos;&apos;, $query);

                $start = $offset + 1;
                $end = $offset + $count;

                &lt;span class=&quot;code-comment&quot;&gt;// Limit query
&lt;/span&gt;                $query = &lt;span class=&quot;code-quote&quot;&gt;&quot;SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS \&quot;&lt;/span&gt;doctrine_rownum\&lt;span class=&quot;code-quote&quot;&gt;&quot;, $query) AS doctrine_tbl WHERE \&quot;&lt;/span&gt;doctrine_rownum\&lt;span class=&quot;code-quote&quot;&gt;&quot; BETWEEN $start AND $end&quot;&lt;/span&gt;;
            }
        }

        &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;I had found this query a long time ago and found it to be fairly fast, however I&apos;m not sure where exactly I found it.&lt;br/&gt;
I&apos;m going to take a guess and assume it might be this comment:&lt;br/&gt;
&lt;a href=&quot;http://josephlindsay.com/archives/2005/05/27/paging-results-in-ms-sql-server/comment-page-1/#comment-28594&quot; class=&quot;external-link&quot;&gt;http://josephlindsay.com/archives/2005/05/27/paging-results-in-ms-sql-server/comment-page-1/#comment-28594&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16053" author="aarondm" created="Fri, 24 Jun 2011 19:29:42 +0000"  >&lt;p&gt;Pull request: &lt;a href=&quot;https://github.com/doctrine/dbal/pull/37&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/37&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16250" author="beberlei" created="Sun, 31 Jul 2011 10:20:54 +0000"  >&lt;p&gt;Fixed, merged pull request&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>