summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-05-18 19:01:47 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-05-18 19:01:47 +0000
commit9102d678abdaf7e9ab0ce59a913283eb16810b9a (patch)
tree5d4be18fb9975437171de3f9e5021389311ef541 /test/sql
parentaeecb08490a44f86bd1c115864f1781c24018f07 (diff)
downloadsqlalchemy-9102d678abdaf7e9ab0ce59a913283eb16810b9a.tar.gz
- removed "no group by's in a select thats part of a UNION"
restriction [ticket:578]
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/select.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sql/select.py b/test/sql/select.py
index 395243aee..281a0f6a3 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -628,6 +628,17 @@ FROM myothertable ORDER BY myid \
LIMIT 5 OFFSET 10"
)
+ self.runtest(
+ union(
+ select([table1.c.myid, table1.c.name, func.max(table1.c.description)], table1.c.name=='name2', group_by=[table1.c.myid, table1.c.name]),
+ table1.select(table1.c.name=='name1')
+ )
+ ,
+ "SELECT mytable.myid, mytable.name, max(mytable.description) FROM mytable \
+WHERE mytable.name = :mytable_name GROUP BY mytable.myid, mytable.name UNION SELECT mytable.myid, mytable.name, mytable.description \
+FROM mytable WHERE mytable.name = :mytable_name_1"
+ )
+
def testouterjoin(self):
# test an outer join. the oracle module should take the ON clause of the join and
# move it up to the WHERE clause of its parent select, and append (+) to all right-hand-side columns