IBM Support

LI73566: SQL STATMENTS CONTAINIG LIKE PREDICATES CAN LEAK MEMORY WHEN RUN AGAINST VIEWS, LEADS TO SQL0954

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following SQL statement:
    select * from testview where col1 like ?
    where the view is defined as:
    create view testview as select * from (values 'test') as TEST
        (col1) where 1 = 2
    will leak memory in the application heap. This can lead to
    SQL0954 errors.
    
    Running the same statement againast a normal table or a view
    defined as:
    create view testview as select * from (values 'test') as TEST
        (col1)
    will not leak memory.
    
    An additional indication is, that the rewritten SQL statement
    does not include the LIKE predicate anymore:
    SELECT NULL AS "COL1" FROM (VALUES) AS Q1 WHERE (1 = 2)
    

Local fix

  • Remove the "WHERE 1 = 2" clausel from the view definition.
    

Problem summary

  • The following SQL statement:
    select * from testview where col1 like ?
    where the view is defined as:
    create view testview as select * from (values 'test') as TEST
        (col1) where 1 = 2
    will leak memory in the application heap. This can lead to
    SQL0954 errors.
    
    Running the same statement againast a normal table or a view
    defined as:
    create view testview as select * from (values 'test') as TEST
        (col1)
    will not leak memory.
    
    An additional indication is, that the rewritten SQL statement
    does not include the LIKE predicate anymore:
    SELECT NULL AS "COL1" FROM (VALUES) AS Q1 WHERE (1 = 2)
    

Problem conclusion

  • First fixed in DB2 UDB Version 9.1, FixPak 6.
    

Temporary fix

  • See LOCAL FIX.
    

Comments

APAR Information

  • APAR number

    LI73566

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    910

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-09-19

  • Closed date

    2008-11-10

  • Last modified date

    2008-11-10

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

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

    LI73629

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R810 PSN

       UP

  • R820 PSN

       UP

  • R910 PSN

       UP

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

Document Information

Modified date:
15 October 2021