IBM Support

JR27833: DELETE STATEMENT ON NOT LOGGED GLOBAL DECLARED TEMP TABLE DELETES ALL ROWS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A delete statement on a not logged global declared temp table
    could result
    in all rows being deleted although the delete qualifies only a
    subset of rows. The delete statement being vulnerable to this
    would look like:
    
    - delete from (select subset of rows) t
    
    The following steps will show the behaviour:
    
    - declare global temporary table session.t (i int) with replace
    on commit preserve rows not logged
    - insert into session.t values (1), (2), (3)
    - delete from (select * from session.t where i=2) t
    
    A select * from session.t will return 0 rows.
    
    The issue has been introduced first in DB2 version 8 FixPak 11
    by APAR IY77333 and in DB2 version 9 GA.
    This APAR will address this behaviour and allow DB2 to delete
    the qualifying rows only.
    

Local fix

  • To workaround the issue you could:
    1. use delete statement with where clause
     delete from session.t where i=2
    
    or
    2. use global declared temp table without 'not logged' clause
    

Problem summary

  • Users Affected: ALL.
    
    Problem Description:
    A DELETE statement on a not logged declared global temporary
    table could result in all rows being deleted even though the
    DELETE statement qualifies only a subset of rows.
    
    
    Problem Summary: A DELETE statement on a not logged declared
    global temporary table could result in all rows being deleted
    even though the DELETE statement qualifies only a subset of
    rows. See the example statement below:
    
    - delete from (select subset of rows) t
    
    The following example demonstrates the behavior:
    
    - declare global temporary table session.t (i int) with replace
    on commit preserve rows not logged
    - insert into session.t values (1), (2), (3)
    - delete from (select * from session.t where i=2) t
    
    A select * from session.t will return 0 rows.
    
    The problem was introduced by APAR IY77333 in DB2 UDB Version 8
    FixPak 11 and DB2 LUW Version 9 GA.
    This APAR will address the behavior and allow DB2 to delete
    the qualifying rows only.
    

Problem conclusion

  • Problem was first fixed in Version 9 FixPak 4a. At a minimum,
    this fix should be applied on the client.
    

Temporary fix

  • See LOCAL FIX.
    

Comments

APAR Information

  • APAR number

    JR27833

  • Reported component name

    DB2 UDB ESE WIN

  • Reported component ID

    5765F4101

  • Reported release

    910

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2007-11-14

  • Closed date

    2008-03-14

  • Last modified date

    2008-03-14

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

    JR27832

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

Fix information

  • Fixed component name

    DB2 UDB ESE WIN

  • Fixed component ID

    5765F4101

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":"910"}]

Document Information

Modified date:
07 October 2021