diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-29 16:35:02 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-29 16:35:02 -0400 |
commit | e4bc7d289477e22815f4c6ab86b3f0c1bf356e08 (patch) | |
tree | fdfe33b2ab7e5ef54b62877d4c17a56a401e23ed /test/dialect/test_mysql.py | |
parent | 87fd1e3260d957ae25c44cc2ac30ce97feb89b35 (diff) | |
download | sqlalchemy-e4bc7d289477e22815f4c6ab86b3f0c1bf356e08.tar.gz |
- move LIMIT/OFFSET rendering to be as bind parameters, for all backends
which support it. This includes SQLite, MySQL, Postgresql, Firebird,
Oracle (already used binds with ROW NUMBER OVER), MSSQL (when ROW NUMBER
is used, not TOP). Not included are Informix, Sybase, MaxDB, Access
[ticket:805]
- LIMIT/OFFSET parameters need to stay as literals within SQL
constructs. This because they may not be renderable as binds on
some backends.
Diffstat (limited to 'test/dialect/test_mysql.py')
-rw-r--r-- | test/dialect/test_mysql.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py index 7c4cc2309..0701c46ab 100644 --- a/test/dialect/test_mysql.py +++ b/test/dialect/test_mysql.py @@ -1046,14 +1046,18 @@ class SQLTest(TestBase, AssertsCompiledSQL): self.assert_compile( select([t]).limit(10).offset(20), - "SELECT t.col1, t.col2 FROM t LIMIT 20, 10" + "SELECT t.col1, t.col2 FROM t LIMIT %s, %s", + {'param_1':20, 'param_2':10} ) self.assert_compile( select([t]).limit(10), - "SELECT t.col1, t.col2 FROM t LIMIT 10") + "SELECT t.col1, t.col2 FROM t LIMIT %s", + {'param_1':10}) + self.assert_compile( select([t]).offset(10), - "SELECT t.col1, t.col2 FROM t LIMIT 10, 18446744073709551615" + "SELECT t.col1, t.col2 FROM t LIMIT %s, %s", + {'param_1':10, 'param_2':18446744073709551615} ) def test_varchar_raise(self): |