[CDRIVER-154] Appending empty string key with bson_append_element Created: 26/Jun/12  Updated: 03/May/17  Resolved: 01/Aug/12

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Morten Kvistgaard Assignee: Gary Murakami
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The following will create an error:

  • call bson_append_element with name_or_null parameter = ""

The "" will cause it to fall through to the "not null" part ... and create an error.



 Comments   
Comment by Gary Murakami [ 01/Aug/12 ]

I'm resolving this, please reopen with details if there is any remaining issue.

Comment by auto [ 31/Jul/12 ]

Author:

{u'date': u'2012-07-31T04:13:49-07:00', u'email': u'gary.murakami@10gen.com', u'name': u'Gary Murakami'}

Message: CDRIVER-154 Appending empty string key with bson_append_element
pedantic comments
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/247c7cebfe475f20ce49be59b4b88b6ff7c47206

Comment by auto [ 30/Jul/12 ]

Author:

{u'date': u'2012-07-30T14:04:37-07:00', u'email': u'gary.murakami@10gen.com', u'name': u'Gary Murakami'}

Message: CDRIVER-154 Appending empty string key with bson_append_element
tests for bson_append_element - there were none before this
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/6b661c18695f2979da4a874821d2d10f99ee7388

Comment by Gary Murakami [ 30/Jul/12 ]

Morten:

An empty string is valid for a field name. In my tests, I don't experience an "error" when passing name_or_null parameter with value "".
This is with a current github clone. With what version do you get an error?

Thanks,

-Gary

Generated at Wed Feb 07 21:08:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.