-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.2.2
-
Component/s: None
-
None
The fix for PHPC-849 always applies the new type map to the cursor's current element by calling phongo_bson_to_zval_ex() if a current element exists. Since phongo_advance_cursor_and_check_for_error() advances to the cursor's first element to check for an error before MongoDB\Driver\Cursor is even initialized, any cursor with at least one document in its result set will always have a current element (even before iteration begins). Since the PHP library is prone to calling setTypeMap() on most cursors it creates, this can lead to redundant BSON conversion as described in this mongodb-user post.
- is related to
-
PHPC-849 Cursor::setTypeMap() leaks current element if called during iteration
- Closed
- links to