Check PID before creating/freeing a session or cursor to avoid interfering with resources owned by a parent process. Additionally, prohibit resetting a client multiple times to avoid cases where child resources may not be cleaned up.
For serialization, 64-bit wtimeout values will always be encoded as strings for portability. Debug output and bsonSerialize() can always use integers on 64-bit platforms and can fall back to strings and Int64 objects on 32-bit platforms, respectively.
Use int64_t API for wTimeoutMS. The initial commit for CDRIVER-3087 deprecated the int32_t API for wTimeoutMS. Migrate to the int64_t API to avoid deprecation warnings. Note: PHPC (and libmongoc's URI parsing) still require 32-bit values for wTimeoutMS, so this does not affect users. Having said that, PHPC-1411 may introduce support for 64-bit values and necessitate changes to the code where we read wTimeoutMS values.
Use mongoc_uri_get_tls to read tls/ssl URI option. As part of CDRIVER-2869, libmongoc deprecated mongoc_uri_get_ssl and introduced a "tls" alias. Migrate to the new API to avoid deprecation warnings.
Expect lowercase URI option in error. As part of CDRIVER-2869, libmongoc does case-folding on option keys to facilitate deduplication.
This allows executeQuery() to throw a CommandException, which exposes the error document.
In 1.6+, it will also ensure that error labels are set on any RuntimeException thrown during cursor iteration, which is relevant for transactions.
executeBulkWrite() will now throw a BulkWriteException on top of any previous exception to ensure that a WriteResult can be attached. InvalidArgumentException is excluded, since that is only thrown before mongoc_bulk_operation_execute does IO (e.g. batch is empty).
This condition was never reached. Apart from code coverage, it's clear that an exception would not be thrown before this point since only libmongoc functions are called.