From: Mike Bayer Date: Wed, 29 Jul 2015 21:40:47 +0000 (-0400) Subject: - Fixed support for cx_Oracle version 5.2, which was tripping X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd6c64609cbfb2e1640d9a655561274227b72058;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - 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. fixes #3491 (cherry picked from commit d8efa2257ec650b345ec6e840984387263a957a6) --- diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index 09cd298349..fb44c7d825 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -14,6 +14,17 @@ .. 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 diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index b9bbc5b655..749b2443bb 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -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