Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-7145

Investigate changes in NODE-5546: Fix Decimal128 rounding issue

    • Type: Icon: Investigation Investigation
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None

      Use Case

      As a... driver engineer
      I want... Decimal128 rounding to be correct
      So that... users do not corrupt their data

      User Impact

      • Users storing values on the edges of the representable range of Decimal128 will have correctly rounded numbers when opting into using fromStringRounded
      • Users whose applications were silently losing precision will now see an uncaught exception.

      Dependencies

      • Possible shell impacts?

      Unknowns

      • How does this impact shell?
        • Shouldn't have any shell impact since they already gracefully catch bson errors
      • Do we want a global static option to control rounding?
        • No
      • Does this need a DOCSP ticket?
        • Yes

      Acceptance Criteria

      Implementation Requirements

      • update fromString to throw on inexact rounding
        • in the rounding section of the code, if there are less significant digits encoded than exist in total, then we check for the digit to be rounded. If it is not zero then we should throw

      Testing Requirements

      • Unskip parse error spec tests and ensure that they are passing.
      • Pull in new Decimal128 spec tests from DRIVERS-2651

      Documentation Requirements

      • Release notes

      Follow Up Requirements

      • File ticket to add fromStringRounded static method
      • File ticket to absorb change into 5.x driver
      • File ticket to absorb change into 6.x driver

            Assignee:
            Unassigned Unassigned
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: