Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#748 Incorrect optimization of filter expressions

v9.0
closed
Michael Kay
5
2014-04-28
2007-12-07
Michael Kay
No

Under some circumstances the Saxon optimizer may incorrectly reorder two predicates of a filter expression when the second predicate is positional, for example

(/a/b[c=d])[2]

is rewritten as

(/a/b)[2][c=d]

In the case in question, the original expression itself resulted from rewriting {count(/a/b[c=d])>1} as {exists((/a/b[c=d])[2]}.

The incorrect rewrite is done when the filter expression as a whole appears in a for-loop, and the base expression (/a/b in this example) is not dependent on the range variable, but the predicate is.

A patch to module FilterExpression is being placed in Subversion.

Discussion

  • Michael Kay
    Michael Kay
    2008-01-18

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.3