Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

4 participants

@dt-stasis

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.

@dt-stasis dt-stasis 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
@travisbot

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

@beberlei beberlei merged commit 0760d95 into from
@beberlei
Owner

You forgot to run the testsuite. This breaks one test

@stof

@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
Commits on Jun 7, 2012
  1. @dt-stasis

    SQL Server doesn't like the quoted alias for doctrine_rownum and fail…

    dt-stasis authored
    …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)"
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View
2  lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
@@ -704,7 +704,7 @@ protected function doModifyLimitQuery($query, $limit, $offset = null)
$start = $offset + 1;
$end = $offset + $limit;
- $query = "SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS \"doctrine_rownum\", $query) AS doctrine_tbl WHERE \"doctrine_rownum\" BETWEEN $start AND $end";
+ $query = "SELECT * FROM (SELECT ROW_NUMBER() OVER ($over) AS doctrine_rownum, $query) AS doctrine_tbl WHERE doctrine_rownum BETWEEN $start AND $end";
}
}
Something went wrong with that request. Please try again.