#771 Union patterns with predicates in instructions

v9.0
closed
Michael Kay
5
2012-10-08
2008-01-24
Michael Kay
No

This problem affects union patterns where one or more branches contain a predicate, where the pattern appears in an XSLT instruction - that is in the count or from attribute of xsl:number, or the group-starting-with or group-ending-with attribute of xsl:for-each-group.

If the predicate, either as written or as modified by the optimizer, contains a for/some/every expression, then no slot on the stack frame is allocated to the range variable, and evaluation of the pattern fails with an ArrayIndexOutOfBoundsException reporting an index of -999 (which always indicates a reference to a variable for which no slot has been allocated).

This is more likely to occur in 9.0 which rewrites expressions of the form @x=123 as "some $z in @x satisfies $z eq 123". Assuming that the attribute is untyped, then a workaround - which is good practice anyway - is to replace the "=" operator by "eq".

A patch is being placed in Subversion. Test case added, numb42

Discussion

  • Michael Kay
    Michael Kay
    2008-03-17

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.4