DB2 - Problembeschreibung
Problem IC62744 | Status: Geschlossen |
INCORRECT RESULT WHEN USING XQUERY FN:SUBSTRING-AFTER WITH EMPTY SEQUENCE ARGUMENT | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 950 - DB2 | |
Problembeschreibung: | |
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-Zusammenfassung: | |
**************************************************************** * 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" | |
verfügbare FixPacks: | |
DB2 Version 9.5 Fix Pack 5 for Linux, UNIX, and Windows | |
Lösung | |
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 | |
keiner bekannt / siehe Local-Fix | |
Bug-Verfolgung | |
Vorgänger : APAR is sysrouted TO one or more of the following: IC62828 Nachfolger : | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 24.08.2009 22.02.2010 22.02.2010 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.5.FP5 | |
Problem behoben lt. FixList in der Version | |
9.5.0.5 |