[GODRIVER-809] Go driver cannot decode gridfs files collection documents if the length field is not stored as int64 Created: 05/Feb/19 Updated: 28/Oct/23 Resolved: 26/Mar/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | GridFS |
| Affects Version/s: | None |
| Fix Version/s: | 1.0.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Patrick Freed | Assignee: | Go Community User |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
From the gridfs spec:
However, the Go driver cannot handle existing GridFS files if the type of length (or chunkSize, presumably) is not int64. To reproduce, insert some GridFS data using the python driver (which stores length as Int32) and try to read it with the Go driver. It will panic with output similar to this:
|
| Comments |
| Comment by Githook User [ 26/Mar/19 ] |
|
Author: {'name': 'Tejus Pratap', 'username': 'tejzpr', 'email': 'tejzpr@gmail.com'}Message: Fix for: https://jira.mongodb.org/browse/GODRIVER-809 |
| Comment by Tejus Pratap [ 26/Mar/19 ] |
|
Created a PR https://github.com/mongodb/mongo-go-driver/pull/151 |
| Comment by Tejus Pratap [ 26/Mar/19 ] |
|
GridFS and various implementations of it (PyMongo's for example) pre-date the GridFS spec by many years. The Go driver has to be ready to parse the length as an int32. |