Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3531

Some decimal128 values can be marshaled to JSON, but can't be unmarshaled

    • Type: Icon: Bug Bug
    • Resolution: Won't Do
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Detailed steps to reproduce the problem?

      Run https://gist.github.com/AlekSi/2919ca17d4d231695316e91a14252da5

      bson.D{bson.E{Key:"v", Value:bson.Decimal128{h:0x3031ff3031303130, l:0x3030313030313030}}}
      {"v":{"$numberDecimal":"103681294822928937359576498.30260784"}}
      $invalid $numberDecimal string: 103681294822928937359576498.30260784

      Definition of done: what must be done to consider the task complete?

      Either marshaling this value should return an error, or it should be possible to unmarshal that JSON back.

      The exact Go version used, with patch level:

      go version go1.24.2 darwin/arm64

      The exact version of the Go driver used:

      go.mongodb.org/mongo-driver/v2 v2.1.0

      Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

      N/A.

      The operating system and version (e.g. Windows 7, OSX 10.8, ...)

      Doesn't matter.

      Security Vulnerabilities

      If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here

            Assignee:
            preston.vasquez@mongodb.com Preston Vasquez
            Reporter:
            alexey.palazhchenko@ferretdb.io Alexey Palazhchenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: