diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-07-29 17:40:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-07-29 17:40:47 -0400 |
commit | d8efa2257ec650b345ec6e840984387263a957a6 (patch) | |
tree | 87c146b0912e3fd32d6c1e7e8867b47d1558849a | |
parent | 2e52f877638ded9d8440fa94632bff0f1705a83e (diff) | |
download | sqlalchemy-d8efa2257ec650b345ec6e840984387263a957a6.tar.gz |
- 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
-rw-r--r-- | doc/build/changelog/changelog_09.rst | 11 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/oracle/cx_oracle.py | 7 |
2 files changed, 16 insertions, 2 deletions
diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index 9d781faef..be8872975 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -15,6 +15,17 @@ :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 :versions: 1.0.8 diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index 4aed45c14..dede3b21a 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -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 |