Derby
  1. Derby
  2. DERBY-74

SQLDecimal.getWholeDigits returns invalid result on JDK1.5.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.1.0
    • Fix Version/s: 10.1.1.0
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      JDK1.5.0

      Description

      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)

        Activity

        Jeremy Boynes created issue -
        Hide
        Jeremy Boynes added a comment -

        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

        Show
        Jeremy Boynes added a comment - 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
        Jeremy Boynes made changes -
        Field Original Value New Value
        Attachment derby_getWholeDigits_jdk15.patch [ 18199 ]
        Hide
        Jeremy Boynes added a comment -

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

        Show
        Jeremy Boynes added a comment - previous patch also fixed a couple of JavaDoc errors and unused imports in SQLDecimal.java
        Hide
        Daniel John Debrunner added a comment -

        Patch applied as-is.

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

        Show
        Daniel John Debrunner added a comment - Patch applied as-is. Sending java/engine/org/apache/derby/iapi/types/SQLDecimal.java Transmitting file data . Committed revision 106329.
        Daniel John Debrunner made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Kathey Marsden made changes -
        Affects Version/s 10.1.1.0 [ 10993 ]
        Fix Version/s 10.1.1.0 [ 10993 ]
        Hide
        Andrew McIntyre added a comment -

        This issue has been resolved for over a year with no further movement. Closing.

        Show
        Andrew McIntyre added a comment - This issue has been resolved for over a year with no further movement. Closing.
        Andrew McIntyre made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow jira [ 38515 ] Default workflow, editable Closed status [ 12800324 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jeremy Boynes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development