IBM Support

IT18201: WRONG RESULT IS POSSIBLE IF GENERATED ALWAYS EXPRESSION REFERENCES A BUILT-IN FUNCTION WITH MORE THEN ONE STRING INPUT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Insert or update may cause wrong result when the target table
    has a GENERATED ALWAYS expression that references a built-in
    function with more than one string input.
    
    example:
    
    create table t1 (
      i int,
      c1 varchar (18),
      c2 varchar (18) GENERATED ALWAYS AS
         (sysibm.ltrim( c1, X'E6BCA2' ) ));
    
    
    create or replace variable v varchar(18) for bit data;
    
    set v = X'E6BCA2E6BCA1';
    
    insert into t1 values (1, v, default );
    insert into t1 values (2, X'E6BCA2E6BCA1', default );
    
    select hex(c1), hex(c2 ) from t1 order by i;
    
    1                                    2
    ------------------------------------
    ------------------------------------
    E6BCA2E6BCA1                         A1
    E6BCA2E6BCA1                         E6BCA1
    
      2 record(s) selected.
    

Local fix

  • Avoid using function with more than one string argument  in the
    definition  OF GENERATED ALWAYS
    column
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 version 10.5 fix pack 9                       *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 version 10.5 fix pack 9
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT18201

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    A50

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-12-01

  • Closed date

    2017-09-27

  • Last modified date

    2017-10-12

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

    IT18170

  • 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

  • RA50 PSN

       UP

[{"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":"10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
12 October 2017