summaryrefslogtreecommitdiff
path: root/test/dialect/mssql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-10-03 11:18:06 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-10-03 11:34:34 -0400
commit66a7befa0c549b92d42afbb5be2b45da13793250 (patch)
tree585179baf7f87f11512fe8fb4fa3c7aeb7ec71b6 /test/dialect/mssql/test_compiler.py
parentdd755ca59b173dfd94c7198557553604ccdfa1c2 (diff)
downloadsqlalchemy-66a7befa0c549b92d42afbb5be2b45da13793250.tar.gz
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
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r--test/dialect/mssql/test_compiler.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py
index 4f656a36c..00a8a08fc 100644
--- a/test/dialect/mssql/test_compiler.py
+++ b/test/dialect/mssql/test_compiler.py
@@ -20,7 +20,6 @@ from sqlalchemy import union
from sqlalchemy import UniqueConstraint
from sqlalchemy import update
from sqlalchemy.dialects import mssql
-from sqlalchemy.dialects.mssql import base
from sqlalchemy.dialects.mssql import mxodbc
from sqlalchemy.dialects.mssql.base import try_cast
from sqlalchemy.sql import column
@@ -480,21 +479,6 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
select([tbl]), "SELECT [Foo].dbo.test.id FROM [Foo].dbo.test"
)
- def test_owner_database_pairs(self):
- dialect = mssql.dialect()
-
- for identifier, expected_schema, expected_owner in [
- ("foo", None, "foo"),
- ("foo.bar", "foo", "bar"),
- ("Foo.Bar", "Foo", "Bar"),
- ("[Foo.Bar]", None, "Foo.Bar"),
- ("[Foo.Bar].[bat]", "Foo.Bar", "bat"),
- ]:
- schema, owner = base._owner_plus_db(dialect, identifier)
-
- eq_(owner, expected_owner)
- eq_(schema, expected_schema)
-
def test_delete_schema(self):
metadata = MetaData()
tbl = Table(