Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2056

Allow all subtype values in BSON::Binary

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-5.0.0
    • Affects Version/s: None
    • Component/s: BSON, Spec Comp
    • None
    • Fully Compatible

      It appears that currently BSON::Binary's constructor requires that it be passed a subtype that is in an enum of recognized subtypes. There appear to be two issues with this:

      1. Per http://bsonspec.org/spec.html, the user defined subtypes are a range of 0x80-0xff. The current constructor appears to only allow the 0x80 value, preventing users from utilizing the remainder of the range.
      2. FLE added subtype 6. There appears to be no way to use existing bson-ruby libraries to store/manipulate data of this subtype.

      As part of this work it appears that BSON::Binary will need to change from storing a symbol type (one of the enum values) to the numeric subtype per the bson spec. We would also need a compatibility layer to map from the numeric subtype to the existing symbol types.

      Also, consider adding BSON corpus tests with 1) user defined type > 0x80, 2) a currently undefined type < 0x80.

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: