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 /lib/sqlalchemy/databases/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 'lib/sqlalchemy/databases/mssql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mssql.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index 1c4a2c286..849d58507 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -938,13 +938,19 @@ class MSSQLCompiler(compiler.DefaultCompiler): kwargs['mssql_aliased'] = True return super(MSSQLCompiler, self).visit_alias(alias, **kwargs) - def visit_column(self, column, **kwargs): + def visit_column(self, column, result_map=None, **kwargs): if column.table is not None and not self.isupdate and not self.isdelete: # translate for schema-qualified table aliases t = self._schema_aliased_table(column.table) if t is not None: - return self.process(expression._corresponding_column_or_error(t, column)) - return super(MSSQLCompiler, self).visit_column(column, **kwargs) + converted = expression._corresponding_column_or_error(t, column) + + if result_map is not None: + result_map[column.name.lower()] = (column.name, (column, ), column.type) + + return super(MSSQLCompiler, self).visit_column(converted, result_map=None, **kwargs) + + return super(MSSQLCompiler, self).visit_column(column, result_map=result_map, **kwargs) def visit_binary(self, binary, **kwargs): """Move bind parameters to the right-hand side of an operator, where possible.""" |