Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-225

insert of decimal value larger than max succeeds with jdk15

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.0.2.1
    • 10.1.1.0
    • JDBC
    • None

    Description

      On the following table:
      create table tmp (d decimal(31,0));
      an insert of a value with a precision larger than 31:
      insert into tmp values (+1.79769E+308);
      Should fail with:
      ERROR 22003: The resulting value is outside the range for the data type DECIMAL/NUMERIC(31,0).

      However, with jdk15, it does not.

      The expected error is generated from org.apache.derby.iapi.types.SQLDecimal.setWidth(), which calls getWholeDigits(), which gets the length of a string based on a BigDecimal using toString, which has a different value using jdk14 vs. jdk15 since the fix for DERBY-38.

      Note: I verified that the fix for DERBY-38 did not per se cause this failure.

      Attachments

        Activity

          People

            djd Daniel John Debrunner
            myrna Myrna van Lunteren
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: