You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jeremy Boynes (JIRA)" <de...@db.apache.org> on 2004/11/22 00:58:24 UTC

[jira] Created: (DERBY-74) SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0

SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0
------------------------------------------------------------

         Key: DERBY-74
         URL: http://nagoya.apache.org/jira/browse/DERBY-74
     Project: Derby
        Type: Bug
  Components: SQL  
 Environment: JDK1.5.0
    Reporter: Jeremy Boynes


With JDK1.5.0 the behaviour of BigDecimal.toString() has changed (thanks Sun) and for numbers < 1e-6 it now returns a String in exponential syntax. This causes the number of digits to be calculated incorrectly.

As a result, the ejbql test fails as the following snippet fails:
create table myDecimal (b DECIMAL(31,31))
insert into myDecimal VALUES(1e-30)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-74) SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-74?page=all ]

Kathey Marsden updated DERBY-74:
--------------------------------

    Fix Version: 10.1.1.0
        Version: 10.1.1.0

> SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0
> ------------------------------------------------------------
>
>          Key: DERBY-74
>          URL: http://issues.apache.org/jira/browse/DERBY-74
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.1.1.0
>  Environment: JDK1.5.0
>     Reporter: Jeremy Boynes
>      Fix For: 10.1.1.0
>  Attachments: derby_getWholeDigits_jdk15.patch
>
> With JDK1.5.0 the behaviour of BigDecimal.toString() has changed (thanks Sun) and for numbers < 1e-6 it now returns a String in exponential syntax. This causes the number of digits to be calculated incorrectly.
> As a result, the ejbql test fails as the following snippet fails:
> create table myDecimal (b DECIMAL(31,31))
> insert into myDecimal VALUES(1e-30)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-74) SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0

Posted by "Jeremy Boynes (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-74?page=comments#action_55723 ]
     
Jeremy Boynes commented on DERBY-74:
------------------------------------

previous patch also fixed a couple of JavaDoc errors and unused imports in SQLDecimal.java

> SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0
> ------------------------------------------------------------
>
>          Key: DERBY-74
>          URL: http://nagoya.apache.org/jira/browse/DERBY-74
>      Project: Derby
>         Type: Bug
>   Components: SQL
>  Environment: JDK1.5.0
>     Reporter: Jeremy Boynes
>  Attachments: derby_getWholeDigits_jdk15.patch
>
> With JDK1.5.0 the behaviour of BigDecimal.toString() has changed (thanks Sun) and for numbers < 1e-6 it now returns a String in exponential syntax. This causes the number of digits to be calculated incorrectly.
> As a result, the ejbql test fails as the following snippet fails:
> create table myDecimal (b DECIMAL(31,31))
> insert into myDecimal VALUES(1e-30)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-74) SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-74?page=history ]
     
Daniel John Debrunner resolved DERBY-74:
----------------------------------------

    Resolution: Fixed

Patch applied as-is.

Sending        java/engine/org/apache/derby/iapi/types/SQLDecimal.java
Transmitting file data .
Committed revision 106329.

> SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0
> ------------------------------------------------------------
>
>          Key: DERBY-74
>          URL: http://nagoya.apache.org/jira/browse/DERBY-74
>      Project: Derby
>         Type: Bug
>   Components: SQL
>  Environment: JDK1.5.0
>     Reporter: Jeremy Boynes
>  Attachments: derby_getWholeDigits_jdk15.patch
>
> With JDK1.5.0 the behaviour of BigDecimal.toString() has changed (thanks Sun) and for numbers < 1e-6 it now returns a String in exponential syntax. This causes the number of digits to be calculated incorrectly.
> As a result, the ejbql test fails as the following snippet fails:
> create table myDecimal (b DECIMAL(31,31))
> insert into myDecimal VALUES(1e-30)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-74) SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0

Posted by "Jeremy Boynes (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-74?page=history ]

Jeremy Boynes updated DERBY-74:
-------------------------------

    Attachment: derby_getWholeDigits_jdk15.patch

patch that stops the exception on insert
still passes derbylang tests with JDK1.4.2
however, text generated by ij is still different resulting in failures on JDK1.5.0

> SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0
> ------------------------------------------------------------
>
>          Key: DERBY-74
>          URL: http://nagoya.apache.org/jira/browse/DERBY-74
>      Project: Derby
>         Type: Bug
>   Components: SQL
>  Environment: JDK1.5.0
>     Reporter: Jeremy Boynes
>  Attachments: derby_getWholeDigits_jdk15.patch
>
> With JDK1.5.0 the behaviour of BigDecimal.toString() has changed (thanks Sun) and for numbers < 1e-6 it now returns a String in exponential syntax. This causes the number of digits to be calculated incorrectly.
> As a result, the ejbql test fails as the following snippet fails:
> create table myDecimal (b DECIMAL(31,31))
> insert into myDecimal VALUES(1e-30)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira