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

Files written to GridFS must be saved before being read back

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta0
    • Affects Version/s: 1.0.2
    • Component/s: GridFS
    • Labels:
      None

      (ported from github)

      The c driver's GridFS implementation requires that data be saved after being written. Unsaved data can't be read back.

      test_write_seek_read (void)
      {
         ...
         mongoc_gridfs_file_writev (file, &iov, 1, 0);
      
      // notice we didn't save yet
         mongoc_gridfs_file_seek (file, 0, SEEK_SET);
         r = mongoc_gridfs_file_readv (file, &riov, 1, -1, 0);
      // r is correct, but riov points to empty buffer(it points to page->read_buf instead page->buf)
      }
      

            Assignee:
            kyle.suarez@mongodb.com Kyle Suarez
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: