1. idank
  2. sqlalchemy

Commits

Mike Bayer  committed 54c2584

- fixed unicode conversion in Oracle TEXT type

  • Participants
  • Parent commits 905c976
  • Branches default

Comments (0)

Files changed (3)

File CHANGES

View file
  • Ignore whitespace
     - mod operator '%' produces MOD [ticket:624]
     - converts cx_oracle datetime objects to Python datetime.datetime when
       Python 2.3 used [ticket:542]
+    - fixed unicode conversion in Oracle TEXT type
 - postgres
     - fixed escaping of the modulo operator [ticket:624]
     - added support for reflection of domains [ticket:570]

File lib/sqlalchemy/databases/oracle.py

View file
  • Ignore whitespace
         if value is None:
             return None
         else:
-            return value.read()
+            return super(OracleText, self).convert_result_value(value.read(), dialect)
+
 
 class OracleRaw(sqltypes.Binary):
     def get_col_spec(self):

File test/sql/testtypes.py

View file
  • Ignore whitespace
         col = Column('', MyDecoratedType)
         dialect_type = col.type.dialect_impl(dialect)
         assert isinstance(dialect_type.impl, oracle.OracleText), repr(dialect_type.impl)
-    
+
+
     def testoracletimestamp(self):
         dialect = oracle.OracleDialect()
         t1 = oracle.OracleTimestamp
         finally:
             db.engine.dialect.convert_unicode = prev_unicode
 
+    @testbase.unsupported('oracle')
     def testlength(self):
         """checks the database correctly understands the length of a unicode string"""
         teststr = u'aaa\x1234'
         global interval_table, metadata
         metadata = MetaData(testbase.db)
         interval_table = Table("intervaltable", metadata, 
-            Column("id", Integer, primary_key=True),
+            Column("id", Integer, Sequence('interval_id_seq', optional=True), primary_key=True),
             Column("interval", Interval),
             )
         metadata.create_all()