Project

Profile

Help

Bug #3152

closed

XQ: Collection filtering is wrong inside a loop if GENERATE_BYTE_CODE=off

Added by Petr K almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2017-03-02
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:

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

Actions #1

Updated by Michael Kay almost 8 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.

Actions #2

Updated by Michael Kay almost 8 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;

}
Actions #3

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.

Actions #4

Updated by O'Neil Delpratt over 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #5

Updated by O'Neil Delpratt over 7 years ago

  • Applies to branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF