Changes between Version 1 and Version 2 of Ticket #11487, comment 23


Ignore:
Timestamp:
Mar 3, 2011, 1:55:50 AM (14 years ago)
Author:
Goldan

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11487, comment 23

    v1 v2  
    77
    88
    9 causes the following error when inserting more than 4000 characters.
     9causes the following error when inserting more than 4000 characters (I'm trying to add a new flatpage):
    1010
    1111
    1212{{{
    13 DatabaseError: ORA-12704: character set mismatch
     13DatabaseError at /admin/flatpages/flatpage/1/
     14ORA-12704: character set mismatch
    1415}}}
    1516
     17I've tried to change the string in oracle/base.py (self.input_size = Database.CLOB) to LONG_STRING and NCLOB. All three variants produce errors. I'm struggling with the issue for several days, so I've tested on various cx_Oracle versions.
    1618
    17 Changing it to
     19I've made tests on three cx_Oracle versions: 4.4.1, 5.0.4 and 5.0.4 with WITH_UNICODE compilation flag.
    1820
     21I've made tests on two strings: cyrillic string of length 10350 symbols (the string can be found on http://dumpz.org/37744/text/) and a simple latin string of 16004 symbols "a".
    1922
     23During the tests, I was getting three types of errors:
     24
     251. (hieroglyphs) The text is being saved without errors, but it is displayed as hieroglyphs (e.g. 慡)
     262. (mismatch) The text is not saved, and the following error is returned:
    2027{{{
    21 self.input_size = Database.LONG_STRING
     28DatabaseError at /admin/flatpages/flatpage/1/
     29ORA-12704: character set mismatch
     30}}}
     313. (!UnicodeDecodeError) The text is saved, but when trying to display it, an exception is raised:
     32{{{
     33UnicodeDecodeError at /admin/flatpages/flatpage/1/
     34'utf16' codec can't decode bytes in position 44-45: illegal encoding
    2235}}}
    2336
     37The distribution of types of errors is the following:
    2438
    25 (as initially suggested by the reporter) works ok.
     391. Cyrillic string:
     401.1. cx_Oracle 4.4.1.
     41CLOB: mismatch,
     42LONG_STRING: hieroglyphs,
     43NCLOB: hieroglyphs.
    2644
    27 I've attached the patch and a test case that fails with CLOB.
     451.2. cx_Oracle 5.0.4.
     46CLOB: mismatch,
     47LONG_STRING: !UnicodeDecodeError,
     48NCLOB: !UnicodeDecodeError.
    2849
    29 I'm using cx_Oracle version 5.0.4 with unicode support, Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production and Django development version.
     501.3. cx_Oracle 5.0.4 + WITH_UNICODE.
     51CLOB: mismatch,
     52LONG_STRING: !UnicodeDecodeError,
     53NCLOB: mismatch.
     54
     552. Latin string:
     562.1. cx_Oracle 4.4.1.
     57CLOB: mismatch,
     58LONG_STRING: hieroglyphs,
     59NCLOB: hieroglyphs.
     60
     612.2. cx_Oracle 5.0.4.
     62CLOB: mismatch,
     63LONG_STRING: hieroglyphs,
     64NCLOB: hieroglyphs.
     65
     662.3. cx_Oracle 5.0.4 + WITH_UNICODE.
     67CLOB: mismatch,
     68LONG_STRING: hieroglyphs,
     69NCLOB: mismatch.
     70
     71I'm using Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production and Django development version.
Back to Top