Updating expression as operand in path expression

Bug #866309 reported by Ghislain
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Matthias Brantner

Bug Description

The following query (under build 5589) fails because the function body is not recognised as an updating expression.

declare updating function local:test($x) {
  $x/(insert node <a/> into .)
};
1+1

Revision history for this message
Ghislain (gfourny) wrote :

Sincere apologies, I made a little mistake. The specification says that expressions which are neither FLWOR, typeswitch, conditional, comma, parenthesized nor function calls may not contain an updating expression as an operand: a static error XUST0001 has to be raised. This is not the case, so the following program is incorrect and should raise an error, but does not:

declare function local:test($x) {
  $x/(insert node <a/> into .)
};
1+1

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

assigning to dan in order to trace that in the translator.

Revision history for this message
dan-muresan (dan-muresan) wrote :

Conforming to the spec as quoted by Ghislain would require checking for updating expressions everywhere in the translator (or a better design idea I guess, like a separate visitor step?). We can probably live with this as it is (certainly for the pending release), so for the time being I will downgrade the issue.

Revision history for this message
Ghislain (gfourny) wrote :

Since Zorba implements the XQuery scripting extension, the restriction mentioned in my last comment no longer applies. The specification says:

"All expressions not listed above are extended to accept both updating and simple expressions as their operands. If an operand of the expression is updating then the expression itself is updating, otherwise it is simple. This includes the following kinds of expressions: Path expressions, [...]"

The consequence is that the initial bug report still holds: the function body should be recognised as an updating expression.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Ghislain is perfectly right with his last comment. The latest XQuery Scripting spec allows this query.
However, I'm downgrading the priority for the 1.0 release since the scripting spec is not yet stable.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Marked with Resolution = None at Dana's request.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.