Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

SQL Server doModifyLimitQuery() quoting of doctrine_rownum causes error #159

Merged
merged 1 commit into from almost 2 years ago

4 participants

dtrethewey Don't Add Me To Your Organization a.k.a The Travis Bot Benjamin Eberlei Christophe Coevoet
dtrethewey

SQL Server doesn't like the quoted alias for doctrine_rownum and fails when setting setMaxResults() and setFirstResult() in query, returning an error like "Conversion failed when converting the varchar value 'doctrine_rownum' to data type int. (severity 16)"

Not sure why the column alias is quoted as have never seen that used before.

dtrethewey SQL Server doesn't like the quoted alias for doctrine_rownum and fail…
…s when setting setMaxResults() and setFirstResult() in query, returning an error like "Conversion failed when converting the varchar value 'doctrine_rownum' to data type int. (severity 16)"
129394c
Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 129394c into e537745).

Benjamin Eberlei beberlei merged commit 0760d95 into from July 05, 2012
Benjamin Eberlei beberlei closed this July 05, 2012
Benjamin Eberlei
Owner

You forgot to run the testsuite. This breaks one test

Christophe Coevoet
stof commented July 05, 2012

@beberlei according to @travisbot, it was passing one month ago when the PR was sent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 07, 2012
dtrethewey SQL Server doesn't like the quoted alias for doctrine_rownum and fail…
…s when setting setMaxResults() and setFirstResult() in query, returning an error like "Conversion failed when converting the varchar value 'doctrine_rownum' to data type int. (severity 16)"
129394c
This page is out of date. Refresh to see the latest.
2  lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
@@ -704,7 +704,7 @@ protected function doModifyLimitQuery($query, $limit, $offset = null)
704 704
                 $start = $offset + 1;
705 705
                 $end = $offset + $limit;
706 706
 
707  
-                $query = "SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS \"doctrine_rownum\", $query) AS doctrine_tbl WHERE \"doctrine_rownum\" BETWEEN $start AND $end";
  707
+                $query = "SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS doctrine_rownum, $query) AS doctrine_tbl WHERE doctrine_rownum BETWEEN $start AND $end";
708 708
             }
709 709
         }
710 710
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.