IBM Support

IT19297: DB2 MIGHT PRODUCE INCORRECT RESULTS WHEN RUNNING QUERIES WITH EQUALITY CHAR/VARCHAR PREDICATES.

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 contains two or more subselects and tables
    2) Each of these have atleast one column of type char and at
    least one table has one column of type varchar
    3) One equality join predicate in subselect on char and varchar
    column
    4) one equality join predicate with char column in left and
    varchar column in right of select and
        redundant local equality predicates on both of these columns
    
    eg. Let table t1 has a varchar column c1, table t2 has a char
    column c1 and table t3 has a char column c1.
    The following query may produce wrong result.
    
     select tmp.c1  from t3,
          (select  t1.c1 from t1 inner join   t2  on (t1.c1 =t2.c1))
    tmp
          where ( t3.c1  =tmp.c1
                        and  t3.c1  = 'a'
                        and  tmp.c1 = 'a'
          );
    

Local fix

  • Please remove the join predicate or any of the redundant
    predicates in the select
        i.e. Remove any of  t3.c1  =tmp.c1, t3.c1  = 'a' and  tmp.c1
    = 'a'
    

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

    IT19297

  • 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

    2017-02-16

  • Closed date

    2017-03-02

  • Last modified date

    2017-03-02

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

    IT12093

  • 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

[{"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