]> 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:34:34 +0000 (11:34 -0400)
commit66a7befa0c549b92d42afbb5be2b45da13793250
tree585179baf7f87f11512fe8fb4fa3c7aeb7ec71b6
parentdd755ca59b173dfd94c7198557553604ccdfa1c2
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
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