[GODRIVER-1233] Truncate Bug Created: 13/Aug/19 Updated: 28/Oct/23 Resolved: 04/Sep/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 1.1.0 |
| Fix Version/s: | 1.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Alice Thum |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I've got the code below that should ignore truncation errors, but returns an error indicating it can't truncate:
produces the following error:
|
| Comments |
| Comment by Githook User [ 05/Sep/19 ] | ||
|
Author: {'email': 'alice.thum@10gen.com', 'name': 'Alice Thum'}Message: Add truncation check to DecodeValue. Change-Id: Ie1b85a73ba7e0eb3b387d596d654eb4da2082cf1 | ||
| Comment by Alice Thum [ 04/Sep/19 ] | ||
|
commit link: https://github.com/mongodb/mongo-go-driver/commit/deb59ac036dbdb1242eb2458f69f2ced31a328bd | ||
| Comment by Githook User [ 04/Sep/19 ] | ||
|
Author: {'email': 'alice.thum@10gen.com', 'name': 'Alice Thum'}Message: Add truncation check to DecodeValue. Change-Id: Ie1b85a73ba7e0eb3b387d596d654eb4da2082cf1 | ||
| Comment by Alice Thum [ 29/Aug/19 ] | ||
|
gerrithub link: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/466782 | ||
| Comment by Kristofer Brandow (Inactive) [ 13/Aug/19 ] | ||
|
The issue stems from how the bsoncodec.StructCodec handles the truncation option. When we create the context to pass to a lower decoder, we don't check to see if the bsoncodec.DecodeContext had Truncate set to true. Changing this line:
to this:
fixes the problem. |