#186 ORDER BY when returning a sequence

v7.8
closed
5
2014-08-18
2004-02-13
Michael Kay
No

If the "order by" clause is used in a FLWOR expression,
and the "return" clause returns a sequence of more than
one item, items after the first are discarded. For example:

for $w in (3,2,1)
order by $w
return ($w, $w+10)

returns (1,2,3) instead of (1, 11, 2, 12, 3, 13).

Source code fixed and test case added (qxmp122).

Discussion