[CDRIVER-2318] _mongoc_read_concern_freeze() assert failure if level is not set Created: 09/Oct/17  Updated: 28/Oct/23  Resolved: 23/Nov/17

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

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2284 Invalidate generated BSON instead of ... Closed

 Description   

_mongoc_read_concern_freeze() assumes that the level is always set:

BSON_ASSERT (read_concern->level);
BSON_APPEND_UTF8 (compiled, "level", read_concern->level);

This makes it impossible to obtain the BSON for a default read concern (i.e. level is NULL), as is possible with _mongoc_write_concern_freeze().



 Comments   
Comment by Githook User [ 23/Nov/17 ]

Author:

{'name': 'Jeremy Mikola', 'username': 'jmikola', 'email': 'jmikola@gmail.com'}

Message: CDRIVER-2318 allow getting BSON for default read concern

This commit also adds missing tests for read concern, based on the
write concern tests.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d7b68a3b75c08824ef945bcdb76d894c4cc5206d

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