Special characters show junk in CLOB columns after upgrade to Oracle 12.2.0.1 with JDBC

Special characters show junk in CLOB columns after upgrade to Oracle 12.2.0.1 with JDBCThanks to my support colleague Roland Graeff who told me about this issue at a customer today. And I consider this a pretty serious issue. It can happen that Special characters show junk in CLOB columns after upgrade to Oracle 12.2.0.1. with JDBC.

This is as bad as it sounds. Roland told me about a case where the application showed weird characters instead of German umlauts (ä, ö, ü, Ä, Ö, Ü) after an upgrade from Oracle Database 12.1.0.2 to 12.2.0.1.

Special characters show junk in CLOB columns after upgrade to Oracle 12.2.0.1 with JDBC

Roland explained to me that his customer is hitting bug 26380097. The bug title is a bit misleading as it says “GEORGIAN CHARACTERS DONOT DISPLAYED CORRECTLY FOR CLOB WITH MYCLOB.GETSUBSTRING“. The issue does not apply to Georgian characters only but can happen with all non-ASCII characters as far as my understanding goes. So everybody who does store non-ASCII characters in CLOBs in the database will need this patch most likely when using a JDBC application. A customer from Georgia hit this issue at first. This lead to the bug tagline.

The issue happens because the server sends CLOB data to the client expecting the client to do a conversion but the client (JDBC) does not do the conversion, and thus the server shouldn’t send it unconverted. The fix corrects this and handles the conversion of CLOBs on the server side.

You’ll get the fix automatically with Oracle Database 18c as the fix went into 18c. And there are a few one-off patches available on MOS.

Special characters show junk in CLOB columns after upgrade to Oracle 12.2.0.1

Patch 26380097 – Download from MyOracle Support

If the patch is not available on top of your patch bundle for your platform, you may have to request it. Or you use the below mentioned patch bundles which include the fix.

Testcase

On MOS you’ll find this note containing a pretty simple testcase:

Hence, I don’t reproduce it here. The issue does not exist with Oracle 11.2.0.4, Oracle 12.1.0.2 and Oracle 18c.

You can find other MOS Notes such as: MOS Note: 2373661.1 – Non English Characters Not Shown Correctly in JDBC Application after Upgrade of Database from 11.2 to 12.2 but they all refer to the same issue.

The Fix

The fix for bug 26380097 is included:

  • In Oracle 18c
  • In the October 2017 Bundle Patch for Windows
  • Is supposed to be included in the July 2018 Update for Oracle 12.2.0.1

And please never forget:
When you apply a single fix or a patch bundle, you must run datapatch afterwards. Otherwise the fix may not take effect (and in this case it really doesn’t take effect unless you execute datapatch).

–Mike

 

 

2 thoughts on “Special characters show junk in CLOB columns after upgrade to Oracle 12.2.0.1 with JDBC

  1. Hi Mike,

    thank you for that important update!

    The testcase shows that this bug could hit me everytime I insert umlauts into a clob column. The values are not destroyed only once after the upgrade, like your headline suggests.

    Do you know if the problem persists when using UTF charactersets?

    Cheers
    Kay.

    • Kay,

      somebody on LinkedIn did ask the exact same question.

      I’m not a client person. I suspect that the issue may not happen with UTF charactersets for two reasons:
      /a/ the JDBC client should operate with Unicode per se and therefore may not require a conversion when data gets sent from the server
      /b/ all information in bugs and SRs I have seen is bound to WE8 or EE8 charactersets but not to Unicode.

      Unfortunately I can’t tell it right now. I have sent an email to the bug owner and asked for clarification. As soon as I have more information I will update the blog post.

      Cheers,
      Mike

Leave a Reply

Your email address will not be published. Required fields are marked *

* Checkbox to comply with GDPR is required

*

I agree

This site uses Akismet to reduce spam. Learn how your comment data is processed.