[GODRIVER-2896] empty bson.RawValue marshal unmarshal behavior are inconsistent. unmarshal error Created: 11/Jul/23 Updated: 28/Oct/23 Resolved: 28/Jul/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.12.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | mongo mongo | Assignee: | Preston Vasquez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
| Comments |
| Comment by Githook User [ 01/Aug/23 ] |
|
Author: {'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}Message: Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com> |
| Comment by Githook User [ 28/Jul/23 ] |
|
Author: {'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}Message: Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com> |
| Comment by mongo mongo [ 11/Jul/23 ] |
|
sorry for not familiar with the Jira editor, some mistake after i paste the code here. I look into the mongo go driver, it may be the bug of RawValueEncodeValue.
When marshalling, an empty RawValue was encoded with type 0 and the filed‘s name written into the bytes, followed by the normal encoding of other fields. During decoding, when encountering a type of 0, it is assumed to be a null terminator and no further fields should exist. However, since the name and additional fields were added during encoding, causing a mismatch in length, an error occurred. |
| Comment by PM Bot [ 11/Jul/23 ] |
|
Hi 1124210681@qq.com, thank you for reporting this issue! The team will look into it and get back to you soon. |