IBM Support

IT29941: 10 CHAR VALUE CAN BE INSERTED INTO VARGRAPHIC(5 CODEUNITS32). THIS SHOULD FAIL WITH SQL0433N ERROR.

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • When a column is defined as VARGRAPHIC with string length unit
    CODEUNITS32,
    it's possible to insert longer-than-allowed values.  For
    example:
    
         create table T (c1 graphic(5 codeunits32),
                               c2 vargraphic(5 codeunits32) );
    
         insert into T values ('abcdefghij','abcdefghij');
         DB20000I  The SQL command completed successfully.  <==
    Should have failed with -433
    
         select c1, hex(c1), length(c1, octets), length(c1,
    codeunits16), length(c1, codeunits32) from T order by c1;
    
    	 C1                   2
    3           4           5
    	 -------------------- ----------------------------------------
    ----------- ----------- -----------
    	 abcde                00610062006300640065
    10           5           5
    
    	   1 record(s) selected.
    
    
         select c2, hex(c2), length(c2, octets), length(c2,
    codeunits16), length(c2, codeunits32) from T order by c2;
    
    	 C2                   2
    3           4           5
    	 -------------------- ----------------------------------------
    ----------- ----------- -----------
    	 abcdefghij           006100620063006400650066006700680069006A
    20          10          10
    
    	   1 record(s) selected.
    
    
      <<< this select shows the problem.
    
    The problem only occurs when all of the following are true:
    - The target column is GRAPHIC or VARGRAPHIC with string units
    CODEUNITS32
    - Inserting a constant value that consists entirely of single
    byte characters
    - The constant length equals twice the target column length (in
    CODEUNITS32)
    
    For a GRAPHIC target column, the value is silently
    truncated to the column size whereas for a VARGRAPHIC column,
    the stored value exceeds the column size.
    

Local fix

  • In the INSERT statement, explicitly cast constant values to
    VARGRAPHIC, e,g.:
    
         insert into T values
    (VARGRAPHIC('abcdefghij'),VARGRAPHIC('abcdefghij'));
         SQL0433N  Value "abcdefghij" is too long.  SQLSTATE=22001
    
    Alternatively, enable the statement concentrator, this replaces
    the constant value with a parameter marker:
    
      db2 update db cfg for <dbname> using stmt_conc literals
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 v11.1.4.6                                     *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 v11.1.4.6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT29941

  • 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

    2019-08-08

  • Closed date

    2021-02-23

  • Last modified date

    2021-03-29

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

    IT29935

  • 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":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1"}]

Document Information

Modified date:
31 March 2021