Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2036

ListCollections throws a FormatException with server 3.5.12

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.4
    • Fix Version/s: 2.5
    • Component/s: Operations
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change

      Description

      The following code:

      var collections = database.ListCollections().ToList();
      

      throws a FormatException when run against server 3.5.12. The message is:

      The GuidRepresentation for the reader is CSharpLegacy, which requires the binary sub type to be UuidLegacy, not UuidStandard.
      

      This is happening because the collection info now includes a UUID.

      The ReadBinaryData method should be able to read either subtype 3 or subtype 4 BsonBinary values regardless of the settings. The GuidRepresentation from the settings should only be used when the value read is of subtype 3.

      This change will be backward breaking only to applications that were counting on the BsonBinaryReader to enforce that all UUIDs read were of the expected subtype.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rstam Robert Stam
              Reporter:
              rstam Robert Stam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: