IBM Support

IT18502: DB2 MAY RETURN SQLCODE:-901 OR RETURN WRONG RESULTS ON QUERIES WITH PLANS THAT INVOVLE SORT ON AN ENCRYPTED DATABASE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • DB2 may return sqlcode -901 or wrong results or hit a
    panic/crash
    when running a query which contains a sort which spilled to
    disk.
    
    Users may see one of the following sqlcodes:
    
    SQL0901N  The SQL statement or command failed because of a
    database system
    error. (Reason "outer > inner, input out of order".)
    SQLSTATE=58004
    
    SQL0901N  The SQL statement or command failed because of a
    database system
    error. (Reason "bad outer compare".)  SQLSTATE=58004
    
    Wrong results can manifest in either invalid data values coming
    back to the user, or aggregation generating duplicate rows, when
    not expected.
    
    Sample stack when hitting the -901 sqlcode:
    0x00007FFFF117665D sqlrrSqlCode + 0x00dd
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFF16A5B49 _Z8sqlri_mjP8sqlrr_cb + 0x0729
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFF163AB08 _Z15sqlriSectInvokeP8sqlrr_cbP12sqlri_opparm
    + 0x04f8
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFF10A0C77
    _Z21sqlrr_subagent_routerP8sqeAgentP12SQLE_DB2RA_T + 0x0d87
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFEEC35B8D address: 0x00007FFFEEC35B8D ; dladdress:
    0x00007FFFE990A000 ; offset in lib: 0x000000000532BB8D ;
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFEEC3447A _Z21sqleProcessSubRequestP8sqeAgent + 0x03da
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFEEC67C7B _ZN8sqeAgent6RunEDUEv + 0x05ab
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFF2426DD6 _ZN9sqzEDUObj9EDUDriverEv + 0x0116
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFF0A76AF8 sqloEDUEntry + 0x0578
        (/home/sbhalla/sqllib/lib64/libdb2e.so.1)
    0x00007FFFF7BC7806 address: 0x00007FFFF7BC7806 ; dladdress:
    0x00007FFFF7BC0000 ; offset in lib: 0x0000000000007806 ;
        (/lib64/libpthread.so.0)
    0x00007FFFE849464D clone + 0x006d
        (/lib64/libc.so.6)
    
    A stack for instance crash would look like the following:
    0x00007F4E28DD54B7 _Z13sqlzeDumpFFDCP8sqeAgentjP5sqlcai + 0x00a7
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E28DD4B80
    _Z11sqlzeMapZrcP8sqeAgentjmjP5sqlcaiPK12sqlzeContextb + 0x0940
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E27B26CF5 _Z11sqlrrMapZrcP8sqlrr_cbjmi + 0x0035
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E280C5A5C _Z17sqlriPrefetchRIDsP8sqlrr_cbP8sqlri_lfl +
    0x042c
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E280C3956 _Z14sqlriListFetchP8sqlrr_cb + 0x0466
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E28134AD0 _Z9sqlrihsjnP8sqlrr_cb + 0x0690
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E28134AD0 _Z9sqlrihsjnP8sqlrr_cb + 0x0690
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E28134AD0 _Z9sqlrihsjnP8sqlrr_cb + 0x0690
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E27FECF18 _Z15sqlriSectInvokeP8sqlrr_cbP12sqlri_opparm
    + 0x04f8
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E27A52387
    _Z21sqlrr_subagent_routerP8sqeAgentP12SQLE_DB2RA_T + 0x0d87
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E255E684D address: 0x00007F4E255E684D ; dladdress:
    0x00007F4E202BB000 ; offset in lib: 0x000000000532B84D ;
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E255E513A _Z21sqleProcessSubRequestP8sqeAgent + 0x03da
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E2561893B _ZN8sqeAgent6RunEDUEv + 0x05ab
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E28DD5A16 _ZN9sqzEDUObj9EDUDriverEv + 0x0116
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x00007F4E274289A8 sqloEDUEntry + 0x0578
            (/db2home/db2edwp1/sqllib/lib64/libdb2e.so.1)
    0x0000003387A07AA1 address: 0x0000003387A07AA1 ; dladdress:
    0x0000003387A00000 ; offset in lib: 0x0000000000007AA1 ;
            (/lib64/libpthread.so.0)
    0x00000033872E893D clone + 0x006d
            (/lib64/libc.so.6)
    

Local fix

  • If it is possible to force a different plan that avoids sort,
    this will avoid the issue.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Install this fix                                             *
    ****************************************************************
    

Problem conclusion

  • See Error Description
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT18502

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-12-20

  • Closed date

    2017-06-23

  • Last modified date

    2017-06-23

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

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

    IT18514 IT18515

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"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:
29 June 2020