]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix max_identifier_length for SQL server
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 7 Oct 2019 20:12:30 +0000 (16:12 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 7 Oct 2019 20:13:20 +0000 (16:13 -0400)
Fixed bug in SQL Server dialect with new "max_identifier_length" feature
where the mssql dialect already featured this flag, and the implementation
did not accommodate for the new initialization hook correctly.

Fixes: #4857
Change-Id: I96a9c6ca9549d8f6fb167c0333f684e8d922a3bf

doc/build/changelog/unreleased_13/4857.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
test/sql/test_labels.py

diff --git a/doc/build/changelog/unreleased_13/4857.rst b/doc/build/changelog/unreleased_13/4857.rst
new file mode 100644 (file)
index 0000000..066e15a
--- /dev/null
@@ -0,0 +1,8 @@
+.. change::
+    :tags: bug, mssql
+    :tickets: 4857
+
+    Fixed bug in SQL Server dialect with new "max_identifier_length" feature
+    where the mssql dialect already featured this flag, and the implementation
+    did not accommodate for the new initialization hook correctly.
+
index 94c2cbe6df4b4448fce1501b5bd60a4b6117e477..6c7895ea13e6f97262adb2997ff8a4dcbc49aa69 100644 (file)
@@ -2292,7 +2292,6 @@ class MSDialect(default.DefaultDialect):
         self,
         query_timeout=None,
         use_scope_identity=True,
-        max_identifier_length=None,
         schema_name="dbo",
         isolation_level=None,
         deprecate_large_types=None,
@@ -2303,9 +2302,6 @@ class MSDialect(default.DefaultDialect):
         self.schema_name = schema_name
 
         self.use_scope_identity = use_scope_identity
-        self.max_identifier_length = (
-            int(max_identifier_length or 0) or self.max_identifier_length
-        )
         self.deprecate_large_types = deprecate_large_types
         self.legacy_schema_aliasing = legacy_schema_aliasing
 
index e953e71a1a760ca417bf750814f6495cb1772181..e4589581751f214b94d0ad3cc71495d3c0682ea4 100644 (file)
@@ -33,6 +33,7 @@ IDENT_LENGTH = 29
 
 class MaxIdentTest(fixtures.TestBase, AssertsCompiledSQL):
     __dialect__ = "DefaultDialect"
+    __backend__ = True
 
     table1 = table(
         "some_large_named_table",