]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Apply quoting to SQL Server _switch_db
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 3 Oct 2019 15:18:06 +0000 (11:18 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 3 Oct 2019 15:35:14 +0000 (11:35 -0400)
commita0f47903711afc6ea438d8c6655f3f8011216afd
tree29b2b3787bf40149910efd029d85871a5e6bea0d
parent5188afe8703b7c8e03086d3898a4f44038316a57
Apply quoting to SQL Server _switch_db

Added identifier quoting to the schema name applied to the "use" statement
which is invoked when a SQL Server multipart schema name is used within  a
:class:`.Table` that is being reflected, as well as for :class:`.Inspector`
methods such as :meth:`.Inspector.get_table_names`; this accommodates for
special characters or spaces in the database name.  Additionally, the "use"
statement is not emitted if the current database matches the target owner
database name being passed.

Fixes: #4883
Change-Id: I84419730e94aac3a88d331ad8c24d10aabbc34af
(cherry picked from commit 66a7befa0c549b92d42afbb5be2b45da13793250)
doc/build/changelog/unreleased_13/4883.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
test/dialect/mssql/test_compiler.py
test/dialect/mssql/test_reflection.py