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: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.0
    • Affects Version/s: 1.2.9
    • Component/s: None
    • Labels:
      None

      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:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: