IBM Support

IC97288: THE DBMS_LOB.COMPARE FUNCTION AND DBMS_LOB.READ PROCEDURE DO NOT PROCESS CLOBS CORRECTLY IF MULTI-BYTE CHARACTERS ARE PRESENT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The dbms_lob.compare function incorrectly expects the unit of
    measurement for the offset_1 and offset_2 parameters to be read
    in terms of the number of bytes, regardless of the type of data
    passed to the lob_1 and lob_2 parameters.  Instead, the
    dbms_lob.compare function should use number of characters as the
    unit of measurement for these parameters in order to correctly
    handle multi-byte character sets.
    
    For example, the following call to the dbms_lob.compare function
    should compare the 2nd character of each string and return -1
    because "a" is not equal to "b".  However, it return 0 because
    it is comparing the second byte of the the double-byte character
    "チ" to the second byte of the character "チ".
    db2 "values(dbms_lob.compare(clob('チa'), clob('チb'), 1, 2, 2))"
    
    Similarly, the following command should fail with SQL0138N (A
    numeric argument of a built-in string function is out of range.
    SQLSTATE=22011), but it returns -1 instead.
    db2 "values(dbms_lob.compare(clob('チa'), clob('チb'), 1, 3, 3))"
    
    The problem can only be hit when the database codepage supports
    multi-byte characters.
    
    The dbms_lob.read procedure has the same problem with the
    "offset" and "amount" parameters.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Applications using DBMS_LOB.COMPARE AND /OR DBMS_LOB.READ    *
    * with multi-byte character data                               *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Please, apply this APAR and recreate system modules using    *
    * db2updvX command.                                            *
    ****************************************************************
    

Problem conclusion

  • Please, apply this APAR and recreate system modules using
    db2updvX command.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC97288

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-29

  • Closed date

    2013-12-23

  • Last modified date

    2014-11-06

  • APAR is sysrouted FROM one or more of the following:

    IC95046

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSY

       UP

  • RA10 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
06 November 2014