diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-08-07 18:56:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-08-07 18:56:11 +0000 |
commit | 9a01ea077776fda90a116acbc76fb60696c78883 (patch) | |
tree | 4aadd7b9039d4eda61c31e76aaa15e7502bb391f /test/dialect/mssql/test_compiler.py | |
parent | 06ca05e1bb803433b93f7d1af7dac97adcba58de (diff) | |
parent | 9de57843a3a98555df21b5c5585f8af699d8ec2e (diff) | |
download | sqlalchemy-9a01ea077776fda90a116acbc76fb60696c78883.tar.gz |
Merge "dont qualify literal_binds with literal_execute"
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r-- | test/dialect/mssql/test_compiler.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index 6afd90e87..cf8894f42 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -36,6 +36,7 @@ from sqlalchemy.testing import AssertsCompiledSQL from sqlalchemy.testing import eq_ from sqlalchemy.testing import fixtures from sqlalchemy.testing import is_ +from sqlalchemy.testing.assertions import eq_ignore_whitespace tbl = table("t", column("a")) @@ -976,6 +977,22 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): checkparams={"x_1": 5, "param_1": 10}, ) + def test_limit_using_top_literal_binds(self): + """test #6863""" + t = table("t", column("x", Integer), column("y", Integer)) + + s = select(t).where(t.c.x == 5).order_by(t.c.y).limit(10) + + eq_ignore_whitespace( + str( + s.compile( + dialect=mssql.dialect(), + compile_kwargs={"literal_binds": True}, + ) + ), + "SELECT TOP 10 t.x, t.y FROM t WHERE t.x = 5 ORDER BY t.y", + ) + def test_limit_zero_using_top(self): t = table("t", column("x", Integer), column("y", Integer)) |