IBM Support

IT20661: WRONG RESULTS MIGHT OCCUR WHEN SCALAR SUB-QUERY IS ON THE LEFT HAND SIDE OF A NOT IN PREDICATE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Wrong results might be observed when a scalar sub-query is on
    the left hand side of a NOT IN predicate.
    This can happen using db2 version 10.5 and later when:
    
       1. a query statement contains a NOT IN predicate;
       2. the left hand side of the NOT IN predicate is a scalar
    sub-query;
       3. the evaluation of the NOT IN predicate returns an empty
    result set
    
       The following use case can reproduce this problem:
       create table t(c1 int);
       insert into t values 1;
       create table ssq(c2 int not null);
       insert into ssq values 2;
       create table sq(c3 int not null);
       insert into sq values 2;
       select c1 from t where (select c2 from ssq) not in (select c3
    from sq);
       C1
       -----------
                 1
    
         1 record(s) selected.
    

Local fix

  • Please, rewrite the query
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 11.1 Mod 2 Fix Pack 2 or higher               *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 11.1 Mod 2 Fix Pack 2
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT20661

  • 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

    2017-05-18

  • Closed date

    2017-06-27

  • Last modified date

    2017-06-27

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

    IT20597

  • 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"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
29 June 2020