IBM Support

IT30629: A QUERY COULD HANG WHEN IT HAS CASE EXPRESSION IN GROUP BY

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A query could hang when it meets the following conditions;
    
    1) GROUP BY has a CASE expression
    2) CASE expression used in GROUP BY is referenced twice in a
    different way
    
    Simple steps to reproduce;
    
    CREATE TABLE TEST_TABLE(C1 CHAR(10));
    
    SELECT T0.A1, T0.A2
    FROM  (
           SELECT CASE
                       WHEN 'A' IN ('B') THEN T.C1
                       ELSE NULL
                  END "A1",
                  MIN(CASE
                        WHEN 'A' IN ('B') THEN T.C1
                        ELSE NULL
                      END) "A2"
            FROM  TEST_TAB T
            GROUP BY CASE
                       WHEN 'A' IN ('B') THEN T.C1
                       ELSE NULL
                  END
          ) "T0"
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * all using case statement in group by                         *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * upgrade to version 11.1 Mod 4 fix pack 6                     *
    ****************************************************************
    

Problem conclusion

  • First fixed in version 11.1 Mod 4 fix pack 6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT30629

  • 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-10-17

  • Closed date

    2021-03-15

  • Last modified date

    2021-03-15

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

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

    IT35702

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • RB50 PSN

       UP

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

Document Information

Modified date:
04 May 2022