]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed support for cx_Oracle version 5.2, which was tripping
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Jul 2015 21:40:47 +0000 (17:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Jul 2015 21:41:22 +0000 (17:41 -0400)
up SQLAlchemy's version detection under Python 3 and inadvertently
not using the correct unicode mode for Python 3.  This would cause
issues such as bound variables mis-interpreted as NULL and rows
silently not being returned.
fixes #3491

(cherry picked from commit d8efa2257ec650b345ec6e840984387263a957a6)

doc/build/changelog/changelog_09.rst
lib/sqlalchemy/dialects/oracle/cx_oracle.py

index 09cd298349843cf54cba53bd3e359df005a6d151..fb44c7d825138f263155cd6ed08de02af8c2c9b6 100644 (file)
 .. changelog::
     :version: 0.9.11
 
+    .. change::
+        :tags: bug, oracle, py3k
+        :tickets: 3491
+        :versions: 1.1.0b1, 1.0.9
+
+        Fixed support for cx_Oracle version 5.2, which was tripping
+        up SQLAlchemy's version detection under Python 3 and inadvertently
+        not using the correct unicode mode for Python 3.  This would cause
+        issues such as bound variables mis-interpreted as NULL and rows
+        silently not being returned.
+
     .. change::
         :tags: bug, engine
         :tickets: 3497
index b9bbc5b655ab0a14417f32793fc39a75f863a386..749b2443bb2a21115b9a15471ba0d4f9d20a9dc0 100644 (file)
@@ -285,6 +285,7 @@ from .base import OracleCompiler, OracleDialect, OracleExecutionContext
 from . import base as oracle
 from ...engine import result as _result
 from sqlalchemy import types as sqltypes, util, exc, processors
+from sqlalchemy import util
 import random
 import collections
 import decimal
@@ -711,8 +712,10 @@ class OracleDialect_cx_oracle(OracleDialect):
             # this occurs in tests with mock DBAPIs
             self._cx_oracle_string_types = set()
             self._cx_oracle_with_unicode = False
-        elif self.cx_oracle_ver >= (5,) and not \
-                hasattr(self.dbapi, 'UNICODE'):
+        elif util.py3k or (
+                self.cx_oracle_ver >= (5,) and not \
+                hasattr(self.dbapi, 'UNICODE')
+        ):
             # cx_Oracle WITH_UNICODE mode.  *only* python
             # unicode objects accepted for anything
             self.supports_unicode_statements = True