Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-774

"w" URI option should identify as both int32 and utf8

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0
    • Affects Version/s: 1.2-beta0
    • Component/s: libmongoc
    • Labels:
      None

      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().

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: