diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-12-09 15:26:15 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-12-09 15:26:15 +0000 |
| commit | f508b867f119fa75e8bec76e22b11641a1ee77db (patch) | |
| tree | b88f6076bef078195afe7803e82c72298005b43e /lib/sqlalchemy | |
| parent | 2672466b3a761949f146d26adbab12a58900e46d (diff) | |
| parent | fdf06c9dcf241d863d252532b801a1281f2626de (diff) | |
| download | sqlalchemy-f508b867f119fa75e8bec76e22b11641a1ee77db.tar.gz | |
Merge "Fixed compile for mssql dialect"
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mssql/base.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 9addbf31f..911e1791a 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -2286,18 +2286,6 @@ class MSDDLCompiler(compiler.DDLCompiler): ), ) - whereclause = index.dialect_options["mssql"]["where"] - - if whereclause is not None: - whereclause = coercions.expect( - roles.DDLExpressionRole, whereclause - ) - - where_compiled = self.sql_compiler.process( - whereclause, include_table=False, literal_binds=True - ) - text += " WHERE " + where_compiled - # handle other included columns if index.dialect_options["mssql"]["include"]: inclusions = [ @@ -2311,6 +2299,18 @@ class MSDDLCompiler(compiler.DDLCompiler): [preparer.quote(c.name) for c in inclusions] ) + whereclause = index.dialect_options["mssql"]["where"] + + if whereclause is not None: + whereclause = coercions.expect( + roles.DDLExpressionRole, whereclause + ) + + where_compiled = self.sql_compiler.process( + whereclause, include_table=False, literal_binds=True + ) + text += " WHERE " + where_compiled + return text def visit_drop_index(self, drop): |
