IBM Support

IT29981: DB2 MAY RETURN INCORRECT RESULTS WHEN EXECUTING IUD STATEMENTS CONTAINING A SUBQUERY WITH CORRELATION AND AGGREGATION

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • Db2 may return incorrect results when executing IUD statements
    containing a subquery with the following properties:
    
    - The subquery contains correlated predicates.
    - The subquery contains aggregation.
    - The subquery references another subquery or
    common-table-expression that returns unique records (for example
    via aggregation or DISTINCT).
    
    For example:
    
    insert into mytable3
      with mycte as (
        select mytable.c1 c1, mytable2.c1 c2
          from mytable, mytable2
          where mytable.c2 = mytable2.c2
          group by mytable.c1, mytable2.c1
        )
      select distinct c1
        from (select c1,
              (select sum(c2)
                 from mycte
                 where mycte.c1 = mycorr.c1 and mycte.c2 = 1) as
    mysum
                from mytable mycorr )
        where mysum > 0;
    

Local fix

  • The incorrect results can be avoided by using the following
    registry setting via db2set or an Optimization
    profile/guideline:
    DB2COMPOPT=NO_GBPRDPU
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 11.1 Mod 4 Fixpack 5 or higher                *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 11.1 Mod 4 Fixpack 5
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT29981

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-08-12

  • Closed date

    2020-01-16

  • Last modified date

    2020-01-16

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

    IT29977

  • 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

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 January 2020