IBM Support

IC76679: INCORRECT RESULTS ARE RETURNED IF AN SQL QUERY CONTAINS RID(), RID_BIT() or ROWID

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Incorrect results are returned if a query contains RID(),
    RID_BIT() or ROWID.
    
    Example:
    
    db2 => CREATE TABLE  TA(C1 VARCHAR(30), C2 VARCHAR(3))
    db2 => CREATE TABLE  TB(C1 VARCHAR(50), c2 VARCHAR(3))
    
    db2 => INSERT INTO TA VALUES('EAD0401','abc')
    db2 => INSERT INTO TB VALUES('Z030_075','123')
    
    Incorrect result 1 row is returned for below SQL:
    
    SELECT
        A.ROWID,
        A.C1
    FROM TA A, TB B
    WHERE ( A.C2 = 'XX'
            OR (A.C1 = 'EAD0401' AND B.C1 = 'XXX')
            OR (A.C1 = 'XXX' AND B.C1 = 'XXX')
          );
    
    1                                  C1
    ---------------------------------------------------------------
    
    
    x'04000000000000000000A204F3040000' EAD0401
    
    The expected result is 0 row.
    
    This problem only occurs with DB2 V9.7 and does not affect V9.1
    or V9.5.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * user of ROWID function                                       *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * Incorrect results are returned if a query contains RID(),    *
    * RID_BIT() or ROWID.                                          *
    *                                                              *
    * Example:                                                     *
    *                                                              *
    * db2 => CREATE TABLE  TA(C1 VARCHAR(30), C2 VARCHAR(3))       *
    * db2 => CREATE TABLE  TB(C1 VARCHAR(50), c2 VARCHAR(3))       *
    *                                                              *
    * db2 => INSERT INTO TA VALUES('EAD0401','abc')                *
    * db2 => INSERT INTO TB VALUES('Z030_075','123')               *
    *                                                              *
    * Incorrect result 1 row is returned for below SQL:            *
    *                                                              *
    * SELECT                                                       *
    *     A.ROWID,                                                 *
    *     A.C1                                                     *
    * FROM TA A, TB B                                              *
    * WHERE ( A.C2 = 'XX'                                          *
    *         OR (A.C1 = 'EAD0401' AND B.C1 = 'XXX')               *
    *         OR (A.C1 = 'XXX' AND B.C1 = 'XXX')                   *
    *       );                                                     *
    *                                                              *
    * 1                                  C1                        *
    * ------------------------------------------------------------ *
    * ---                                                          *
    *                                                              *
    *                                                              *
    * x'04000000000000000000A204F3040000' EAD0401                  *
    *                                                              *
    * The expected result is 0 row.                                *
    *                                                              *
    * This problem only occurs with DB2 V9.7 and does not affect   *
    * V9.1                                                         *
    * or V9.5.                                                     *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Install this APAR                                            *
    ****************************************************************
    

Problem conclusion

  • Install this APAR
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC76679

  • 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

    2011-05-30

  • Closed date

    2011-11-01

  • Last modified date

    2011-11-01

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

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

    IC83445

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSY UP

       FIX



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC76679

Modified date: 01 November 2011