IBM Support

IT11774: DB2 MIGHT PRODUCE INCORRECT RESULTS WHEN ELIMINATING CORRELATED SCALAR SUBQUERY

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Under rare scenarios, DB2 might produce incorrect result when
    the following conditions are true:
    1) The query contains one or more correlated scalar subqueries
    2) The scalar subquery has an aggregation function of type
    MAX/MIN
    3) The table referenced in the subquery is also joined to the
    parent of the correlation in the outer select
    4) The join predicates of the 1 and 2 are identical
    
    Eg.
    SELECT *
    FROM  tab1 d , tab2 c
    where d.c1 = c.c1
    and c.c1 =
           ( SELECT MAX(c1)
             FROM tab2 catg
             WHERE catg.c1 = d.c1 );
    

Local fix

  • Reduce the optimization level to 3 or below
    

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

    IT11774

  • 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

    2015-10-14

  • Closed date

    2017-03-02

  • Last modified date

    2017-03-02

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

    IT11713

  • 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

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

Document Information

Modified date:
26 September 2021