IBM Support

IT23930: THE TO_DATE FUNCTION IS NOT PUSHED DOWN CORRECTLY IN FEDERATED SETUP

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as new function.

Error description

  • In the federated setup, function to_date is not pushed down
    below SHIP operator. Problem can be observed with following SQL:
    
    create nickname nname1 for fedserver.db2inst1.tab1
    select * from nname1 where c3 BETWEEN to_date('2017-06-30',
    'YYYY-MM-DD', 0)-2 MONTHS AND '2017-06-30'
    
    
    
    During execution of the above query, only part of the SQL is
    passed to
    federated data source. Following is observed in the access plan:
    
    RMTQTXT : (Remote statement)
    SELECT A0."C3" C0, A0."C1" C1, A0."C2" C2 FROM "DB2INST1"."TAB1"
    A0 WHERE (A0."C3" <= '2017-06-30') FOR READ ONLY
    
    
    
    The predicate defined by to_date function is applied in FILTER
    operator above SHIP of RMTQTXT above:
    
    3) Residual Predicate,
    Comparison Operator: Less Than or Equal (<=)
    Subquery Input Required: No
    Filter Factor: 0.333333
    
    Predicate Text:
    --------------
    ('2017-04-30-00.00.00.000000' <= Q1.C3)
    
    
    
    Issue is caused by lack of default mapping for to_date function.
    To workaround the problem, following mapping has to be created:
    
    CREATE FUNCTION MAPPING {mapping_name} FOR
    "SYSIBM"."<="(SYSIBM.TIMESTAMP,SYSIBM.DATE) SERVER {server_name}
    OPTIONS (REMOTE_NAME '(:1P<=:2P)')
    

Local fix

  • To workaround the problem, following mapping has to be created:
    
    CREATE FUNCTION MAPPING {mapping_name} FOR
    "SYSIBM"."<="(SYSIBM.TIMESTAMP,SYSIBM.DATE) SERVER {server_name}
    OPTIONS (REMOTE_NAME '(:1P<=:2P)')
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 11.1 Mod 4 Fixpack 4 or higher                *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 11.1 Mod 4 Fixpack 4
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT23930

  • 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

    2018-02-02

  • Closed date

    2018-11-27

  • Last modified date

    2018-11-27

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

    IT23929

  • 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

  • RB10 PSN

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
27 November 2018