]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
CAST bind values against SQL Server sys into NVARCHAR
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 28 Jun 2019 14:41:38 +0000 (10:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 28 Jun 2019 14:41:38 +0000 (10:41 -0400)
commit345f2eb05b07713cec19c620b95ca2dfa1ca5aa0
tree9611a3a72fd81708e73c78c8d8d808e793652b91
parent502cd9240e639bd9334ac83111d22500506ca773
CAST bind values against SQL Server sys into NVARCHAR

Ensured that the queries used to reflect indexes and view definitions will
explicitly CAST string parameters into NVARCHAR, as many SQL Server drivers
frequently treat string values, particularly those with non-ascii
characters or larger string values, as TEXT which often don't compare
correctly against VARCHAR characters in SQL Server's information schema
tables for some reason.    These CAST operations already take place for
reflection queries against SQL Server ``information_schema.`` tables but
were missing from three additional queries that are against ``sys.``
tables.

Fixes: #4745
Change-Id: I3056533bf1a1e8ef17742879d369ab13f8b704ea
doc/build/changelog/unreleased_13/4745.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
test/dialect/mssql/test_reflection.py