summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-02-12 21:16:31 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-02-12 21:16:31 +0000
commit9fffa2c7e1539689750ead7cd70f2d4812322a77 (patch)
treeb1e29451f30ec66505c646d9cac9a6ce44f97490 /test/sql
parent85e8cb7ffb9134fa34135bf83d231e0e55b0d0cf (diff)
downloadsqlalchemy-9fffa2c7e1539689750ead7cd70f2d4812322a77.tar.gz
- fixed bug introduced in r4070 where union() and other compound selects would not get
an OID column if it only contained one selectable element, due to missing return in _proxy_column() - visit_column() calls itself to render a primary key col being used as the interpretation of the oid col instead of relying upon broken partial logic
Diffstat (limited to 'test/sql')
-rwxr-xr-xtest/sql/selectable.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/sql/selectable.py b/test/sql/selectable.py
index c93c62825..3ad296aaa 100755
--- a/test/sql/selectable.py
+++ b/test/sql/selectable.py
@@ -92,6 +92,16 @@ class SelectableTest(TestBase, AssertsExecutionResults):
assert u.corresponding_column(s1.c.table1_col2) is u.c.col2
assert u.corresponding_column(s2.c.table2_col2) is u.c.col2
+ def test_singular_union(self):
+ u = union(select([table.c.col1, table.c.col2, table.c.col3]), select([table.c.col1, table.c.col2, table.c.col3]))
+ assert u.oid_column is not None
+
+ u = union(select([table.c.col1, table.c.col2, table.c.col3]))
+ assert u.oid_column
+ assert u.c.col1
+ assert u.c.col2
+ assert u.c.col3
+
def testaliasunion(self):
# same as testunion, except its an alias of the union
u = select([table.c.col1, table.c.col2, table.c.col3, table.c.colx, null().label('coly')]).union(