doctrine/dbal — pull request #123 by dtrethewey (2012-03-23 15:40:01+00:00)
Title: SQL Server doModifyLimitQuery() quoting of doctrine_rownum causes error

Fixed an issue with the SQL Server implementation of the limit and offset functionality. Basically the doModifyLimitQuery() method in SQLServerPlatform.php was wrapping the alias "doctrine_rownum" in quotes. When doing a setMaxResults() and setFirstResult() the following PDO error was being returned:

PHP Warning: PDO::query() [pdo.query]: message: Conversion failed when converting the varchar value 'doctrine_rownum' to data type int. (severity 16) in /lib/vendor/Doctrine/DBAL/lib/Doctrine/DBAL/Connection.php on line 633

I've simply unquoted the alias as you don't need quotes there. Fixes my issue on SQL Server 2008.

(my first pull request...)