IBM Support

IT13193: DB2 MIGHT PRODUCE INCORRECT RESULT WHEN EXECUTING QUERIES WITH INTERSECT AND DISTINCT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Under rare scenario, DB2 might produce incorrect results when
    the following conditions are true:
    1) The query contains an INTERSECT/INTERSECT ALL with 3 or more
    branches
    2) There is an explicit or implicit DISTINCT in the query
    3) One of the branches is guaranteed to produce one row
    
    eg.
    T1 (PK1 int not null primary key, FK1 int not null);
    T2 (PK2 int not null primary key, FK2 int not null);
    
    Select PK1 from T1 where PK1 = 1
    INTERSECT
    Select FK2 from T2 where PK2 in (1,2,3)
    INTERSECT
    Select PK1 from T1
    
    eg 2.
    Select DISTINCT col from
    (
      Select PK1 from T1 where PK1 = 1
      INTERSECT ALL
      Select FK2 from T2 where PK2 in (1,2,3)
      INTERSECT ALL
      Select PK1 from T1
    ) as INT(col);
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 10.1 Fix Pack 6                               *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 10.1 Fix Pack 6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT13193

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-01-14

  • Closed date

    2017-03-02

  • Last modified date

    2017-03-02

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

    IT13020

  • 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

  • RA10 PSN UP

       FIX

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
02 March 2017