From: Mike Bayer Date: Mon, 7 Oct 2019 20:12:30 +0000 (-0400) Subject: Fix max_identifier_length for SQL server X-Git-Tag: rel_1_3_10~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7d7f980146a79f567d6f5e091932e59458bb6e4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix max_identifier_length for SQL server 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) --- diff --git a/doc/build/changelog/unreleased_13/4857.rst b/doc/build/changelog/unreleased_13/4857.rst new file mode 100644 index 0000000000..066e15a276 --- /dev/null +++ b/doc/build/changelog/unreleased_13/4857.rst @@ -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. + diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 3e770d6e15..ad5f418350 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -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 diff --git a/test/sql/test_labels.py b/test/sql/test_labels.py index 80cf68740d..e8a04cc184 100644 --- a/test/sql/test_labels.py +++ b/test/sql/test_labels.py @@ -24,6 +24,7 @@ IDENT_LENGTH = 29 class MaxIdentTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = "DefaultDialect" + __backend__ = True table1 = table( "some_large_named_table",