-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Do not allow case-insensitive options in execute functions
phongo_execute_parse_options() currently iterates through the options array and uses strcasecmp() to check for each option. The case-insensitivity appears to have been copied over from URI option handling. While URI options are case-insensitive, I don't believe we allow case-insensitive options anywhere else (e.g. Query).
Switching to php_array API for accessing the options will enforce case-sensitive names. We will then rely on PHPC-1066 to warn users about unknown/unsupported options.
Refactor Manager to select server before calling phongo_execute functions
Currently, the phongo_execute functions may be called with and without a server hint. Having the execute methods in Manager.c select a server in advance would simplify the phongo_execute code paths. Additionally, that selection code could then be shared with Manager::selectServer().
Since libmongoc 1.9.0 supports a "serverId" option in its with_opts() functions and bulk write API, we can consistently pass the server hint directly for all of our execute methods (write, command, and query).