diff options
| author | Michael Trier <mtrier@gmail.com> | 2008-11-08 04:43:35 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2008-11-08 04:43:35 +0000 |
| commit | 8924a0e4fe3f6dfe3f90413deb8bee8cd776cafb (patch) | |
| tree | 2f87e4bc128ce54ee022dbe0ef3f634e25dd4169 /test/sql/query.py | |
| parent | cfca625e9445f9c52fe20c6542dd7268f2c55b6d (diff) | |
| download | sqlalchemy-8924a0e4fe3f6dfe3f90413deb8bee8cd776cafb.tar.gz | |
Corrected a lot of mssql limit / offset issues. Also ensured that mssql uses the IN / NOT IN syntax when using a binary expression with a subquery.
Diffstat (limited to 'test/sql/query.py')
| -rw-r--r-- | test/sql/query.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/sql/query.py b/test/sql/query.py index 3118aef64..ac11b4452 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -648,9 +648,10 @@ class LimitTest(TestBase): r = users.select(limit=3, order_by=[users.c.user_id]).execute().fetchall() self.assert_(r == [(1, 'john'), (2, 'jack'), (3, 'ed')], repr(r)) - @testing.crashes('mssql', 'FIXME: guessing') @testing.fails_on('maxdb') def test_select_limit_offset(self): + """Test the interaction between limit and offset""" + r = users.select(limit=3, offset=2, order_by=[users.c.user_id]).execute().fetchall() self.assert_(r==[(3, 'ed'), (4, 'wendy'), (5, 'laura')]) r = users.select(offset=5, order_by=[users.c.user_id]).execute().fetchall() @@ -659,14 +660,15 @@ class LimitTest(TestBase): def test_select_distinct_limit(self): """Test the interaction between limit and distinct""" - r = sorted([x[0] for x in select([addresses.c.address]).distinct().limit(3).execute().fetchall()]) + r = sorted([x[0] for x in select([addresses.c.address]).distinct().limit(3).order_by(addresses.c.address).execute().fetchall()]) self.assert_(len(r) == 3, repr(r)) self.assert_(r[0] != r[1] and r[1] != r[2], repr(r)) + @testing.fails_on('mssql') def test_select_distinct_offset(self): - """Test the interaction between limit and offset""" + """Test the interaction between distinct and offset""" - r = sorted([x[0] for x in select([addresses.c.address]).distinct().offset(1).execute().fetchall()]) + r = sorted([x[0] for x in select([addresses.c.address]).distinct().offset(1).order_by(addresses.c.address).execute().fetchall()]) self.assert_(len(r) == 4, repr(r)) self.assert_(r[0] != r[1] and r[1] != r[2] and r[2] != [3], repr(r)) |
