IBM Support

IT22826: WRONG RESULT WHEN PREDICATE HAS CONCATENATED CONSTANT AND COLUMN.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Db2 may produce wrong result when the following conditions are
    met:
    1) The query has an equality predicate
    2) The equality predicate has a constant string in one side and
       a constant concatenated with a fixed length character column
    on the other side
    3) The number of characters in the constant part of
    concatenation is less than the
       number of characters in the constant used in the other side
    of the predicate.
    4) SYSIBM.NLS_STRING_UNITS is set to 'CODEUNITS32'
    
    Example:
    CREATE TABLE T (C CHAR(4 CODEUNITS32) NOT NULL);
    insert into T values('BCD');
    select * from T where 'ABCD'='A'||C;
    
    The expected result is 1 row :
    C
    ----------------
    BCD
    
      1 record(s) selected.
    
    and it generates 0 rows, which is wrong.
    

Local fix

  • Rewrite the query by splitting the predicate so that
    concatenation gets removed:
    
    select * from T where 'A'='A' and 'BCD'=C;
    
    or rewrite to remove the constant part of the predicate as:
    select * from T where 'BCD'=C;
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All Db2 for Linux, UNIX, and Windows users                   *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 Version 11.1 Mod 3 Fix Pack 3 for Linux,      *
    * UNIX, and Windows or later                                   *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 Version 11.1 Mod 3 Fix Pack 3 for Linux,
    UNIX, and Windows
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT22826

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-10-18

  • Closed date

    2018-03-16

  • Last modified date

    2018-03-16

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

    IT22822

  • 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

  • RA60 PSY

       UP

  • RB10 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"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 March 2018