db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-3398) Support min/max values for Java types float/double in real/double columns
Date Mon, 11 Feb 2013 12:39:12 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13575763#comment-13575763
] 

Knut Anders Hatlen commented on DERBY-3398:
-------------------------------------------

I tried this simple upgrade test with the #2 patch (that is, before the upgrade logic was
added):

1) Create a new database with 10.9.1.0 and create a table: create table t(d double);

2) Attempt to insert a previously illegal value:

ij> insert into t values 1.7976931348623157e+308;
ERROR 22003: The resulting value is outside the range for the data type DOUBLE. (errorCode
= 30000)

3) Boot the database with the #2 patch and re-run the above insert statement (which now succeeds).

4) Reboot the database with 10.9.1.0 and read the table:

ij> select * from t;
D                     
----------------------
1.7976931348623157E308

1 row selected

So from this test case, it looks like the old versions are able to read values that are out
of range from a table. So maybe it would be OK to accept the values unconditionally in the
new versions?
                
> Support min/max values for Java types float/double in real/double columns
> -------------------------------------------------------------------------
>
>                 Key: DERBY-3398
>                 URL: https://issues.apache.org/jira/browse/DERBY-3398
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.4.1.3
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>              Labels: derby_triage10_10
>         Attachments: derby-3398-2.diff, derby-3398-3.diff, derby-3398-3.stat, derby-3398.diff,
derby-3398.status
>
>
> Derby doesn't support the entire range of valid (finite) values of the Java primitive
types double/float in columns with SQL type DOUBLE or REAL. This appears to be a limitation
that was introduced for compatibility with DB2. There have been some requests on derby-user
that we lift this restriction.
> The restriction is enforced by the methods normalizeREAL() and normalizeDOUBLE() in org.apache.derby.iapi.types.NumberDataType.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message