summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-12-09 15:26:15 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-12-09 15:26:15 +0000
commitf508b867f119fa75e8bec76e22b11641a1ee77db (patch)
treeb88f6076bef078195afe7803e82c72298005b43e /lib/sqlalchemy
parent2672466b3a761949f146d26adbab12a58900e46d (diff)
parentfdf06c9dcf241d863d252532b801a1281f2626de (diff)
downloadsqlalchemy-f508b867f119fa75e8bec76e22b11641a1ee77db.tar.gz
Merge "Fixed compile for mssql dialect"
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py24
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):