[Bug 5290] [XQuery] Unclear meaning of "collation" in order-by clause

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5290


chamberl@almaden.ibm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #2 from chamberl@almaden.ibm.com  2008-01-08 19:49 -------
The working group discussed this bug report on 8 Jan 2008. Two alternatives
were discussed:

(1) Close the bug with no changes. In this case, specifying a collation for a
non-string ordering-key is an error. It was observed that this behavior is
inconsistent with max, min, distinct-values, and possibly a future group-by.

(2) Change XQuery Section 3.8.3 as follows:
When two orderspec values V and W are compared to determine their relative
order in the ordering sequence, the "greater-than" relationship is defined as
follows:
When the orderspec specifies "empty least", the following rules are applied in
order:
(a) If V is an empty sequence and W is not an empty sequence, then W
"greater-than" V is true.
(b) If V is NaN and W is neither NaN nor an empty sequence, then W
"greater-than" V is true.
(c) If a specific collation C is specified, and V and W are both of type
xs:string or are convertible to xs:string by subtype substitution and/or type
promotion, and fn:compare(V, W, C) is less than zero, then W "greater than" V
is true.
(d) If W gt V is true, then W "greater-than" V is true.
(e) If none of the above rules apply, then W "greater-than" V is false.
Analogous changes apply when the orderspec specifies "empty greatest".

If adopted, these changes could be made effective immediately by an erratum to
XQuery 1.0, or could be introduced in XQuery 1.1 as relaxation of an error
condition.

This bug report remains open pending discussion of these alternatives.
--Don Chamberlin (for the Query Working Group)

Received on Tuesday, 8 January 2008 19:49:35 UTC