]> 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:40:47 +0000 (17:40 -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

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

index 9d781faef5ccc2f9984c692b94157d3f391c4487..be8872975f0cfd1d1a96b683ebdbfafb37c21d96 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 4aed45c14697374daa146522d4a8fe8e2be96fd3..dede3b21a6b67c181a4b01c1fba05b3db1dd251b 100644 (file)
@@ -293,6 +293,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
@@ -719,8 +720,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