]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Adjusted the pyodbc dialect such that bound
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Jun 2011 02:24:07 +0000 (22:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Jun 2011 02:24:07 +0000 (22:24 -0400)
    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.

CHANGES
lib/sqlalchemy/__init__.py
lib/sqlalchemy/connectors/pyodbc.py

diff --git a/CHANGES b/CHANGES
index 345447674234430af41d3519fcac0cd01ae28f45..9eeeb725ae795c2d8866eeec040fe15277899d77 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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
index 5da63c9af8357bde62a867717333f8a783ec17c7..cf7ebd22cdac694796c286492e21dd72d220bc75 100644 (file)
@@ -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
index 3f6d6cb5facbaebec2f6a5d1e76cf4d2d7f4e7e0..ea4810df7aad49ad3b6251fa6d5efefc72c5332d 100644 (file)
@@ -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.