]> 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:53 +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
(cherry picked from commit 2ba70aba90c69152641b2cce838b3afa35c8586c)

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 3e770d6e15036191d225bc6e9cc6cfdc3e43c5b4..ad5f418350f534e7ec48a7b3d217c5941b65a078 100644 (file)
@@ -2263,7 +2263,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,
@@ -2274,9 +2273,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 80cf68740d3e1542de25aeb3ae4c7c65baa813fd..e8a04cc184f3d0d051f73d53935e5cd798249474 100644 (file)
@@ -24,6 +24,7 @@ IDENT_LENGTH = 29
 
 class MaxIdentTest(fixtures.TestBase, AssertsCompiledSQL):
     __dialect__ = "DefaultDialect"
+    __backend__ = True
 
     table1 = table(
         "some_large_named_table",