[GODRIVER-409] bson decoder should not zero entire struct before beginning unmarshalling Created: 08/May/18  Updated: 28/Oct/23  Resolved: 03/Dec/18

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 0.1.0

Type: Bug Priority: Major - P3
Reporter: Sam Kleinman (Inactive) Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: beta, evg, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

this is quite limiting custom unmarshallers, and is inconsistent with other serialization tools in Go



 Comments   
Comment by Githook User [ 03/Dec/18 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@10gen.com', 'username': 'iwysiu'}

Message: GODRIVER-409 add test that structs are not zeroed when decoding

Change-Id: I360745392a4379dedbdf536a33334cfecd069db0
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/c1c56331bb9fd4f5e3efea523334757283b077cc

Comment by Jeffrey Yemin [ 29/Nov/18 ]

isabella.siu if there's not one already, can you add a regression test that demonstrates the desired behavior?

Comment by Jeffrey Yemin [ 29/Nov/18 ]

sam.kleinman I suspect this is a change in behavior since you reported this, as the struct decoder has been entirely re-written since then.

 

CC kris.brandow

Comment by Isabella Siu (Inactive) [ 28/Nov/18 ]

sam.kleinman I tried to reproduce this by decoding into a struct with non-zero extra fields and those fields were not zeroed out by the decoder.

Generated at Thu Feb 08 08:34:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.