IBM Support

IC68745: A "SQL1034C THE DATABASE IS DAMAGED" ERROR MAY OCCUR IN CERTAIN XML QUERIES OR XMLTABLE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A "SQL1034C The database is damaged" error may occur in certain
    XML Queries OR XMLTABLE expressions such as the one below:
    
    Select   c1, c2, c3, c4, c5, c6, c7,
    c8, c9, c10, c11 from
        t1  where
        exists( select 1 from XMLTABLE('$C11/P1/P2'
    columns             "UPDDATE" timestamp path '@upddate'  )
            where upddate between '2001-01-17-00.00.00.000000' and
    '2010-01-18-00.00.00.000000' ) ;
    
    
    This happens because during XML navigation we try to fetch a
    temp record which has already been deleted.
    
    If such error is encountered you will see a similar stack trace
    as the one below:
    
    0x00002B09BF2E690F sqlo_trce + 0x045b
    0x00002B09BF3DEE05 sqloDumpDiagInfoHandler + 0x019b
    0x00002B09BBAB1C00 address: 0x00002B09BBAB1C00 ; dladdress:
    0x00002B09BBAA4000 ; offset in lib: 0x000000000000DC00 ;
    0x00002B09BBAAEEA3 pthread_kill + 0x0033
    0x00002B09BF3DF867 sqloDumpEDU + 0x005f
    0x00002B09BD8937E9 _ZN16sqeLocalDatabase9MarkDBBadEi + 0x0235
    0x00002B09BD4E8EB2 _Z15sqldDumpContextP9sqeBsuEduiiiiiPKcPvi +
    0x0a6c
    0x00002B09BCC4E437
    _Z19sqldcsl_dumpBadPageP8sqeAgentP8SQLD_TCBP16SQLB_OBJECT_DESCP1
    1SQLB_FIX_CBjP16SQLDCSL_PAGESLOTiimz
    + 0x17f7
    0x00002B09BCC4BA24
    _Z19sqldcsl_fetchDirectP8sqeAgentP8SQLD_TCBP12SQLD_TCB_CSLP16SQL
    DCSL_FETCH_CB
    + 0x0274
    0x00002B09BCC4BBCB
    _Z16sqldcsl_fetchRowP8sqeAgentP8SQLD_TCBP12SQLD_TCB_CSLP16SQLDCS
    L_FETCH_CB
    + 0x0125
    0x00002B09C0DBB2D2
    _Z19xmls_fetchCSLRecordP11XMLSTORE_CBP15SQLXMS_WORKAREAP8SQLD_TC
    B
    + 0x0120
    0x00002B09C100C233
    _Z16xmls_FetchRecordP11XMLSTORE_CBR8XMLS_XIDPPcPtS5_hP13XMLS_WA
    TOKENPP8SQLD_TCB
    + 0x06bd
    0x00002B09C0D7B056
    _ZN12XmlrnNodeMgr11fetchRecordEP11XMLSTORE_CBR8XMLS_XIDPPcPtS6_h
    P13XMLS_WA_TOKENPP8SQLD_TCB
    + 0x0076
    0x00002B09C0DFEC03
    _ZN12XmlrnNodeMgr13fetchTempNodeEP11XMLSTORE_CBP17xmlDataDescrip
    torR8XMLS_XIDsRP9XmlrnNodePPcPtP12XmlsNidStackP13XMLS_WA_TOKENP8
    SQLD_TCB
    + 0x04f9
    0x00002B09C0D08A2D
    _ZN12XmlrnNodeMgr9fetchNodeEP11XMLSTORE_CBP17xmlDataDescriptorR8
    XMLS_XIDRP9XmlrnNodePtP13XMLS_WA_TOKEN
    + 0x0103
    0x00002B09C0D08A9B
    _ZN12XmlrnNodeMgr9fetchNodeEP17xmlDataDescriptorR8XMLS_XIDRP9Xml
    rnNodePt
    + 0x0057
    0x00002B09C0D08EAB
    _ZN12XmlrnNodeMgr12fetchXDMNodeEP17xmlDataDescriptorR8XMLS_XIDP1
    2XmlrnXDMNode
    + 0x0403
    0x00002B09C0D197B2 _ZN14XmlnvNavigator10m_traverseEb + 0x012e
    0x00002B09C0D192D2 _ZN14XmlnvNavigator8getTupleERbP8sqlrr_cb +
    0x020e
    0x00002B09C0D27046
    _ZN21XmlnvTupleConstructor21m_getTupleBeforeWhereERb + 0x075c
    0x00002B09C0D264BA _ZN21XmlnvTupleConstructor8getTupleERb +
    0x01cc
    0x00002B09C0D19347 _ZN14XmlnvNavigator8getTupleERbP8sqlrr_cb +
    0x0283
    0x00002B09BFD45365 _Z12sqlriXMLScanP8sqlrr_cb + 0x05c5
    0x00002B09BFB6DF09 _Z15sqlriExecThreadP8sqlrr_cbP12sqlri_opparm
    + 0x0561
    

