diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-06-06 22:24:07 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-06-06 22:24:07 -0400 |
commit | 9a34d9a83fa40a27c6e9ab5c275c48716895574c (patch) | |
tree | 624a8b9aa32adfcfa7b616e6f3c1c5e7f8bdbd44 | |
parent | 2291c0a59a626abc1c23a3ba16b72574de2d3e98 (diff) | |
download | sqlalchemy-9a34d9a83fa40a27c6e9ab5c275c48716895574c.tar.gz |
- Adjusted the pyodbc dialect such that bound
values are passed as bytes and not unicode
if the "Easysoft" unix drivers are detected.
This is the same behavior as occurs with
FreeTDS. Easysoft appears to segfault
if Python unicodes are passed under
certain circumstances.
-rw-r--r-- | CHANGES | 11 | ||||
-rw-r--r-- | lib/sqlalchemy/__init__.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/connectors/pyodbc.py | 14 |
3 files changed, 22 insertions, 5 deletions
@@ -3,6 +3,17 @@ ======= CHANGES ======= +0.7.2 +===== +- mssql + - Adjusted the pyodbc dialect such that bound + values are passed as bytes and not unicode + if the "Easysoft" unix drivers are detected. + This is the same behavior as occurs with + FreeTDS. Easysoft appears to segfault + if Python unicodes are passed under + certain circumstances. + 0.7.1 ===== - general diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py index 5da63c9af..cf7ebd22c 100644 --- a/lib/sqlalchemy/__init__.py +++ b/lib/sqlalchemy/__init__.py @@ -117,6 +117,6 @@ from sqlalchemy.engine import create_engine, engine_from_config __all__ = sorted(name for name, obj in locals().items() if not (name.startswith('_') or inspect.ismodule(obj))) -__version__ = '0.7.1' +__version__ = '0.7.2' del inspect, sys diff --git a/lib/sqlalchemy/connectors/pyodbc.py b/lib/sqlalchemy/connectors/pyodbc.py index 3f6d6cb5f..ea4810df7 100644 --- a/lib/sqlalchemy/connectors/pyodbc.py +++ b/lib/sqlalchemy/connectors/pyodbc.py @@ -29,6 +29,10 @@ class PyODBCConnector(Connector): # if the freetds.so is detected freetds = False + # will be set to True after initialize() + # if the libessqlsrv.so is detected + easysoft = False + @classmethod def dbapi(cls): return __import__('pyodbc') @@ -98,15 +102,17 @@ class PyODBCConnector(Connector): dbapi_con = connection.connection - self.freetds = bool(re.match(r".*libtdsodbc.*\.so", - dbapi_con.getinfo(pyodbc.SQL_DRIVER_NAME) + _sql_driver_name = dbapi_con.getinfo(pyodbc.SQL_DRIVER_NAME) + self.freetds = bool(re.match(r".*libtdsodbc.*\.so", _sql_driver_name + )) + self.easysoft = bool(re.match(r".*libessqlsrv.*\.so", _sql_driver_name )) # the "Py2K only" part here is theoretical. # have not tried pyodbc + python3.1 yet. # Py2K - self.supports_unicode_statements = not self.freetds - self.supports_unicode_binds = not self.freetds + self.supports_unicode_statements = not self.freetds and not self.easysoft + self.supports_unicode_binds = not self.freetds and not self.easysoft # end Py2K # run other initialization which asks for user name, etc. |