#953 In XQuery Update, errors in updating functions not detected

v9.1
closed
Michael Kay
5
2012-10-08
2009-05-29
Michael Kay
No

In XQuery Update, if an expression within an updating function uses an updating subexpression in a context where it is not allowed, the compiler does not detect the error. The error may go undetected, or it might result in an UnsupportedOperationException at run-time.

An example is to use

let $x := delete //s
return EXPR

which is an error because the right-hand-side of ":=" must not be an updating expression. The error is detected if this FLWOR expression appears at the top level of an updating (or non-updating) query, but it is not detected if it appears as the body of an updating function.

A patch is being raised in the Saxon-SA subversion source.

Discussion

  • Michael Kay
    Michael Kay
    2009-06-17

    Fixed in 9.1.0.7