mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-29 12:06:28 -04:00
Evaluate fixes for cx_Oracle 8 API changes
in [1] we have reported some behavioral changes in cx_Oracle symbols. As it is unclear if these are intended changes in cx_Oracle, test workarounds for these changes against cx_Oracle master. [1] https://github.com/oracle/python-cx_Oracle/issues/415 Fixes: #5246 Change-Id: If63f92553c46484bf2b61b53a9e6d85cb08e800a
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
.. change::
|
||||
:tags: bug, oracle
|
||||
:tickets: 5246
|
||||
|
||||
Some modifications to how the cx_oracle dialect sets up per-column
|
||||
outputtype handlers for LOB and numeric datatypes to adjust for potential
|
||||
changes coming in cx_Oracle 8.
|
||||
|
||||
@@ -912,7 +912,11 @@ class OracleDialect_cx_oracle(OracleDialect):
|
||||
def output_type_handler(
|
||||
cursor, name, default_type, size, precision, scale
|
||||
):
|
||||
if default_type == cx_Oracle.NUMBER:
|
||||
|
||||
if (
|
||||
default_type == cx_Oracle.NUMBER
|
||||
and default_type is not cx_Oracle.NATIVE_FLOAT
|
||||
):
|
||||
if not dialect.coerce_to_decimal:
|
||||
return None
|
||||
elif precision == 0 and scale in (0, -127):
|
||||
@@ -934,9 +938,11 @@ class OracleDialect_cx_oracle(OracleDialect):
|
||||
)
|
||||
|
||||
# allow all strings to come back natively as Unicode
|
||||
elif dialect.coerce_to_unicode and default_type in (
|
||||
cx_Oracle.STRING,
|
||||
cx_Oracle.FIXED_CHAR,
|
||||
elif (
|
||||
dialect.coerce_to_unicode
|
||||
and default_type in (cx_Oracle.STRING, cx_Oracle.FIXED_CHAR,)
|
||||
and default_type is not cx_Oracle.CLOB
|
||||
and default_type is not cx_Oracle.NCLOB
|
||||
):
|
||||
if compat.py2k:
|
||||
outconverter = processors.to_unicode_processor_factory(
|
||||
@@ -1064,7 +1070,6 @@ class OracleDialect_cx_oracle(OracleDialect):
|
||||
util.coerce_kw_type(opts, "threaded", bool)
|
||||
util.coerce_kw_type(opts, "events", bool)
|
||||
util.coerce_kw_type(opts, "purity", convert_cx_oracle_constant)
|
||||
|
||||
return ([], opts)
|
||||
|
||||
def _get_server_version_info(self, connection):
|
||||
|
||||
Reference in New Issue
Block a user