[CDRIVER-774] "w" URI option should identify as both int32 and utf8 Created: 31/Jul/15  Updated: 04/Aug/15  Resolved: 04/Aug/15

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.2-beta0
Fix Version/s: 1.2.0

Type: Improvement Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to PHPC-353 Support read preference and write con... Closed

 Description   

mongoc-uri.c has several methods for checking whether an option may be set with a particular type. "w" is unique among the options in that it may be a positive integer or a string (e.g. negative integer as a string, "majority").

Currently, the option is only handled in the static mongoc_uri_parse_option() function, and it's not possible for other drivers (see: PHPC-353) to use the mongoc_uri_set_option_as_int32() and mongoc_uri_set_option_as_utf8() functions, since those rely on {{mongoc_uri_option_is_TYPE() functions to return true before the value is overridden or appended to the options BSON structure.

I propose that mongoc_uri_option_is_int32() and mongoc_uri_option_is_utf8() be changed to return true for the "w" option. To my knowledge, these are only declared in the private API and used by mongoc_uri_set_option_as_int32() (to control which options are allowed to be set with an integer) and mongoc_uri_parse_option().



 Comments   
Comment by Jeremy Mikola [ 04/Aug/15 ]

bjori said this isn't really necessary, since the functions are only used internally. Additionally, PHPC-353 should no longer depend on this functionality.

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