DB2 - Problembeschreibung
Problem IC83578 | 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 / 970 - 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 9.7.0.7. * **************************************************************** | |
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 9.7 Fix Pack 7 for Linux, UNIX, and Windows | |
Lösung | |
The problem is first fixed in DB2 version 9.7.0.7. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Bug-Verfolgung | |
Vorgänger : APAR is sysrouted TO one or more of the following: IC85608 IC85834 Nachfolger : | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 17.05.2012 18.10.2012 07.12.2012 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.0.7 | |
Problem behoben lt. FixList in der Version | |
9.7.0.7 |