Bug #3152
closed
XQ: Collection filtering is wrong inside a loop if GENERATE_BYTE_CODE=off
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Description
if GENERATE_BYTE_CODE=off
following xq loses all but one element - very basic functionality is compromised
let $collection := (,,)
let $ids := ('a','b')
return
{
for $id in $ids
return
<x id='{$id}'>{ $collection[@attr=$id] }</x>
}
please fix it asap because Bug #3127 needs GENERATE_BYTE_CODE=off as workaround
- Category set to Internals
- Status changed from New to In Progress
- Assignee set to Michael Kay
Thanks. There's an optimisation not working correctly. The filter expression is implemented using indexing, specifically an IndexedFilterExpression. This is evaluated in push mode using the process() method, which is invoking evaluateItem() rather than iterate because getEvaluationMethod() returns EVALUATE_ITEM. This is incorrect, because evaluateItem only returns the first selected value - it is intended for use only when the static cardinality is limited to one.
Currently examining why getEvaluationMethod() is incorrect.
- Status changed from In Progress to Resolved
- Priority changed from High to Normal
- Applies to branch 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
The IndexedFilterExpression should have the method
public int getImplementationMethod() {
return ITERATE_METHOD;
}
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.18 added
Bug fix applied in the Saxon 9.7.0.18 maintenance release.
- Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
- Applies to branch deleted (
9.8)
Please register to edit this issue
Also available in: Atom
PDF