IBM Support

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

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as fixed if next.

Error description

  • Db2 may run out of statement heap and return a SQL0101N error
    code while compiling queries involving unions and predicates
    with weak 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                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * upgrade higher versions                                      *
    ****************************************************************
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    IT30013

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    A50

  • Status

    CLOSED FIN

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-08-16

  • Closed date

    2022-02-23

  • Last modified date

    2022-02-23

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

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

    IT30017 IT30018

Fix information

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.5"}]

Document Information

Modified date:
24 February 2022