Bug #3152
closedXQ: Collection filtering is wrong inside a loop if GENERATE_BYTE_CODE=off
100%
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
Updated by Michael Kay over 7 years ago
- 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.
Updated by Michael Kay over 7 years ago
- 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;
}
Updated by O'Neil Delpratt over 7 years ago
- 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.
Updated by O'Neil Delpratt over 7 years ago
- Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue