summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-10-20 16:15:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-10-20 16:15:54 -0400
commitdb318240d12becdf183af869b5b863979c55b050 (patch)
treed12c6e91d273d2d5c45a85a51627721c6a14383a /test
parent976df5bf96adc16ea8c97e822cf7e773b0525f78 (diff)
downloadsqlalchemy-db318240d12becdf183af869b5b863979c55b050.tar.gz
- Fixed bug where aliasing of tables with "schema" would
fail to compile properly. [ticket:1943]
Diffstat (limited to 'test')
-rw-r--r--test/dialect/test_mssql.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/dialect/test_mssql.py b/test/dialect/test_mssql.py
index c6d8d3f28..e840f9c0c 100644
--- a/test/dialect/test_mssql.py
+++ b/test/dialect/test_mssql.py
@@ -127,7 +127,6 @@ class CompileTest(TestBase, AssertsCompiledSQL):
s = table4.select(use_labels=True)
c = s.compile(dialect=self.__dialect__)
- print c.result_map
assert table4.c.rem_id \
in set(c.result_map['remote_owner_remotetable_rem_id'][1])
self.assert_compile(table4.select(),
@@ -151,7 +150,20 @@ class CompileTest(TestBase, AssertsCompiledSQL):
'remotetable_1.value FROM mytable JOIN '
'remote_owner.remotetable AS remotetable_1 '
'ON remotetable_1.rem_id = mytable.myid')
-
+
+ self.assert_compile(select([table4.c.rem_id,
+ table4.c.value]).apply_labels().union(select([table1.c.myid,
+ table1.c.description]).apply_labels()).alias().select(),
+ "SELECT anon_1.remote_owner_remotetable_rem_id, "
+ "anon_1.remote_owner_remotetable_value FROM "
+ "(SELECT remotetable_1.rem_id AS remote_owner_remotetable_rem_id, "
+ "remotetable_1.value AS remote_owner_remotetable_value "
+ "FROM remote_owner.remotetable AS remotetable_1 UNION "
+ "SELECT mytable.myid AS mytable_myid, mytable.description "
+ "AS mytable_description FROM mytable) AS anon_1"
+ )
+
+
def test_delete_schema(self):
metadata = MetaData()
tbl = Table('test', metadata, Column('id', Integer,