IBM Support

IT00386: SQL QUERY CONTAINS NOT EXISTS SUBQUERY AND NODENUMBER PREDICATE MIGHT PRODUCE AN INCORRECT RESULT

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 results if
    the following conditions are true:
    1) The query consists of one or more NOT EXISTS or NOT IN
    subqueries
    2) The parent side table of the subquery contains a nodenumber
    predicate
    
    eg.  select count(*)
            from t1
            where not exists (select 1 from t2 where t1.a=t2.a) and
    <-------------- condition 1
                         nodenumber(t1.a)=1;
    <-------------- condition 2
    

Local fix

  • 1) Turn DB2_ANTIJOIN=NO
    2) Manually rewrite the query to form:
    select count(*) from t1 left join t2 on t1.a=t2.a where t2.a is
    null and nodenumber(t1.a)=1;
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 version 101 fixpack 4                         *
    ****************************************************************
    

Problem conclusion

  • Problem is fixed in DB2 version 101 fixpack 4
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT00386

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-03-18

  • Closed date

    2014-07-03

  • Last modified date

    2015-04-07

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

    IT00270

  • 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 PSY

       UP

[{"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:
25 September 2021