Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1738

Length field of gridfs files collection documents stored as Int32 instead of int64

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 3.9
    • None
    • None

    Description

      EDIT: Upon further reading, this is actually also a bug in the Go driver, as per the spec:

      Note: drivers SHOULD store length as Int64 and chunkSize as Int32 when creating new GridFS files. However, drivers MUST be able to handle existing GridFS files where the length and chunkSize fields might have been stored using a different numeric data type.

      In pymongo gridfs, the files collection documents are stored with length as an int32(at least when the length is small), but the gridfs spec defines the schema such that this this field should be an int64.

      This type mismatch can cause problems when reading gridfs files that were inserted by pymongo in a driver written in a statically typed language. 

      e.g. the go driver crashes when trying to decode the length field.

      Attachments

        Issue Links

          Activity

            People

              bernie@mongodb.com Bernie Hackett
              patrick.freed@mongodb.com Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: