diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-04-02 16:35:06 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-04-02 16:35:06 +0000 |
commit | 38b2869bb8a940949a44e6d51617d31e53570aae (patch) | |
tree | 49e88cf80afdd3f0e4a9c8e59f9db10fd1ab318a /test/dialect/mssql.py | |
parent | fef66e5c5b9f7706545fe2263fe8fe71df78f527 (diff) | |
download | sqlalchemy-38b2869bb8a940949a44e6d51617d31e53570aae.tar.gz |
some fixes to the MS-SQL aliasing so that result_map is properly populated
Diffstat (limited to 'test/dialect/mssql.py')
-rwxr-xr-x | test/dialect/mssql.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dialect/mssql.py b/test/dialect/mssql.py index 2adbca6b8..857aa2b5b 100755 --- a/test/dialect/mssql.py +++ b/test/dialect/mssql.py @@ -52,7 +52,18 @@ class CompileTest(TestBase, AssertsCompiledSQL): schema = 'remote_owner' ) + s = table4.select() + c = s.compile(dialect=self.__dialect__) + assert table4.c.rem_id in set(c.result_map['rem_id'][1]) + + 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(), "SELECT remotetable_1.rem_id, remotetable_1.datatype_id, remotetable_1.value FROM remote_owner.remotetable AS remotetable_1") + + self.assert_compile(table4.select(use_labels=True), "SELECT remotetable_1.rem_id AS remote_owner_remotetable_rem_id, remotetable_1.datatype_id AS remote_owner_remotetable_datatype_id, remotetable_1.value AS remote_owner_remotetable_value FROM remote_owner.remotetable AS remotetable_1") self.assert_compile(table1.join(table4, table1.c.myid==table4.c.rem_id).select(), "SELECT mytable.myid, mytable.name, mytable.description, remotetable_1.rem_id, remotetable_1.datatype_id, remotetable_1.value FROM mytable JOIN remote_owner.remotetable AS remotetable_1 ON remotetable_1.rem_id = mytable.myid") |