IBM Support

IT14637: IN FEDERATED SCENARIO, TABLE EXPRESSION AGAINST NICKNAME WITH BOTH CORRELATION AND FFNR CLAUSE COULD PRODUCE INCORRECT RESULT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • DB2 federated server can return incorrect result for queries
    that involve a table expression that selects from nicknames, and
    the table expression contains both correlation and FFNR clause.
    
    For example
    
    select *
    from local_table ta,
         table(select tb.b2
               from nick_name tb
               where ta.a1>=tb.b1
               order by tb.b1
               fetch first 1 rows only) as tbb
    where ta.a1=tbb.b2 and ta.a1< 10
    
    The table expression contains a correlated predicate
    ta.a1>=tb.b1, and it has "fetch first 1 row only" clause.
    
    The FFNR clause might not be present in the remote statement;
    this can cause wrong result. You can get query explain and
    observe "Remote statement" in the formatted explain (db2exfmt
    output)
    
          RMTQTXT : (Remote statement)
             RMTQTXT : SELECT A0."B2" C0 FROM <remote_table> A0
    WHERE (A0."B1" <= :H0 ) ORDER BY A0."B1" ASC FOR READ ONLY
    
    The Remote statement should have been
    
          RMTQTXT : (Remote statement)
             RMTQTXT : SELECT A0."B2" C0 FROM <remote_table> A0
    WHERE (A0."B1" <= :H0 ) ORDER BY A0."B1" ASC FETCH FIRST 1 ROWS
    ONLY FOR READ ONLY
    

Local fix

  • Rewrite query or install this fix.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 10.1 Fix Pack 6                               *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 10.1 Fix Pack 6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT14637

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-04-05

  • Closed date

    2017-03-02

  • Last modified date

    2017-03-02

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

    IT14604

  • 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

  • RA10 PSN UP

       FIX

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
02 March 2017