home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
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 IC62744 Status: Closed

INCORRECT RESULT WHEN USING XQUERY FN:SUBSTRING-AFTER WITH EMPTY SEQUENCE
ARGUMENT

product:
DB2 FOR LUW / DB2FORLUW / 950 - DB2
Problem description:
XQuery fn:substring-after("some arg", ())  should return "some 
arg" but instead returns a zero-length string. 
 
Thus the following XQuery 
 
' XQuery fn:substring-after("a string", ()) eq "a string" ' 
which should return true, currently returns false.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* DB2 LUW All Platforms                                        * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* XQuery fn:substring-after("some arg", ())  should return     * 
* "some                                                        * 
* arg" but instead returns a zero-length string.               * 
*                                                              * 
*                                                              * 
*                                                              * 
* Thus the following XQuery                                    * 
*                                                              * 
*                                                              * 
*                                                              * 
* ' XQuery fn:substring-after("a string", ()) eq "a string" '  * 
*                                                              * 
* which should return true, currently returns false.           * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 v95 Fixpack 5                                 * 
****************************************************************
Local Fix:
Instead of using the substring-after function with an empty 
sequence passed in as the second parameter, the substring 
function can be used instead. An example follows:  XQuery 
fn:substring("some arg",0,fn:string-length("some arg")+1). 
This will return the correct result "some arg"
available fix packs:
DB2 Version 9.5 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 6a for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 10 for Linux, UNIX, and Windows

Solution
The problem occurs because in substring-after function we are 
not handling the case where we pass in empty sequence as the 
target string with non empty source string. The fix checks for 
that and returns the correct results.
Workaround
not known / see Local fix
BUG-Tracking
forerunner  : APAR is sysrouted TO one or more of the following: IC62828 
follow-up : 
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
24.08.2009
22.02.2010
22.02.2010
Problem solved at the following versions (IBM BugInfos)
9.5.FP5
Problem solved according to the fixlist(s) of the following version(s)
9.5.0.5 FixList