Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-990

Throw if generic boolean URI option has an unexpected type

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.0.0
    • Affects Version/s: 1.2.9
    • Component/s: None
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Historically, the driver does not throw when encountering a non-boolean value for a boolean option. Instead, the driver uses bson_iter_as_bool() to cast the value.

      This is inconsistent with our handling of other options (including specific boolean options such as "journal"), which use BSON_ITER_HOLDS_TYPE() macros to guard processing. PHPC-887 introduces exceptions for unexpected types, but earlier versions of the driver silently ignore options with unexpected types.

      Throwing exceptions for non-boolean types that are currently cast and applied would be a BC break, so this ticket has been triaged for the next major version.

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

              Created:
              Updated:
              Resolved: