[CXX-1258] Cursor iterators lose lockstep at cursor end Created: 16/Mar/17 Updated: 28/Feb/18 Resolved: 27/Mar/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Implementation |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.0-rc0, 3.1.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Golden | Assignee: | David Golden |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
When there are multiple iterators for a cursor, iterators should move in lockstep, meaning that incrementing any iterator is equivalent to incrementing all of them. This fails when an interator is incremented and there are no more documents. In that case, other iterators will not compare equal to cursor.end(). Example code:
The current way that iterators are marked "at the end" is by setting their _cursor member to nullptr. This means that a cursor that doesn't yet know that it's at the end won't compare equal to the cursor.end() iterator with a nullptr _cursor. Iterator equality comparison needs to be enhanced so that comparing a nullptr _cursor with a non-null _cursor has some additional way to see if _cursor has actually been exhausted. |
| Comments |
| Comment by Githook User [ 27/Mar/17 ] |
|
Author: {u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}Message: This commit fixes a bug where iterators might not always compare It adds extensive tests for cursor lockstep and invariants. It also substantially revises cursor/iterator documentation for |
| Comment by David Golden [ 27/Mar/17 ] |
|
We're going to finish this work as is and open |
| Comment by David Golden [ 22/Mar/17 ] |
|
On hold, pending information from the C driver team on how/when they plan to address |
| Comment by David Golden [ 22/Mar/17 ] |
|
Blocked waiting on investigation/fixes of libmongoc cursor bugs. |