IBM Support

IT30017: DB2 MAY RUN OUT OF STATEMENT HEAP WHILE COMPILING QUERIES INVOLVING UNIONS AND PREDICATES WITH WEAK UDTS

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

  • Db2 may run out of statement heap and return a SQL0101N error
    code while compiling queries involving unions and predicates
    with weak User-defined Distinct Type (UDTs). The query must have
    the following properties:
    
    - The query contains a UNION or UNION ALL
    - The query contains a predicate outside of the union subselects
    - The predicate is a basic predicate and contains a weak
    user-defined type
    
    For example:
    
    create distinct type myweaktype as varchar(8) with weak type
    rules;
    create table t1 (c myweaktype);
    create table t2 (c myweaktype);
    
    select 1 from
    (
      select c from t1
      union
      select c from t2
    ) as myunion
    where
    exists (select 1 from t2 where myunion.c = t2.c)
    and
    exists (select 1 from t2 where myunion.c = t2.c);
    

Local fix

  • Rewrite the query to push the predicates into the union
    subselects. For example, the query above can be rewritten to:
    
    select 1 from
    (
      select c from t1
      where
      exists( select 1 from t2 where t1.c = t2.c)
      and
      exists (select 1 from t2 where t1.c = t2.c)
      union
      select c from t1
      where
      exists( select 1 from t2 where t1.c = t2.c)
      and
      exists (select 1 from t2 where t1.c = t2.c)
    ) as myunion;
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL users                                                    *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 11.1 Mod 4 Fix Pack 6                         *
    ****************************************************************
    

Problem conclusion

  • The APAR was first fixed in Db2 11.1 Mod 4 Fix Pack 6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT30017

  • 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

    2019-08-16

  • Closed date

    2021-03-19

  • Last modified date

    2021-03-19

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

    IT30013

  • 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:
20 March 2021