[GODRIVER-588] Cannot decode pointers to nil / cannot decode *ObjectID Created: 04/Oct/18 Updated: 28/Oct/23 Resolved: 04/Dec/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 0.0.15 |
| Fix Version/s: | 0.1.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Delio D'Anna | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Decoding a nil into *time.Time returns an error, *time.Time is a pointer so it should be possible to decode nul from the database into a nil but this returns an error. Same thing happens with ObjectID and possible other default_value_decoders. In ObjectID though there is another issue too, not only it is not possible to decode into nil, but it does not even accept a pointer to ObjectID, the check/type assertion .(**bson.ObjectId) is totally missing form the code, while is present in TimeDecodeValue The affected file seems bson/bsoncodec/default_value_decoders.go |
| Comments |
| Comment by Githook User [ 04/Dec/18 ] |
|
Author: {'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}Message: Update codec system to use reflect.Value Add support for pointers to the BSON codec system. When doing an This change changes the ValueEncoder and ValueDecoder interfaces to use Move the bson.D family of types into the primitive package.
Change-Id: Idec68f74e354973160bd59f9f8fef009f026f943 |
| Comment by Kristofer Brandow (Inactive) [ 28/Nov/18 ] |
|
Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/435374. |
| Comment by Kristofer Brandow (Inactive) [ 04/Oct/18 ] |
|
Hi ddanna79, This work will be covered by Thanks, |