From 51c0d90c8d3dff721329d5ef0eb896227aff3c99 Mon Sep 17 00:00:00 2001 From: Ants Aasma Date: Tue, 26 Jun 2007 18:00:57 +0000 Subject: add missing grouping for compound selects. fixes ticket #623 --- test/sql/query.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/sql/query.py') diff --git a/test/sql/query.py b/test/sql/query.py index f7c38eb87..632246fad 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -624,6 +624,29 @@ class CompoundTest(PersistTest): assert e.execute().fetchall() == [('aaa', 'aaa'), ('aaa', 'ccc'), ('bbb', 'aaa'), ('bbb', 'bbb'), ('ccc', 'bbb'), ('ccc', 'ccc')] assert e.alias('bar').select().execute().fetchall() == [('aaa', 'aaa'), ('aaa', 'ccc'), ('bbb', 'aaa'), ('bbb', 'bbb'), ('ccc', 'bbb'), ('ccc', 'ccc')] + @testbase.unsupported('sqlite', 'mysql', 'oracle') + def test_except_style3(self): + # aaa, bbb, ccc - (aaa, bbb, ccc - (ccc)) = ccc + e = except_( + select([t1.c.col3]), # aaa, bbb, ccc + except_( + select([t2.c.col3]), # aaa, bbb, ccc + select([t3.c.col3], t3.c.col3 == 'ccc'), #ccc + ) + ) + self.assertEquals(e.execute().fetchall(), [('ccc',)]) + + @testbase.unsupported('sqlite', 'mysql', 'oracle') + def test_union_union_all(self): + e = union_all( + select([t1.c.col3]), + union( + select([t1.c.col3]), + select([t1.c.col3]), + ) + ) + self.assertEquals(e.execute().fetchall(), [('aaa',),('bbb',),('ccc',),('aaa',),('bbb',),('ccc',)]) + @testbase.unsupported('mysql') def test_composite(self): u = intersect( -- cgit v1.2.1