Bug 5706 - [F&O] Overflow errors in casting to gYear, gYearMonth.
: [F&O] Overflow errors in casting to gYear, gYearMonth.
Status: CLOSED FIXED
Product: XPath / XQuery / XSLT
Functions and Operators 1.0
: Candidate Recommendation
: PC Windows NT
: P2 normal
: ---
Assigned To: Michael Kay
: Mailing list for public feedback on specs from XSL and XML Query WGs
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-05-21 15:41 UTC by Oliver Hallam
Modified: 2008-07-09 14:20 UTC (History)
0 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hallam 2008-05-21 15:41:03 UTC
The range of gYear and gYearMonth are implementation defined (XQuery 5.3.4).

Section 17.1.1 of functions and operators says (re. casting from strings):

In casting to a date or time value, if the value is too large or too small to
be represented by the implementation, error [err:FODT0001] is raised.

In casting to a duration value, if the value is too large or too small to be
represented by the implementation, error [err:FODT0002] is raised.

For xs:anyURI, the extent to which an implementation validates the lexical form
of xs:anyURI is implementation dependent.

If the cast fails for any other reason, error [err:FORG0001] is raised.

If the phrase "date or time value" was intended to include gYear and
gYearMonth, then this could have been phrased more clearly.

Otherwise it does not seem desirable to raise a FORG0001 error when a value is
too large for gYear or gYearMonth (especially since this case is covered for
all other types with implementation defined limits).  Ideally this should be
either covered by FODT0001, or by a new error code (e.g. FODT0004).
Comment 1 Michael Kay 2008-05-21 16:23:21 UTC
I propose changing the sentence from 

In casting to a date or time value, if the value is too large or too small to
be represented by the implementation, error [err:FODT0001] is raised.

to

In casting to xs:date, xs:dateTime, xs:gYear, or xs:gYearMonth (or types
derived from these), if the value is too large or too small to be represented
by the implementation, error [err:FODT0001] is raised.
Comment 2 Michael Kay 2008-07-08 22:24:05 UTC
On 27 May 2008 (recorded in the minutes but sadly not here), the joint WGs
agreed to accept the change proposed in comment #1.

Oliver, if you accept this resolution, I would be grateful if you would mark
the bug as closed.

This will be the subject of erratum E28
Comment 3 Oliver Hallam 2008-07-09 14:20:19 UTC
I agree with this resolution.  Thanks.


  翻译: