Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-960

Remove decimal128 feature flag and functionality

      The decimal128 feature flag enables the usage of the decimal crate to provide some added experimental / unstable functionality to our Decimal128 type. However, the decimal crate is backed by the decNumber C library, which uses the "Densely Packed Decimal" encoding for the coefficient. MongoDB, on the other hand, uses "binary encoding" (BID) (see https://github.com/mongodb/specifications/pull/795). Thus, any BSON generated by the bson crate that contains decimal128 values will be invalid if the feature flag is enabled. The driver will be able to decode it, but other drivers / MongoDB clients will decode invalid values (see https://github.com/mongodb/bson-rust/issues/282).

      There does not seem to be an existing crate that implements the IEEE 754-2008 standard using binary encoding for the coefficient, so we don't have a drop-in replacement to fix this. There is a work-in-progress implementation here that we should pick up once we do RUST-36, but in the meantime, we should just remove the feature flag and any code associated with it to prevent users from accidentally working with bad data.

       

       

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: