Bug 20519 - [QT3TS] test cases with too many digits
[QT3TS] test cases with too many digits
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite
Last Call drafts
PC Windows XP
: P2 normal
: ---
Assigned To: Tim Mills
Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
  Show dependency treegraph
Reported: 2012-12-26 23:10 UTC by Andrew Eisenberg
Modified: 2013-01-01 18:08 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg 2012-12-26 23:10:11 UTC
rangeExpr-28 to rangeExpr-32 contain queries with long strings of digits. The query in rangeExpr-28 is:

18446744073709551616 to 18446744073709551620

As XML Schema requires implementations to support only 18 digits, I suggest that either a) the test cases contains smaller integer values, or b) error FORG0001 be accepted.
Comment 1 Tim Mills 2012-12-27 08:19:30 UTC
I suspect FOCA0003 (Input value too large for integer) might be more appropriate.
Comment 2 Michael Kay 2012-12-27 08:51:48 UTC
Fixed to use FOCA0003.

It seems that currently we don't allow an implementation to raise a static error in such cases; it has to be a dynamic error - which has the virtue that you can use try/catch on it.
Comment 3 Andrew Eisenberg 2012-12-27 15:04:19 UTC
I don't think FOCA0003 is the correct error for this situation. The bullet that raises FOCA0003 begins with "If ST is xs:decimal, xs:float or xs:double, then ..."

I believe that the rules that apply are:

3.1.1 Literals

The value of the numeric literal is determined by casting it to the appropriate type according to the rules for casting from xs:untypedAtomic to a numeric type as specified in Section 18.2 Casting from xs:string and xs:untypedAtomic (FO30).

18.2 Casting from xs:string and xs:untypedAtomic

When casting to a numeric type:

    o If the value is too large or too small to be accurately represented by the implementation, it is handled as an overflow or underflow as defined in 4.2 Arithmetic operators on numeric values.

4.2 Arithmetic operators on numeric values

o For xs:integer operations, implementations that support limited-precision integer operations ·must· select from the following options:

    o They ·may· choose to always raise an error [err:FOAR0002].

    o They ·may· provide an ·implementation-defined· mechanism that allows users to choose between raising an error and returning a result that is modulo the largest representable integer value. See [ISO 10967].

So, I now believe that FOAR0002 should be returned.
Comment 4 Michael Kay 2012-12-31 09:57:32 UTC
Agreed. Will commit the change when I'm on a better internet connection.