Local fix

  • You can try to re-write your query to cast the xpath expression
    for the column value extraction in xmltable function. For
    example in the query listed in the Error Description, we are
    extracting "@update" as a timestamp value, if we explicitly cast
    to timestamp "xs:dateTime(@upddate)" we can avoid hitting this
    error.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * A "SQL1034C The database is damaged" error may occur         *
    * incertainXML Queries OR XMLTABLE expressions such as the one *
    * below:Select  c1, c2, c3, c4, c5, c6, c7,c8, c9, c10, c11    *
    * fromt1  whereexists( select 1 from                           *
    * XMLTABLE('$C11/P1/P2'columns            "UPDDATE" timestamp  *
    * path '@upddate'  )where upddate between                      *
    * '2001-01-17-00.00.00.000000'and'2010-01-18-00.00.00.000000'  *
    * ) ;This happens because during XML navigation we try to      *
    * fetch atemp record which has already been deleted.If such    *
    * error is encountered you will see a similar stacktraceas the *
    * one below:0x00002B09BF2E690F sqlo_trce +                     *
    * 0x045b0x00002B09BF3DEE05 sqloDumpDiagInfoHandler +           *
    * 0x019b0x00002B09BBAB1C00 address: 0x00002B09BBAB1C00 ;       *
    * dladdress:0x00002B09BBAA4000 ; offset in lib:                *
    * 0x000000000000DC00 ;0x00002B09BBAAEEA3 pthread_kill +        *
    * 0x00330x00002B09BF3DF867 sqloDumpEDU +                       *
    * 0x005f0x00002B09BD8937E9 _ZN16sqeLocalDatabase9MarkDBBadEi   *
    * +0x02350x00002B09BD4E8EB2                                    *
    * _Z15sqldDumpContextP9sqeBsuEduiiiiiPKcPvi+0x0a6c0x00002B09BCC4
    * 0x17f70x00002B09BCC4BA24_Z19sqldcsl_fetchDirectP8sqeAgentP8SQL
    * 0x02740x00002B09BCC4BBCB_Z16sqldcsl_fetchRowP8sqeAgentP8SQLD_T
    * 0x01250x00002B09C0DBB2D2_Z19xmls_fetchCSLRecordP11XMLSTORE_CBP
    * 0x01200x00002B09C100C233_Z16xmls_FetchRecordP11XMLSTORE_CBR8XM
    * 0x06bd0x00002B09C0D7B056_ZN12XmlrnNodeMgr11fetchRecordEP11XMLS
    * 0x00760x00002B09C0DFEC03_ZN12XmlrnNodeMgr13fetchTempNodeEP11XM
    * 0x04f90x00002B09C0D08A2D_ZN12XmlrnNodeMgr9fetchNodeEP11XMLSTOR
    * 0x01030x00002B09C0D08A9B_ZN12XmlrnNodeMgr9fetchNodeEP17xmlData
    * 0x00570x00002B09C0D08EAB_ZN12XmlrnNodeMgr12fetchXDMNodeEP17xml
    * 0x04030x00002B09C0D197B2 _ZN14XmlnvNavigator10m_traverseEb   *
    * +0x012e0x00002B09C0D192D2                                    *
    * _ZN14XmlnvNavigator8getTupleERbP8sqlrr_cb+0x020e0x00002B09C0D2
    * +0x075c0x00002B09C0D264BA                                    *
    * _ZN21XmlnvTupleConstructor8getTupleERb                       *
    * +0x01cc0x00002B09C0D19347                                    *
    * _ZN14XmlnvNavigator8getTupleERbP8sqlrr_cb+0x02830x00002B09BFD4
    * _Z12sqlriXMLScanP8sqlrr_cb +                                 *
    * 0x05c50x00002B09BFB6DF09_Z15sqlriExecThreadP8sqlrr_cbP12sqlri_
    * 0x0561                                                       *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 UDB version 9.7 fix pack 3.                   *
    ****************************************************************
    

Problem conclusion

  • Problem was first fixed in DB2 UDB Version 9.7 Fix Pack 3.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC68745

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-05-20

  • Closed date

    2010-09-27

  • Last modified date

    2010-09-27

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

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

    IC69734

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU029","label":"Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.7"}]

Document Information

Modified date:
10 September 2020