IBM Support

IT28638: DB2 MAY PRODUCE INCORRECT RESULTS FOR HSJN WITH PREDICATE THAT HAS CASE(COALESCE) AND NLJN OR ZZJOIN ON THE OUTER

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 PRODUCE INCORRECT RESULTS FOR HSJN WHEN
    - HSJN HAS COMPLEX PREDICATE THAT HAS CASE ( COALESCE )
    - HSJN HAS NLJN OR ZZJOIN ON THE OUTER
    - INTERNAL OPTIMIZATION IS APPLIED
    
    Example of the Complex Predicate in HSJN from the Plan that
    could produce wrong results:
    
    Predicate Text:
    --------------
    (Q8.C1 =
    CASE
    WHEN (Q1.C2 = 'X')
    THEN COALESCE(Q1.C3, 'Y')
    WHEN NOT(Q1.C4 IN ('A', 'B'))
    THEN
    CASE
    WHEN UPPER(COALESCE(Q2.C5, 'D')) IN ('E', 'F', 'G')
    THEN 'H'
    WHEN (UPPER(COALESCE(Q2.C5, 'D')) = 'K')
    THEN 'L'
    ELSE COALESCE(Q2.C5, 'D') END
    ELSE COALESCE(Q2.C5, 'D') END)
    
    Example of HSJN with NLJN on the outer:
    
                                                101225
                                                  HSJN
                                                  ( 6)
                                                 552757
                                         /------/      \----\
                                   101225                       46
    
                                    NLJN                      ISCAN
    
                                    ( 7)                        (22)
    
                                   552653                   ...
                                  /      \
                             101224        1
                              SCAN       ISCAN
                              ( 8)         (21)
                             548163    ...
                               |
    ...
    

Local fix

  • db2set DB2_TCG_DEFAULT_OPTIONS="set disable_pushdown on"
    instance restart is needed
    Static packages need  to be rebound.
    

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

    IT28638

  • 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-04-02

  • Closed date

    2020-01-16

  • Last modified date

    2020-01-16

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

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

    IT30005 IT30006

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