IBM Support

IT10059: WRONG RESULTS USING AGGREGATION AND SAME COLUMN TWICE IN DIFFERENT AGGREGATION FUNCTIONS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A complex query might produce wrong results with the following
    conditions:
    
    - using aggregation
    - the same column is used twice in different aggregation
    functions
    - internal optimization is done (this can only be checked by DB2
    support looking at the section dumps for the query)
    
    Example:
    select  a11.ART_DAN  ART_DAN_S,
            max(a13.ART_ARTBEZ)  ART_ARTBEZ,
            a14.DAT_JJJJMM  DAT_JJJJMM,
            max(a14.DAT_MON_KBEZ)  DAT_MON_KBEZ,
            a12.DAT_JJJJMM  DAT_JJJJMM0,
            min(a12.DAT_MON_KBEZ)  DAT_MON_KBEZ0,
            sum((a11.WB_MENGE * a11.WB_C_FIL))  WJXBFS1
    from    dpermv.F3WB_A_L_M       a11,
            dpermv.D1TAGMON a12,
            dpermv.D1DANDAN a13,
            dpermv.D1TAGMON a14
    where   a11.DAT_JJJJMM = a12.DAT_VJM and
            a11.ART_DAN = a13.ART_DAN
     and    (a13.ART_HLNR in (14)
     and a12.DAT_JJJJMM in (201312, 201311, 201310, 201309, 201308,
    201307,
    201306, 201305, 201304, 201303, 201302, 201301)
     and a12.DAT_JJJJMM = a14.DAT_JJJJMM
     and a11.BWART_BWART in ('S02', 'S14', 'S15', 'S11', 'S03', 'S08
    ',
    'I02  ', 'I03  ', 'S72  ', 'S81  ', 'S73  ', 'S78  ', 'S23  ',
    'S20  ',
    'S21  ', 'S22  '))
    group by        a11.ART_DAN,
            a14.DAT_JJJJMM,
            a12.DAT_JJJJMM;
    
    Note:
    
    max(a14.DAT_MON_KBEZ) DAT_MON_KBEZ,
       min(a12.DAT_MON_KBEZ) DAT_MON_KBEZ0,
    
    are coming from the same column in the same table:
        dpermv.D1TAGMON a12,
        dpermv.D1TAGMON a14
    

Local fix

  • db2set DB2_TCG_DEFAULT_OPTIONS="set disable_pushdown on"
    

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

    IT10059

  • 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-07-14

  • Closed date

    2017-03-02

  • Last modified date

    2017-03-02

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

    IT10009

  • 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