From 47a799ecd5d03b78e5d67918302c0da2950d27b8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 1 Apr 2012 19:42:54 -0400 Subject: - sql - [bug] Removed warning when Index is created with no columns; while this might not be what the user intended, it is a valid use case as an Index could be a placeholder for just an index of a certain name. - mssql - [feature] Added interim create_engine flag supports_unicode_binds to PyODBC dialect, to force whether or not the dialect passes Python unicode literals to PyODBC or not. --- lib/sqlalchemy/connectors/pyodbc.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/connectors/pyodbc.py') diff --git a/lib/sqlalchemy/connectors/pyodbc.py b/lib/sqlalchemy/connectors/pyodbc.py index 439b8f4fe..a684a2dcb 100644 --- a/lib/sqlalchemy/connectors/pyodbc.py +++ b/lib/sqlalchemy/connectors/pyodbc.py @@ -37,6 +37,10 @@ class PyODBCConnector(Connector): # if the libessqlsrv.so is detected easysoft = False + def __init__(self, supports_unicode_binds=None, **kw): + super(PyODBCConnector, self).__init__(**kw) + self._user_supports_unicode_binds = supports_unicode_binds + @classmethod def dbapi(cls): return __import__('pyodbc') @@ -119,8 +123,12 @@ class PyODBCConnector(Connector): # have not tried pyodbc + python3.1 yet. # Py2K self.supports_unicode_statements = not self.freetds and not self.easysoft - self.supports_unicode_binds = (not self.freetds or - self.freetds_driver_version >= '0.91') and not self.easysoft + if self._user_supports_unicode_binds is not None: + self.supports_unicode_binds = self._user_supports_unicode_binds + else: + self.supports_unicode_binds = (not self.freetds or + self.freetds_driver_version >= '0.91' + ) and not self.easysoft # end Py2K # run other initialization which asks for user name, etc. -- cgit v1.2.1