Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC66735 Status: Closed

ORDER BY WITH XMLTABLE INVOLVING CONSTRUCTED OR INLINED XML DOCUMENTS
MAY CRASH INSTANCE.

product:
DB2 FOR LUW / DB2FORLUW / 980 - DB2
Problem description:
If you run a SQL, order by with xmltable table function which 
works on a constructed or inlined xml document, as below, the 
instance may be crashed.  The associated trap file may have 
stack trace backs as below. 
 
A snip of an example SQL: 
------------ 
    : 
  (SELECT 
           XMLELEMENT(NAME "root", 
         XMLAGG( 
           XMLELEMENT(NAME "kind", 
             XMLELEMENT(NAME "id", trim(ki.id)), 
             XMLELEMENT(NAME "d_id", trim(ki.d_id)), 
             XMLELEMENT(NAME "name", km.name), 
               XMLELEMENT(NAME "d", km.d) 
           ) 
           ORDER BY km.d 
         ) as kind 
       ) 
    : 
, xmltable( 
        '$KIND/kind[1]' COLUMNS 
        col1 DECIMAL(8,0) PATH './d', 
        col2 VARCHAR(10) PATH './id', 
        col3 VARCHAR(10) PATH './d_id' 
) 
ORDER BY 
        col1 ASC, col2 ASC, col3 ASC 
; 
------------ 
 
A snip of the stack trace backs of associated trap file: 
------------ 
--EBP------EIP------ARGS----------------------------- 
.. <?getLength@XmlsNidSubdigit@@QAEEXZ> 
.. <?xmlrnTestRootNode@@YA_NPAD@Z> 
.. <?fetchTempNode@XmlrnNodeMgr@@CAHPAUXMLSTORE_CB@@PAUxml... 
.. <?fetchNode@XmlrnNodeMgr@@SAHPAUXMLSTORE_CB@@PAUxmlData... 
.. <?fetchNode@XmlrnNodeMgr@@QAEHPAUxmlDataDescriptor@@AAU... 
.. <?fetchXDMNode@XmlrnNodeMgr@@QAEHPAUxmlDataDescriptor@@... 
.. <?m_traverse@XmlnvNavigator@@AAEH_N@Z> 
.. <?getTuple@XmlnvNavigator@@QAEHAA_NPAUsqlrr_cb@@@Z> 
.. <?sqlriXMLScan@@YAHPAUsqlrr_cb@@@Z> 
------------
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* DB2 UDB Version 9.8                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error description field for more information.            * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to Version 9.8 FixPack 3.                            * 
****************************************************************
Local Fix:
1. Removeing ORDER BY clause. 
   In the above case, remove 
   "ORDER BY col1 ASC, col2 ASC, col3 ASC" 
2. Changing ORDER BY clause. 
   In the above case, change it 
   from 
   ----- 
   ) ORDER BY col1 ASC, col2 ASC, col3 ASC ; 
   ----- 
   to 
   ----- 
   ) order by xmlcast(xmlquery('$k/kind[1]/d' passing 
     kind as "k") as decimal(8,0) ) ; 
   -----
available fix packs:
DB2 Version 9.8 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 9.8 Fix Pack 4 for AIX and Linux
DB2 Version 9.8 Fix Pack 5 for AIX and Linux

Solution
Problem was first fixed in DB2 UDB Version 9.8 FixPack 3.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
26.02.2010
19.01.2011
19.01.2011
Problem solved at the following versions (IBM BugInfos)
9.8.FP3
Problem solved according to the fixlist(s) of the following version(s)
9.8.0.3 FixList