diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-08 18:29:16 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-09 15:30:58 -0500 |
commit | b919a0a85afd5066f9188b20ef06ee1b4af884a9 (patch) | |
tree | 39536ce18d644aae3488905ba501aeffcee8337b /test/dialect/test_sqlite.py | |
parent | cf404d840c15fe167518dd884b295dc99ee26178 (diff) | |
download | sqlalchemy-b919a0a85afd5066f9188b20ef06ee1b4af884a9.tar.gz |
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
Diffstat (limited to 'test/dialect/test_sqlite.py')
-rw-r--r-- | test/dialect/test_sqlite.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index a2fe81a4b..f1efaf7a6 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -1156,7 +1156,7 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL): .in_([(1, 2), (3, 4)]) .compile(dialect=sqlite.dialect()) ) - eq_(str(compiled), "(q, p) IN ([POSTCOMPILE_param_1])") + eq_(str(compiled), "(q, p) IN (__[POSTCOMPILE_param_1])") eq_( compiled._literal_execute_expanding_parameter( "param_1", |