]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
change the POSTCOMPILE/ SCHEMA symbols to not conflict w mssql quoting
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 8 Nov 2021 23:29:16 +0000 (18:29 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Nov 2021 20:30:58 +0000 (15:30 -0500)
commitb919a0a85afd5066f9188b20ef06ee1b4af884a9
tree39536ce18d644aae3488905ba501aeffcee8337b
parentcf404d840c15fe167518dd884b295dc99ee26178
change the POSTCOMPILE/ SCHEMA symbols to not conflict w mssql quoting

Adjusted the compiler's generation of "post compile" symbols including
those used for "expanding IN" as well as for the "schema translate map" to
not be based directly on plain bracketed strings with underscores, as this
conflicts directly with SQL Server's quoting format of also using brackets,
which produces false matches when the compiler replaces "post compile" and
"schema translate" symbols. The issue created easy to reproduce examples
both with the :meth:`.Inspector.get_schema_names` method when used in
conjunction with the
:paramref:`_engine.Connection.execution_options.schema_translate_map`
feature, as well in the unlikely case that a symbol overlapping with the
internal name "POSTCOMPILE" would be used with a feature like "expanding
in".

Fixes: #7300
Change-Id: I6255c850b140522a4aba95085216d0bca18ce230
34 files changed:
doc/build/changelog/unreleased_14/7300.rst [new file with mode: 0644]
doc/build/core/operators.rst
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/testing/suite/test_reflection.py
lib/sqlalchemy/testing/suite/test_select.py
test/dialect/mssql/test_compiler.py
test/dialect/mssql/test_query.py
test/dialect/oracle/test_compiler.py
test/dialect/postgresql/test_types.py
test/dialect/test_sqlite.py
test/engine/test_execute.py
test/orm/declarative/test_mixin.py
test/orm/inheritance/test_deprecations.py
test/orm/inheritance/test_poly_loading.py
test/orm/inheritance/test_relationship.py
test/orm/inheritance/test_single.py
test/orm/test_ac_relationships.py
test/orm/test_deferred.py
test/orm/test_deprecations.py
test/orm/test_froms.py
test/orm/test_lockmode.py
test/orm/test_of_type.py
test/orm/test_query.py
test/orm/test_relationship_criteria.py
test/orm/test_relationships.py
test/orm/test_selectin_relations.py
test/sql/test_compiler.py
test/sql/test_deprecations.py
test/sql/test_external_traversal.py
test/sql/test_lambdas.py
test/sql/test_operators.py
test/sql/test_selectable.py
test/sql/test_type_expressions.py