summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2020-07-17 18:06:41 -0600
committerGord Thompson <gord@gordthompson.com>2020-07-18 06:49:19 -0600
commit547e959157f841f4f6d1e405ceed14755fcbd0bd (patch)
tree99e288566eaeb65d62b37424bc6aaa7c4149b8e5 /lib
parent4d277a24652c1092b2bacd73dbb6b465a5554594 (diff)
downloadsqlalchemy-547e959157f841f4f6d1e405ceed14755fcbd0bd.tar.gz
Fix mssql dialect escaping object names containing ']'
Fixes: #5467 Change-Id: I054ec219717ba62847a9daf1214e215dd6b70633
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index c3cc4e425..0ec6cf8a3 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -2244,7 +2244,10 @@ class MSIdentifierPreparer(compiler.IdentifierPreparer):
)
def _escape_identifier(self, value):
- return value
+ return value.replace("]", "]]")
+
+ def _unescape_identifier(self, value):
+ return value.replace("]]", "]")
def quote_schema(self, schema, force=None):
"""Prepare a quoted table and schema name."""