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

 

 

Share this: