DB2 - Problembeschreibung
Problem IC85608 | Status: Geschlossen |
XQUERY MIGHT RETURN INCORRECT RESULTS WHEN BOTH 'AND' AND 'OR' P REDICATES EXIST AND ALL PREDICATES CAN BE APPLIED TO XML INDEXES | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
Problembeschreibung: | |
XQuery might return incorrect result when both 'AND' and 'OR' predicates exist, and all predicate can be applied to XML indexes. The following example shows a sample XQuery: ----- a.sql ---------------------- select count(*) from xxxxx.xxxxxxx where xmlexists(' declare namespace xxxx = "xxxxxxxxx"; $data/ap:User [ap:sex = "male"] [ap:address = "tokyo"] [ap:status = "10" or ap:status = "40"] ' passing data as "data") @ ---------------------------------- In this example, there are no explicit AND predicates. However, the three filters in the XQuery statement get combined to be: [ap:sex = "male" and ap:address = "tokyo" and (ap:status = "10" or ap:status = "40")] The DB2 database might incorrectly decide that navigation is not needed and might lead to incorrect results when the following conditions are satisfied: - There are both AND and OR terms in the XQuery - All subterms are applicable to XML indexes - There is no extraction of data from the XML document, for example using XMLEXISTS The problem can affect both, SQL/XML and XQuery statements. SQL/XML statements that are simple and do not apply predicates to XML indexes are not affected by this problem. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * All users * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 10.1.0.2. * **************************************************************** | |
Local-Fix: | |
Adding an 'or fn:false()' term to the OR predicates will prevent this from occuring. . Here is an example work around for the above: ----- a.sql ---------------------- select count(*) from xxxxx.xxxxxxx where xmlexists(' declare namespace xxxx = "xxxxxxxxx"; $data/ap:User [ap:sex = "male"] [ap:address = "tokyo"] [ap:status = "10" or ap:status = "40" or fn:false()] ' passing data as "data") @ ---------------------------------- | |
verfügbare FixPacks: | |
DB2 Version 10.1 Fix Pack 2 for Linux, UNIX, and Windows | |
Lösung | |
The problem is first fixed in DB2 version 10.1.0.2. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 30.07.2012 07.12.2012 07.12.2012 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
Problem behoben lt. FixList in der Version | |
10.1.0.2 | |
10.5.0.2 |