Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-26

Unable to work with large files in GridFS

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 0.2
    • Affects Version/s: 0.2
    • Component/s: None
    • Labels:
      None

      Sticking a ~3GB file in the database (length of 2996783104 bytes) will break the C driver. I'm rusty on my C, but it appears everywhere we load "length" we use bson_iterator_int when it should probably be bson_iterator_double:

      bson_find(&it, gfile->meta, "length");
      length = bson_iterator_int(&it);

      A full example is gridfile_get_numchunks: http://github.com/ctriolo/mongo-c-driver/blob/master/src/gridfs.c#L500-516

      I would offer to help dig in and supply a patch, but before I do so I'd like someone with a better understanding of the driver to take a look and see if that is in fact the likely culprit.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            dougtmayer Doug Mayer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: