[CDRIVER-839] Bad interpretation of GridFS "SEEK_END" mode Created: 14/Sep/15  Updated: 23/Oct/15  Resolved: 17/Sep/15

Status: Closed
Project: C Driver
Component/s: GridFS
Affects Version/s: None
Fix Version/s: 1.3.0-beta0

Type: Bug Priority: Major - P3
Reporter: Kyle Suarez Assignee: Kyle Suarez
Resolution: Done Votes: 0
Labels: bug, drivers, pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Any


Issue Links:
Depends
depends on CDRIVER-847 Cannot seek on new GridFS file Closed
is depended on by CDRIVER-509 GridFS crashes when creating empty file Closed
Backwards Compatibility: Fully Compatible

 Description   

From GitHub pull request https://github.com/mongodb/mongo-c-driver/pull/260 by Jose Battig:

Bad interpretation of seek_end mode. it should seek from one byte more than number of bytes written. seek_end with offset zero should put pointer exactly at the end ready to receive more data



 Comments   
Comment by Githook User [ 18/Sep/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #271 from ksuarz/CDRIVER-839

CDRIVER-839 fix "seek_end" on gridfs file seek
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/d62df21f9686538767fa0f795a8e0e12f3688bb9

Comment by Githook User [ 18/Sep/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #271 from ksuarz/CDRIVER-839

CDRIVER-839 fix "seek_end" on gridfs file seek
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/d62df21f9686538767fa0f795a8e0e12f3688bb9

Comment by Githook User [ 18/Sep/15 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}

Message: CDRIVER-839 test gridfs file seek between chunks
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/084576f692b163b4f5ddd791fb2355cd5dd86faf

Comment by Githook User [ 18/Sep/15 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}

Message: CDRIVER-839 test gridfs file seek
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/8755d4c376eb7b3a42b897bf9df4c209f84f4e21

Comment by Kyle Suarez [ 16/Sep/15 ]

We can write tests for this, but they'll break if we can't seek on new GridFS handles.

Comment by Kyle Suarez [ 15/Sep/15 ]

We should clearly document the behavior of mongoc_gridfs_file_seek; for example, the delta is always added, even when whence=SEEK_END. This matches the behavior of fseek(3) but might not be obvious to the casual user.

Generated at Wed Feb 07 21:10:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.