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

ListCollections throws a FormatException with server 3.5.12

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.5
    • Affects Version/s: 2.4.4
    • Component/s: Operations
    • None
    • Minor Change

      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.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: