]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
include ORDER BY in subquery that has TOP via FETCH
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 11 Oct 2023 19:36:24 +0000 (15:36 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Oct 2023 13:58:49 +0000 (09:58 -0400)
commit5c8bc517ee2d1d9bbb343cf664a522f24d59f4d2
treecb6f6d0c134d9167694b54fc1a0d1b457e1c31ca
parenta342b3d503f968bbf43f3b2de1f4f623b03a6310
include ORDER BY in subquery that has TOP via FETCH

Fixed bug where the rule that prevents ORDER BY from emitting within
subqueries on SQL Server was not being disabled in the case where the
:meth:`.select.fetch` method were used to limit rows in conjunction with
WITH TIES or PERCENT, preventing valid subqueries with TOP / ORDER BY from
being used.

Fixes: #10458
Change-Id: I5bfab485241ee54de50cc03e222d9d1736089ea8
doc/build/changelog/unreleased_20/10458.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
test/dialect/mssql/test_compiler.py