The Oracle LONG type, while an unbounded text type, does not appear
to use the cx_Oracle.LOB type when result rows are returned, so the dialect has been repaired to exclude LONG from having cx_Oracle.LOB filtering applied. [ticket:2620]
This commit is contained in:
parent
a1405b3d5a
commit
f2909ff71b
|
@ -27,6 +27,15 @@
|
||||||
to the MSSQL dialect's "schema rendering"
|
to the MSSQL dialect's "schema rendering"
|
||||||
logic's failure to take .key into account.
|
logic's failure to take .key into account.
|
||||||
|
|
||||||
|
.. change::
|
||||||
|
:tags: oracle, bug
|
||||||
|
:tickets: 2620
|
||||||
|
|
||||||
|
The Oracle LONG type, while an unbounded text type, does not appear
|
||||||
|
to use the cx_Oracle.LOB type when result rows are returned,
|
||||||
|
so the dialect has been repaired to exclude LONG from
|
||||||
|
having cx_Oracle.LOB filtering applied.
|
||||||
|
|
||||||
.. change::
|
.. change::
|
||||||
:tags: oracle, bug
|
:tags: oracle, bug
|
||||||
:tickets: 2611
|
:tickets: 2611
|
||||||
|
|
|
@ -283,6 +283,13 @@ class _OracleText(_LOBMixin, sqltypes.Text):
|
||||||
def get_dbapi_type(self, dbapi):
|
def get_dbapi_type(self, dbapi):
|
||||||
return dbapi.CLOB
|
return dbapi.CLOB
|
||||||
|
|
||||||
|
class _OracleLong(oracle.LONG):
|
||||||
|
# a raw LONG is a text type, but does *not*
|
||||||
|
# get the LobMixin with cx_oracle.
|
||||||
|
|
||||||
|
def get_dbapi_type(self, dbapi):
|
||||||
|
return dbapi.LONG_STRING
|
||||||
|
|
||||||
class _OracleString(_NativeUnicodeMixin, sqltypes.String):
|
class _OracleString(_NativeUnicodeMixin, sqltypes.String):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -502,6 +509,11 @@ class OracleDialect_cx_oracle(OracleDialect):
|
||||||
sqltypes.String : _OracleString,
|
sqltypes.String : _OracleString,
|
||||||
sqltypes.UnicodeText : _OracleUnicodeText,
|
sqltypes.UnicodeText : _OracleUnicodeText,
|
||||||
sqltypes.CHAR : _OracleChar,
|
sqltypes.CHAR : _OracleChar,
|
||||||
|
|
||||||
|
# a raw LONG is a text type, but does *not*
|
||||||
|
# get the LobMixin with cx_oracle.
|
||||||
|
oracle.LONG: _OracleLong,
|
||||||
|
|
||||||
sqltypes.Integer : _OracleInteger, # this is only needed for OUT parameters.
|
sqltypes.Integer : _OracleInteger, # this is only needed for OUT parameters.
|
||||||
# it would be nice if we could not use it otherwise.
|
# it would be nice if we could not use it otherwise.
|
||||||
oracle.RAW: _OracleRaw,
|
oracle.RAW: _OracleRaw,
|
||||||
|
|
|
@ -1189,6 +1189,21 @@ class TypesTest(fixtures.TestBase):
|
||||||
finally:
|
finally:
|
||||||
t1.drop()
|
t1.drop()
|
||||||
|
|
||||||
|
@testing.provide_metadata
|
||||||
|
def test_long_type(self):
|
||||||
|
metadata = self.metadata
|
||||||
|
|
||||||
|
t = Table('t', metadata,
|
||||||
|
Column('data', oracle.LONG)
|
||||||
|
)
|
||||||
|
metadata.create_all(testing.db)
|
||||||
|
testing.db.execute(t.insert(), data='xyz')
|
||||||
|
eq_(
|
||||||
|
testing.db.scalar(select([t.c.data])),
|
||||||
|
"xyz"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_longstring(self):
|
def test_longstring(self):
|
||||||
metadata = MetaData(testing.db)
|
metadata = MetaData(testing.db)
|
||||||
|
|
Loading…
Reference in New Issue