Skip to content

Commit 17bb0c8

Browse files
authored
Merge pull request #218 from adelkhayata76/patch-1
Fix an issue of adding OFFSET keyword for legacy SQL Server versions
2 parents 54ef30d + f59b59b commit 17bb0c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mssql/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def as_sql(self, with_limits=True, with_col_aliases=False):
364364
# Django 2.x. See https://github.com/microsoft/mssql-django/issues/12
365365
# Add OFFSET for all Django versions.
366366
# https://github.com/microsoft/mssql-django/issues/109
367-
if not (do_offset or do_limit):
367+
if not (do_offset or do_limit) and supports_offset_clause:
368368
result.append("OFFSET 0 ROWS")
369369

370370
# SQL Server requires the backend-specific emulation (2008 or earlier)

0 commit comments

Comments
 (0)