Skip to content

Commit 030eee4

Browse files
committed
CDRIVER-482 mongoc_cursor_clone() ignores fields
Correctly propogate the fields parameter in copied cursors. We copied the bson, but not the flag that indicated that we'd actually set something.
1 parent 85ffd27 commit 030eee4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mongoc/mongoc-cursor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@ _mongoc_cursor_clone (const mongoc_cursor_t *cursor)
977977
_clone->batch_size = cursor->batch_size;
978978
_clone->limit = cursor->limit;
979979
_clone->nslen = cursor->nslen;
980+
_clone->has_fields = cursor->has_fields;
980981

981982
if (cursor->read_prefs) {
982983
_clone->read_prefs = mongoc_read_prefs_copy (cursor->read_prefs);

0 commit comments

Comments
 (0)